aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp
blob: d93a193f44e89b27cb0731e7d85667543ad52881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<%--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --%>

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
  <title>Admin: Add Legacy Artifact Path</title>
  <s:head/>
</head>

<body>

<h1>Admin: Add Legacy Artifact Path</h1>

<div id="contentArea">

  <p>
    Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary.
  </p>

  <script type="text/javascript">
  function parse( path )
  {
      var group = path.indexOf( "/" );
      if ( group > 0 )
      {
          document.getElementById( "addLegacyArtifactPath_commit_groupId" ).value
              = path.substring( 0, group );
          group += 1;
          var type = path.indexOf( "/", group );
          if ( type > 0 )
          {
              document.getElementById( "addLegacyArtifactPath_commit_type" ).value
                  = path.substring( group, type - 1 );
          }
          type += 1;
          var version = path.indexOf( "-", type );
          var ext = path.lastIndexOf( "." );
          if ( version > 0 )
          {
              document.getElementById( "addLegacyArtifactPath_commit_artifactId" ).value
                  = path.substring( type, version );
              document.getElementById( "addLegacyArtifactPath_commit_version" ).value
                  = path.substring( version + 1, ext );
          }

      }
  }
  </script>

  <%-- changed the structure of displaying errorMessages & actionMessages in order for them to be escaped. --%>
  <s:if test="hasActionErrors()">
      <ul>
      <s:iterator value="actionErrors">
          <li><span class="errorMessage"><s:property escape="true" /></span></li>
      </s:iterator>
      </ul>
  </s:if>
  <s:if test="hasActionMessages()">
      <ul>
      <s:iterator value="actionMessages">
          <li><span class="actionMessage"><s:property escape="true" /></span></li>
      </s:iterator>
      </ul>
  </s:if>

  <s:form method="post" action="addLegacyArtifactPath_commit" namespace="/admin" validate="true">
    <s:textfield name="legacyArtifactPath.path" label="Path" size="50" requiredLabel="true" onchange="parse( this.value )"/>
    <s:textfield name="groupId" label="GroupId" size="20" requiredLabel="true"/>
    <s:textfield name="artifactId" label="ArtifactId" size="20" requiredLabel="true"/>
    <s:textfield name="version" label="Version" size="20" requiredLabel="true"/>
    <s:textfield name="classifier" label="Classifier" size="20" requiredLabel="false"/>
    <s:textfield name="type" label="Type" size="20" requiredLabel="true"/>
    <s:submit value="Add Legacy Artifact Path"/>
  </s:form>

</div>

</body>
</html>