Commit 038237e2 authored by Brian Long's avatar Brian Long
Browse files

Merge branch 'develop-acs52' into stable-acs52

parents 29a13ac7 407197d3
Loading
Loading
Loading
Loading
+33 −3
Original line number Diff line number Diff line
@@ -5,10 +5,10 @@

	<groupId>com.inteligr8.alfresco</groupId>
	<artifactId>acs-public-rest-api</artifactId>
	<version>2.0.1-acs51</version>
	<version>2.0.1-acs52</version>

	<name>Alfresco Content Services ReST API for Java</name>
	<description>A library for building ACS v5.1.x JAX-RS REST API clients</description>
	<description>A library for building ACS v5.2.x JAX-RS REST API clients</description>
	<url>https://bitbucket.org/inteligr8/acs-public-rest-api</url>

	<licenses>
@@ -44,7 +44,7 @@

		<swagger.basePackage>com.inteligr8.alfresco.acs</swagger.basePackage>
		
		<alfresco.platform.version>5.1.0</alfresco.platform.version>
		<alfresco.platform.version>5.2.0</alfresco.platform.version>

		<jersey.version>2.35</jersey.version>
		<cxf.version>3.4.7</cxf.version>
@@ -144,6 +144,36 @@
							<inputSpec>${project.build.directory}/dependency/definitions/alfresco-core.yaml</inputSpec>
						</configuration>
					</execution>
					<execution>
						<id>swagger-search-codegen</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<inputSpec>${project.build.directory}/dependency/definitions/alfresco-search.yaml</inputSpec>
						</configuration>
					</execution>
					<execution>
						<id>swagger-auth-codegen</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<inputSpec>${project.build.directory}/dependency/definitions/alfresco-auth.yaml</inputSpec>
						</configuration>
					</execution>
					<execution>
						<id>swagger-discovery-codegen</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<inputSpec>${project.build.directory}/dependency/definitions/alfresco-discovery.yaml</inputSpec>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
+55 −0
Original line number Diff line number Diff line
@@ -14,14 +14,25 @@
 */
package com.inteligr8.alfresco.acs;

import com.inteligr8.alfresco.acs.api.ActivitiesApi;
import com.inteligr8.alfresco.acs.api.AuthenticationApi;
import com.inteligr8.alfresco.acs.api.CommentsApi;
import com.inteligr8.alfresco.acs.api.DiscoveryApi;
import com.inteligr8.alfresco.acs.api.FavoritesApi;
import com.inteligr8.alfresco.acs.api.NetworksApi;
import com.inteligr8.alfresco.acs.api.NodesApi;
import com.inteligr8.alfresco.acs.api.PeopleApi;
import com.inteligr8.alfresco.acs.api.PreferencesApi;
import com.inteligr8.alfresco.acs.api.QueriesApi;
import com.inteligr8.alfresco.acs.api.RatingsApi;
import com.inteligr8.alfresco.acs.api.RenditionsApi;
import com.inteligr8.alfresco.acs.api.SearchApi;
import com.inteligr8.alfresco.acs.api.SharedLinksApi;
import com.inteligr8.alfresco.acs.api.SitesApi;
import com.inteligr8.alfresco.acs.api.TagsApi;
import com.inteligr8.alfresco.acs.api.TrashcanApi;
import com.inteligr8.alfresco.acs.api.V0Api;
import com.inteligr8.alfresco.acs.api.VersionsApi;

/**
 * This interface consolidates the JAX-RS APIs available in the ACS Public
@@ -33,10 +44,22 @@ public interface AcsPublicRestApi {
	
	<T> T getApi(Class<T> apiClass);
	
	default ActivitiesApi getActivitiesApi() {
		return this.getApi(ActivitiesApi.class);
	}
	
	default AuthenticationApi getAuthenticationApi() {
		return this.getApi(AuthenticationApi.class);
	}
	
	default CommentsApi getCommentsApi() {
		return this.getApi(CommentsApi.class);
	}
	
	default DiscoveryApi getDiscoveryApi() {
		return this.getApi(DiscoveryApi.class);
	}
	
	default FavoritesApi getFavoritesApi() {
		return this.getApi(FavoritesApi.class);
	}
@@ -45,14 +68,38 @@ public interface AcsPublicRestApi {
		return this.getApi(NetworksApi.class);
	}
	
	default NodesApi getNodesApi() {
		return this.getApi(NodesApi.class);
	}
	
	default PeopleApi getPeopleApi() {
		return this.getApi(PeopleApi.class);
	}
	
	default PreferencesApi getPreferencesApi() {
		return this.getApi(PreferencesApi.class);
	}
	
	default QueriesApi getQueriesApi() {
		return this.getApi(QueriesApi.class);
	}
	
	default RatingsApi getRatingsApi() {
		return this.getApi(RatingsApi.class);
	}
	
	default RenditionsApi getRenditionsApi() {
		return this.getApi(RenditionsApi.class);
	}
	
	default SearchApi getSearchApi() {
		return this.getApi(SearchApi.class);
	}
	
	default SharedLinksApi getSharedLinksApi() {
		return this.getApi(SharedLinksApi.class);
	}
	
	default SitesApi getSitesApi() {
		return this.getApi(SitesApi.class);
	}
@@ -61,6 +108,14 @@ public interface AcsPublicRestApi {
		return this.getApi(TagsApi.class);
	}
	
	default TrashcanApi getTrashcanApi() {
		return this.getApi(TrashcanApi.class);
	}
	
	default VersionsApi getVersionsApi() {
		return this.getApi(VersionsApi.class);
	}
	
	default V0Api getV0Api() {
		return this.getApi(V0Api.class);
	}
+32 −0
Original line number Diff line number Diff line
/*
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.inteligr8.alfresco.acs;

import com.inteligr8.alfresco.acs.api.NodesCxfApi;

/**
 * This interface appends Apache CXF implementation specific methods to the
 * JAX-RS API of the ACS Public ReST API.  This is due to a lack of multi-part
 * in the JAX-RS specification.
 * 
 * @author brian@inteligr8.com
 */
public interface AcsPublicRestCxfApi extends AcsPublicRestApi {
	
	default NodesCxfApi getNodesExtApi() {
		return this.getApi(NodesCxfApi.class);
	}

}
+32 −0
Original line number Diff line number Diff line
/*
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.inteligr8.alfresco.acs;

import com.inteligr8.alfresco.acs.api.NodesJerseyApi;

/**
 * This interface appends Jersey implementation specific methods to the
 * JAX-RS API of the ACS Public ReST API.  This is due to a lack of multi-part
 * in the JAX-RS specification.
 * 
 * @author brian@inteligr8.com
 */
public interface AcsPublicRestJerseyApi extends AcsPublicRestApi {
	
	default NodesJerseyApi getNodesExtApi() {
		return this.getApi(NodesJerseyApi.class);
	}

}
+87 −0
Original line number Diff line number Diff line
/*
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.inteligr8.alfresco.acs.api;

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.core.MediaType;

import com.inteligr8.alfresco.acs.model.Error;
import com.inteligr8.alfresco.acs.model.NodeBodyCreateMultipartCxf;
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({ MediaType.MULTIPART_FORM_DATA })
    @Produces({ MediaType.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,
    		NodeBodyCreateMultipartCxf body);
/*
 * This better impl doesn't work
 *
    @POST
    @Path("/nodes/{nodeId}/children")
    @Consumes({ MediaType.MULTIPART_FORM_DATA })
    @Produces({ MediaType.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,
    		@Multipart("name") String name,
    		@Multipart("nodeType") String nodeType,
    		@Multipart("filedata") InputStream fileStream,
    		@Multipart("filedata") ContentDisposition disposition,
    		@Multipart(value = "autoRename", required = false) Boolean autoRename,
    		@Multipart(value = "majorVersion", required = false) Boolean majorVersion,
    		@Multipart(value = "versioningEnabled", required = false) Boolean versioningEnabled);
*/
}
Loading