2 ~ Licensed to the Apache Software Foundation (ASF) under one
3 ~ or more contributor license agreements. See the NOTICE file
4 ~ distributed with this work for additional information
5 ~ regarding copyright ownership. The ASF licenses this file
6 ~ to you under the Apache License, Version 2.0 (the
7 ~ "License"); you may not use this file except in compliance
8 ~ with the License. You may obtain a copy of the License at
10 ~ http://www.apache.org/licenses/LICENSE-2.0
12 ~ Unless required by applicable law or agreed to in writing,
13 ~ software distributed under the License is distributed on an
14 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ~ KIND, either express or implied. See the License for the
16 ~ specific language governing permissions and limitations
19 <%@ taglib prefix="ww" uri="/webwork" %>
20 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
22 <c:url var="iconDeleteUrl" value="/images/icons/delete.gif"/>
23 <c:url var="iconCreateUrl" value="/images/icons/create.png"/>
25 <%-- This hidden 'pattern' field is used by remove (white|black)list scripts --%>
26 <ww:hidden name="pattern" />
28 <ww:hidden name="connector.order" />
30 <ww:select name="connector.proxyId" list="proxyIdOptions" label="Network Proxy" required="true"/>
31 <ww:select name="connector.sourceRepoId" list="managedRepoIdList"
32 label="Managed Repository" required="true"/>
33 <ww:select name="connector.targetRepoId" list="remoteRepoIdList"
34 label="Remote Repository" required="true"/>
37 <td valign="top"><label>Policies:</label>
41 <c:forEach items="${policyMap}" var="policy" varStatus="i">
44 <ww:label for="policy_${policy.key}" required="true"
45 theme="simple">${policy.key}:
50 <ww:property id="value" value="connector.policies['${policy.key}']" default="${policy.value.defaultOption}" />
52 <ww:select name="connector.policies['${policy.key}']"
53 list="policyMap['${policy.key}'].options"
55 id="policy_${policy.key}"
57 cssStyle="width: 10em"/>
65 <tr class="seperator">
67 <label for="propertiesEntry">Properties:</label>
70 <ww:textfield name="propertyKey" size="15" id="propertiesEntry" theme="simple"
71 onkeypress="submitenter(event, 'addProperty')"/>
73 <ww:textfield name="propertyValue" size="15" id="propertiesValue" theme="simple"
74 onkeypress="submitenter(event, 'addProperty')"/>
75 <input type="button" onclick="submitForm('addProperty')" value="Add Property" />
84 <c:when test="${empty(connector.properties)}">
85 <i>No properties have been set.</i>
89 <c:forEach items="${connector.properties}" var="property" varStatus="i">
92 <ww:label for="property_${property.key}"
93 theme="simple">${property.key}</ww:label>
96 <ww:textfield name="connector.properties['${property.key}']"
98 id="property_${property.key}"
102 <ww:a href="#" title="Remove [${property.key}] Property"
103 onclick="setAndSubmit('propertyKey', '${property.key}', 'removeProperty')"
105 <img src="${iconDeleteUrl}"/></ww:a>
115 <tr class="seperator">
117 <label for="blackListEntry">Black List:</label>
120 <ww:textfield name="blackListPattern" size="30" id="blackListEntry" theme="simple"
121 onkeypress="submitenter(event, 'addBlackListPattern')"/>
122 <input type="button" onclick="submitForm('addBlackListPattern')" value="Add Pattern" />
131 <c:when test="${empty(connector.blackListPatterns)}">
132 <i>No black list patterns have been set.</i>
136 <c:forEach items="${connector.blackListPatterns}" var="pattern" varStatus="i">
139 <ww:hidden name="connector.blackListPatterns" value="${pattern}"/>
140 <code>"${pattern}"</code>
143 <a href="#" title="Remove [${pattern}] Pattern"
144 onclick="setAndSubmit('pattern', '${pattern}', 'removeBlackListPattern')">
145 <img src="${iconDeleteUrl}"/></a>
155 <tr class="seperator">
157 <label for="whiteListEntry">White List:</label>
160 <ww:textfield name="whiteListPattern" size="30" id="whiteListEntry" theme="simple"
161 onkeypress="submitenter(event, 'addWhiteListPattern')"/>
162 <input type="button" onclick="submitForm('addWhiteListPattern')" value="Add Pattern" />
170 <c:when test="${empty(connector.whiteListPatterns)}">
171 <i>No white list patterns have been set.</i>
175 <c:forEach items="${connector.whiteListPatterns}" var="pattern" varStatus="i">
178 <ww:hidden name="connector.whiteListPatterns" value="${pattern}"/>
179 <code>"${pattern}"</code>
182 <ww:a href="#" title="Remove [${pattern}] Pattern"
183 onclick="setAndSubmit('pattern', '${pattern}', 'removeWhiteListPattern')"
185 <img src="${iconDeleteUrl}"/></ww:a>
195 <script type="text/javascript">
197 function adjustActionMethod( action, method )
199 var idx = action.indexOf( "!" );
202 // no "name!method.action" defined, split by ".action" instead.
203 idx = action.indexOf( ".action" );
206 return action.substring( 0, idx ) + "!" + method + ".action";
209 function setAndSubmit( id, value, method )
211 var f = document.forms['saveProxyConnector'];
213 f.action = adjustActionMethod( f.action, method );
214 f.elements[id].value = value;
218 function submitForm( method )
220 var f = document.forms['saveProxyConnector'];
222 var before = f.action;
223 f.action = adjustActionMethod( f.action, method );
227 function submitenter( e, method )
234 keycode = window.event.keyCode;
247 submitForm( method );
256 document.forms["saveProxyConnector"]["connector.proxyId"].focus();