You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

addLegacyArtifactPath.jsp 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <%--
  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
  9. ~
  10. ~ http://www.apache.org/licenses/LICENSE-2.0
  11. ~
  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
  17. ~ under the License.
  18. --%>
  19. <%@ taglib prefix="s" uri="/struts-tags" %>
  20. <html>
  21. <head>
  22. <title>Admin: Add Legacy Artifact Path</title>
  23. <s:head/>
  24. </head>
  25. <body>
  26. <h1>Admin: Add Legacy Artifact Path</h1>
  27. <div id="contentArea">
  28. <p>
  29. Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary.
  30. </p>
  31. <script type="text/javascript">
  32. function parse( path )
  33. {
  34. var group = path.indexOf( "/" );
  35. if ( group > 0 )
  36. {
  37. document.getElementById( "addLegacyArtifactPath_groupId" ).value
  38. = path.substring( 0, group );
  39. group += 1;
  40. var type = path.indexOf( "/", group );
  41. if ( type > 0 )
  42. {
  43. document.getElementById( "addLegacyArtifactPath_type" ).value
  44. = path.substring( group, type - 1 );
  45. }
  46. type += 1;
  47. var version = path.indexOf( "-", type );
  48. var ext = path.lastIndexOf( "." );
  49. if ( version > 0 )
  50. {
  51. document.getElementById( "addLegacyArtifactPath_artifactId" ).value
  52. = path.substring( type, version );
  53. document.getElementById( "addLegacyArtifactPath_version" ).value
  54. = path.substring( version + 1, ext );
  55. }
  56. }
  57. }
  58. </script>
  59. <s:actionmessage/>
  60. <s:actionerror/>
  61. <s:form method="post" action="addLegacyArtifactPath!commit" namespace="/admin" validate="true">
  62. <s:textfield name="legacyArtifactPath.path" label="Path" size="50" required="true" onchange="parse( this.value )"/>
  63. <s:textfield name="groupId" label="GroupId" size="20" required="true"/>
  64. <s:textfield name="artifactId" label="ArtifactId" size="20" required="true"/>
  65. <s:textfield name="version" label="Version" size="20" required="true"/>
  66. <s:textfield name="classifier" label="Classifier" size="20" required="false"/>
  67. <s:textfield name="type" label="Type" size="20" required="true"/>
  68. <s:submit value="Add Legacy Artifact Path"/>
  69. </s:form>
  70. <script type="text/javascript">
  71. var ref = document.getElementById("addLegacyArtifactPath_legacyArtifactPath_artifact").value;
  72. var i = ref.indexOf( ":" );
  73. document.getElementById("addLegacyArtifactPath_groupId").value = ref.substring( 0, i );
  74. var j = i + 1;
  75. var i = ref.indexOf( ":", j );
  76. document.getElementById("addLegacyArtifactPath_artifactId").value = ref.substring( j, i );
  77. var j = i + 1;
  78. var i = ref.indexOf( ":", j );
  79. document.getElementById("addLegacyArtifactPath_version").value = ref.substring( j, i );
  80. var j = i + 1;
  81. var i = ref.indexOf( ":", j );
  82. document.getElementById("addLegacyArtifactPath_classifier").value = ref.substring( j, i );
  83. document.getElementById("addLegacyArtifactPath_legacyArtifactPath_path").focus();
  84. </script>
  85. </div>
  86. </body>
  87. </html>