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
20 <%@ page contentType="text/html; charset=UTF-8" %>
21 <%@ taglib prefix="s" uri="/struts-tags" %>
25 <title>Admin: Add Legacy Artifact Path</title>
31 <h1>Admin: Add Legacy Artifact Path</h1>
33 <div id="contentArea">
36 Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary.
39 <script type="text/javascript">
40 function parse( path )
42 var group = path.indexOf( "/" );
45 document.getElementById( "addLegacyArtifactPath_groupId" ).value
46 = path.substring( 0, group );
48 var type = path.indexOf( "/", group );
51 document.getElementById( "addLegacyArtifactPath_type" ).value
52 = path.substring( group, type - 1 );
55 var version = path.indexOf( "-", type );
56 var ext = path.lastIndexOf( "." );
59 document.getElementById( "addLegacyArtifactPath_artifactId" ).value
60 = path.substring( type, version );
61 document.getElementById( "addLegacyArtifactPath_version" ).value
62 = path.substring( version + 1, ext );
69 <%-- changed the structure of displaying errorMessages & actionMessages in order for them to be escaped. --%>
70 <s:if test="hasActionErrors()">
72 <s:iterator value="actionErrors">
73 <li><span class="errorMessage"><s:property escape="true" /></span></li>
77 <s:if test="hasActionMessages()">
79 <s:iterator value="actionMessages">
80 <li><span class="actionMessage"><s:property escape="true" /></span></li>
85 <s:form method="post" action="addLegacyArtifactPath!commit" namespace="/admin" validate="true">
86 <s:textfield name="legacyArtifactPath.path" label="Path" size="50" required="true" onchange="parse( this.value )"/>
87 <s:textfield name="groupId" label="GroupId" size="20" required="true"/>
88 <s:textfield name="artifactId" label="ArtifactId" size="20" required="true"/>
89 <s:textfield name="version" label="Version" size="20" required="true"/>
90 <s:textfield name="classifier" label="Classifier" size="20" required="false"/>
91 <s:textfield name="type" label="Type" size="20" required="true"/>
92 <s:submit value="Add Legacy Artifact Path"/>
95 <script type="text/javascript">
96 var ref = document.getElementById("addLegacyArtifactPath_legacyArtifactPath_artifact").value;
97 var i = ref.indexOf( ":" );
98 document.getElementById("addLegacyArtifactPath_groupId").value = ref.substring( 0, i );
100 var i = ref.indexOf( ":", j );
101 document.getElementById("addLegacyArtifactPath_artifactId").value = ref.substring( j, i );
103 var i = ref.indexOf( ":", j );
104 document.getElementById("addLegacyArtifactPath_version").value = ref.substring( j, i );
106 var i = ref.indexOf( ":", j );
107 document.getElementById("addLegacyArtifactPath_classifier").value = ref.substring( j, i );
109 document.getElementById("addLegacyArtifactPath_legacyArtifactPath_path").focus();