added multipart support for createNode
This commit is contained in:
parent
c4a2bd66a2
commit
1aa4c4943f
6
pom.xml
6
pom.xml
@ -46,6 +46,12 @@
|
||||
<version>${jersey.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-multipart</artifactId>
|
||||
<version>${jersey.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-rs-client</artifactId>
|
||||
|
@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.inteligr8.alfresco.acs.api.NodesCxfApi;
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
|
||||
/**
|
||||
@ -25,5 +26,9 @@ public class AcsPublicRestApiCxfImpl extends AcsPublicRestApi {
|
||||
protected <T> T getApi(Class<T> apiClass) {
|
||||
return this.client.getApi(apiClass);
|
||||
}
|
||||
|
||||
public NodesCxfApi getNodesExtApi() {
|
||||
return this.client.getApi(NodesCxfApi.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.inteligr8.alfresco.acs.api.NodesJerseyApi;
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
|
||||
/**
|
||||
@ -25,5 +26,9 @@ public class AcsPublicRestApiJerseyImpl extends AcsPublicRestApi {
|
||||
protected <T> T getApi(Class<T> apiClass) {
|
||||
return this.client.getApi(apiClass);
|
||||
}
|
||||
|
||||
public NodesJerseyApi getNodesExtApi() {
|
||||
return this.client.getApi(NodesJerseyApi.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.inteligr8.alfresco.acs.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Error;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreate;
|
||||
import com.inteligr8.alfresco.acs.model.NodeEntry;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
|
||||
@Path("/api/-default-/public/alfresco/versions/1")
|
||||
@Api(value = "/api/-default-/public/alfresco/versions/1", description = "")
|
||||
public interface NodesCxfApi {
|
||||
|
||||
@POST
|
||||
@Path("/nodes/{nodeId}/children")
|
||||
@Consumes({ "application/json", "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@ApiOperation(value = "Create a node", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 201, message = "Successful response", response = NodeEntry.class),
|
||||
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format or **nodeBodyCreate** is invalid "),
|
||||
@ApiResponse(code = 401, message = "Authentication failed"),
|
||||
@ApiResponse(code = 403, message = "Current user does not have permission to create children of **nodeId**"),
|
||||
@ApiResponse(code = 404, message = "**nodeId** or **renditionId** does not exist "),
|
||||
@ApiResponse(code = 409, message = "New name clashes with an existing node in the current parent folder"),
|
||||
@ApiResponse(code = 413, message = "Content exceeds individual file size limit configured for the network or system"),
|
||||
@ApiResponse(code = 415, message = "Content Type is not supported"),
|
||||
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
|
||||
@ApiResponse(code = 507, message = "Content exceeds overall storage quota limit configured for the network or system"),
|
||||
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
|
||||
public NodeEntry createNode(
|
||||
@PathParam("nodeId") String nodeId,
|
||||
NodeBodyCreate nodeBodyCreate,
|
||||
@QueryParam("autoRename") Boolean autoRename,
|
||||
@QueryParam("majorVersion") Boolean majorVersion,
|
||||
@QueryParam("versioningEnabled") Boolean versioningEnabled,
|
||||
@QueryParam("include") List<String> include,
|
||||
@QueryParam("fields") List<String> fields,
|
||||
List<Attachment> attachments);
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.inteligr8.alfresco.acs.api;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Error;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreate;
|
||||
import com.inteligr8.alfresco.acs.model.NodeEntry;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
|
||||
@Path("/api/-default-/public/alfresco/versions/1")
|
||||
@Api(value = "/api/-default-/public/alfresco/versions/1", description = "")
|
||||
public interface NodesJerseyApi {
|
||||
|
||||
@POST
|
||||
@Path("/nodes/{nodeId}/children")
|
||||
@Consumes({ "application/json", "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@ApiOperation(value = "Create a node", tags={ })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 201, message = "Successful response", response = NodeEntry.class),
|
||||
@ApiResponse(code = 400, message = "Invalid parameter: **nodeId** is not a valid format or **nodeBodyCreate** is invalid "),
|
||||
@ApiResponse(code = 401, message = "Authentication failed"),
|
||||
@ApiResponse(code = 403, message = "Current user does not have permission to create children of **nodeId**"),
|
||||
@ApiResponse(code = 404, message = "**nodeId** or **renditionId** does not exist "),
|
||||
@ApiResponse(code = 409, message = "New name clashes with an existing node in the current parent folder"),
|
||||
@ApiResponse(code = 413, message = "Content exceeds individual file size limit configured for the network or system"),
|
||||
@ApiResponse(code = 415, message = "Content Type is not supported"),
|
||||
@ApiResponse(code = 422, message = "Model integrity exception including a file name containing invalid characters"),
|
||||
@ApiResponse(code = 507, message = "Content exceeds overall storage quota limit configured for the network or system"),
|
||||
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
|
||||
public NodeEntry createNode(
|
||||
@PathParam("nodeId") String nodeId,
|
||||
NodeBodyCreate nodeBodyCreate,
|
||||
@QueryParam("autoRename") Boolean autoRename,
|
||||
@QueryParam("majorVersion") Boolean majorVersion,
|
||||
@QueryParam("versioningEnabled") Boolean versioningEnabled,
|
||||
@QueryParam("include") List<String> include,
|
||||
@QueryParam("fields") List<String> fields,
|
||||
@FormDataParam("filedata") InputStream filedataStream,
|
||||
@FormDataParam("filedata") FormDataContentDisposition filedataDisposition);
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user