Author: oching
Date: Mon Jan 28 23:00:14 2008
New Revision: 616186

URL: http://svn.apache.org/viewvc?rev=616186&view=rev
Log:
-merged with r615904 in trunk

Added:
    
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/
      - copied from r615904, 
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/
    
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml
      - copied unchanged from r615904, 
maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml
Modified:
    
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java
    
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp

Modified: 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java?rev=616186&r1=616185&r2=616186&view=diff
==============================================================================
--- 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java
 (original)
+++ 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java
 Mon Jan 28 23:00:14 2008
@@ -54,6 +54,16 @@
 
     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 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() ) )
         {
@@ -116,5 +130,55 @@
         }
 
         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;
     }
 }

Modified: 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp
URL: 
http://svn.apache.org/viewvc/maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp?rev=616186&r1=616185&r2=616186&view=diff
==============================================================================
--- 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp
 (original)
+++ 
maven/archiva/branches/archiva-1.0.x/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp
 Mon Jan 28 23:00:14 2008
@@ -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;
-  }
   </script>
 
   <ww:actionmessage/>
   <ww:actionerror/>
-  <ww:form method="post" action="addLegacyArtifactPath!commit" 
namespace="/admin" validate="true" onsubmit="computeArtifactReference()">
+  <ww:form method="post" action="addLegacyArtifactPath!commit" 
namespace="/admin" validate="true">
     <ww:textfield name="legacyArtifactPath.path" label="Path" size="50" 
required="true" onchange="parse( this.value )"/>
-    <ww:textfield name="groupId" label="GroupId" size="20" required="true" 
disabled="true"/>
+    <ww:textfield name="groupId" label="GroupId" size="20" required="true"/>
     <ww:textfield name="artifactId" label="ArtifactId" size="20" 
required="true"/>
     <ww:textfield name="version" label="Version" size="20" required="true"/>
     <ww:textfield name="classifier" label="Classifier" size="20" 
required="false"/>
-    <ww:textfield name="type" label="Type" size="20" required="true" 
disabled="true"/>
-    <ww:hidden name="legacyArtifactPath.artifact"/>
+    <ww:textfield name="type" label="Type" size="20" required="true"/>
     <ww:submit value="Add Legacy Artifact Path"/>
   </ww:form>
 


Reply via email to