]> source.dussan.org Git - archiva.git/commitdiff
transfer more informations for file uploading: maven coordinate
authorOlivier Lamy <olamy@apache.org>
Thu, 29 Mar 2012 22:53:13 +0000 (22:53 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 29 Mar 2012 22:53:13 +0000 (22:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1307154 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/FileMetadata.java
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/artifacts-management.html

index 37c6dafeb41289676864cfc91fc34fd3d8562f60..4d5ff797f6034d1bef43dd3957c89ff79853892c 100644 (file)
@@ -88,19 +88,34 @@ public class DefaultFileUploadService
             String packaging =
                 IOUtils.toString( multipartBody.getAttachment( "packaging" ).getDataHandler().getInputStream() );
 
+            String repositoryId =
+                IOUtils.toString( multipartBody.getAttachment( "repositoryId" ).getDataHandler().getInputStream() );
+
             boolean generatePom = BooleanUtils.toBoolean(
                 IOUtils.toString( multipartBody.getAttachment( "generatePom" ).getDataHandler().getInputStream() ) );
 
             String classifier =
                 IOUtils.toString( multipartBody.getAttachment( "classifier" ).getDataHandler().getInputStream() );
 
+            boolean pomFile = BooleanUtils.toBoolean(
+                IOUtils.toString( multipartBody.getAttachment( "pomFile" ).getDataHandler().getInputStream() ) );
+
             log.info( "uploading file:" + groupId + ":" + artifactId + ":" + version );
             Attachment file = multipartBody.getAttachment( "files[]" );
             File tmpFile = File.createTempFile( "upload-artifact", "tmp" );
             tmpFile.deleteOnExit();
             IOUtils.copy( file.getDataHandler().getInputStream(), new FileOutputStream( tmpFile ) );
             FileMetadata fileMetadata = new FileMetadata( "thefile", tmpFile.length(), "theurl" );
+            fileMetadata.setGroupId( groupId );
+            fileMetadata.setArtifactId( artifactId );
+            fileMetadata.setVersion( version );
+            fileMetadata.setVersion( version );
+            fileMetadata.setPackaging( packaging );
+            fileMetadata.setGeneratePom( generatePom );
+            fileMetadata.setClassifier( classifier );
             fileMetadata.setDeleteUrl( tmpFile.getName() );
+            fileMetadata.setRepositoryId( repositoryId );
+            fileMetadata.setPomFile( pomFile );
             return fileMetadata;
         }
         catch ( IOException e )
index 5dbeb2515514146c35a5de8081436b61d50bae5d..864d9b7e407c1340aac6d8a0968f42ee764feb14 100644 (file)
@@ -41,6 +41,22 @@ public class FileMetadata
 
     private String errorKey;
 
+    private String groupId;
+
+    private String artifactId;
+
+    private String version;
+
+    private String packaging;
+
+    private boolean generatePom;
+
+    private String classifier;
+
+    private String repositoryId;
+
+    private boolean pomFile;
+
     public FileMetadata()
     {
         // no op
@@ -105,4 +121,94 @@ public class FileMetadata
     {
         this.deleteType = deleteType;
     }
+
+    public String getErrorKey()
+    {
+        return errorKey;
+    }
+
+    public void setErrorKey( String errorKey )
+    {
+        this.errorKey = errorKey;
+    }
+
+    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 getPackaging()
+    {
+        return packaging;
+    }
+
+    public void setPackaging( String packaging )
+    {
+        this.packaging = packaging;
+    }
+
+    public boolean isGeneratePom()
+    {
+        return generatePom;
+    }
+
+    public void setGeneratePom( boolean generatePom )
+    {
+        this.generatePom = generatePom;
+    }
+
+    public String getClassifier()
+    {
+        return classifier;
+    }
+
+    public void setClassifier( String classifier )
+    {
+        this.classifier = classifier;
+    }
+
+    public String getRepositoryId()
+    {
+        return repositoryId;
+    }
+
+    public void setRepositoryId( String repositoryId )
+    {
+        this.repositoryId = repositoryId;
+    }
+
+    public boolean isPomFile()
+    {
+        return pomFile;
+    }
+
+    public void setPomFile( boolean pomFile )
+    {
+        this.pomFile = pomFile;
+    }
 }
index 719965d768ab50e73c8645bfe7c3337c80490147..8140438f88fd1324df135aa710fbc27407c228b9 100644 (file)
@@ -94,7 +94,8 @@
   {% for (var i=0, file; file=o.files[i]; i++) { %}
     <tr class="template-upload">
       <td class="name"><span>{%=file.name%}</span></td>
-      <td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""></td>
+      <td><input type="text" id="classifier" name="classifier" placeholder="classifier" value=""/></td>
+      <td><span>pomFile:</span><input type="checkbox" id="pomFile" name="pomFile"/></td>
       <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
       {% if (file.error) { %}
       <td class="error" colspan="2">