Compare commits
26 Commits
stable-acs
...
develop-ac
Author | SHA1 | Date | |
---|---|---|---|
27f2c2677c | |||
783d93dfe2 | |||
14853ca9ca | |||
91f215ec1d | |||
c637298e3b | |||
224a40c1eb | |||
3718b3afb1 | |||
b06c7a5b6e | |||
6becd9fbcd | |||
573804252b | |||
151366e787 | |||
af23be4e64 | |||
b420e53a58 | |||
457bdec3ec | |||
afa78f27d5 | |||
11f1b54dc2 | |||
0f32bb67c0 | |||
4563273606 | |||
39bdc3ab0d | |||
89515eb147 | |||
12b4544f81 | |||
c800a492d6 | |||
e80401167a | |||
2d05f7a2a5 | |||
ca54c5f893 | |||
1f6838ece7 |
79
pom.xml
79
pom.xml
@ -5,10 +5,10 @@
|
||||
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-api</artifactId>
|
||||
<version>2.1-SNAPSHOT-acs52</version>
|
||||
<version>3.0-SNAPSHOT-acs7</version>
|
||||
|
||||
<name>Alfresco Content Services ReST API for Java</name>
|
||||
<description>A library for building ACS v5.2.x JAX-RS REST API clients</description>
|
||||
<description>A library for building ACS v7.x JAX-RS REST API clients</description>
|
||||
<url>https://bitbucket.org/inteligr8/acs-public-rest-api</url>
|
||||
|
||||
<licenses>
|
||||
@ -38,17 +38,17 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.compiler.debuglevel>lines,vars,source</maven.compiler.debuglevel>
|
||||
|
||||
<swagger.basePackage>com.inteligr8.alfresco.acs</swagger.basePackage>
|
||||
|
||||
<alfresco.platform.version>5.2.0</alfresco.platform.version>
|
||||
<alfresco.platform.version>7.3.0</alfresco.platform.version>
|
||||
|
||||
<jersey.version>2.39.1</jersey.version>
|
||||
<cxf.version>3.5.6</cxf.version>
|
||||
<jackson.version>2.15.1</jackson.version>
|
||||
<jersey.version>3.1.8</jersey.version>
|
||||
<cxf.version>4.0.2</cxf.version>
|
||||
<jackson.version>2.17.2</jackson.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -63,9 +63,9 @@
|
||||
<version>2.2.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
<groupId>jakarta.activation</groupId>
|
||||
<artifactId>jakarta.activation-api</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
@ -75,7 +75,12 @@
|
||||
<dependency>
|
||||
<groupId>jakarta.ws.rs</groupId>
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<version>2.1.6</version>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
@ -131,9 +136,12 @@
|
||||
<plugin>
|
||||
<groupId>io.swagger.codegen.v3</groupId>
|
||||
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||
<version>3.0.45</version>
|
||||
<version>3.0.61</version>
|
||||
<configuration>
|
||||
<language>jaxrs-cxf-client</language>
|
||||
<configOptions>
|
||||
<jakarta>true</jakarta>
|
||||
</configOptions>
|
||||
<output>${basedir}</output>
|
||||
<apiPackage>${swagger.basePackage}.api</apiPackage>
|
||||
<modelPackage>${swagger.basePackage}.model</modelPackage>
|
||||
@ -144,6 +152,17 @@
|
||||
<generateModelDocumentation>false</generateModelDocumentation>
|
||||
</configuration>
|
||||
<executions>
|
||||
<!-- search before core, as ContentInfo is incorrect in search -->
|
||||
<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-core-codegen</id>
|
||||
<phase>generate-sources</phase>
|
||||
@ -164,16 +183,6 @@
|
||||
<inputSpec>${project.build.directory}/dependency/definitions/alfresco-workflow.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>
|
||||
@ -194,6 +203,16 @@
|
||||
<inputSpec>${project.build.directory}/dependency/definitions/alfresco-discovery.yaml</inputSpec>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>swagger-model-codegen</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<inputSpec>${project.build.directory}/dependency/definitions/alfresco-model.yaml</inputSpec>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -225,25 +244,29 @@
|
||||
<previousPattern>/\*\*</previousPattern>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\* Alfresco Core REST API[^@]*)@Path\("/"\)</pattern>
|
||||
<pattern>(\*\*Core API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api/-default-/public/alfresco/versions/1")</replacement>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\* Alfresco Workflow REST API[^@]*)@Path\("/"\)</pattern>
|
||||
<pattern>(\*\*Workflow API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api/-default-/public/workflow/versions/1")</replacement>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\* Alfresco Authentication REST API[^@]*)@Path\("/"\)</pattern>
|
||||
<pattern>(\*\*Authentication API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api/-default-/public/authentication/versions/1")</replacement>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\* Alfresco Discovery REST API[^@]*)@Path\("/"\)</pattern>
|
||||
<pattern>(\*\*Discovery API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api")</replacement>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\* Alfresco Search REST API[^@]*)@Path\("/"\)</pattern>
|
||||
<pattern>(\*\*Search API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api/-default-/public/search/versions/1")</replacement>
|
||||
</regex>
|
||||
<regex>
|
||||
<pattern>(\*\*Model API\*\*[^@]*)@Path\("/"\)</pattern>
|
||||
<replacement>$1@Path("/api/-default-/public/alfresco/versions/1")</replacement>
|
||||
</regex>
|
||||
</regexes>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -14,16 +14,22 @@
|
||||
*/
|
||||
package com.inteligr8.alfresco.acs;
|
||||
|
||||
import com.inteligr8.alfresco.acs.api.ActionsApi;
|
||||
import com.inteligr8.alfresco.acs.api.ActivitiesApi;
|
||||
import com.inteligr8.alfresco.acs.api.AspectsApi;
|
||||
import com.inteligr8.alfresco.acs.api.AuditApi;
|
||||
import com.inteligr8.alfresco.acs.api.AuthenticationApi;
|
||||
import com.inteligr8.alfresco.acs.api.CommentsApi;
|
||||
import com.inteligr8.alfresco.acs.api.DeploymentsApi;
|
||||
import com.inteligr8.alfresco.acs.api.DiscoveryApi;
|
||||
import com.inteligr8.alfresco.acs.api.DownloadsApi;
|
||||
import com.inteligr8.alfresco.acs.api.FavoritesApi;
|
||||
import com.inteligr8.alfresco.acs.api.GroupsApi;
|
||||
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.ProbesApi;
|
||||
import com.inteligr8.alfresco.acs.api.ProcessDefinitionsApi;
|
||||
import com.inteligr8.alfresco.acs.api.ProcessesApi;
|
||||
import com.inteligr8.alfresco.acs.api.QueriesApi;
|
||||
@ -35,6 +41,7 @@ import com.inteligr8.alfresco.acs.api.SitesApi;
|
||||
import com.inteligr8.alfresco.acs.api.TagsApi;
|
||||
import com.inteligr8.alfresco.acs.api.TasksApi;
|
||||
import com.inteligr8.alfresco.acs.api.TrashcanApi;
|
||||
import com.inteligr8.alfresco.acs.api.TypesApi;
|
||||
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||
import com.inteligr8.alfresco.acs.api.VersionsApi;
|
||||
|
||||
@ -48,10 +55,22 @@ public interface AcsPublicRestApi {
|
||||
|
||||
<T> T getApi(Class<T> apiClass);
|
||||
|
||||
default ActionsApi getActionsApi() {
|
||||
return this.getApi(ActionsApi.class);
|
||||
}
|
||||
|
||||
default ActivitiesApi getActivitiesApi() {
|
||||
return this.getApi(ActivitiesApi.class);
|
||||
}
|
||||
|
||||
default AspectsApi getAspectsApi() {
|
||||
return this.getApi(AspectsApi.class);
|
||||
}
|
||||
|
||||
default AuditApi getAuditApi() {
|
||||
return this.getApi(AuditApi.class);
|
||||
}
|
||||
|
||||
default AuthenticationApi getAuthenticationApi() {
|
||||
return this.getApi(AuthenticationApi.class);
|
||||
}
|
||||
@ -68,10 +87,18 @@ public interface AcsPublicRestApi {
|
||||
return this.getApi(DiscoveryApi.class);
|
||||
}
|
||||
|
||||
default DownloadsApi getDownloadsApi() {
|
||||
return this.getApi(DownloadsApi.class);
|
||||
}
|
||||
|
||||
default FavoritesApi getFavoritesApi() {
|
||||
return this.getApi(FavoritesApi.class);
|
||||
}
|
||||
|
||||
default GroupsApi getGroupsApi() {
|
||||
return this.getApi(GroupsApi.class);
|
||||
}
|
||||
|
||||
default NetworksApi getNetworksApi() {
|
||||
return this.getApi(NetworksApi.class);
|
||||
}
|
||||
@ -96,6 +123,10 @@ public interface AcsPublicRestApi {
|
||||
return this.getApi(ProcessesApi.class);
|
||||
}
|
||||
|
||||
default ProbesApi getProbesApi() {
|
||||
return this.getApi(ProbesApi.class);
|
||||
}
|
||||
|
||||
default QueriesApi getQueriesApi() {
|
||||
return this.getApi(QueriesApi.class);
|
||||
}
|
||||
@ -132,6 +163,10 @@ public interface AcsPublicRestApi {
|
||||
return this.getApi(TrashcanApi.class);
|
||||
}
|
||||
|
||||
default TypesApi getTypesApi() {
|
||||
return this.getApi(TypesApi.class);
|
||||
}
|
||||
|
||||
default VersionsApi getVersionsApi() {
|
||||
return this.getApi(VersionsApi.class);
|
||||
}
|
||||
|
@ -14,12 +14,12 @@
|
||||
*/
|
||||
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 jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Error;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreateMultipartCxf;
|
||||
|
@ -14,12 +14,12 @@
|
||||
*/
|
||||
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 jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Error;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreateMultipartJersey;
|
||||
|
@ -16,11 +16,11 @@ package com.inteligr8.alfresco.acs.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.QueryParam;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.v0.AssociationInfo;
|
||||
import com.inteligr8.alfresco.acs.model.v0.ClassInfo;
|
||||
|
@ -17,12 +17,13 @@ package com.inteligr8.alfresco.acs.model;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.ContentDisposition;
|
||||
@ -90,9 +91,18 @@ public class NodeBodyCreateMultipartCxf extends MultipartBody {
|
||||
if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty())
|
||||
logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content");
|
||||
if (nodeBody.getProperties() != null) {
|
||||
Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties();
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties();
|
||||
for (Entry<String, ?> prop : props.entrySet()) {
|
||||
if (prop.getValue() != null) {
|
||||
if (prop.getValue() instanceof Collection<?>) {
|
||||
for (Object value : (Collection<?>)prop.getValue())
|
||||
if (value != null)
|
||||
atts.add(toAttachment(prop.getKey(), value.toString()));
|
||||
} else if (prop.getValue() instanceof Object[]) {
|
||||
for (Object value : (Object[])prop.getValue())
|
||||
if (value != null)
|
||||
atts.add(toAttachment(prop.getKey(), value.toString()));
|
||||
} else if (prop.getValue() != null) {
|
||||
// FIXME convert dates as ACS would expect them to be formatted
|
||||
atts.add(toAttachment(prop.getKey(), prop.getValue().toString()));
|
||||
}
|
||||
|
@ -17,12 +17,13 @@ package com.inteligr8.alfresco.acs.model;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.ParseException;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.BodyPart;
|
||||
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
||||
@ -86,12 +87,21 @@ public class NodeBodyCreateMultipartJersey extends FormDataMultiPart {
|
||||
if (nodeBody.getAspectNames() != null && !nodeBody.getAspectNames().isEmpty())
|
||||
logger.warn("The ACS Public REST API does not support the explicit inclusion of aspects while creating content");
|
||||
if (nodeBody.getProperties() != null) {
|
||||
Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties();
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, ?> props = (Map<String, ?>)nodeBody.getProperties();
|
||||
for (Entry<String, ?> prop : props.entrySet()) {
|
||||
if (prop.getValue() != null) {
|
||||
// FIXME convert dates as ACS would expect them to be formatted
|
||||
fields.add(new FormDataBodyPart(prop.getKey(), prop.getValue().toString()));
|
||||
}
|
||||
if (prop.getValue() instanceof Collection<?>) {
|
||||
for (Object value : (Collection<?>)prop.getValue())
|
||||
if (value != null)
|
||||
fields.add(new FormDataBodyPart(prop.getKey(), value.toString()));
|
||||
} else if (prop.getValue() instanceof Object[]) {
|
||||
for (Object value : (Object[])prop.getValue())
|
||||
if (value != null)
|
||||
fields.add(new FormDataBodyPart(prop.getKey(), value.toString()));
|
||||
} else if (prop.getValue() != null) {
|
||||
// FIXME convert dates as ACS would expect them to be formatted
|
||||
fields.add(new FormDataBodyPart(prop.getKey(), prop.getValue().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user