\r
private LegacyArtifactPath legacyArtifactPath;\r
\r
+ private String groupId;\r
+\r
+ private String artifactId;\r
+\r
+ private String version;\r
+\r
+ private String classifier;\r
+\r
+ private String type;\r
+\r
\r
public void prepare()\r
{\r
\r
public String commit()\r
{\r
+ this.legacyArtifactPath.setArtifact(\r
+ this.groupId + ":" + this.artifactId + ":" + this.classifier + ":" + this.version + ":" + this.type );\r
+\r
+ // Check the proposed Artifact macthes the path\r
ArtifactReference artifact = new ArtifactReference();\r
- \r
- artifact.setGroupId( this.legacyArtifactPath.getGroupId() );\r
- artifact.setArtifactId( this.legacyArtifactPath.getArtifactId() );\r
- artifact.setClassifier( this.legacyArtifactPath.getClassifier() );\r
- artifact.setVersion( this.legacyArtifactPath.getVersion() );\r
- artifact.setType( this.legacyArtifactPath.getType() );\r
- \r
+\r
+ artifact.setGroupId( this.groupId );\r
+ artifact.setArtifactId( this.artifactId );\r
+ artifact.setClassifier( this.classifier );\r
+ artifact.setVersion( this.version );\r
+ artifact.setType( this.type );\r
+\r
String path = repositoryContent.toPath( artifact );\r
if ( ! path.equals( this.legacyArtifactPath.getPath() ) )\r
{\r
\r
return SUCCESS;\r
}\r
+\r
+ public String getGroupId()\r
+ {\r
+ return groupId;\r
+ }\r
+\r
+ public void setGroupId( String groupId )\r
+ {\r
+ this.groupId = groupId;\r
+ }\r
+\r
+ public String getArtifactId()\r
+ {\r
+ return artifactId;\r
+ }\r
+\r
+ public void setArtifactId( String artifactId )\r
+ {\r
+ this.artifactId = artifactId;\r
+ }\r
+\r
+ public String getVersion()\r
+ {\r
+ return version;\r
+ }\r
+\r
+ public void setVersion( String version )\r
+ {\r
+ this.version = version;\r
+ }\r
+\r
+ public String getClassifier()\r
+ {\r
+ return classifier;\r
+ }\r
+\r
+ public void setClassifier( String classifier )\r
+ {\r
+ this.classifier = classifier;\r
+ }\r
+\r
+ public String getType()\r
+ {\r
+ return type;\r
+ }\r
+\r
+ public void setType( String type )\r
+ {\r
+ this.type = type;\r
+ }\r
}\r
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+ <field name="legacyArtifactPath.path">
+ <field-validator type="requiredstring">
+ <message>You must enter a legacy path.</message>
+ </field-validator>
+ </field>
+ <field name="groupId">
+ <field-validator type="requiredstring">
+ <message>You must enter a groupId.</message>
+ </field-validator>
+ </field>
+ <field name="artifactId">
+ <field-validator type="requiredstring">
+ <message>You must enter an artifactId.</message>
+ </field-validator>
+ </field>
+ <field name="version">
+ <field-validator type="requiredstring">
+ <message>You must enter a version.</message>
+ </field-validator>
+ </field>
+ <field name="type">
+ <field-validator type="requiredstring">
+ <message>You must enter a type.</message>
+ </field-validator>
+ </field>
+</validators>
\ No newline at end of file
\r
}\r
}\r
- function computeArtifactReference()\r
- {\r
- document.getElementById("addLegacyArtifactPath_legacyArtifactPath_artifact").value\r
- = document.getElementById("addLegacyArtifactPath_groupId").value\r
- + ":"\r
- + document.getElementById("addLegacyArtifactPath_artifactId").value\r
- + ":"\r
- + document.getElementById("addLegacyArtifactPath_version").value\r
- + ":"\r
- + document.getElementById("addLegacyArtifactPath_classifier").value\r
- + ":"\r
- + document.getElementById("addLegacyArtifactPath_type").value;\r
- }\r
</script>\r
\r
<ww:actionmessage/>\r
<ww:actionerror/>\r
- <ww:form method="post" action="addLegacyArtifactPath!commit" namespace="/admin" validate="true" onsubmit="computeArtifactReference()">\r
+ <ww:form method="post" action="addLegacyArtifactPath!commit" namespace="/admin" validate="true">\r
<ww:textfield name="legacyArtifactPath.path" label="Path" size="50" required="true" onchange="parse( this.value )"/>\r
- <ww:textfield name="groupId" label="GroupId" size="20" required="true" disabled="true"/>\r
+ <ww:textfield name="groupId" label="GroupId" size="20" required="true"/>\r
<ww:textfield name="artifactId" label="ArtifactId" size="20" required="true"/>\r
<ww:textfield name="version" label="Version" size="20" required="true"/>\r
<ww:textfield name="classifier" label="Classifier" size="20" required="false"/>\r
- <ww:textfield name="type" label="Type" size="20" required="true" disabled="true"/>\r
- <ww:hidden name="legacyArtifactPath.artifact"/>\r
+ <ww:textfield name="type" label="Type" size="20" required="true"/>\r
<ww:submit value="Add Legacy Artifact Path"/>\r
</ww:form>\r
\r