Compare commits

..

5 Commits

Author SHA1 Message Date
0e8d522769 v1.0.5-v2 pom 2021-07-22 15:30:18 -04:00
7185dd225e using commons-rest-api v1.0.2 to fix jersey/put 2021-07-22 15:25:07 -04:00
1e4f420f47 v1.0.4-v2 2021-07-12 15:17:14 -04:00
64330e3ca4 Merge branch 'develop' into stable 2021-07-12 15:15:52 -04:00
1aa4c4943f added multipart support for createNode 2021-07-12 15:15:31 -04:00
5 changed files with 129 additions and 2 deletions

10
pom.xml
View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.alfresco</groupId>
<artifactId>acs-public-rest-api</artifactId>
<version>1.0.3-v2</version>
<version>1.0.5-v2</version>
<name>Alfresco Content Services ReST API Client for Java</name>
<properties>
@@ -27,7 +27,7 @@
<dependency>
<groupId>com.inteligr8</groupId>
<artifactId>common-rest-api</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
@@ -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>

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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);
}