Compare commits
13 Commits
v1.0.6-v1-
...
v1.1.3
Author | SHA1 | Date | |
---|---|---|---|
5d7d2b68ec | |||
ac0622c1e4 | |||
1211f8ad5b | |||
8c2c394e9f | |||
61400ad8c7 | |||
6cc939addb | |||
147a9a4a3e | |||
9f4f0d1c9f | |||
7089fb2bc8 | |||
fa0a7d19ed | |||
11d9038ef1 | |||
29baa2a56a | |||
41379c3970 |
47
pom.xml
47
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.inteligr8.alfresco</groupId>
|
<groupId>com.inteligr8.alfresco</groupId>
|
||||||
<artifactId>acs-public-rest-api</artifactId>
|
<artifactId>acs-public-rest-api</artifactId>
|
||||||
<version>1.0.6-v1-acs6</version>
|
<version>1.1.3</version>
|
||||||
<name>Alfresco Content Services ReST API Client for Java</name>
|
<name>Alfresco Content Services ReST API Client for Java</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
<!-- If you want to build for your specific version, point to your own
|
<!-- If you want to build for your specific version, point to your own
|
||||||
installation -->
|
installation -->
|
||||||
<acs.baseUrl>http://localhost:8080/api-explorer</acs.baseUrl>
|
<acs.baseUrl>http://localhost:8080/api-explorer</acs.baseUrl>
|
||||||
|
<acs.platform.tag>acs6</acs.platform.tag>
|
||||||
<swagger.basePackage>com.inteligr8.alfresco.acs</swagger.basePackage>
|
<swagger.basePackage>com.inteligr8.alfresco.acs</swagger.basePackage>
|
||||||
|
|
||||||
<junit.version>5.7.2</junit.version>
|
<junit.version>5.7.2</junit.version>
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.inteligr8</groupId>
|
<groupId>com.inteligr8</groupId>
|
||||||
<artifactId>common-rest-api</artifactId>
|
<artifactId>common-rest-api</artifactId>
|
||||||
<version>1.0.2</version>
|
<version>1.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
@@ -119,6 +120,12 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<classifier>${acs.platform.tag}</classifier>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.0.0-M5</version>
|
<version>3.0.0-M5</version>
|
||||||
@@ -142,16 +149,17 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.repaint.maven</groupId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<artifactId>tiles-maven-plugin</artifactId>
|
<executions>
|
||||||
<version>2.21</version>
|
<execution>
|
||||||
<extensions>true</extensions>
|
<id>javadoc</id>
|
||||||
<configuration>
|
<phase>package</phase>
|
||||||
<filtering>true</filtering>
|
<goals><goal>jar</goal></goals>
|
||||||
<tiles>
|
<configuration>
|
||||||
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
|
<show>public</show>
|
||||||
</tiles>
|
</configuration>
|
||||||
</configuration>
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@@ -409,7 +417,7 @@
|
|||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>inteligr8-releases</id>
|
<id>inteligr8-public</id>
|
||||||
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
@@ -420,8 +428,19 @@
|
|||||||
<url>https://repository.mulesoft.org/releases</url>
|
<url>https://repository.mulesoft.org/releases</url>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>inteligr8-releases</id>
|
<id>inteligr8-public</id>
|
||||||
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>inteligr8-releases</id>
|
||||||
|
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>inteligr8-snapshots</id>
|
||||||
|
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-snapshots</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -4,11 +4,20 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||||
|
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides a POJO & Spring-based implementation of the
|
||||||
|
* ClientConfiguration interface. You can use it outside of the Spring
|
||||||
|
* context, but you will need the spring-context and spring-beans libraries in
|
||||||
|
* your non-Spring application.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ComponentScan
|
@ComponentScan
|
||||||
public class AcsClientConfiguration extends ClientConfiguration {
|
public class AcsClientConfiguration implements ClientCxfConfiguration, ClientJerseyConfiguration {
|
||||||
|
|
||||||
@Value("${content.service.baseUrl:http://localhost:8080/alfresco}")
|
@Value("${content.service.baseUrl:http://localhost:8080/alfresco}")
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
@@ -19,8 +28,8 @@ public class AcsClientConfiguration extends ClientConfiguration {
|
|||||||
@Value("${content.service.security.basicAuth.password:admin}")
|
@Value("${content.service.security.basicAuth.password:admin}")
|
||||||
private String basicAuthPassword;
|
private String basicAuthPassword;
|
||||||
|
|
||||||
@Value("${content.service.security.accessToken:#{null}}")
|
@Value("${content.service.security.bearerToken:#{null}}")
|
||||||
private String accessToken;
|
private String bearerToken;
|
||||||
|
|
||||||
@Value("${content.service.security.oauth.tokenUrl:#{null}}")
|
@Value("${content.service.security.oauth.tokenUrl:#{null}}")
|
||||||
private String oAuthTokenUrl;
|
private String oAuthTokenUrl;
|
||||||
@@ -43,48 +52,114 @@ public class AcsClientConfiguration extends ClientConfiguration {
|
|||||||
@Value("${content.service.security.oauth.grantPassword:#{null}}")
|
@Value("${content.service.security.oauth.grantPassword:#{null}}")
|
||||||
private String oAuthPassword;
|
private String oAuthPassword;
|
||||||
|
|
||||||
|
@Value("${content.service.cxf.defaultBusEnabled:true}")
|
||||||
|
private boolean defaultBusEnabled;
|
||||||
|
|
||||||
|
@Value("${content.service.jersey.putBodyRequired:true}")
|
||||||
|
private boolean putBodyRequired;
|
||||||
|
|
||||||
public String getBaseUrl() {
|
public String getBaseUrl() {
|
||||||
return this.baseUrl;
|
return this.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBaseUrl(String baseUrl) {
|
||||||
|
this.baseUrl = baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getBasicAuthUsername() {
|
public String getBasicAuthUsername() {
|
||||||
return this.basicAuthUsername;
|
return this.basicAuthUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBasicAuthUsername(String basicAuthUsername) {
|
||||||
|
this.basicAuthUsername = basicAuthUsername;
|
||||||
|
}
|
||||||
|
|
||||||
public String getBasicAuthPassword() {
|
public String getBasicAuthPassword() {
|
||||||
return this.basicAuthPassword;
|
return this.basicAuthPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBasicAuthPassword(String basicAuthPassword) {
|
||||||
|
this.basicAuthPassword = basicAuthPassword;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAccessToken() {
|
public String getBearerToken() {
|
||||||
return this.accessToken;
|
return this.bearerToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBearerToken(String bearerToken) {
|
||||||
|
this.bearerToken = bearerToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOAuthTokenUrl() {
|
public String getOAuthTokenUrl() {
|
||||||
return this.oAuthTokenUrl;
|
return this.oAuthTokenUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthTokenUrl(String oAuthTokenUrl) {
|
||||||
|
this.oAuthTokenUrl = oAuthTokenUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthClientId() {
|
public String getOAuthClientId() {
|
||||||
return this.oAuthClientId;
|
return this.oAuthClientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthClientId(String oAuthClientId) {
|
||||||
|
this.oAuthClientId = oAuthClientId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthClientSecret() {
|
public String getOAuthClientSecret() {
|
||||||
return this.oAuthClientSecret;
|
return this.oAuthClientSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthClientSecret(String oAuthClientSecret) {
|
||||||
|
this.oAuthClientSecret = oAuthClientSecret;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthAuthCode() {
|
public String getOAuthAuthCode() {
|
||||||
return this.oAuthAuthCode;
|
return this.oAuthAuthCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthAuthCode(String oAuthAuthCode) {
|
||||||
|
this.oAuthAuthCode = oAuthAuthCode;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthAuthRedirectUri() {
|
public String getOAuthAuthRedirectUri() {
|
||||||
return this.oAuthAuthRedirectUri;
|
return this.oAuthAuthRedirectUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthAuthRedirectUri(String oAuthAuthRedirectUri) {
|
||||||
|
this.oAuthAuthRedirectUri = oAuthAuthRedirectUri;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthUsername() {
|
public String getOAuthUsername() {
|
||||||
return this.oAuthUsername;
|
return this.oAuthUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthUsername(String oAuthUsername) {
|
||||||
|
this.oAuthUsername = oAuthUsername;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthPassword() {
|
public String getOAuthPassword() {
|
||||||
return this.oAuthPassword;
|
return this.oAuthPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOAuthPassword(String oAuthPassword) {
|
||||||
|
this.oAuthPassword = oAuthPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDefaultBusEnabled() {
|
||||||
|
return this.defaultBusEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultBusEnabled(boolean defaultBusEnabled) {
|
||||||
|
this.defaultBusEnabled = defaultBusEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPutBodyRequired() {
|
||||||
|
return this.putBodyRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPutBodyRequired(boolean putBodyRequired) {
|
||||||
|
this.putBodyRequired = putBodyRequired;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,11 +4,16 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||||
import com.inteligr8.rs.ClientCxfImpl;
|
import com.inteligr8.rs.ClientCxfImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configured JAX-RS Client & WebTarget for ACS & CXF
|
* This class provides a POJO & Spring-based implementation of the Apache
|
||||||
|
* CXF client. You can use it outside of the Spring context, but you will need
|
||||||
|
* the spring-context and spring-beans libraries in your non-Spring
|
||||||
|
* application.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("acs.client.cxf")
|
@Component("acs.client.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,8 +22,22 @@ public class AcsClientCxfImpl extends ClientCxfImpl {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AcsClientConfiguration config;
|
private AcsClientConfiguration config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use.
|
||||||
|
*/
|
||||||
|
AcsClientCxfImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use.
|
||||||
|
* @param config
|
||||||
|
*/
|
||||||
|
public AcsClientCxfImpl(AcsClientConfiguration config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientConfiguration getConfig() {
|
protected ClientCxfConfiguration getConfig() {
|
||||||
return this.config;
|
return this.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,11 +4,16 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||||
import com.inteligr8.rs.ClientJerseyImpl;
|
import com.inteligr8.rs.ClientJerseyImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configured JAX-RS Client & WebTarget for ACS & Jersey
|
* This class provides a POJO & Spring-based implementation of the Apache
|
||||||
|
* CXF client. You can use it outside of the Spring context, but you will need
|
||||||
|
* the spring-context and spring-beans libraries in your non-Spring
|
||||||
|
* application.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("acs.client.jersey")
|
@Component("acs.client.jersey")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,8 +22,22 @@ public class AcsClientJerseyImpl extends ClientJerseyImpl {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AcsClientConfiguration config;
|
private AcsClientConfiguration config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use.
|
||||||
|
*/
|
||||||
|
AcsClientJerseyImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use.
|
||||||
|
* @param config
|
||||||
|
*/
|
||||||
|
public AcsClientJerseyImpl(AcsClientConfiguration config) {
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientConfiguration getConfig() {
|
protected ClientJerseyConfiguration getConfig() {
|
||||||
return this.config;
|
return this.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,116 +22,222 @@ import com.inteligr8.alfresco.acs.api.SharedLinksApi;
|
|||||||
import com.inteligr8.alfresco.acs.api.SitesApi;
|
import com.inteligr8.alfresco.acs.api.SitesApi;
|
||||||
import com.inteligr8.alfresco.acs.api.TagsApi;
|
import com.inteligr8.alfresco.acs.api.TagsApi;
|
||||||
import com.inteligr8.alfresco.acs.api.TrashcanApi;
|
import com.inteligr8.alfresco.acs.api.TrashcanApi;
|
||||||
|
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||||
import com.inteligr8.alfresco.acs.api.VersionsApi;
|
import com.inteligr8.alfresco.acs.api.VersionsApi;
|
||||||
|
import com.inteligr8.rs.AuthorizationFilter;
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Content Services Spring-ready API
|
* This class serves as the base implementation for the JAX-RS API for the ACS
|
||||||
|
* Public ReST API.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
public abstract class AcsPublicRestApi {
|
public abstract class AcsPublicRestApi {
|
||||||
|
|
||||||
abstract ClientConfiguration getConfig();
|
abstract ClientConfiguration getConfig();
|
||||||
|
|
||||||
protected abstract <T> T getApi(Class<T> apiClass);
|
abstract Client getClient();
|
||||||
|
|
||||||
|
protected final <T> T getApi(Class<T> apiClass) {
|
||||||
|
return this.getApi(null, apiClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <T> T getApi(AuthorizationFilter authFilter, Class<T> apiClass) {
|
||||||
|
return this.getClient().getApi(authFilter, apiClass);
|
||||||
|
}
|
||||||
|
|
||||||
public ActionsApi getActionsApi() {
|
public ActionsApi getActionsApi() {
|
||||||
return this.getApi(ActionsApi.class);
|
return this.getApi(ActionsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionsApi getActionsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, ActionsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public ActivitiesApi getActivitiesApi() {
|
public ActivitiesApi getActivitiesApi() {
|
||||||
return this.getApi(ActivitiesApi.class);
|
return this.getApi(ActivitiesApi.class);
|
||||||
}
|
}
|
||||||
/* v7
|
|
||||||
public AspectsApi getAspectsApi() {
|
public ActivitiesApi getActivitiesApi(AuthorizationFilter authFilter) {
|
||||||
return this.getApi(AspectsApi.class);
|
return this.getApi(authFilter, ActivitiesApi.class);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
public AuditApi getAuditApi() {
|
public AuditApi getAuditApi() {
|
||||||
return this.getApi(AuditApi.class);
|
return this.getApi(AuditApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuditApi getAuditApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, AuditApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public AuthenticationApi getAuthenticationApi() {
|
public AuthenticationApi getAuthenticationApi() {
|
||||||
return this.getApi(AuthenticationApi.class);
|
return this.getApi(AuthenticationApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthenticationApi getAuthenticationApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, AuthenticationApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public CommentsApi getCommentsApi() {
|
public CommentsApi getCommentsApi() {
|
||||||
return this.getApi(CommentsApi.class);
|
return this.getApi(CommentsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommentsApi getCommentsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, CommentsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public DiscoveryApi getDiscoveryApi() {
|
public DiscoveryApi getDiscoveryApi() {
|
||||||
return this.getApi(DiscoveryApi.class);
|
return this.getApi(DiscoveryApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DiscoveryApi getDiscoveryApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, DiscoveryApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public DownloadsApi getDownloadsApi() {
|
public DownloadsApi getDownloadsApi() {
|
||||||
return this.getApi(DownloadsApi.class);
|
return this.getApi(DownloadsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DownloadsApi getDownloadsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, DownloadsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public FavoritesApi getFavoritesApi() {
|
public FavoritesApi getFavoritesApi() {
|
||||||
return this.getApi(FavoritesApi.class);
|
return this.getApi(FavoritesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FavoritesApi getFavoritesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, FavoritesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public GroupsApi getGroupsApi() {
|
public GroupsApi getGroupsApi() {
|
||||||
return this.getApi(GroupsApi.class);
|
return this.getApi(GroupsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GroupsApi getGroupsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, GroupsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public NetworksApi getNetworksApi() {
|
public NetworksApi getNetworksApi() {
|
||||||
return this.getApi(NetworksApi.class);
|
return this.getApi(NetworksApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NetworksApi getNetworksApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, NetworksApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public NodesApi getNodesApi() {
|
public NodesApi getNodesApi() {
|
||||||
return this.getApi(NodesApi.class);
|
return this.getApi(NodesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NodesApi getNodesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, NodesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public PeopleApi getPeopleApi() {
|
public PeopleApi getPeopleApi() {
|
||||||
return this.getApi(PeopleApi.class);
|
return this.getApi(PeopleApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PeopleApi getPeopleApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, PeopleApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public PreferencesApi getPreferencesApi() {
|
public PreferencesApi getPreferencesApi() {
|
||||||
return this.getApi(PreferencesApi.class);
|
return this.getApi(PreferencesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PreferencesApi getPreferencesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, PreferencesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public ProbesApi getProbesApi() {
|
public ProbesApi getProbesApi() {
|
||||||
return this.getApi(ProbesApi.class);
|
return this.getApi(ProbesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProbesApi getProbesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, ProbesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public QueriesApi getQueriesApi() {
|
public QueriesApi getQueriesApi() {
|
||||||
return this.getApi(QueriesApi.class);
|
return this.getApi(QueriesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueriesApi getQueriesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, QueriesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public RatingsApi getRatingsApi() {
|
public RatingsApi getRatingsApi() {
|
||||||
return this.getApi(RatingsApi.class);
|
return this.getApi(RatingsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RatingsApi getRatingsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, RatingsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public RenditionsApi getRenditionsApi() {
|
public RenditionsApi getRenditionsApi() {
|
||||||
return this.getApi(RenditionsApi.class);
|
return this.getApi(RenditionsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RenditionsApi getRenditionsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, RenditionsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public SearchApi getSearchApi() {
|
public SearchApi getSearchApi() {
|
||||||
return this.getApi(SearchApi.class);
|
return this.getApi(SearchApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SearchApi getSearchApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, SearchApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public SharedLinksApi getSharedLinksApi() {
|
public SharedLinksApi getSharedLinksApi() {
|
||||||
return this.getApi(SharedLinksApi.class);
|
return this.getApi(SharedLinksApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SharedLinksApi getSharedLinksApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, SharedLinksApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public SitesApi getSitesApi() {
|
public SitesApi getSitesApi() {
|
||||||
return this.getApi(SitesApi.class);
|
return this.getApi(SitesApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SitesApi getSitesApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, SitesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public TagsApi getTagsApi() {
|
public TagsApi getTagsApi() {
|
||||||
return this.getApi(TagsApi.class);
|
return this.getApi(TagsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TagsApi getTagsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, TagsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
public TrashcanApi getTrashcanApi() {
|
public TrashcanApi getTrashcanApi() {
|
||||||
return this.getApi(TrashcanApi.class);
|
return this.getApi(TrashcanApi.class);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public TypesApi getTypesApi() {
|
public TrashcanApi getTrashcanApi(AuthorizationFilter authFilter) {
|
||||||
return this.getApi(TypesApi.class);
|
return this.getApi(authFilter, TrashcanApi.class);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
public VersionsApi getVersionsApi() {
|
public VersionsApi getVersionsApi() {
|
||||||
return this.getApi(VersionsApi.class);
|
return this.getApi(VersionsApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VersionsApi getVersionsApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, VersionsApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public V0Api getV0Api() {
|
||||||
|
return this.getApi(V0Api.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public V0Api getV0Api(AuthorizationFilter authFilter) {
|
||||||
|
return this.getApi(authFilter, V0Api.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,10 +5,15 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.inteligr8.alfresco.acs.api.NodesCxfApi;
|
import com.inteligr8.alfresco.acs.api.NodesCxfApi;
|
||||||
|
import com.inteligr8.rs.AuthorizationFilter;
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Content Services Spring-ready API for CXF
|
* This class provides the Apache CXF client to the JAX-RS API for the ACS
|
||||||
|
* Public ReST API. It also provides extension API helpers.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("acs.api.cxf")
|
@Component("acs.api.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,18 +22,35 @@ public class AcsPublicRestApiCxfImpl extends AcsPublicRestApi {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AcsClientCxfImpl client;
|
private AcsClientCxfImpl client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use.
|
||||||
|
*/
|
||||||
|
AcsPublicRestApiCxfImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use.
|
||||||
|
*/
|
||||||
|
public AcsPublicRestApiCxfImpl(AcsClientCxfImpl client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
ClientConfiguration getConfig() {
|
ClientConfiguration getConfig() {
|
||||||
return this.client.getConfig();
|
return this.client.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <T> T getApi(Class<T> apiClass) {
|
Client getClient() {
|
||||||
return this.client.getApi(apiClass);
|
return this.client;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodesCxfApi getNodesExtApi() {
|
public NodesCxfApi getNodesExtApi() {
|
||||||
return this.client.getApi(NodesCxfApi.class);
|
return this.client.getApi(NodesCxfApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NodesCxfApi getNodesExtApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.client.getApi(authFilter, NodesCxfApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,10 +5,15 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.inteligr8.alfresco.acs.api.NodesJerseyApi;
|
import com.inteligr8.alfresco.acs.api.NodesJerseyApi;
|
||||||
|
import com.inteligr8.rs.AuthorizationFilter;
|
||||||
|
import com.inteligr8.rs.Client;
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alfresco Content Services Spring-ready API for Jersey
|
* This class provides the Jersey client to the JAX-RS API for the ACS Public
|
||||||
|
* ReST API. It also provides extension API helpers.
|
||||||
|
*
|
||||||
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("acs.api.jersey")
|
@Component("acs.api.jersey")
|
||||||
@Lazy
|
@Lazy
|
||||||
@@ -17,18 +22,35 @@ public class AcsPublicRestApiJerseyImpl extends AcsPublicRestApi {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AcsClientJerseyImpl client;
|
private AcsClientJerseyImpl client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for Spring use.
|
||||||
|
*/
|
||||||
|
AcsPublicRestApiJerseyImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This constructor is for POJO use.
|
||||||
|
*/
|
||||||
|
public AcsPublicRestApiJerseyImpl(AcsClientJerseyImpl client) {
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
ClientConfiguration getConfig() {
|
ClientConfiguration getConfig() {
|
||||||
return this.client.getConfig();
|
return this.client.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <T> T getApi(Class<T> apiClass) {
|
Client getClient() {
|
||||||
return this.client.getApi(apiClass);
|
return this.client;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodesJerseyApi getNodesExtApi() {
|
public NodesJerseyApi getNodesExtApi() {
|
||||||
return this.client.getApi(NodesJerseyApi.class);
|
return this.client.getApi(NodesJerseyApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NodesJerseyApi getNodesExtApi(AuthorizationFilter authFilter) {
|
||||||
|
return this.client.getApi(authFilter, NodesJerseyApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
92
src/main/java/com/inteligr8/alfresco/acs/api/V0Api.java
Executable file
92
src/main/java/com/inteligr8/alfresco/acs/api/V0Api.java
Executable file
@@ -0,0 +1,92 @@
|
|||||||
|
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 com.inteligr8.alfresco.acs.model.v0.AssociationInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.ClassInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.MimeTypesData;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.PropertyInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.ServerData;
|
||||||
|
|
||||||
|
@Path("/service/api")
|
||||||
|
public interface V0Api {
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/server")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public ServerData getServer();
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/mimetypes/descriptions")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public MimeTypesData getMimeTypes();
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public List<ClassInfo> getClasses(
|
||||||
|
@QueryParam("cf") String classFilter,
|
||||||
|
@QueryParam("nsp") String namespacePrefix,
|
||||||
|
@QueryParam("n") String name);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public ClassInfo getClass(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}/subclasses")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public List<ClassInfo> getClassSubclasses(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}/associations")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public List<AssociationInfo> getClassAssociations(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}/association/{assocPrefix}/{assocLocalName}")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public AssociationInfo getClassAssociation(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName,
|
||||||
|
@PathParam("assocPrefix") String assocPrefix,
|
||||||
|
@PathParam("assocLocalName") String assocLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}/properties")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public List<PropertyInfo> getClassProperties(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/defclasses/{classPrefix}/{classLocalName}/property/{propPrefix}/{propLocalName}")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public PropertyInfo getClassProperty(
|
||||||
|
@PathParam("classPrefix") String classPrefix,
|
||||||
|
@PathParam("classLocalName") String classLocalName,
|
||||||
|
@PathParam("propPrefix") String propPrefix,
|
||||||
|
@PathParam("propLocalName") String propLocalName);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/properties")
|
||||||
|
@Produces({ "application/json" })
|
||||||
|
public List<PropertyInfo> getProperties(
|
||||||
|
@QueryParam("nsp") String namespacePrefix,
|
||||||
|
@QueryParam("name") String name,
|
||||||
|
@QueryParam("type") String dataType);
|
||||||
|
|
||||||
|
}
|
106
src/main/java/com/inteligr8/alfresco/acs/model/v0/AssociationInfo.java
Executable file
106
src/main/java/com/inteligr8/alfresco/acs/model/v0/AssociationInfo.java
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class AssociationInfo extends NamedObject {
|
||||||
|
|
||||||
|
@JsonProperty("isChildAssociation")
|
||||||
|
private boolean childAssociation;
|
||||||
|
|
||||||
|
@JsonProperty("protected")
|
||||||
|
private boolean protected_;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean duplicateChildNameAllowed;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private EndpointInfo source;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private EndpointInfo target;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isChildAssociation() {
|
||||||
|
return childAssociation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildAssociation(boolean childAssociation) {
|
||||||
|
this.childAssociation = childAssociation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isProtected() {
|
||||||
|
return protected_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtected(boolean protected_) {
|
||||||
|
this.protected_ = protected_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDuplicateChildNameAllowed() {
|
||||||
|
return duplicateChildNameAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuplicateChildNameAllowed(boolean duplicateChildNameAllowed) {
|
||||||
|
this.duplicateChildNameAllowed = duplicateChildNameAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EndpointInfo getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(EndpointInfo source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EndpointInfo getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTarget(EndpointInfo target) {
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public static class EndpointInfo {
|
||||||
|
|
||||||
|
@JsonProperty("class")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean mandatory;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean many;
|
||||||
|
|
||||||
|
public String getClassName() {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClassName(String className) {
|
||||||
|
this.className = className;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMandatory() {
|
||||||
|
return mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatory(boolean mandatory) {
|
||||||
|
this.mandatory = mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMany() {
|
||||||
|
return many;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMany(boolean many) {
|
||||||
|
this.many = many;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
135
src/main/java/com/inteligr8/alfresco/acs/model/v0/ClassInfo.java
Executable file
135
src/main/java/com/inteligr8/alfresco/acs/model/v0/ClassInfo.java
Executable file
@@ -0,0 +1,135 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ClassInfo extends NamedObject {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean isAspect;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean isContainer;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private ParentInfo parent;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private Map<String, AspectInfo> defaultAspects;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private Map<String, PropertyInfo> properties;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private Map<String, AssociationInfo> associations;
|
||||||
|
|
||||||
|
@JsonProperty("childassociations")
|
||||||
|
private Map<String, AssociationInfo> childAssociations;
|
||||||
|
|
||||||
|
|
||||||
|
private Object syncAssocs = new Object();
|
||||||
|
private boolean correctedAssocs = false;
|
||||||
|
|
||||||
|
private Object syncChildAssocs = new Object();
|
||||||
|
private boolean correctedChildAssocs = false;
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isAspect() {
|
||||||
|
return isAspect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAspect(boolean isAspect) {
|
||||||
|
this.isAspect = isAspect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isContainer() {
|
||||||
|
return isContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(boolean isContainer) {
|
||||||
|
this.isContainer = isContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParentInfo getParent() {
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent(ParentInfo parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, AspectInfo> getDefaultAspects() {
|
||||||
|
return defaultAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultAspects(Map<String, AspectInfo> defaultAspects) {
|
||||||
|
this.defaultAspects = defaultAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, PropertyInfo> getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(Map<String, PropertyInfo> properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, AssociationInfo> getAssociations() {
|
||||||
|
synchronized (this.syncAssocs) {
|
||||||
|
if (!this.correctedAssocs)
|
||||||
|
for (AssociationInfo assoc : this.associations.values())
|
||||||
|
assoc.setChildAssociation(false);
|
||||||
|
this.correctedAssocs = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssociations(Map<String, AssociationInfo> associations) {
|
||||||
|
synchronized (this.syncAssocs) {
|
||||||
|
this.associations = associations;
|
||||||
|
this.correctedAssocs = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, AssociationInfo> getChildAssociations() {
|
||||||
|
synchronized (this.syncChildAssocs) {
|
||||||
|
if (!this.correctedChildAssocs)
|
||||||
|
for (AssociationInfo assoc : this.childAssociations.values())
|
||||||
|
assoc.setChildAssociation(false);
|
||||||
|
this.correctedChildAssocs = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return childAssociations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildAssociations(Map<String, AssociationInfo> childAssociations) {
|
||||||
|
synchronized (this.syncChildAssocs) {
|
||||||
|
this.childAssociations = childAssociations;
|
||||||
|
this.correctedChildAssocs = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public static class ParentInfo extends NamedObject {}
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public static class AspectInfo extends NamedObject {}
|
||||||
|
|
||||||
|
}
|
34
src/main/java/com/inteligr8/alfresco/acs/model/v0/ConstraintInfo.java
Executable file
34
src/main/java/com/inteligr8/alfresco/acs/model/v0/ConstraintInfo.java
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ConstraintInfo {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private List<Map<String, String>> parameters;
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Map<String, String>> getParameters() {
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(List<Map<String, String>> parameters) {
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
66
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypeInfo.java
Executable file
66
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypeInfo.java
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class MimeTypeInfo {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private ExtensionsInfo extensions;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtensionsInfo getExtensions() {
|
||||||
|
return extensions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtensions(ExtensionsInfo extensions) {
|
||||||
|
this.extensions = extensions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public static class ExtensionsInfo {
|
||||||
|
|
||||||
|
@JsonProperty("default")
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private List<String> additional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDefault() {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefault(String defaultValue) {
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAdditional() {
|
||||||
|
return additional;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdditional(List<String> additional) {
|
||||||
|
this.additional = additional;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
22
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypesData.java
Executable file
22
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypesData.java
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class MimeTypesData {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private MimeTypesMap data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public MimeTypesMap getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(MimeTypesMap data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
21
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypesMap.java
Executable file
21
src/main/java/com/inteligr8/alfresco/acs/model/v0/MimeTypesMap.java
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class MimeTypesMap extends HashMap<String, MimeTypeInfo> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4776034773614276742L;
|
||||||
|
|
||||||
|
public Collection<String> getMimeTypes() {
|
||||||
|
return this.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MimeTypeInfo getMimeTypeInfo(String mimeType) {
|
||||||
|
return this.get(mimeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
44
src/main/java/com/inteligr8/alfresco/acs/model/v0/NamedObject.java
Executable file
44
src/main/java/com/inteligr8/alfresco/acs/model/v0/NamedObject.java
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class NamedObject {
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
112
src/main/java/com/inteligr8/alfresco/acs/model/v0/PropertyInfo.java
Executable file
112
src/main/java/com/inteligr8/alfresco/acs/model/v0/PropertyInfo.java
Executable file
@@ -0,0 +1,112 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class PropertyInfo extends NamedObject {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String defaultValue;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean multiValued;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean mandatory;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean enforced;
|
||||||
|
|
||||||
|
@JsonProperty("protected")
|
||||||
|
private boolean protected_;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean indexed;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private List<ConstraintInfo> constraints;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultValue() {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultValue(String defaultValue) {
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMultiValued() {
|
||||||
|
return multiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMultiValued(boolean multiValued) {
|
||||||
|
this.multiValued = multiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMandatory() {
|
||||||
|
return mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatory(boolean mandatory) {
|
||||||
|
this.mandatory = mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnforced() {
|
||||||
|
return enforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnforced(boolean enforced) {
|
||||||
|
this.enforced = enforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isProtected_() {
|
||||||
|
return protected_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtected_(boolean protected_) {
|
||||||
|
this.protected_ = protected_;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIndexed() {
|
||||||
|
return indexed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndexed(boolean indexed) {
|
||||||
|
this.indexed = indexed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ConstraintInfo> getConstraints() {
|
||||||
|
return constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConstraints(List<ConstraintInfo> constraints) {
|
||||||
|
this.constraints = constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
22
src/main/java/com/inteligr8/alfresco/acs/model/v0/ServerData.java
Executable file
22
src/main/java/com/inteligr8/alfresco/acs/model/v0/ServerData.java
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ServerData {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private ServerInfo data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ServerInfo getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(ServerInfo data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
44
src/main/java/com/inteligr8/alfresco/acs/model/v0/ServerInfo.java
Executable file
44
src/main/java/com/inteligr8/alfresco/acs/model/v0/ServerInfo.java
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
package com.inteligr8.alfresco.acs.model.v0;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ServerInfo {
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String edition;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String schema;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getEdition() {
|
||||||
|
return edition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEdition(String edition) {
|
||||||
|
this.edition = edition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSchema() {
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSchema(String schema) {
|
||||||
|
this.schema = schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
54
src/test/java/com/inteligr8/alfresco/acs/ConnectionClientIT.java
Normal file → Executable file
54
src/test/java/com/inteligr8/alfresco/acs/ConnectionClientIT.java
Normal file → Executable file
@@ -1,5 +1,6 @@
|
|||||||
package com.inteligr8.alfresco.acs;
|
package com.inteligr8.alfresco.acs;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.ws.rs.NotFoundException;
|
import javax.ws.rs.NotFoundException;
|
||||||
@@ -10,7 +11,12 @@ import org.junit.jupiter.api.condition.EnabledIf;
|
|||||||
|
|
||||||
import com.inteligr8.alfresco.acs.api.DiscoveryApi;
|
import com.inteligr8.alfresco.acs.api.DiscoveryApi;
|
||||||
import com.inteligr8.alfresco.acs.api.NodesApi;
|
import com.inteligr8.alfresco.acs.api.NodesApi;
|
||||||
|
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||||
import com.inteligr8.alfresco.acs.model.RepositoryInfo;
|
import com.inteligr8.alfresco.acs.model.RepositoryInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.ClassInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.MimeTypesData;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.PropertyInfo;
|
||||||
|
import com.inteligr8.alfresco.acs.model.v0.ServerData;
|
||||||
|
|
||||||
public abstract class ConnectionClientIT extends ConditionalIT {
|
public abstract class ConnectionClientIT extends ConditionalIT {
|
||||||
|
|
||||||
@@ -37,4 +43,52 @@ public abstract class ConnectionClientIT extends ConditionalIT {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledIf("hostExists")
|
||||||
|
public void testV0ServerInfo() {
|
||||||
|
V0Api api = this.getClient().getV0Api();
|
||||||
|
ServerData server = api.getServer();
|
||||||
|
|
||||||
|
Assertions.assertNotNull(server);
|
||||||
|
Assertions.assertNotNull(server.getData());
|
||||||
|
Assertions.assertNotNull(server.getData().getEdition());
|
||||||
|
Assertions.assertTrue(server.getData().getEdition().length() > 5);
|
||||||
|
Assertions.assertTrue(server.getData().getVersion().length() > 5);
|
||||||
|
Assertions.assertTrue(server.getData().getSchema().length() > 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledIf("hostExists")
|
||||||
|
public void testV0MimeTypes() {
|
||||||
|
V0Api api = this.getClient().getV0Api();
|
||||||
|
MimeTypesData mimeTypes = api.getMimeTypes();
|
||||||
|
|
||||||
|
Assertions.assertNotNull(mimeTypes);
|
||||||
|
Assertions.assertNotNull(mimeTypes.getData());
|
||||||
|
Assertions.assertTrue(mimeTypes.getData().getMimeTypes().size() > 50);
|
||||||
|
Assertions.assertNotNull(mimeTypes.getData().getMimeTypeInfo("application/pdf"));
|
||||||
|
Assertions.assertEquals("pdf", mimeTypes.getData().getMimeTypeInfo("application/pdf").getExtensions().getDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledIf("hostExists")
|
||||||
|
public void testV0Classes() {
|
||||||
|
V0Api api = this.getClient().getV0Api();
|
||||||
|
List<ClassInfo> classes = api.getClasses(null, null, null);
|
||||||
|
|
||||||
|
Assertions.assertNotNull(classes);
|
||||||
|
Assertions.assertTrue(classes.size() > 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@EnabledIf("hostExists")
|
||||||
|
public void testV0Property() {
|
||||||
|
V0Api api = this.getClient().getV0Api();
|
||||||
|
List<PropertyInfo> props = api.getProperties(null, "cm:content", null);
|
||||||
|
|
||||||
|
Assertions.assertNotNull(props);
|
||||||
|
Assertions.assertEquals(1, props.size());
|
||||||
|
Assertions.assertEquals("d:content", props.iterator().next().getDataType());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user