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 <%@ page contentType="text/html; charset=UTF-8" %>
20 <%@ taglib prefix="s" uri="/struts-tags" %>
21 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
23 <c:url var="iconDeleteUrl" value="/images/icons/delete.gif"/>
24 <c:url var="iconCreateUrl" value="/images/icons/create.png"/>
26 <%-- This hidden 'pattern' field is used by remove (white|black)list scripts --%>
27 <s:hidden name="pattern" />
29 <s:hidden name="connector.order" />
31 <s:select name="connector.proxyId" list="proxyIdOptions" label="Network Proxy" required="true"/>
32 <s:select name="connector.sourceRepoId" list="managedRepoIdList"
33 label="Managed Repository" required="true"/>
34 <s:select name="connector.targetRepoId" list="remoteRepoIdList"
35 label="Remote Repository" required="true"/>
38 <td valign="top"><label>Policies:</label>
42 <c:forEach items="${policyMap}" var="policy" varStatus="i">
45 <s:label for="policy_%{#attr.policy.key}" required="true"
46 theme="simple">${policy.value.name}:
51 <s:property value="%{#attr.connector.policies[#attr.policy.key]}" default="%{#attr.policy.value.defaultOption}" />
53 <s:select name="connector.policies['%{#attr.policy.key}']"
54 list="%{#attr.policyMap[#attr.policy.key].options}"
55 value="%{#attr.value}"
56 id="policy_%{#attr.policy.key}"
58 cssStyle="width: 10em"/>
66 <tr class="seperator">
68 <label for="propertiesEntry">Properties:</label>
71 <s:textfield name="propertyKey" size="15" id="propertiesEntry" theme="simple"
72 onkeypress="submitenter(event, 'addProperty')"/>
74 <s:textfield name="propertyValue" size="15" id="propertiesValue" theme="simple"
75 onkeypress="submitenter(event, 'addProperty')"/>
76 <input type="button" onclick="submitForm('addProperty')" value="Add Property" />
85 <c:when test="${empty (connector.properties)}">
86 <i>No properties have been set.</i>
90 <c:forEach items="${connector.properties}" var="property" varStatus="i">
93 <s:label for="property_%{#attr.property.key}"
94 theme="simple">${property.key}</s:label>
97 <s:textfield name="connector.properties['%{#attr.property.key}']"
99 id="property_%{#attr.property.key}"
103 <s:a href="#" title="Remove [%{#attr.property.key}] Property"
104 onclick="setAndSubmit('propertyKey', '%{#attr.property.key}', 'removeProperty')"
106 <img src="${iconDeleteUrl}"/></s:a>
116 <tr class="seperator">
118 <label for="blackListEntry">Black List:</label>
121 <s:textfield name="blackListPattern" size="30" id="blackListEntry" theme="simple"
122 onkeypress="submitenter(event, 'addBlackListPattern')"/>
123 <input type="button" onclick="submitForm('addBlackListPattern')" value="Add Pattern" />
132 <c:when test="${empty (connector.blackListPatterns)}">
133 <i>No black list patterns have been set.</i>
137 <s:iterator value="connector.blackListPatterns" var="currentPattern" status="i">
140 <input type="hidden" name="connector.blackListPatterns" value="<s:property value="currentPattern" escapeHtml="true"/>"/>
141 <code>"${currentPattern}"</code>
144 <a href="#" title="Remove [${currentPattern}] Pattern"
145 onclick="setAndSubmit('pattern', '<s:property value="currentPattern" escapeJavaScript="true"/>', 'removeBlackListPattern')">
146 <img src="${iconDeleteUrl}"/></a>
156 <tr class="seperator">
158 <label for="whiteListEntry">White List:</label>
161 <s:textfield name="whiteListPattern" size="30" id="whiteListEntry" theme="simple"
162 onkeypress="submitenter(event, 'addWhiteListPattern')"/>
163 <input type="button" onclick="submitForm('addWhiteListPattern')" value="Add Pattern" />
171 <c:when test="${empty (connector.whiteListPatterns)}">
172 <i>No white list patterns have been set.</i>
176 <s:iterator value="connector.whiteListPatterns" var="currentPattern" status="i">
179 <input type="hidden" name="connector.whiteListPatterns" value="<s:property value="currentPattern" escapeHtml="true"/>"/>
180 <code>"${currentPattern}"</code>
183 <a href="#" title="Remove ${currentPattern} Pattern"
184 onclick="setAndSubmit('pattern', '<s:property value="currentPattern" escapeJavaScript="true"/>', 'removeWhiteListPattern')"
186 <img src="${iconDeleteUrl}"/></a>
196 <script type="text/javascript">
198 function adjustActionMethod( action, method )
200 var idx = action.indexOf( "!" );
203 // no "name!method.action" defined, split by ".action" instead.
204 idx = action.indexOf( ".action" );
207 return action.substring( 0, idx ) + "!" + method + ".action";
210 function setAndSubmit( id, value, method )
212 var f = document.forms['saveProxyConnector'];
214 f.action = adjustActionMethod( f.action, method );
215 f.elements[id].value = value;
219 function submitForm( method )
221 var f = document.forms['saveProxyConnector'];
223 var before = f.action;
224 f.action = adjustActionMethod( f.action, method );
228 function submitenter( e, method )
235 keycode = window.event.keyCode;
248 submitForm( method );
257 document.forms["saveProxyConnector"]["connector.proxyId"].focus();