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}:
49 <ww:select name="connector.policies['${policy.key}']"
50 list="policyMap['${policy.key}'].options"
51 value="connector.policies['${policy.key}']"
52 id="policy_${policy.key}"
54 cssStyle="width: 10em"/>
62 <tr class="seperator">
64 <label for="propertiesEntry">Properties:</label>
67 <ww:textfield name="propertyKey" size="15" id="propertiesEntry" theme="simple"
68 onkeypress="submitenter(event, 'addProperty')"/>
70 <ww:textfield name="propertyValue" size="15" id="propertiesValue" theme="simple"
71 onkeypress="submitenter(event, 'addProperty')"/>
72 <input type="button" onclick="submitForm('addProperty')" value="Add Property" />
81 <c:when test="${empty(connector.properties)}">
82 <i>No properties have been set.</i>
86 <c:forEach items="${connector.properties}" var="property" varStatus="i">
89 <ww:label for="property_${property.key}"
90 theme="simple">${property.key}</ww:label>
93 <ww:textfield name="connector.properties['${property.key}']"
95 id="property_${property.key}"
99 <ww:a href="#" title="Remove [${property.key}] Property"
100 onclick="setAndSubmit('propertyKey', '${property.key}', 'removeProperty')"
102 <img src="${iconDeleteUrl}"/></ww:a>
112 <tr class="seperator">
114 <label for="blackListEntry">Black List:</label>
117 <ww:textfield name="blackListPattern" size="30" id="blackListEntry" theme="simple"
118 onkeypress="submitenter(event, 'addBlackListPattern')"/>
119 <input type="button" onclick="submitForm('addBlackListPattern')" value="Add Pattern" />
128 <c:when test="${empty(connector.blackListPatterns)}">
129 <i>No black list patterns have been set.</i>
133 <c:forEach items="${connector.blackListPatterns}" var="pattern" varStatus="i">
136 <ww:hidden name="connector.blackListPatterns" value="${pattern}"/>
137 <code>"${pattern}"</code>
140 <a href="#" title="Remove [${pattern}] Pattern"
141 onclick="setAndSubmit('pattern', '${pattern}', 'removeBlackListPattern')">
142 <img src="${iconDeleteUrl}"/></a>
152 <tr class="seperator">
154 <label for="whiteListEntry">White List:</label>
157 <ww:textfield name="whiteListPattern" size="30" id="whiteListEntry" theme="simple"
158 onkeypress="submitenter(event, 'addWhiteListPattern')"/>
159 <input type="button" onclick="submitForm('addWhiteListPattern')" value="Add Pattern" />
167 <c:when test="${empty(connector.whiteListPatterns)}">
168 <i>No white list patterns have been set.</i>
172 <c:forEach items="${connector.whiteListPatterns}" var="pattern" varStatus="i">
175 <ww:hidden name="connector.whiteListPatterns" value="${pattern}"/>
176 <code>"${pattern}"</code>
179 <ww:a href="#" title="Remove [${pattern}] Pattern"
180 onclick="setAndSubmit('pattern', '${pattern}', 'removeWhiteListPattern')"
182 <img src="${iconDeleteUrl}"/></ww:a>
192 <script type="text/javascript">
194 function adjustActionMethod( action, method )
196 var idx = action.indexOf( "!" );
199 // no "name!method.action" defined, split by ".action" instead.
200 idx = action.indexOf( ".action" );
203 return action.substring( 0, idx ) + "!" + method + ".action";
206 function setAndSubmit( id, value, method )
208 var f = document.forms['saveProxyConnector'];
210 f.action = adjustActionMethod( f.action, method );
211 f.elements[id].value = value;
215 function submitForm( method )
217 var f = document.forms['saveProxyConnector'];
219 var before = f.action;
220 f.action = adjustActionMethod( f.action, method );
224 function submitenter( e, method )
231 keycode = window.event.keyCode;
244 submitForm( method );
253 document.forms["saveProxyConnector"]["connector.proxyId"].focus();