diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java index 37c6dafeb..4d5ff797f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java @@ -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 ) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/FileMetadata.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/FileMetadata.java index 5dbeb2515..864d9b7e4 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/FileMetadata.java +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/FileMetadata.java @@ -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; + } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/artifacts-management.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/artifacts-management.html index 719965d76..8140438f8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/artifacts-management.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/artifacts-management.html @@ -94,7 +94,8 @@ {% for (var i=0, file; file=o.files[i]; i++) { %}