From: Maria Odea B. Ching Date: Tue, 29 Jan 2008 07:00:14 +0000 (+0000) Subject: -merged with r615904 in trunk X-Git-Tag: archiva-1.0.1~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4385b73f5f185933cd7da7960c681d40d7d6a89d;p=archiva.git -merged with r615904 in trunk git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-1.0.x@616186 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java index 6dca666ea..71d6c3bc8 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java @@ -54,6 +54,16 @@ public class AddLegacyArtifactPathAction private LegacyArtifactPath legacyArtifactPath; + private String groupId; + + private String artifactId; + + private String version; + + private String classifier; + + private String type; + public void prepare() { @@ -67,14 +77,18 @@ public class AddLegacyArtifactPathAction public String commit() { + this.legacyArtifactPath.setArtifact( + this.groupId + ":" + this.artifactId + ":" + this.classifier + ":" + this.version + ":" + this.type ); + + // Check the proposed Artifact macthes the path ArtifactReference artifact = new ArtifactReference(); - - artifact.setGroupId( this.legacyArtifactPath.getGroupId() ); - artifact.setArtifactId( this.legacyArtifactPath.getArtifactId() ); - artifact.setClassifier( this.legacyArtifactPath.getClassifier() ); - artifact.setVersion( this.legacyArtifactPath.getVersion() ); - artifact.setType( this.legacyArtifactPath.getType() ); - + + artifact.setGroupId( this.groupId ); + artifact.setArtifactId( this.artifactId ); + artifact.setClassifier( this.classifier ); + artifact.setVersion( this.version ); + artifact.setType( this.type ); + String path = repositoryContent.toPath( artifact ); if ( ! path.equals( this.legacyArtifactPath.getPath() ) ) { @@ -117,4 +131,54 @@ public class AddLegacyArtifactPathAction return SUCCESS; } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public String getVersion() + { + return version; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public String getClassifier() + { + return classifier; + } + + public void setClassifier( String classifier ) + { + this.classifier = classifier; + } + + public String getType() + { + return type; + } + + public void setType( String type ) + { + this.type = type; + } } diff --git a/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml b/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml new file mode 100644 index 000000000..1725a33ec --- /dev/null +++ b/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml @@ -0,0 +1,50 @@ + + + + + + + + + You must enter a legacy path. + + + + + You must enter a groupId. + + + + + You must enter an artifactId. + + + + + You must enter a version. + + + + + You must enter a type. + + + \ No newline at end of file diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp index 4258e8cc9..6c647d426 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp @@ -63,31 +63,17 @@ } } - function computeArtifactReference() - { - document.getElementById("addLegacyArtifactPath_legacyArtifactPath_artifact").value - = document.getElementById("addLegacyArtifactPath_groupId").value - + ":" - + document.getElementById("addLegacyArtifactPath_artifactId").value - + ":" - + document.getElementById("addLegacyArtifactPath_version").value - + ":" - + document.getElementById("addLegacyArtifactPath_classifier").value - + ":" - + document.getElementById("addLegacyArtifactPath_type").value; - } - + - + - - +