Compare commits
19 Commits
v1.1.0-v1-
...
v1.1.6-acs
Author | SHA1 | Date | |
---|---|---|---|
ac59ee7960 | |||
d0afee96da | |||
8f4370a55f | |||
de86a1e01e | |||
e610752bc1 | |||
e07a8f9c0e | |||
7f495b6c76 | |||
41c7bd062b | |||
5d7d2b68ec | |||
ac0622c1e4 | |||
1211f8ad5b | |||
8c2c394e9f | |||
61400ad8c7 | |||
6cc939addb | |||
147a9a4a3e | |||
9f4f0d1c9f | |||
7089fb2bc8 | |||
fa0a7d19ed | |||
11d9038ef1 |
47
pom.xml
47
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-api</artifactId>
|
||||
<version>1.1.0-v1-acs6</version>
|
||||
<version>1.1.6</version>
|
||||
<name>Alfresco Content Services ReST API Client for Java</name>
|
||||
|
||||
<properties>
|
||||
@@ -15,6 +15,7 @@
|
||||
<!-- If you want to build for your specific version, point to your own
|
||||
installation -->
|
||||
<acs.baseUrl>http://localhost:8080/api-explorer</acs.baseUrl>
|
||||
<acs.platform.tag>acs6</acs.platform.tag>
|
||||
<swagger.basePackage>com.inteligr8.alfresco.acs</swagger.basePackage>
|
||||
|
||||
<junit.version>5.7.2</junit.version>
|
||||
@@ -29,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>com.inteligr8</groupId>
|
||||
<artifactId>common-rest-api</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
@@ -119,6 +120,12 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<classifier>${acs.platform.tag}</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M5</version>
|
||||
@@ -142,16 +149,17 @@
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.21</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<filtering>true</filtering>
|
||||
<tiles>
|
||||
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc</id>
|
||||
<phase>package</phase>
|
||||
<goals><goal>jar</goal></goals>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
@@ -409,7 +417,7 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>inteligr8-releases</id>
|
||||
<id>inteligr8-public</id>
|
||||
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
@@ -420,8 +428,19 @@
|
||||
<url>https://repository.mulesoft.org/releases</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>inteligr8-releases</id>
|
||||
<id>inteligr8-public</id>
|
||||
<url>https://repos.inteligr8.com/nexus/repository/inteligr8-public</url>
|
||||
</pluginRepository>
|
||||
</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>
|
||||
|
@@ -7,6 +7,14 @@ import org.springframework.context.annotation.Configuration;
|
||||
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
|
||||
@ComponentScan
|
||||
public class AcsClientConfiguration implements ClientCxfConfiguration, ClientJerseyConfiguration {
|
||||
@@ -20,8 +28,8 @@ public class AcsClientConfiguration implements ClientCxfConfiguration, ClientJer
|
||||
@Value("${content.service.security.basicAuth.password:admin}")
|
||||
private String basicAuthPassword;
|
||||
|
||||
@Value("${content.service.security.accessToken:#{null}}")
|
||||
private String accessToken;
|
||||
@Value("${content.service.security.bearerToken:#{null}}")
|
||||
private String bearerToken;
|
||||
|
||||
@Value("${content.service.security.oauth.tokenUrl:#{null}}")
|
||||
private String oAuthTokenUrl;
|
||||
@@ -49,57 +57,109 @@ public class AcsClientConfiguration implements ClientCxfConfiguration, ClientJer
|
||||
|
||||
@Value("${content.service.jersey.putBodyRequired:true}")
|
||||
private boolean putBodyRequired;
|
||||
|
||||
|
||||
public String getBaseUrl() {
|
||||
return this.baseUrl;
|
||||
}
|
||||
|
||||
public void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
public String getBasicAuthUsername() {
|
||||
return this.basicAuthUsername;
|
||||
}
|
||||
|
||||
public void setBasicAuthUsername(String basicAuthUsername) {
|
||||
this.basicAuthUsername = basicAuthUsername;
|
||||
}
|
||||
|
||||
public String getBasicAuthPassword() {
|
||||
return this.basicAuthPassword;
|
||||
}
|
||||
|
||||
public void setBasicAuthPassword(String basicAuthPassword) {
|
||||
this.basicAuthPassword = basicAuthPassword;
|
||||
}
|
||||
|
||||
public String getAccessToken() {
|
||||
return this.accessToken;
|
||||
public String getBearerToken() {
|
||||
return this.bearerToken;
|
||||
}
|
||||
|
||||
public void setBearerToken(String bearerToken) {
|
||||
this.bearerToken = bearerToken;
|
||||
}
|
||||
|
||||
public String getOAuthTokenUrl() {
|
||||
return this.oAuthTokenUrl;
|
||||
}
|
||||
|
||||
public void setOAuthTokenUrl(String oAuthTokenUrl) {
|
||||
this.oAuthTokenUrl = oAuthTokenUrl;
|
||||
}
|
||||
|
||||
public String getOAuthClientId() {
|
||||
return this.oAuthClientId;
|
||||
}
|
||||
|
||||
public void setOAuthClientId(String oAuthClientId) {
|
||||
this.oAuthClientId = oAuthClientId;
|
||||
}
|
||||
|
||||
public String getOAuthClientSecret() {
|
||||
return this.oAuthClientSecret;
|
||||
}
|
||||
|
||||
public void setOAuthClientSecret(String oAuthClientSecret) {
|
||||
this.oAuthClientSecret = oAuthClientSecret;
|
||||
}
|
||||
|
||||
public String getOAuthAuthCode() {
|
||||
return this.oAuthAuthCode;
|
||||
}
|
||||
|
||||
public void setOAuthAuthCode(String oAuthAuthCode) {
|
||||
this.oAuthAuthCode = oAuthAuthCode;
|
||||
}
|
||||
|
||||
public String getOAuthAuthRedirectUri() {
|
||||
return this.oAuthAuthRedirectUri;
|
||||
}
|
||||
|
||||
public void setOAuthAuthRedirectUri(String oAuthAuthRedirectUri) {
|
||||
this.oAuthAuthRedirectUri = oAuthAuthRedirectUri;
|
||||
}
|
||||
|
||||
public String getOAuthUsername() {
|
||||
return this.oAuthUsername;
|
||||
}
|
||||
|
||||
public void setOAuthUsername(String oAuthUsername) {
|
||||
this.oAuthUsername = oAuthUsername;
|
||||
}
|
||||
|
||||
public String getOAuthPassword() {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,7 +8,12 @@ import com.inteligr8.rs.ClientCxfConfiguration;
|
||||
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")
|
||||
@Lazy
|
||||
@@ -17,6 +22,20 @@ public class AcsClientCxfImpl extends ClientCxfImpl {
|
||||
@Autowired
|
||||
private AcsClientConfiguration config;
|
||||
|
||||
/**
|
||||
* This constructor is for Spring use.
|
||||
*/
|
||||
protected AcsClientCxfImpl() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is for POJO use.
|
||||
* @param config
|
||||
*/
|
||||
public AcsClientCxfImpl(AcsClientConfiguration config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClientCxfConfiguration getConfig() {
|
||||
return this.config;
|
||||
|
@@ -8,7 +8,12 @@ import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||
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")
|
||||
@Lazy
|
||||
@@ -17,6 +22,20 @@ public class AcsClientJerseyImpl extends ClientJerseyImpl {
|
||||
@Autowired
|
||||
private AcsClientConfiguration config;
|
||||
|
||||
/**
|
||||
* This constructor is for Spring use.
|
||||
*/
|
||||
protected AcsClientJerseyImpl() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is for POJO use.
|
||||
* @param config
|
||||
*/
|
||||
public AcsClientJerseyImpl(AcsClientConfiguration config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClientJerseyConfiguration getConfig() {
|
||||
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.TagsApi;
|
||||
import com.inteligr8.alfresco.acs.api.TrashcanApi;
|
||||
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||
import com.inteligr8.alfresco.acs.api.VersionsApi;
|
||||
import com.inteligr8.rs.AuthorizationFilter;
|
||||
import com.inteligr8.rs.Client;
|
||||
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 {
|
||||
|
||||
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() {
|
||||
return this.getApi(ActionsApi.class);
|
||||
}
|
||||
|
||||
public ActionsApi getActionsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, ActionsApi.class);
|
||||
}
|
||||
|
||||
public ActivitiesApi getActivitiesApi() {
|
||||
return this.getApi(ActivitiesApi.class);
|
||||
}
|
||||
/* v7
|
||||
public AspectsApi getAspectsApi() {
|
||||
return this.getApi(AspectsApi.class);
|
||||
|
||||
public ActivitiesApi getActivitiesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, ActivitiesApi.class);
|
||||
}
|
||||
*/
|
||||
|
||||
public AuditApi getAuditApi() {
|
||||
return this.getApi(AuditApi.class);
|
||||
}
|
||||
|
||||
public AuditApi getAuditApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, AuditApi.class);
|
||||
}
|
||||
|
||||
public AuthenticationApi getAuthenticationApi() {
|
||||
return this.getApi(AuthenticationApi.class);
|
||||
}
|
||||
|
||||
public AuthenticationApi getAuthenticationApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, AuthenticationApi.class);
|
||||
}
|
||||
|
||||
public CommentsApi getCommentsApi() {
|
||||
return this.getApi(CommentsApi.class);
|
||||
}
|
||||
|
||||
public CommentsApi getCommentsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, CommentsApi.class);
|
||||
}
|
||||
|
||||
public DiscoveryApi getDiscoveryApi() {
|
||||
return this.getApi(DiscoveryApi.class);
|
||||
}
|
||||
|
||||
public DiscoveryApi getDiscoveryApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, DiscoveryApi.class);
|
||||
}
|
||||
|
||||
public DownloadsApi getDownloadsApi() {
|
||||
return this.getApi(DownloadsApi.class);
|
||||
}
|
||||
|
||||
public DownloadsApi getDownloadsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, DownloadsApi.class);
|
||||
}
|
||||
|
||||
public FavoritesApi getFavoritesApi() {
|
||||
return this.getApi(FavoritesApi.class);
|
||||
}
|
||||
|
||||
public FavoritesApi getFavoritesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, FavoritesApi.class);
|
||||
}
|
||||
|
||||
public GroupsApi getGroupsApi() {
|
||||
return this.getApi(GroupsApi.class);
|
||||
}
|
||||
|
||||
public GroupsApi getGroupsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, GroupsApi.class);
|
||||
}
|
||||
|
||||
public NetworksApi getNetworksApi() {
|
||||
return this.getApi(NetworksApi.class);
|
||||
}
|
||||
|
||||
public NetworksApi getNetworksApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, NetworksApi.class);
|
||||
}
|
||||
|
||||
public NodesApi getNodesApi() {
|
||||
return this.getApi(NodesApi.class);
|
||||
}
|
||||
|
||||
public NodesApi getNodesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, NodesApi.class);
|
||||
}
|
||||
|
||||
public PeopleApi getPeopleApi() {
|
||||
return this.getApi(PeopleApi.class);
|
||||
}
|
||||
|
||||
public PeopleApi getPeopleApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, PeopleApi.class);
|
||||
}
|
||||
|
||||
public PreferencesApi getPreferencesApi() {
|
||||
return this.getApi(PreferencesApi.class);
|
||||
}
|
||||
|
||||
public PreferencesApi getPreferencesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, PreferencesApi.class);
|
||||
}
|
||||
|
||||
public ProbesApi getProbesApi() {
|
||||
return this.getApi(ProbesApi.class);
|
||||
}
|
||||
|
||||
public ProbesApi getProbesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, ProbesApi.class);
|
||||
}
|
||||
|
||||
public QueriesApi getQueriesApi() {
|
||||
return this.getApi(QueriesApi.class);
|
||||
}
|
||||
|
||||
public QueriesApi getQueriesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, QueriesApi.class);
|
||||
}
|
||||
|
||||
public RatingsApi getRatingsApi() {
|
||||
return this.getApi(RatingsApi.class);
|
||||
}
|
||||
|
||||
public RatingsApi getRatingsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, RatingsApi.class);
|
||||
}
|
||||
|
||||
public RenditionsApi getRenditionsApi() {
|
||||
return this.getApi(RenditionsApi.class);
|
||||
}
|
||||
|
||||
public RenditionsApi getRenditionsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, RenditionsApi.class);
|
||||
}
|
||||
|
||||
public SearchApi getSearchApi() {
|
||||
return this.getApi(SearchApi.class);
|
||||
}
|
||||
|
||||
public SearchApi getSearchApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, SearchApi.class);
|
||||
}
|
||||
|
||||
public SharedLinksApi getSharedLinksApi() {
|
||||
return this.getApi(SharedLinksApi.class);
|
||||
}
|
||||
|
||||
public SharedLinksApi getSharedLinksApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, SharedLinksApi.class);
|
||||
}
|
||||
|
||||
public SitesApi getSitesApi() {
|
||||
return this.getApi(SitesApi.class);
|
||||
}
|
||||
|
||||
public SitesApi getSitesApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, SitesApi.class);
|
||||
}
|
||||
|
||||
public TagsApi getTagsApi() {
|
||||
return this.getApi(TagsApi.class);
|
||||
}
|
||||
|
||||
public TagsApi getTagsApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, TagsApi.class);
|
||||
}
|
||||
|
||||
public TrashcanApi getTrashcanApi() {
|
||||
return this.getApi(TrashcanApi.class);
|
||||
}
|
||||
/*
|
||||
public TypesApi getTypesApi() {
|
||||
return this.getApi(TypesApi.class);
|
||||
|
||||
public TrashcanApi getTrashcanApi(AuthorizationFilter authFilter) {
|
||||
return this.getApi(authFilter, TrashcanApi.class);
|
||||
}
|
||||
*/
|
||||
|
||||
public VersionsApi getVersionsApi() {
|
||||
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 com.inteligr8.alfresco.acs.api.NodesCxfApi;
|
||||
import com.inteligr8.rs.AuthorizationFilter;
|
||||
import com.inteligr8.rs.Client;
|
||||
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")
|
||||
@Lazy
|
||||
@@ -17,18 +22,35 @@ public class AcsPublicRestApiCxfImpl extends AcsPublicRestApi {
|
||||
@Autowired
|
||||
private AcsClientCxfImpl client;
|
||||
|
||||
/**
|
||||
* This constructor is for Spring use.
|
||||
*/
|
||||
protected AcsPublicRestApiCxfImpl() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is for POJO use.
|
||||
*/
|
||||
public AcsPublicRestApiCxfImpl(AcsClientCxfImpl client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
@Override
|
||||
ClientConfiguration getConfig() {
|
||||
return this.client.getConfig();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected <T> T getApi(Class<T> apiClass) {
|
||||
return this.client.getApi(apiClass);
|
||||
Client getClient() {
|
||||
return this.client;
|
||||
}
|
||||
|
||||
public NodesCxfApi getNodesExtApi() {
|
||||
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 com.inteligr8.alfresco.acs.api.NodesJerseyApi;
|
||||
import com.inteligr8.rs.AuthorizationFilter;
|
||||
import com.inteligr8.rs.Client;
|
||||
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")
|
||||
@Lazy
|
||||
@@ -17,18 +22,35 @@ public class AcsPublicRestApiJerseyImpl extends AcsPublicRestApi {
|
||||
@Autowired
|
||||
private AcsClientJerseyImpl client;
|
||||
|
||||
/**
|
||||
* This constructor is for Spring use.
|
||||
*/
|
||||
protected AcsPublicRestApiJerseyImpl() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is for POJO use.
|
||||
*/
|
||||
public AcsPublicRestApiJerseyImpl(AcsClientJerseyImpl client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
@Override
|
||||
ClientConfiguration getConfig() {
|
||||
return this.client.getConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T> T getApi(Class<T> apiClass) {
|
||||
return this.client.getApi(apiClass);
|
||||
Client getClient() {
|
||||
return this.client;
|
||||
}
|
||||
|
||||
public NodesJerseyApi getNodesExtApi() {
|
||||
return this.client.getApi(NodesJerseyApi.class);
|
||||
}
|
||||
|
||||
public NodesJerseyApi getNodesExtApi(AuthorizationFilter authFilter) {
|
||||
return this.client.getApi(authFilter, NodesJerseyApi.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,8 +8,10 @@ import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
|
||||
|
||||
import com.inteligr8.alfresco.acs.model.Error;
|
||||
import com.inteligr8.alfresco.acs.model.NodeBodyCreate;
|
||||
@@ -26,8 +28,8 @@ public interface NodesCxfApi {
|
||||
|
||||
@POST
|
||||
@Path("/nodes/{nodeId}/children")
|
||||
@Consumes({ "application/json", "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@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),
|
||||
@@ -43,12 +45,12 @@ public interface NodesCxfApi {
|
||||
@ApiResponse(code = 200, message = "Unexpected error", response = Error.class) })
|
||||
public NodeEntry createNode(
|
||||
@PathParam("nodeId") String nodeId,
|
||||
NodeBodyCreate nodeBodyCreate,
|
||||
@Multipart 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);
|
||||
@Multipart(value = "filedata", required = false) Attachment attachment);
|
||||
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
@@ -28,8 +29,8 @@ public interface NodesJerseyApi {
|
||||
|
||||
@POST
|
||||
@Path("/nodes/{nodeId}/children")
|
||||
@Consumes({ "application/json", "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@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),
|
||||
|
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, Object>> parameters;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void setParameters(List<Map<String, Object>> 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;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
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.NodesApi;
|
||||
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||
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 {
|
||||
|
||||
@@ -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