Compare commits
6 Commits
v1.0.6-v1-
...
v1.1.2-acs
Author | SHA1 | Date | |
---|---|---|---|
068aff951e | |||
c03c916e02 | |||
76ac68d0e4 | |||
f5489e3e42 | |||
9e0499b243 | |||
5acff2bb5d |
38
pom.xml
38
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.inteligr8.alfresco</groupId>
|
||||
<artifactId>acs-public-rest-api</artifactId>
|
||||
<version>1.0.6-v1-acs7</version>
|
||||
<version>1.1.2</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>https://api-explorer.alfresco.com/api-explorer</acs.baseUrl>
|
||||
<acs.platform.tag>acs7</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.0.2</version>
|
||||
<version>1.1.0</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>
|
||||
@@ -141,18 +148,6 @@
|
||||
</dependency>
|
||||
</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>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -409,7 +404,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 +415,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>
|
||||
|
@@ -4,11 +4,12 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
public class AcsClientConfiguration extends ClientConfiguration {
|
||||
public class AcsClientConfiguration implements ClientCxfConfiguration, ClientJerseyConfiguration {
|
||||
|
||||
@Value("${content.service.baseUrl:http://localhost:8080/alfresco}")
|
||||
private String baseUrl;
|
||||
@@ -43,6 +44,12 @@ public class AcsClientConfiguration extends ClientConfiguration {
|
||||
@Value("${content.service.security.oauth.grantPassword:#{null}}")
|
||||
private String oAuthPassword;
|
||||
|
||||
@Value("${content.service.cxf.defaultBusEnabled:true}")
|
||||
private boolean defaultBusEnabled;
|
||||
|
||||
@Value("${content.service.jersey.putBodyRequired:true}")
|
||||
private boolean putBodyRequired;
|
||||
|
||||
public String getBaseUrl() {
|
||||
return this.baseUrl;
|
||||
}
|
||||
@@ -86,5 +93,13 @@ public class AcsClientConfiguration extends ClientConfiguration {
|
||||
public String getOAuthPassword() {
|
||||
return this.oAuthPassword;
|
||||
}
|
||||
|
||||
public boolean isDefaultBusEnabled() {
|
||||
return this.defaultBusEnabled;
|
||||
}
|
||||
|
||||
public boolean isPutBodyRequired() {
|
||||
return this.putBodyRequired;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||
import com.inteligr8.rs.ClientCxfImpl;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ public class AcsClientCxfImpl extends ClientCxfImpl {
|
||||
private AcsClientConfiguration config;
|
||||
|
||||
@Override
|
||||
protected ClientConfiguration getConfig() {
|
||||
protected ClientCxfConfiguration getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
import com.inteligr8.rs.ClientJerseyConfiguration;
|
||||
import com.inteligr8.rs.ClientJerseyImpl;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ public class AcsClientJerseyImpl extends ClientJerseyImpl {
|
||||
private AcsClientConfiguration config;
|
||||
|
||||
@Override
|
||||
protected ClientConfiguration getConfig() {
|
||||
protected ClientJerseyConfiguration getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ 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.TypesApi;
|
||||
import com.inteligr8.alfresco.acs.api.V0Api;
|
||||
import com.inteligr8.alfresco.acs.api.VersionsApi;
|
||||
import com.inteligr8.rs.ClientConfiguration;
|
||||
|
||||
@@ -135,5 +136,9 @@ public abstract class AcsPublicRestApi {
|
||||
public VersionsApi getVersionsApi() {
|
||||
return this.getApi(VersionsApi.class);
|
||||
}
|
||||
|
||||
public V0Api getV0Api() {
|
||||
return this.getApi(V0Api.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;
|
||||
}
|
||||
|
||||
}
|
104
src/main/java/com/inteligr8/alfresco/acs/model/v0/PropertyInfo.java
Executable file
104
src/main/java/com/inteligr8/alfresco/acs/model/v0/PropertyInfo.java
Executable file
@@ -0,0 +1,104 @@
|
||||
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> contraints;
|
||||
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
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