diff options
author | alecharp <alecharp@unknown> | 2012-10-16 09:08:22 +0000 |
---|---|---|
committer | alecharp <alecharp@unknown> | 2012-10-16 09:08:22 +0000 |
commit | b2c8b7464e385859c2e1437df876ce86691a4f94 (patch) | |
tree | 65500f1bc68edb39fbccbc83f1fbcb0cddefcb9d /archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src | |
parent | fecebd5b756848002dd6d58890ecf567bb60a488 (diff) | |
download | archiva-b2c8b7464e385859c2e1437df876ce86691a4f94.tar.gz archiva-b2c8b7464e385859c2e1437df876ce86691a4f94.zip |
Improve metadata import interfaces
Possibility to import more than one metadata each time
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1398702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src')
2 files changed, 93 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/MetadataAddRequest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/MetadataAddRequest.java new file mode 100644 index 000000000..b024fefae --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/MetadataAddRequest.java @@ -0,0 +1,85 @@ +package org.apache.archiva.rest.api.model; +/* + * 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. + */ + +import javax.xml.bind.annotation.XmlRootElement; +import java.io.Serializable; +import java.util.Map; + +/** + * @author Adrien Lecharpentier <alecharp@apache.org> + * @since 1.4-M4 + */ +@XmlRootElement( name = "metadataAddRequest" ) +public class MetadataAddRequest + implements Serializable +{ + private String groupId; + + private String artifactId; + + private String version; + + private Map<String, String> metadatas; + + public MetadataAddRequest() + { + // no op + } + + 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 Map<String, String> getMetadatas() + { + return metadatas; + } + + public void setMetadatas( Map<String, String> metadatas ) + { + this.metadatas = metadatas; + } +} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java index 735ea9279..fc65767d7 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java @@ -21,17 +21,18 @@ package org.apache.archiva.rest.api.services; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.maven2.model.TreeEntry; -import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.redback.authorization.RedbackAuthorization; import org.apache.archiva.rest.api.model.ArtifactContent; import org.apache.archiva.rest.api.model.ArtifactContentEntry; import org.apache.archiva.rest.api.model.BrowseResult; import org.apache.archiva.rest.api.model.Entry; +import org.apache.archiva.rest.api.model.MetadataAddRequest; import org.apache.archiva.rest.api.model.VersionsList; import javax.ws.rs.DELETE; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -151,6 +152,12 @@ public interface BrowseService @QueryParam ("repositoryId") String repositoryId ) throws ArchivaRestServiceException; + @Path( "importMetadata" ) + @POST + @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata") + Boolean importMetadata( MetadataAddRequest metadataAddRequest, @QueryParam ("repository") String repository ) + throws ArchivaRestServiceException; + @Path ("artifactContentEntries/{g}/{a}/{v}") @GET @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) |