mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
121 Commits
tas-restap
...
tas-restap
Author | SHA1 | Date | |
---|---|---|---|
|
b2dc3fa5cd | ||
|
54c91e8770 | ||
|
da2db2c339 | ||
|
84b62f2386 | ||
|
bcc3c30985 | ||
|
c457fafc1b | ||
|
fcf7d017b0 | ||
|
94be653375 | ||
|
d9c37d5f9f | ||
|
2555ff04f6 | ||
|
668e14182f | ||
|
e0e27f6448 | ||
|
0c7fe86cc0 | ||
|
c631cdba82 | ||
|
aabbcf449f | ||
|
ec4958a6e2 | ||
|
751643bac1 | ||
|
08b603cc33 | ||
|
410759bb37 | ||
|
29b25ea8ce | ||
|
cd6c38347f | ||
|
5ce6a774cc | ||
|
13529c0408 | ||
|
718968e77f | ||
|
2b59c3ad71 | ||
|
4c984b3b52 | ||
|
764e47b472 | ||
|
0c24c55296 | ||
|
5d74ca8323 | ||
|
a45137fc48 | ||
|
3595ffd7cf | ||
|
586f5f546c | ||
|
f129a47be0 | ||
|
f8287e59e2 | ||
|
79c7310a34 | ||
|
5039d4d0d0 | ||
|
f68299aa37 | ||
|
e63b0a8751 | ||
|
3d2b7a733a | ||
|
4bcffcd820 | ||
|
c552a7b660 | ||
|
3f41f8e4eb | ||
|
71ed6d1155 | ||
|
c04a83e3c2 | ||
|
e946bfcf71 | ||
|
1cee8f46bd | ||
|
dfb05bb00e | ||
|
c33dde8f41 | ||
|
f93d07d116 | ||
|
a88d0b07f2 | ||
|
da6e08b0e3 | ||
|
48c0546bd0 | ||
|
2c0fb3fe95 | ||
|
ea308c1c0a | ||
|
a02f0e7e2f | ||
|
9f32368582 | ||
|
b42b08559a | ||
|
95af4d6876 | ||
|
9c17870040 | ||
|
e93028c30e | ||
|
7741456b79 | ||
|
27f7b2ec33 | ||
|
078ae4cd32 | ||
|
ab3a0f00c4 | ||
|
829c7ef65d | ||
|
0d40d455b2 | ||
|
3d91bf154d | ||
|
d87532ce55 | ||
|
e6f97e979a | ||
|
b800d4b7e4 | ||
|
92bad68c5b | ||
|
d77e02f9a8 | ||
|
8a6584540f | ||
|
2dec33388e | ||
|
2c149b412e | ||
|
10b427209d | ||
|
a53eb13f9f | ||
|
c0a90dd32b | ||
|
d2a414f8a7 | ||
|
e484360980 | ||
|
691855bed2 | ||
|
e81a33d770 | ||
|
9dab62b490 | ||
|
44f602eee4 | ||
|
c04c149779 | ||
|
9cfa31ca63 | ||
|
a061d8d4df | ||
|
8052f7f299 | ||
|
962ce7a740 | ||
|
57603871d3 | ||
|
7d7cc446a4 | ||
|
2733ece40f | ||
|
f01204bf0a | ||
|
add073938a | ||
|
472becd973 | ||
|
d9293fff27 | ||
|
361e6b0221 | ||
|
3aec98cb92 | ||
|
cfd0dd388e | ||
|
8aadb2baf1 | ||
|
ca6b4cce24 | ||
|
eb2c76f600 | ||
|
fa910faea6 | ||
|
d428c542fc | ||
|
d0d5ce8d9d | ||
|
3e4a3a0a31 | ||
|
7d5f01f3d5 | ||
|
1ae1f87cdf | ||
|
a5ceb3df00 | ||
|
18dc254813 | ||
|
b737775fd3 | ||
|
175a525b64 | ||
|
8dba7f9468 | ||
|
838794f274 | ||
|
917961569d | ||
|
8e1c10aae0 | ||
|
580dda50e6 | ||
|
d0bc3f1ece | ||
|
a05f2eb20f | ||
|
51029868a9 | ||
|
e0b1c6f776 |
@@ -20,7 +20,7 @@ Back to [TAS Master Documentation](https://git.alfresco.com/tas/alfresco-tas-uti
|
|||||||
* [Configuration](#configuration)
|
* [Configuration](#configuration)
|
||||||
* [How to enable Test Rail Integration?](#how-to-enable-test-rail-integration)
|
* [How to enable Test Rail Integration?](#how-to-enable-test-rail-integration)
|
||||||
* [Reference](#reference)
|
* [Reference](#reference)
|
||||||
* [Change Log](docs/CHANGELOG.md) :glowing_star:
|
* [Change Log](docs/CHANGELOG.md) 🌟
|
||||||
* [Contributors](#contributors)
|
* [Contributors](#contributors)
|
||||||
* [Releasing](#releasing)
|
* [Releasing](#releasing)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.alfresco.tas</groupId>
|
<groupId>org.alfresco.tas</groupId>
|
||||||
<artifactId>restapi</artifactId>
|
<artifactId>restapi</artifactId>
|
||||||
<name>alfresco-tas-restapi</name>
|
<name>alfresco-tas-restapi</name>
|
||||||
<version>1.33</version>
|
<version>1.73</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-super-pom</artifactId>
|
<artifactId>alfresco-super-pom</artifactId>
|
||||||
@@ -28,27 +28,45 @@
|
|||||||
<suiteXmlFile>src/main/resources/shared-resources/testCount.xml</suiteXmlFile>
|
<suiteXmlFile>src/main/resources/shared-resources/testCount.xml</suiteXmlFile>
|
||||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<tas.utility.version>3.0.19</tas.utility.version>
|
<tas.utility.version>3.0.48</tas.utility.version>
|
||||||
<rest-assured.version>3.3.0</rest-assured.version>
|
<rest-assured.version>3.3.0</rest-assured.version>
|
||||||
<httpclient-osgi-version>4.5.3</httpclient-osgi-version>
|
<httpclient-osgi-version>4.5.3</httpclient-osgi-version>
|
||||||
<json-path.version>3.3.0</json-path.version>
|
<json-path.version>3.3.0</json-path.version>
|
||||||
<xml-path.version>3.3.0</xml-path.version>
|
<xml-path.version>3.3.0</xml-path.version>
|
||||||
<json-schema-validator.version>3.3.0</json-schema-validator.version>
|
<json-schema-validator.version>3.3.0</json-schema-validator.version>
|
||||||
<jackson-databind.version>2.9.8</jackson-databind.version>
|
<jackson-databind.version>2.9.10.8</jackson-databind.version>
|
||||||
<maven-release.version>2.5.3</maven-release.version>
|
<maven-release.version>2.5.3</maven-release.version>
|
||||||
<org.glassfish.version>1.1.4</org.glassfish.version>
|
<org.glassfish.version>1.1.4</org.glassfish.version>
|
||||||
<commons-lang3.version>3.9</commons-lang3.version>
|
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||||
<scribejava-apis.version>6.9.0</scribejava-apis.version>
|
<scribejava-apis.version>6.9.0</scribejava-apis.version>
|
||||||
<test.exclude />
|
<test.exclude />
|
||||||
<test.include />
|
<test.include />
|
||||||
<java.version>11</java.version>
|
<java.version>11</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>rest-api-explorer-master</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<rest.api.explorer.branch>master</rest.api.explorer.branch>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>rest-api-explorer-52N</id>
|
||||||
|
<properties>
|
||||||
|
<rest.api.explorer.branch>5.2.N</rest.api.explorer.branch>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
|
<connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
|
||||||
<url>https://github.com/Alfresco/alfresco-tas-restapi</url>
|
<url>https://github.com/Alfresco/alfresco-tas-restapi</url>
|
||||||
<tag>v1.33</tag>
|
<tag>v1.73</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
@@ -120,11 +138,11 @@
|
|||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/5.2.N/src/main/webapp/definitions/alfresco-auth.yaml</argument>
|
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-auth.yaml</argument>
|
||||||
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/5.2.N/src/main/webapp/definitions/alfresco-core.yaml</argument>
|
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-core.yaml</argument>
|
||||||
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/5.2.N/src/main/webapp/definitions/alfresco-discovery.yaml</argument>
|
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-discovery.yaml</argument>
|
||||||
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/5.2.N/src/main/webapp/definitions/alfresco-search.yaml</argument>
|
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-search.yaml</argument>
|
||||||
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/5.2.N/src/main/webapp/definitions/alfresco-workflow.yaml</argument>
|
<argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-workflow.yaml</argument>
|
||||||
</arguments>
|
</arguments>
|
||||||
<mainClass>org.alfresco.rest.core.swagger.Generator</mainClass>
|
<mainClass>org.alfresco.rest.core.swagger.Generator</mainClass>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -255,14 +273,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.30</version>
|
<version>1.7.32</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger parser -->
|
<!-- swagger parser -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-parser</artifactId>
|
<artifactId>swagger-parser</artifactId>
|
||||||
<version>1.0.23</version>
|
<version>1.0.31</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
@@ -274,7 +292,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xerces</groupId>
|
<groupId>xerces</groupId>
|
||||||
<artifactId>xercesImpl</artifactId>
|
<artifactId>xercesImpl</artifactId>
|
||||||
<version>2.12.0</version>
|
<version>2.12.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--fixing java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap') -->
|
<!--fixing java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap') -->
|
||||||
@@ -282,7 +300,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.groovy</groupId>
|
<groupId>org.codehaus.groovy</groupId>
|
||||||
<artifactId>groovy</artifactId>
|
<artifactId>groovy</artifactId>
|
||||||
<version>2.5.9</version>
|
<version>2.5.14</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
|
||||||
@@ -299,7 +317,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.1.2</version>
|
||||||
<reportSets>
|
<reportSets>
|
||||||
<reportSet>
|
<reportSet>
|
||||||
<reports>
|
<reports>
|
||||||
|
@@ -13,6 +13,7 @@ import org.alfresco.dataprep.CMISUtil.Priority;
|
|||||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||||
import org.alfresco.rest.model.RestVariableModel;
|
import org.alfresco.rest.model.RestVariableModel;
|
||||||
import org.alfresco.utility.Utility;
|
import org.alfresco.utility.Utility;
|
||||||
|
import org.alfresco.utility.constants.UserRole;
|
||||||
import org.alfresco.utility.model.FileModel;
|
import org.alfresco.utility.model.FileModel;
|
||||||
import org.alfresco.utility.model.FolderModel;
|
import org.alfresco.utility.model.FolderModel;
|
||||||
import org.alfresco.utility.model.RepoTestModel;
|
import org.alfresco.utility.model.RepoTestModel;
|
||||||
@@ -158,6 +159,15 @@ public class JsonBodyGenerator
|
|||||||
return value.toString();
|
return value.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String siteGroup(String authorityId, UserRole role)
|
||||||
|
{
|
||||||
|
Utility.checkObjectIsInitialized(authorityId, "authorityId");
|
||||||
|
JsonObject value = defineJSON()
|
||||||
|
.add("role", role.name())
|
||||||
|
.add("id", authorityId).build();
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static String siteMemberhipRequest(String message, SiteModel siteModel, String title)
|
public static String siteMemberhipRequest(String message, SiteModel siteModel, String title)
|
||||||
{
|
{
|
||||||
JsonObject value = defineJSON()
|
JsonObject value = defineJSON()
|
||||||
|
@@ -36,6 +36,7 @@ import org.alfresco.rest.requests.authAPI.RestAuthAPI;
|
|||||||
import org.alfresco.rest.requests.cmisAPI.RestCmisAPI;
|
import org.alfresco.rest.requests.cmisAPI.RestCmisAPI;
|
||||||
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
|
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
|
||||||
import org.alfresco.rest.requests.discoveryAPI.RestDiscoveryAPI;
|
import org.alfresco.rest.requests.discoveryAPI.RestDiscoveryAPI;
|
||||||
|
import org.alfresco.rest.requests.modelAPI.RestModelAPI;
|
||||||
import org.alfresco.rest.requests.privateAPI.RestPrivateAPI;
|
import org.alfresco.rest.requests.privateAPI.RestPrivateAPI;
|
||||||
import org.alfresco.rest.requests.search.SearchAPI;
|
import org.alfresco.rest.requests.search.SearchAPI;
|
||||||
import org.alfresco.rest.requests.search.SearchSQLAPI;
|
import org.alfresco.rest.requests.search.SearchSQLAPI;
|
||||||
@@ -932,6 +933,11 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
|||||||
return new RestAuthAPI(this);
|
return new RestAuthAPI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RestModelAPI withModelAPI()
|
||||||
|
{
|
||||||
|
return new RestModelAPI(this);
|
||||||
|
}
|
||||||
|
|
||||||
public SearchAPI withSearchAPI()
|
public SearchAPI withSearchAPI()
|
||||||
{
|
{
|
||||||
return new SearchAPI(this);
|
return new SearchAPI(this);
|
||||||
@@ -1123,6 +1129,20 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
|||||||
this.serverURI = restProperties.envProperty().getSolrServerUrl();
|
this.serverURI = restProperties.envProperty().getSolrServerUrl();
|
||||||
this.serverPort = restProperties.envProperty().getSolrPort();
|
this.serverPort = restProperties.envProperty().getSolrPort();
|
||||||
configureServerEndpoint();
|
configureServerEndpoint();
|
||||||
|
configureSecretHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the secret Solr header if it has been set
|
||||||
|
*/
|
||||||
|
private void configureSecretHeader()
|
||||||
|
{
|
||||||
|
String solrSecret = restProperties.envProperty().getSolrSecret();
|
||||||
|
if(!solrSecret.isEmpty())
|
||||||
|
{
|
||||||
|
String solrSecretName = restProperties.envProperty().getSolrSecretName();
|
||||||
|
configureRequestSpec().addHeader(solrSecretName, solrSecret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1140,4 +1160,15 @@ public class RestWrapper extends DSLWrapper<RestWrapper>
|
|||||||
configureRequestSpec().setBaseUri(this.serverURI);
|
configureRequestSpec().setBaseUri(this.serverURI);
|
||||||
configureRequestSpec().setPort(this.serverPort);
|
configureRequestSpec().setPort(this.serverPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adding new method to configure Alfresco Endpoint.
|
||||||
|
* Reconfiguration is required when restClient is used to executed apis on different <host>:<port> e.g. solr api followed by search api
|
||||||
|
*/
|
||||||
|
public void configureAlfrescoEndpoint()
|
||||||
|
{
|
||||||
|
this.serverURI = restProperties.envProperty().getTestServerUrl();
|
||||||
|
this.serverPort = restProperties.envProperty().getPort();
|
||||||
|
configureServerEndpoint();
|
||||||
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,158 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RestAbstractClassModel extends TestModel implements IRestModel<RestAbstractClassModel>
|
||||||
|
{
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestAbstractClassModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestAbstractClassModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String id;
|
||||||
|
public String title;
|
||||||
|
public String description;
|
||||||
|
public String parentId;
|
||||||
|
public Boolean isContainer = null;
|
||||||
|
public Boolean isArchive = null;
|
||||||
|
public Boolean includedInSupertypeQuery = null;
|
||||||
|
public List<String> mandatoryAspects = null;
|
||||||
|
public List<RestClassAssociationModel> associations = null;
|
||||||
|
public List <RestPropertyDefinitionModel> properties = null;
|
||||||
|
|
||||||
|
@JsonProperty(value = "model")
|
||||||
|
public RestClassModel modelInfo;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentId()
|
||||||
|
{
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(String parentId)
|
||||||
|
{
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getContainer()
|
||||||
|
{
|
||||||
|
return isContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(Boolean container)
|
||||||
|
{
|
||||||
|
isContainer = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getArchive()
|
||||||
|
{
|
||||||
|
return isArchive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArchive(Boolean archive)
|
||||||
|
{
|
||||||
|
isArchive = archive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIncludedInSupertypeQuery()
|
||||||
|
{
|
||||||
|
return includedInSupertypeQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncludedInSupertypeQuery(Boolean includedInSupertypeQuery)
|
||||||
|
{
|
||||||
|
this.includedInSupertypeQuery = includedInSupertypeQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getMandatoryAspects()
|
||||||
|
{
|
||||||
|
return mandatoryAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatoryAspects(List<String> mandatoryAspects)
|
||||||
|
{
|
||||||
|
this.mandatoryAspects = mandatoryAspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestClassAssociationModel> getAssociations()
|
||||||
|
{
|
||||||
|
return associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssociations(List<RestClassAssociationModel> associations)
|
||||||
|
{
|
||||||
|
this.associations = associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestPropertyDefinitionModel> getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(List<RestPropertyDefinitionModel> properties)
|
||||||
|
{
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassModel getModelInfo()
|
||||||
|
{
|
||||||
|
return modelInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModelInfo(RestClassModel modelInfo)
|
||||||
|
{
|
||||||
|
this.modelInfo = modelInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DSL for assertion on this rest model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestAbstractClassModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestAbstractClassModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestAbstractClassModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Alfresco Software, Ltd. All rights reserved.
|
||||||
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||||
|
* pursuant to a written agreement and any use of this program without such an
|
||||||
|
* agreement is prohibited.
|
||||||
|
*/
|
||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
|
||||||
|
*/
|
||||||
|
public class RestArchiveContentRequestModel extends TestModel implements IRestModel<RestArchiveContentRequestModel>
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestArchiveContentRequestModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestArchiveContentRequestModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestArchiveContentRequestModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestArchiveContentRequestModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestArchiveContentRequestModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
A map (String-String) of archive request properties for given content.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Object archiveProperties;
|
||||||
|
|
||||||
|
public Object getArchiveProperties()
|
||||||
|
{
|
||||||
|
return this.archiveProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArchiveProperties(Object archiveProperties)
|
||||||
|
{
|
||||||
|
this.archiveProperties = archiveProperties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,5 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
public class RestAspectModel extends RestAbstractClassModel
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
|
public class RestAspectsCollection extends RestModels<RestAspectModel, RestAspectsCollection>
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassAssociationDefinitionModel extends TestModel
|
||||||
|
{
|
||||||
|
public String role = null;
|
||||||
|
public String cls = null;
|
||||||
|
public Boolean isMany = null;
|
||||||
|
public Boolean isMandatory = null;
|
||||||
|
public Boolean isMandatoryEnforced = null;
|
||||||
|
|
||||||
|
public String getRole()
|
||||||
|
{
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(String role)
|
||||||
|
{
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCls()
|
||||||
|
{
|
||||||
|
return cls;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCls(String cls)
|
||||||
|
{
|
||||||
|
this.cls = cls;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMany()
|
||||||
|
{
|
||||||
|
return isMany;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMany(Boolean many)
|
||||||
|
{
|
||||||
|
isMany = many;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMandatory()
|
||||||
|
{
|
||||||
|
return isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatory(Boolean mandatory)
|
||||||
|
{
|
||||||
|
isMandatory = mandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getMandatoryEnforced()
|
||||||
|
{
|
||||||
|
return isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMandatoryEnforced(Boolean mandatoryEnforced)
|
||||||
|
{
|
||||||
|
isMandatoryEnforced = mandatoryEnforced;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,86 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassAssociationModel extends TestModel
|
||||||
|
{
|
||||||
|
public String id;
|
||||||
|
public String title;
|
||||||
|
public String description;
|
||||||
|
public Boolean isChild;
|
||||||
|
public Boolean isProtected;
|
||||||
|
public RestClassAssociationDefinitionModel source = null;
|
||||||
|
public RestClassAssociationDefinitionModel target = null;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getChild()
|
||||||
|
{
|
||||||
|
return isChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsChild(Boolean isChild)
|
||||||
|
{
|
||||||
|
this.isChild = isChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsProtected()
|
||||||
|
{
|
||||||
|
return isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsProtected(Boolean isProtected)
|
||||||
|
{
|
||||||
|
this.isProtected = isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassAssociationDefinitionModel getSource()
|
||||||
|
{
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSource(RestClassAssociationDefinitionModel source)
|
||||||
|
{
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestClassAssociationDefinitionModel getTarget()
|
||||||
|
{
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTarget(RestClassAssociationDefinitionModel target)
|
||||||
|
{
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
public class RestClassModel extends TestModel
|
||||||
|
{
|
||||||
|
public String id;
|
||||||
|
public String author;
|
||||||
|
public String description;
|
||||||
|
public String namespaceUri;
|
||||||
|
public String namespacePrefix;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor()
|
||||||
|
{
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthor(String author)
|
||||||
|
{
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespaceUri()
|
||||||
|
{
|
||||||
|
return namespaceUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNamespaceUri(String namespaceUri)
|
||||||
|
{
|
||||||
|
this.namespaceUri = namespaceUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNamespacePrefix()
|
||||||
|
{
|
||||||
|
return namespacePrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNamespacePrefix(String namespacePrefix)
|
||||||
|
{
|
||||||
|
this.namespacePrefix = namespacePrefix;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,62 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class RestConstraintDefinitionModel
|
||||||
|
{
|
||||||
|
private String id;
|
||||||
|
private String type;
|
||||||
|
private String title;
|
||||||
|
private String description;
|
||||||
|
private Map<String, Object> parameters;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getParameters()
|
||||||
|
{
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(Map<String, Object> parameters)
|
||||||
|
{
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
}
|
@@ -2,6 +2,8 @@ package org.alfresco.rest.model;
|
|||||||
|
|
||||||
import org.alfresco.utility.model.TestModel;
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Claudia Agache on 11/11/2016.
|
* Created by Claudia Agache on 11/11/2016.
|
||||||
*/
|
*/
|
||||||
@@ -11,6 +13,7 @@ public class RestContentModel extends TestModel
|
|||||||
private String mimeTypeName;
|
private String mimeTypeName;
|
||||||
private String mimeType;
|
private String mimeType;
|
||||||
private String encoding;
|
private String encoding;
|
||||||
|
private Set<String> storageClasses;
|
||||||
|
|
||||||
public int getSizeInBytes()
|
public int getSizeInBytes()
|
||||||
{
|
{
|
||||||
@@ -51,4 +54,14 @@ public class RestContentModel extends TestModel
|
|||||||
{
|
{
|
||||||
this.encoding = encoding;
|
this.encoding = encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getStorageClasses()
|
||||||
|
{
|
||||||
|
return storageClasses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStorageClasses(Set<String> storageClasses)
|
||||||
|
{
|
||||||
|
this.storageClasses = storageClasses;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Alfresco Software, Ltd. All rights reserved.
|
||||||
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||||
|
* pursuant to a written agreement and any use of this program without such an
|
||||||
|
* agreement is prohibited.
|
||||||
|
*/
|
||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
|
||||||
|
*/
|
||||||
|
public class RestContentStorageInfoModel extends TestModel implements IRestModel<RestContentStorageInfoModel>
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestContentStorageInfoModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestContentStorageInfoModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestContentStorageInfoModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestContentStorageInfoModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestContentStorageInfoModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Content type property identifier (e.g. cm:content). Inside this object only colon (':') delimiter for namespace-prefix will be used.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
A map (String-String) of storage properties for given content.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Map<String, String> storageProperties;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getStorageProperties()
|
||||||
|
{
|
||||||
|
return this.storageProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStorageProperties(Map<String, String> storageProperties)
|
||||||
|
{
|
||||||
|
this.storageProperties = storageProperties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,120 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.CustomAspectPropertiesModel;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bogdan Bocancea
|
||||||
|
*/
|
||||||
|
public class RestCustomTypeModel extends TestModel implements IRestModel<RestCustomTypeModel>
|
||||||
|
{
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestCustomTypeModel model;
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private List<CustomAspectPropertiesModel> properties;
|
||||||
|
|
||||||
|
public RestCustomTypeModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestCustomTypeModel(String name, String parentName)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.parentName = parentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestCustomTypeModel(String name, String parentName, String title)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.parentName = parentName;
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestCustomTypeModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestCustomTypeModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestCustomTypeModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestCustomTypeModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentName()
|
||||||
|
{
|
||||||
|
return parentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentName(String parentName)
|
||||||
|
{
|
||||||
|
this.parentName = parentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CustomAspectPropertiesModel> getProperties()
|
||||||
|
{
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(List<CustomAspectPropertiesModel> properties)
|
||||||
|
{
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
}
|
@@ -71,6 +71,8 @@ public class RestPersonModel extends TestModel implements IModelAssertion<RestPe
|
|||||||
private String userStatus;
|
private String userStatus;
|
||||||
private String password;
|
private String password;
|
||||||
private Object properties;
|
private Object properties;
|
||||||
|
private String quotaUsed;
|
||||||
|
private String quota;
|
||||||
private Map<String, Boolean> capabilities;
|
private Map<String, Boolean> capabilities;
|
||||||
|
|
||||||
public RestPersonModel()
|
public RestPersonModel()
|
||||||
@@ -319,7 +321,25 @@ public class RestPersonModel extends TestModel implements IModelAssertion<RestPe
|
|||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public String getQuotaUsed() {
|
||||||
|
return quotaUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setQuotaUsed(String quotaUsed) {
|
||||||
|
this.quotaUsed = quotaUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuota() {
|
||||||
|
return quota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuota(String quota) {
|
||||||
|
this.quota = quota;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* Generate a PersonModel with random values for all existing fields excluding fields specified as ingnoredFields
|
* Generate a PersonModel with random values for all existing fields excluding fields specified as ingnoredFields
|
||||||
*
|
*
|
||||||
* @param ignoredFields field to be excluded when generating a random model
|
* @param ignoredFields field to be excluded when generating a random model
|
||||||
|
@@ -0,0 +1,117 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RestPropertyDefinitionModel
|
||||||
|
{
|
||||||
|
private String id;
|
||||||
|
private String title;
|
||||||
|
private String description;
|
||||||
|
private String defaultValue;
|
||||||
|
private String dataType;
|
||||||
|
private Boolean isMultiValued;
|
||||||
|
private Boolean isMandatory;
|
||||||
|
private Boolean isMandatoryEnforced;
|
||||||
|
private Boolean isProtected;
|
||||||
|
private List<RestConstraintDefinitionModel> constraints;
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultValue()
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultValue(String defaultValue)
|
||||||
|
{
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataType()
|
||||||
|
{
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType)
|
||||||
|
{
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsProtected()
|
||||||
|
{
|
||||||
|
return isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsProtected(boolean isProtected)
|
||||||
|
{
|
||||||
|
this.isProtected = isProtected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RestConstraintDefinitionModel> getConstraints()
|
||||||
|
{
|
||||||
|
return constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConstraints(List<RestConstraintDefinitionModel> constraints)
|
||||||
|
{
|
||||||
|
this.constraints = constraints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMultiValued()
|
||||||
|
{
|
||||||
|
return isMultiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMultiValued(boolean isMultiValued)
|
||||||
|
{
|
||||||
|
this.isMultiValued = isMultiValued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMandatory()
|
||||||
|
{
|
||||||
|
return isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMandatory(boolean isMandatory)
|
||||||
|
{
|
||||||
|
this.isMandatory = isMandatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsMandatoryEnforced()
|
||||||
|
{
|
||||||
|
return isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMandatoryEnforced(boolean isMandatoryEnforced)
|
||||||
|
{
|
||||||
|
this.isMandatoryEnforced = isMandatoryEnforced;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Alfresco Software, Ltd. All rights reserved.
|
||||||
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||||
|
* pursuant to a written agreement and any use of this program without such an
|
||||||
|
* agreement is prohibited.
|
||||||
|
*/
|
||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated by 'dedwards' on '2021-12-16 08:32' from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||||
|
* Base Path {@linkplain /alfresco/api/-default-/public/alfresco/versions/1}
|
||||||
|
*/
|
||||||
|
public class RestRestoreArchivedContentRequestModel extends TestModel implements IRestModel<RestRestoreArchivedContentRequestModel>
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestRestoreArchivedContentRequestModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestRestoreArchivedContentRequestModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestRestoreArchivedContentRequestModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestRestoreArchivedContentRequestModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestRestoreArchivedContentRequestModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Restore from archive priority (Standard/High - to be mapped to Storage Provider specific values in Cloud Connectors)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String restorePriority;
|
||||||
|
|
||||||
|
public String getRestorePriority()
|
||||||
|
{
|
||||||
|
return this.restorePriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRestorePriority(String restorePriority)
|
||||||
|
{
|
||||||
|
this.restorePriority = restorePriority;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,78 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import org.alfresco.rest.core.IRestModel;
|
||||||
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
|
import org.alfresco.utility.constants.UserRole;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
import org.testng.Assert;
|
||||||
|
|
||||||
|
import static org.alfresco.utility.report.log.Step.STEP;
|
||||||
|
|
||||||
|
public class RestSiteGroupModel extends TestModel implements IRestModel<RestSiteGroupModel>
|
||||||
|
{
|
||||||
|
@JsonProperty(value = "entry")
|
||||||
|
RestSiteGroupModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RestSiteGroupModel onModel()
|
||||||
|
{
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserRole role;
|
||||||
|
private String id = "no-id";
|
||||||
|
private RestGroupsModel group;
|
||||||
|
|
||||||
|
public UserRole getRole()
|
||||||
|
{
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(UserRole role)
|
||||||
|
{
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestGroupsModel getGroup()
|
||||||
|
{
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroup(RestGroupsModel group)
|
||||||
|
{
|
||||||
|
this.group = group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestSiteGroupModel assertSiteGroupHasRole(UserRole role) {
|
||||||
|
STEP(String.format("REST API: Assert that site group role is '%s'", role));
|
||||||
|
Assert.assertEquals(getRole(), role, "Site group role is not as expected.");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DSL for assertion on this rest model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestSiteGroupModel> assertThat()
|
||||||
|
{
|
||||||
|
return new ModelAssertion<RestSiteGroupModel>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAssertion<RestSiteGroupModel> and()
|
||||||
|
{
|
||||||
|
return assertThat();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,32 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.alfresco.utility.report.log.Step.STEP;
|
||||||
|
|
||||||
|
public class RestSiteGroupModelsCollection extends RestModels<RestSiteGroupModel, RestSiteGroupModelsCollection>
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get groups from site groups list
|
||||||
|
*/
|
||||||
|
public RestSiteGroupModel getSiteGroups(String groupId)
|
||||||
|
{
|
||||||
|
STEP(String.format("REST API: Get site group with id '%s'", groupId));
|
||||||
|
RestSiteGroupModel siteGroupEntry = null;
|
||||||
|
List<RestSiteGroupModel> siteGroups = getEntries();
|
||||||
|
|
||||||
|
for (int i = 1; i < siteGroups.size(); i++)
|
||||||
|
{
|
||||||
|
if (siteGroups.get(i).onModel().getId().equals(groupId))
|
||||||
|
{
|
||||||
|
siteGroupEntry = siteGroups.get(i).onModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return siteGroupEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -23,7 +23,8 @@ public class RestSiteMemberModel extends TestModel implements IRestModel<RestSit
|
|||||||
|
|
||||||
private UserRole role;
|
private UserRole role;
|
||||||
private String id = "no-id";
|
private String id = "no-id";
|
||||||
|
private boolean isMemberOfGroup;
|
||||||
|
|
||||||
private RestPersonModel person;
|
private RestPersonModel person;
|
||||||
|
|
||||||
public UserRole getRole()
|
public UserRole getRole()
|
||||||
@@ -51,6 +52,16 @@ public class RestSiteMemberModel extends TestModel implements IRestModel<RestSit
|
|||||||
return person;
|
return person;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsMemberOfGroup()
|
||||||
|
{
|
||||||
|
return isMemberOfGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsMemberOfGroup(boolean memberOfGroup)
|
||||||
|
{
|
||||||
|
isMemberOfGroup = memberOfGroup;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPerson(RestPersonModel person)
|
public void setPerson(RestPersonModel person)
|
||||||
{
|
{
|
||||||
this.person = person;
|
this.person = person;
|
||||||
|
@@ -22,6 +22,7 @@ import org.alfresco.rest.core.RestModels;
|
|||||||
* {
|
* {
|
||||||
* "entry": {
|
* "entry": {
|
||||||
* "role": "SiteManager",
|
* "role": "SiteManager",
|
||||||
|
* "isMemberOfGroup": false,
|
||||||
* "person": {
|
* "person": {
|
||||||
* "firstName": "Administrator",
|
* "firstName": "Administrator",
|
||||||
* "emailNotificationsEnabled": true,
|
* "emailNotificationsEnabled": true,
|
||||||
@@ -36,6 +37,7 @@ import org.alfresco.rest.core.RestModels;
|
|||||||
* {
|
* {
|
||||||
* "entry": {
|
* "entry": {
|
||||||
* "role": "SiteConsumer",
|
* "role": "SiteConsumer",
|
||||||
|
* "isMemberOfGroup": false,
|
||||||
* "person": {
|
* "person": {
|
||||||
* "firstName": "CqeKxvPHBd FirstName",
|
* "firstName": "CqeKxvPHBd FirstName",
|
||||||
* "lastName": "LN-CqeKxvPHBd",
|
* "lastName": "LN-CqeKxvPHBd",
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
package org.alfresco.rest.model;
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.rest.core.IRestModel;
|
import org.alfresco.rest.core.IRestModel;
|
||||||
import org.alfresco.rest.core.assertion.ModelAssertion;
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
import org.alfresco.utility.model.TestModel;
|
import org.alfresco.utility.model.TestModel;
|
||||||
@@ -7,7 +9,7 @@ import org.alfresco.utility.model.TestModel;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by 'aforascu' on '2018-01-10 16:02' from 'Alfresco Content Services REST API' swagger file
|
* Generated by 'tsalvado' on '2021-08-18 21:15' from 'Alfresco Content Services REST API' swagger file
|
||||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||||
* Base Path {@linkplain /alfresco/api}
|
* Base Path {@linkplain /alfresco/api}
|
||||||
*/
|
*/
|
||||||
@@ -47,6 +49,9 @@ public class RestStatusInfoModel extends TestModel implements IRestModel<RestSta
|
|||||||
@JsonProperty(required = true)
|
@JsonProperty(required = true)
|
||||||
private boolean isThumbnailGenerationEnabled;
|
private boolean isThumbnailGenerationEnabled;
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private boolean isDirectAccessUrlEnabled;
|
||||||
|
|
||||||
public boolean getIsReadOnly()
|
public boolean getIsReadOnly()
|
||||||
{
|
{
|
||||||
return this.isReadOnly;
|
return this.isReadOnly;
|
||||||
@@ -86,5 +91,15 @@ public class RestStatusInfoModel extends TestModel implements IRestModel<RestSta
|
|||||||
{
|
{
|
||||||
this.isThumbnailGenerationEnabled = isThumbnailGenerationEnabled;
|
this.isThumbnailGenerationEnabled = isThumbnailGenerationEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsDirectAccessUrlEnabled()
|
||||||
|
{
|
||||||
|
return this.isDirectAccessUrlEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDirectAccessUrlEnabled(boolean isDirectAccessUrlEnabled)
|
||||||
|
{
|
||||||
|
this.isDirectAccessUrlEnabled = isDirectAccessUrlEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,6 +36,12 @@ public class RestSyncServiceComponentModel extends TestModel
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private int duration;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String timestamp;
|
||||||
|
|
||||||
public Boolean getHealthy()
|
public Boolean getHealthy()
|
||||||
{
|
{
|
||||||
return healthy;
|
return healthy;
|
||||||
@@ -46,4 +52,14 @@ public class RestSyncServiceComponentModel extends TestModel
|
|||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDuration()
|
||||||
|
{
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimestamp()
|
||||||
|
{
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
"async": false,
|
"async": false,
|
||||||
"authority": null,
|
"authority": null,
|
||||||
"cascade": false
|
"cascade": false
|
||||||
|
"folderChange": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
*/
|
*/
|
||||||
@@ -147,6 +148,9 @@ public class RestSyncSetChangesModel extends TestModel
|
|||||||
|
|
||||||
@JsonProperty(required = true)
|
@JsonProperty(required = true)
|
||||||
private int numberOfSecondaryAssocs;
|
private int numberOfSecondaryAssocs;
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private boolean folderChange;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -294,4 +298,12 @@ public class RestSyncSetChangesModel extends TestModel
|
|||||||
{
|
{
|
||||||
this.numberOfSecondaryAssocs = numberOfSecondaryAssocs;
|
this.numberOfSecondaryAssocs = numberOfSecondaryAssocs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFolderChange() {
|
||||||
|
return folderChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFolderChange(boolean folderChange) {
|
||||||
|
this.folderChange = folderChange;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
public class RestTypeModel extends RestAbstractClassModel
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package org.alfresco.rest.model;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
|
public class RestTypesCollection extends RestModels<RestTypeModel, RestTypesCollection>
|
||||||
|
{
|
||||||
|
}
|
@@ -0,0 +1,212 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Alfresco Software, Ltd. All rights reserved.
|
||||||
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
||||||
|
* pursuant to a written agreement and any use of this program without such an
|
||||||
|
* agreement is prohibited.
|
||||||
|
*/
|
||||||
|
package org.alfresco.rest.requests;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestRequest;
|
||||||
|
import org.alfresco.rest.core.RestResponse;
|
||||||
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.model.RestArchiveContentRequestModel;
|
||||||
|
import org.alfresco.rest.model.RestContentStorageInfoModel;
|
||||||
|
import org.alfresco.rest.model.RestRestoreArchivedContentRequestModel;
|
||||||
|
import org.alfresco.utility.model.TestModel;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
public class ContentStorageInformation extends ModelRequest<ContentStorageInformation>
|
||||||
|
{
|
||||||
|
private static final String BASE_PATH = "nodes/{nodeId}/storage-info/{contentPropName}";
|
||||||
|
private static final String VERSIONS_BASE_PATH = "nodes/{nodeId}/versions/{versionId}/storage-info/{contentPropName}";
|
||||||
|
private static final String ARCHIVE_PATH_SUFFIX = "/archive";
|
||||||
|
private static final String ARCHIVE_RESTORE_PATH_SUFFIX = "/archive-restore";
|
||||||
|
|
||||||
|
private String nodeId;
|
||||||
|
private String contentPropName;
|
||||||
|
private String versionId;
|
||||||
|
|
||||||
|
public ContentStorageInformation(RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ContentStorageInformation withNodeId(String nodeId)
|
||||||
|
{
|
||||||
|
this.nodeId = nodeId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentStorageInformation withContentPropName(String contentPropName)
|
||||||
|
{
|
||||||
|
this.contentPropName = contentPropName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentStorageInformation withVersionId(String versionId)
|
||||||
|
{
|
||||||
|
this.versionId = versionId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content Storage Properties using GET call on "nodes/{nodeId}/storage-info/{contentPropName}"
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestContentStorageInfoModel getStorageInfo()
|
||||||
|
{
|
||||||
|
return getStorageInfo(nodeId, contentPropName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content Version Storage Properties using GET call on "nodes/{nodeId}/versions/{versionId}/storage-info/{contentPropName}"
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestContentStorageInfoModel getVersionStorageInfo()
|
||||||
|
{
|
||||||
|
return getVersionStorageInfo(nodeId, versionId, contentPropName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content Storage Properties using GET call on "nodes/{nodeId}/storage-info/{contentPropName}"
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestContentStorageInfoModel getStorageInfo(String nodeId, String contentPropName)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, BASE_PATH, nodeId, contentPropName);
|
||||||
|
return restWrapper.processModel(RestContentStorageInfoModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content Version Storage Properties using GET call on "nodes/{nodeId}/versions/{versionId}/storage-info/{contentPropName}"
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param versionId The versionId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @return object of {@link RestContentStorageInfoModel}
|
||||||
|
*/
|
||||||
|
public RestContentStorageInfoModel getVersionStorageInfo(String nodeId, String versionId, String contentPropName)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, VERSIONS_BASE_PATH, nodeId, versionId, contentPropName);
|
||||||
|
return restWrapper.processModel(RestContentStorageInfoModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send content to archive using POST call on "nodes/{nodeId}/storage-info/{contentPropName}/archive"
|
||||||
|
*
|
||||||
|
* @param archiveContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestArchiveContent(RestArchiveContentRequestModel archiveContentRequest)
|
||||||
|
{
|
||||||
|
return requestArchiveContent(nodeId, contentPropName, archiveContentRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send version content to archive using POST call on "nodes/{nodeId}/versions/{versionId}/storage-info/{contentPropName}/archive"
|
||||||
|
*
|
||||||
|
* @param archiveContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestArchiveVersionContent(RestArchiveContentRequestModel archiveContentRequest)
|
||||||
|
{
|
||||||
|
return requestArchiveVersionContent(nodeId, contentPropName, versionId, archiveContentRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send content to archive using POST call on "nodes/{nodeId}/storage-info/{contentPropName}/archive"
|
||||||
|
*
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @param archiveContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestArchiveContent(String nodeId, String contentPropName, RestArchiveContentRequestModel archiveContentRequest)
|
||||||
|
{
|
||||||
|
RestRequest request = createRestRequestWithBody(HttpMethod.POST, archiveContentRequest, BASE_PATH + ARCHIVE_PATH_SUFFIX, nodeId, contentPropName);
|
||||||
|
return restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send version content to archive using POST call on "nodes/{nodeId}/versions/{versionId}/storage-info/{contentPropName}/archive"
|
||||||
|
*
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @param versionId The versionId
|
||||||
|
* @param archiveContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestArchiveVersionContent(String nodeId, String contentPropName, String versionId, RestArchiveContentRequestModel archiveContentRequest)
|
||||||
|
{
|
||||||
|
RestRequest request = createRestRequestWithBody(HttpMethod.POST, archiveContentRequest, VERSIONS_BASE_PATH + ARCHIVE_PATH_SUFFIX, nodeId, versionId, contentPropName);
|
||||||
|
return restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore content from archive using POST call on "nodes/{nodeId}/storage-info/{contentPropName}/archive-restore"
|
||||||
|
*
|
||||||
|
* @param restoreArchivedContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestRestoreContentFromArchive(RestRestoreArchivedContentRequestModel restoreArchivedContentRequest)
|
||||||
|
{
|
||||||
|
return requestRestoreContentFromArchive(nodeId, contentPropName, restoreArchivedContentRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore version content from archive using POST call on "nodes/{nodeId}/storage-info/versions/{versionId}/{contentPropName}/archive-restore"
|
||||||
|
*
|
||||||
|
* @param restoreArchivedContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestRestoreVersionContentFromArchive(RestRestoreArchivedContentRequestModel restoreArchivedContentRequest)
|
||||||
|
{
|
||||||
|
return requestRestoreVersionContentFromArchive(nodeId, contentPropName, versionId, restoreArchivedContentRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore content from archive using POST call on "nodes/{nodeId}/storage-info/{contentPropName}/archive-restore"
|
||||||
|
*
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @param restoreArchivedContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestRestoreContentFromArchive(String nodeId, String contentPropName, RestRestoreArchivedContentRequestModel restoreArchivedContentRequest)
|
||||||
|
{
|
||||||
|
RestRequest request = createRestRequestWithBody(HttpMethod.POST, restoreArchivedContentRequest, BASE_PATH +
|
||||||
|
ARCHIVE_RESTORE_PATH_SUFFIX, nodeId, contentPropName);
|
||||||
|
return restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore version content from archive using POST call on "nodes/{nodeId}/storage-info/{contentPropName}/archive-restore"
|
||||||
|
*
|
||||||
|
* @param nodeId The nodeId
|
||||||
|
* @param contentPropName The content property QNAME ie. "cm:content"
|
||||||
|
* @param versionId The versionId
|
||||||
|
* @param restoreArchivedContentRequest The request body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse requestRestoreVersionContentFromArchive(String nodeId, String contentPropName, String versionId,
|
||||||
|
RestRestoreArchivedContentRequestModel restoreArchivedContentRequest)
|
||||||
|
{
|
||||||
|
RestRequest request = createRestRequestWithBody(HttpMethod.POST, restoreArchivedContentRequest, VERSIONS_BASE_PATH +
|
||||||
|
ARCHIVE_RESTORE_PATH_SUFFIX, nodeId, versionId, contentPropName);
|
||||||
|
return restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private RestRequest createRestRequestWithBody(HttpMethod httpMethod, TestModel request, String path, String... pathParams)
|
||||||
|
{
|
||||||
|
if (request != null)
|
||||||
|
{
|
||||||
|
return RestRequest.requestWithBody(httpMethod, request.toJson(), path, pathParams);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return RestRequest.simpleRequest(httpMethod, path, pathParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,5 @@
|
|||||||
package org.alfresco.rest.requests;
|
package org.alfresco.rest.requests;
|
||||||
|
|
||||||
import javax.json.JsonArrayBuilder;
|
|
||||||
|
|
||||||
import org.alfresco.rest.core.JsonBodyGenerator;
|
import org.alfresco.rest.core.JsonBodyGenerator;
|
||||||
import org.alfresco.rest.core.RestRequest;
|
import org.alfresco.rest.core.RestRequest;
|
||||||
import org.alfresco.rest.core.RestWrapper;
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
@@ -18,7 +16,9 @@ public class CustomAspectModelManager extends ModelRequest<CustomAspectModelMana
|
|||||||
{
|
{
|
||||||
private CustomContentModel customContentModel;
|
private CustomContentModel customContentModel;
|
||||||
private CustomAspectModel customAspectModel;
|
private CustomAspectModel customAspectModel;
|
||||||
|
private CustomModelProperties customProperties = new CustomModelProperties(restWrapper);
|
||||||
|
|
||||||
|
|
||||||
public CustomAspectModelManager(CustomContentModel customContentModel, CustomAspectModel aspectModel, RestWrapper restWrapper)
|
public CustomAspectModelManager(CustomContentModel customContentModel, CustomAspectModel aspectModel, RestWrapper restWrapper)
|
||||||
{
|
{
|
||||||
super(restWrapper);
|
super(restWrapper);
|
||||||
@@ -29,41 +29,58 @@ public class CustomAspectModelManager extends ModelRequest<CustomAspectModelMana
|
|||||||
public RestCustomAspectModel getAspect()
|
public RestCustomAspectModel getAspect()
|
||||||
{
|
{
|
||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "cmm/{modelName}/aspects/{aspectName}?{parameters}",
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "cmm/{modelName}/aspects/{aspectName}?{parameters}",
|
||||||
this.customContentModel.getName(), this.customAspectModel.getName(), restWrapper.getParameters());
|
this.customContentModel.getName(), this.customAspectModel.getName(), restWrapper.getParameters());
|
||||||
return restWrapper.processModel(RestCustomAspectModel.class, request);
|
return restWrapper.processModel(RestCustomAspectModel.class, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addProperty(CustomAspectPropertiesModel propertyModel)
|
public void addProperty(CustomAspectPropertiesModel propertyModel)
|
||||||
{
|
{
|
||||||
JsonArrayBuilder array = JsonBodyGenerator.defineJSONArray();
|
customProperties.addProperty(propertyModel, this.customContentModel, true,
|
||||||
array.add(JsonBodyGenerator.defineJSON()
|
this.customAspectModel.getName(), false, null);
|
||||||
.add("name", propertyModel.getName())
|
|
||||||
.add("title", propertyModel.getTitle())
|
|
||||||
.add("description", propertyModel.getDescription())
|
|
||||||
.add("dataType", propertyModel.getDataType())
|
|
||||||
.add("multiValued", propertyModel.isMultiValued())
|
|
||||||
.add("mandatory", propertyModel.isMandatory())
|
|
||||||
.add("mandatoryEnforced", propertyModel.isMandatoryEnforced()));
|
|
||||||
|
|
||||||
String body = JsonBodyGenerator.defineJSON().add("name", this.customAspectModel.getName()).add("properties", array).build().toString();
|
|
||||||
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body, "cmm/{modelName}/aspects/{aspectName}?select=props",
|
|
||||||
this.customContentModel.getName(), this.customAspectModel.getName());
|
|
||||||
restWrapper.processEmptyModel(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithMinMaxValueConstraint(CustomAspectPropertiesModel propertyModel, int minValue, int maxValue)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, true, this.customAspectModel.getName(),
|
||||||
|
true, customProperties.createMinMaxValueConstraintArray(minValue, maxValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithMinMaxLengthConstraint(CustomAspectPropertiesModel propertyModel, int minLength, int maxLength)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, true, this.customAspectModel.getName(),
|
||||||
|
true, customProperties.createMinMaxLengthConstraint(minLength, maxLength));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithListOfValues(CustomAspectPropertiesModel propertyModel, boolean sorted, String... listOfValues)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, true, this.customAspectModel.getName(),
|
||||||
|
true, customProperties.createListOfValuesConstraint(sorted, listOfValues));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithRegularExpression(CustomAspectPropertiesModel propertyModel, String regex)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, true, this.customAspectModel.getName(),
|
||||||
|
true, customProperties.createRegexConstraint(regex));
|
||||||
|
}
|
||||||
|
|
||||||
public void deleteAspectProperty(CustomAspectPropertiesModel propertyModel)
|
public void deleteAspectProperty(CustomAspectPropertiesModel propertyModel)
|
||||||
{
|
{
|
||||||
String body = JsonBodyGenerator.defineJSON()
|
String body = JsonBodyGenerator.defineJSON()
|
||||||
.add("name", this.customAspectModel.getName()).build().toString();
|
.add("name", this.customAspectModel.getName()).build().toString();
|
||||||
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body, "cmm/{modelName}/aspects/{aspectName}?select=props&delete={propertyName}",
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body,
|
||||||
this.customContentModel.getName(), this.customAspectModel.getName(), propertyModel.getName());
|
"cmm/{modelName}/aspects/{aspectName}?select=props&delete={propertyName}",
|
||||||
|
this.customContentModel.getName(),
|
||||||
|
this.customAspectModel.getName(),
|
||||||
|
propertyModel.getName());
|
||||||
restWrapper.processEmptyModel(request);
|
restWrapper.processEmptyModel(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAspect()
|
public void deleteAspect()
|
||||||
{
|
{
|
||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "cmm/{modelName}/aspects/{aspectName}",
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE,
|
||||||
this.customContentModel.getName(), this.customAspectModel.getName());
|
"cmm/{modelName}/aspects/{aspectName}",
|
||||||
|
this.customContentModel.getName(),
|
||||||
|
this.customAspectModel.getName());
|
||||||
restWrapper.processEmptyModel(request);
|
restWrapper.processEmptyModel(request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,10 +3,19 @@ package org.alfresco.rest.requests;
|
|||||||
import org.alfresco.rest.core.JsonBodyGenerator;
|
import org.alfresco.rest.core.JsonBodyGenerator;
|
||||||
import org.alfresco.rest.core.RestRequest;
|
import org.alfresco.rest.core.RestRequest;
|
||||||
import org.alfresco.rest.core.RestWrapper;
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.model.RestCustomAspectModel;
|
||||||
import org.alfresco.rest.model.RestCustomModel;
|
import org.alfresco.rest.model.RestCustomModel;
|
||||||
|
import org.alfresco.rest.model.RestCustomTypeModel;
|
||||||
|
import org.alfresco.rest.model.RestGroupsModelsCollection;
|
||||||
|
import org.alfresco.utility.model.CustomAspectModel;
|
||||||
|
import org.alfresco.utility.model.CustomAspectPropertiesModel;
|
||||||
import org.alfresco.utility.model.CustomContentModel;
|
import org.alfresco.utility.model.CustomContentModel;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
import javax.json.Json;
|
||||||
|
import javax.json.JsonArrayBuilder;
|
||||||
|
import javax.json.JsonObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bogdan Bocancea
|
* @author Bogdan Bocancea
|
||||||
*/
|
*/
|
||||||
@@ -14,12 +23,30 @@ public class CustomModelManager extends ModelRequest<CustomModelManager>
|
|||||||
{
|
{
|
||||||
private CustomContentModel customContentModel;
|
private CustomContentModel customContentModel;
|
||||||
|
|
||||||
|
public CustomModelManager(RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
public CustomModelManager(CustomContentModel customContentModel, RestWrapper restWrapper)
|
public CustomModelManager(CustomContentModel customContentModel, RestWrapper restWrapper)
|
||||||
{
|
{
|
||||||
super(restWrapper);
|
super(restWrapper);
|
||||||
this.customContentModel = customContentModel;
|
this.customContentModel = customContentModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new custom model
|
||||||
|
*
|
||||||
|
* @param customContentModel
|
||||||
|
* @return {@link RestCustomModel}
|
||||||
|
*/
|
||||||
|
public RestCustomModel createCustomModel(CustomContentModel customContentModel)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, customContentModel.toJson(),
|
||||||
|
"cmm?{parameters}", restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestCustomModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve one model using GET call on "cmm/{modelName}"
|
* Retrieve one model using GET call on "cmm/{modelName}"
|
||||||
*
|
*
|
||||||
@@ -51,4 +78,18 @@ public class CustomModelManager extends ModelRequest<CustomModelManager>
|
|||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "cmm/{modelName}", this.customContentModel.getName());
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "cmm/{modelName}", this.customContentModel.getName());
|
||||||
restWrapper.processEmptyModel(request);
|
restWrapper.processEmptyModel(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RestCustomAspectModel createAspect(CustomAspectModel aspectModel)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, aspectModel.toJson(),
|
||||||
|
"cmm/{modelName}/aspects?{parameters}", this.customContentModel.getName(), restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestCustomAspectModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestCustomTypeModel createCustomType(RestCustomTypeModel customType)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, customType.toJson(),
|
||||||
|
"cmm/{modelName}/types?{parameters}", this.customContentModel.getName(), restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestCustomTypeModel.class, request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,164 @@
|
|||||||
|
package org.alfresco.rest.requests;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.JsonBodyGenerator;
|
||||||
|
import org.alfresco.rest.core.RestRequest;
|
||||||
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.utility.model.CustomAspectPropertiesModel;
|
||||||
|
import org.alfresco.utility.model.CustomContentModel;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
import javax.json.JsonArrayBuilder;
|
||||||
|
import javax.json.JsonObjectBuilder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bogdan Bocancea
|
||||||
|
*/
|
||||||
|
public class CustomModelProperties extends ModelRequest<CustomModelProperties>
|
||||||
|
{
|
||||||
|
public CustomModelProperties(RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addProperty(CustomAspectPropertiesModel propertyModel,
|
||||||
|
CustomContentModel customContentModel,
|
||||||
|
boolean isAspect,
|
||||||
|
String aspectOrTypeName,
|
||||||
|
boolean hasConstraints,
|
||||||
|
JsonArrayBuilder constraintsArray)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder array;
|
||||||
|
if(hasConstraints)
|
||||||
|
{
|
||||||
|
array = getPropertiesArray(propertyModel, true, constraintsArray);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array = getPropertiesArray(propertyModel, false, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
String body = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", aspectOrTypeName)
|
||||||
|
.add("properties", array).build().toString();
|
||||||
|
String urlPath;
|
||||||
|
if(isAspect)
|
||||||
|
{
|
||||||
|
urlPath = "cmm/{modelName}/aspects/{aspectName}?select=props";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
urlPath = "cmm/{modelName}/types/{typeName}?select=props";
|
||||||
|
}
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body, urlPath,
|
||||||
|
customContentModel.getName(), aspectOrTypeName);
|
||||||
|
restWrapper.processEmptyModel(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JsonArrayBuilder getPropertiesArray(CustomAspectPropertiesModel propertyModel, boolean hasConstraints, JsonArrayBuilder constraintsArray)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder array = JsonBodyGenerator.defineJSONArray();;
|
||||||
|
if(hasConstraints)
|
||||||
|
{
|
||||||
|
array.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", propertyModel.getName())
|
||||||
|
.add("title", propertyModel.getTitle())
|
||||||
|
.add("description", propertyModel.getDescription())
|
||||||
|
.add("dataType", propertyModel.getDataType())
|
||||||
|
.add("multiValued", propertyModel.isMultiValued())
|
||||||
|
.add("mandatory", propertyModel.isMandatory())
|
||||||
|
.add("mandatoryEnforced", propertyModel.isMandatoryEnforced())
|
||||||
|
.add("constraints", constraintsArray));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", propertyModel.getName())
|
||||||
|
.add("title", propertyModel.getTitle())
|
||||||
|
.add("description", propertyModel.getDescription())
|
||||||
|
.add("dataType", propertyModel.getDataType())
|
||||||
|
.add("multiValued", propertyModel.isMultiValued())
|
||||||
|
.add("mandatory", propertyModel.isMandatory())
|
||||||
|
.add("mandatoryEnforced", propertyModel.isMandatoryEnforced()));
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonArrayBuilder createMinMaxValueConstraintArray(int minValue, int maxValue)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder constraintsArray = JsonBodyGenerator.defineJSONArray();
|
||||||
|
JsonObjectBuilder param1 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "minValue")
|
||||||
|
.add("simpleValue", Integer.valueOf(minValue));
|
||||||
|
JsonObjectBuilder param2 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "maxValue")
|
||||||
|
.add("simpleValue", Integer.valueOf(maxValue));
|
||||||
|
JsonArrayBuilder parameters = JsonBodyGenerator.defineJSONArray();
|
||||||
|
parameters.add(0, param1).add(1, param2);
|
||||||
|
constraintsArray.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "MINMAX_" + UUID.randomUUID())
|
||||||
|
.add("type", "MINMAX")
|
||||||
|
.add("parameters", parameters));
|
||||||
|
return constraintsArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonArrayBuilder createMinMaxLengthConstraint(int minLength, int maxLength)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder constraintsArray = JsonBodyGenerator.defineJSONArray();
|
||||||
|
JsonObjectBuilder param1 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "minLength")
|
||||||
|
.add("simpleValue", Integer.valueOf(minLength));
|
||||||
|
JsonObjectBuilder param2 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "maxLength")
|
||||||
|
.add("simpleValue", Integer.valueOf(maxLength));
|
||||||
|
JsonArrayBuilder parameters = JsonBodyGenerator.defineJSONArray();
|
||||||
|
parameters.add(0, param1).add(1, param2);
|
||||||
|
constraintsArray.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "LENGTH_" + UUID.randomUUID())
|
||||||
|
.add("type", "LENGTH")
|
||||||
|
.add("parameters", parameters));
|
||||||
|
return constraintsArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonArrayBuilder createListOfValuesConstraint(boolean sorted, String... listOfValues)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder valuesArray = JsonBodyGenerator.defineJSONArray();
|
||||||
|
Arrays.stream(listOfValues).forEach(valuesArray::add);
|
||||||
|
JsonArrayBuilder constraintsArray = JsonBodyGenerator.defineJSONArray();
|
||||||
|
JsonObjectBuilder param1 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "allowedValues")
|
||||||
|
.add("listValue", valuesArray);
|
||||||
|
JsonObjectBuilder param2 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "sorted")
|
||||||
|
.add("simpleValue", Boolean.valueOf(sorted));
|
||||||
|
JsonArrayBuilder parameters = JsonBodyGenerator.defineJSONArray();
|
||||||
|
parameters.add(0, param1).add(1, param2);
|
||||||
|
constraintsArray.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "LIST_" + UUID.randomUUID())
|
||||||
|
.add("type", "LIST")
|
||||||
|
.add("parameters", parameters));
|
||||||
|
return constraintsArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JsonArrayBuilder createRegexConstraint(String regex)
|
||||||
|
{
|
||||||
|
JsonArrayBuilder constraintsArray = JsonBodyGenerator.defineJSONArray();
|
||||||
|
JsonObjectBuilder param1 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "expression")
|
||||||
|
.add("simpleValue", regex);
|
||||||
|
JsonObjectBuilder param2 = JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "requiresMatch")
|
||||||
|
.add("simpleValue", true);
|
||||||
|
JsonArrayBuilder parameters = JsonBodyGenerator.defineJSONArray();
|
||||||
|
parameters.add(0, param1).add(1, param2);
|
||||||
|
constraintsArray.add(JsonBodyGenerator.defineJSON()
|
||||||
|
.add("name", "REGEX_" + UUID.randomUUID())
|
||||||
|
.add("type", "REGEX")
|
||||||
|
.add("parameters", parameters));
|
||||||
|
return constraintsArray;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,65 @@
|
|||||||
|
package org.alfresco.rest.requests;
|
||||||
|
|
||||||
|
import org.alfresco.rest.core.RestRequest;
|
||||||
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.model.RestCustomTypeModel;
|
||||||
|
import org.alfresco.utility.model.CustomAspectPropertiesModel;
|
||||||
|
import org.alfresco.utility.model.CustomContentModel;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bogdan Bocancea
|
||||||
|
*/
|
||||||
|
public class CustomTypeManager extends ModelRequest<CustomTypeManager>
|
||||||
|
{
|
||||||
|
private CustomContentModel customContentModel;
|
||||||
|
private RestCustomTypeModel customTypeModel;
|
||||||
|
private CustomModelProperties customProperties = new CustomModelProperties(restWrapper);
|
||||||
|
|
||||||
|
public CustomTypeManager(CustomContentModel customContentModel, RestCustomTypeModel customTypeModel, RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
this.customContentModel = customContentModel;
|
||||||
|
this.customTypeModel = customTypeModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestCustomTypeModel getCustomType()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "cmm/{modelName}/types/{typeName}?{parameters}",
|
||||||
|
this.customContentModel.getName(), this.customTypeModel.getName(), restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestCustomTypeModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addProperty(CustomAspectPropertiesModel propertyModel)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, false,
|
||||||
|
this.customTypeModel.getName(), false, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithMinMaxValueConstraint(CustomAspectPropertiesModel propertyModel, int minValue, int maxValue)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, false, this.customTypeModel.getName(),
|
||||||
|
true, customProperties.createMinMaxValueConstraintArray(minValue, maxValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithMinMaxLengthConstraint(CustomAspectPropertiesModel propertyModel, int minLength, int maxLength)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, false, this.customTypeModel.getName(),
|
||||||
|
true, customProperties.createMinMaxLengthConstraint(minLength, maxLength));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPropertyWithListOfValues(CustomAspectPropertiesModel propertyModel, boolean sorted, String... listOfValues)
|
||||||
|
{
|
||||||
|
customProperties.addProperty(propertyModel, this.customContentModel, false, this.customTypeModel.getName(),
|
||||||
|
true, customProperties.createListOfValuesConstraint(sorted, listOfValues));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteCustomType()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE,
|
||||||
|
"cmm/{modelName}/types/{typeName}",
|
||||||
|
this.customContentModel.getName(),
|
||||||
|
this.customTypeModel.getName());
|
||||||
|
restWrapper.processEmptyModel(request);
|
||||||
|
}
|
||||||
|
}
|
@@ -371,6 +371,23 @@ public class Node extends ModelRequest<Node>
|
|||||||
restWrapper.processEmptyModel(request);
|
restWrapper.processEmptyModel(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create node version rendition using POST call on '/nodes/{nodeId}/versions/{versionId}/renditions'
|
||||||
|
*
|
||||||
|
* @param renditionId id of rendition to be created
|
||||||
|
* @param versionId version id of node
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void createNodeVersionRendition(String renditionId, String versionId) throws Exception
|
||||||
|
{
|
||||||
|
String postBody = JsonBodyGenerator.keyValueJson("id", renditionId);
|
||||||
|
RestRequest request = RestRequest
|
||||||
|
.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/versions/{versionId}/renditions",
|
||||||
|
repoModel.getNodeRef(), versionId);
|
||||||
|
restWrapper.processEmptyModel(request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if specified rendition exists and if not
|
* Check if specified rendition exists and if not
|
||||||
* create node rendition using POST call on '/nodes/{nodeId}/renditions'
|
* create node rendition using POST call on '/nodes/{nodeId}/renditions'
|
||||||
@@ -403,6 +420,22 @@ public class Node extends ModelRequest<Node>
|
|||||||
return restWrapper.processModel(RestRenditionInfoModel.class, request);
|
return restWrapper.processModel(RestRenditionInfoModel.class, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get node version rendition using GET call on '/nodes/{nodeId}/versions/{versionId}renditions/{renditionId}
|
||||||
|
*
|
||||||
|
* @param renditionId id of rendition to be retrieved
|
||||||
|
* @param versionId versionId of the node
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public RestRenditionInfoModel getNodeVersionRendition(String renditionId, String versionId) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest
|
||||||
|
.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}",
|
||||||
|
repoModel.getNodeRef(), versionId, renditionId);
|
||||||
|
return restWrapper.processModel(RestRenditionInfoModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get node rendition using GET call on 'nodes/{nodeId}/renditions/{renditionId} Please note that it retries to get
|
* Get node rendition using GET call on 'nodes/{nodeId}/renditions/{renditionId} Please note that it retries to get
|
||||||
* the renditions response several times because on the alfresco server the rendition can take a while to be created.
|
* the renditions response several times because on the alfresco server the rendition can take a while to be created.
|
||||||
@@ -426,6 +459,30 @@ public class Node extends ModelRequest<Node>
|
|||||||
}
|
}
|
||||||
return renditions;
|
return renditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get node version rendition using GET call on 'nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} Please note that it retries to get
|
||||||
|
* the renditions response several times because on the alfresco server the rendition can take a while to be created.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public RestRenditionInfoModel getNodeVersionRenditionUntilIsCreated(String renditionId, String versionId) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}",repoModel.getNodeRef(), versionId, renditionId);
|
||||||
|
RestRenditionInfoModel renditions = restWrapper.processModel(RestRenditionInfoModel.class, request);
|
||||||
|
int retry = 0;
|
||||||
|
if (Integer.valueOf(restWrapper.getStatusCode()).equals(HttpStatus.OK.value()))
|
||||||
|
{
|
||||||
|
while (renditions.getStatus().equals("NOT_CREATED") && retry < Utility.retryCountSeconds - 8)
|
||||||
|
{
|
||||||
|
Utility.waitToLoopTime(1);
|
||||||
|
renditions = restWrapper.processModel(RestRenditionInfoModel.class, request);
|
||||||
|
retry++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return renditions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get node rendition content using GET call on
|
* Get node rendition content using GET call on
|
||||||
@@ -442,6 +499,32 @@ public class Node extends ModelRequest<Node>
|
|||||||
renditionId);
|
renditionId);
|
||||||
RestResponse response = restWrapper.process(request);
|
RestResponse response = restWrapper.process(request);
|
||||||
int retry = 0;
|
int retry = 0;
|
||||||
|
//Multiplied by '4' because AI rendition test cases need more time (~30 seconds) - see ACS-2158
|
||||||
|
while (Integer.valueOf(response.getStatusCode()).equals(HttpStatus.NOT_FOUND.value()) && retry < (4 * Utility.retryCountSeconds))
|
||||||
|
{
|
||||||
|
Utility.waitToLoopTime(1);
|
||||||
|
response = restWrapper.process(request);
|
||||||
|
retry++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get node version rendition content using GET call on
|
||||||
|
* 'nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content Please note that it
|
||||||
|
* retries to get the renditions response several times because on the
|
||||||
|
* alfresco server the rendition can take a while to be created.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public RestResponse getNodeVersionRenditionContentUntilIsCreated(String renditionId, String versionId) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content", repoModel.getNodeRef(),
|
||||||
|
versionId, renditionId);
|
||||||
|
RestResponse response = restWrapper.process(request);
|
||||||
|
int retry = 0;
|
||||||
while (Integer.valueOf(response.getStatusCode()).equals(HttpStatus.NOT_FOUND.value()) && retry < Utility.retryCountSeconds)
|
while (Integer.valueOf(response.getStatusCode()).equals(HttpStatus.NOT_FOUND.value()) && retry < Utility.retryCountSeconds)
|
||||||
{
|
{
|
||||||
Utility.waitToLoopTime(1);
|
Utility.waitToLoopTime(1);
|
||||||
@@ -466,6 +549,20 @@ public class Node extends ModelRequest<Node>
|
|||||||
return restWrapper.process(request);
|
return restWrapper.process(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get node version rendition content using GET call on
|
||||||
|
* 'nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public RestResponse getNodeVersionRenditionContent(String renditionId, String versionId) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content", repoModel.getNodeRef(),
|
||||||
|
versionId, renditionId);
|
||||||
|
return restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get rendition information for available renditions for the node using GET call on
|
* Get rendition information for available renditions for the node using GET call on
|
||||||
* 'nodes/{nodeId}/renditions'
|
* 'nodes/{nodeId}/renditions'
|
||||||
@@ -479,6 +576,20 @@ public class Node extends ModelRequest<Node>
|
|||||||
return restWrapper.processModels(RestRenditionInfoModelCollection.class, request);
|
return restWrapper.processModels(RestRenditionInfoModelCollection.class, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get rendition information for available renditions for the node version using GET call on
|
||||||
|
* 'nodes/{nodeId}/versions/{versionId}/renditions'
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public RestRenditionInfoModelCollection getNodeVersionRenditionsInfo(String versionId) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/versions/{versionId}/renditions?{parameters}", repoModel.getNodeRef(),
|
||||||
|
versionId, restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestRenditionInfoModelCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a node's children using GET call 'nodes/{nodeId}/children
|
* Get a node's children using GET call 'nodes/{nodeId}/children
|
||||||
*
|
*
|
||||||
@@ -778,11 +889,6 @@ public class Node extends ModelRequest<Node>
|
|||||||
restWrapper.processEmptyModel(request);
|
restWrapper.processEmptyModel(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*@param nodeId
|
|
||||||
*@return
|
|
||||||
*/
|
|
||||||
public RestActionDefinitionModelsCollection getActionDefinitions()
|
public RestActionDefinitionModelsCollection getActionDefinitions()
|
||||||
{
|
{
|
||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/action-definitions?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "nodes/{nodeId}/action-definitions?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
|
||||||
@@ -790,4 +896,75 @@ public class Node extends ModelRequest<Node>
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* Get Direct Access URL for a node
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse createDirectAccessURL(String postBody)
|
||||||
|
{
|
||||||
|
RestRequest request;
|
||||||
|
if (postBody == null)
|
||||||
|
{
|
||||||
|
request = RestRequest.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/request-direct-access-url", this.repoModel.getNodeRef());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
request = RestRequest.requestWithBody(HttpMethod.POST, postBody, "nodes/{nodeId}/request-direct-access-url", this.repoModel.getNodeRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Direct Access URL for a specific node version. E.g "1.1"
|
||||||
|
* @param versionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse createDirectAccessURLforVersion(String versionId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest
|
||||||
|
.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/versions/{versionId}/request-direct-access-url", this.repoModel.getNodeRef(), versionId);
|
||||||
|
return this.restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Direct Access URL for a specific node version rendition. E.g ("1.1", "pdf")
|
||||||
|
* @param versionId
|
||||||
|
* @param renditionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse createDirectAccessURLforVersionAndRendition(String versionId, String renditionId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest
|
||||||
|
.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/request-direct-access-url", this.repoModel.getNodeRef(), versionId, renditionId);
|
||||||
|
return this.restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Direct Access URL for a specific node rendition E.g "pdf"
|
||||||
|
* @param renditionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public RestResponse createDirectAccessURLforRendition(String renditionId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest
|
||||||
|
.simpleRequest(HttpMethod.POST, "nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url", this.repoModel.getNodeRef(), renditionId);
|
||||||
|
return this.restWrapper.process(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ContentStorageInformation usingStorageInfo(String contentPropName)
|
||||||
|
{
|
||||||
|
return new ContentStorageInformation(restWrapper)
|
||||||
|
.withNodeId(repoModel.getNodeRef())
|
||||||
|
.withContentPropName(contentPropName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentStorageInformation usingVersionStorageInfo(String contentPropName, String versionId)
|
||||||
|
{
|
||||||
|
return new ContentStorageInformation(restWrapper)
|
||||||
|
.withNodeId(repoModel.getNodeRef())
|
||||||
|
.withContentPropName(contentPropName)
|
||||||
|
.withVersionId(versionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -11,9 +11,12 @@ import org.alfresco.rest.model.RestSiteContainerModel;
|
|||||||
import org.alfresco.rest.model.RestSiteContainerModelsCollection;
|
import org.alfresco.rest.model.RestSiteContainerModelsCollection;
|
||||||
import org.alfresco.rest.model.RestSiteMemberModel;
|
import org.alfresco.rest.model.RestSiteMemberModel;
|
||||||
import org.alfresco.rest.model.RestSiteMemberModelsCollection;
|
import org.alfresco.rest.model.RestSiteMemberModelsCollection;
|
||||||
|
import org.alfresco.rest.model.RestSiteGroupModel;
|
||||||
|
import org.alfresco.rest.model.RestSiteGroupModelsCollection;
|
||||||
import org.alfresco.rest.model.RestSiteModel;
|
import org.alfresco.rest.model.RestSiteModel;
|
||||||
import org.alfresco.rest.model.RestSiteModelsCollection;
|
import org.alfresco.rest.model.RestSiteModelsCollection;
|
||||||
import org.alfresco.rest.model.RestSitePersonMembershipRequestModelsCollection;
|
import org.alfresco.rest.model.RestSitePersonMembershipRequestModelsCollection;
|
||||||
|
import org.alfresco.utility.constants.UserRole;
|
||||||
import org.alfresco.utility.model.SiteModel;
|
import org.alfresco.utility.model.SiteModel;
|
||||||
import org.alfresco.utility.model.UserModel;
|
import org.alfresco.utility.model.UserModel;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
@@ -257,4 +260,66 @@ public class Site extends ModelRequest<Site>
|
|||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.POST, "sites/{siteId}/site-membership-requests/{inviteeId}/reject", site.getId(), siteMember.getUsername());
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.POST, "sites/{siteId}/site-membership-requests/{inviteeId}/reject", site.getId(), siteMember.getUsername());
|
||||||
return restWrapper.process(request);
|
return restWrapper.process(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all group membership of a site using GET call on "sites/{siteId}/group-members"
|
||||||
|
*
|
||||||
|
* @return RestSiteGroupModelsCollection
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestSiteGroupModelsCollection getSiteGroups()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "sites/{siteId}/group-members?{parameters}", site.getId(), restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestSiteGroupModelsCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add new site group membership using POST call on "sites/{siteId}/group-members"
|
||||||
|
*
|
||||||
|
* @param authorityId The authorityId of the group
|
||||||
|
* @param role role to assign
|
||||||
|
* @return
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestSiteGroupModel addSiteGroup(String authorityId, UserRole role)
|
||||||
|
{
|
||||||
|
String siteMemberBody = JsonBodyGenerator.siteGroup(authorityId, role);
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, siteMemberBody, "sites/{siteId}/group-members?{parameters}", site.getId(), restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestSiteGroupModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve specific group membership of a site using GET call on "sites/{siteId}/group-members/{groupId}"
|
||||||
|
*
|
||||||
|
* @param groupId
|
||||||
|
* @return RestSiteGroupModel
|
||||||
|
*/
|
||||||
|
public RestSiteGroupModel getSiteGroup(String groupId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "sites/{siteId}/group-members/{groupId}", site.getId(), groupId);
|
||||||
|
return restWrapper.processModel(RestSiteGroupModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update site group membership role with PUT call on "sites/{siteId}/group-members/{groupId}"
|
||||||
|
* @param groupId
|
||||||
|
* @return RestSiteGroupModel
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestSiteGroupModel updateSiteGroup(String groupId, UserRole role)
|
||||||
|
{
|
||||||
|
String json = JsonBodyGenerator.keyValueJson("role", role.toString());
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, json, "sites/{siteId}/group-members/{groupId}", site.getId(), groupId);
|
||||||
|
return restWrapper.processModel(RestSiteGroupModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete site group membership with DELETE call on "sites/{siteId}/group-members/{groupId}"
|
||||||
|
* @param groupId
|
||||||
|
*/
|
||||||
|
public void deleteSiteGroup(String groupId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "sites/{siteId}/group-members/{groupId}", site.getId(), groupId);
|
||||||
|
restWrapper.processEmptyModel(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@ import org.alfresco.rest.model.RestTagModel;
|
|||||||
import org.alfresco.rest.model.RestTagModelsCollection;
|
import org.alfresco.rest.model.RestTagModelsCollection;
|
||||||
import org.alfresco.rest.requests.Actions;
|
import org.alfresco.rest.requests.Actions;
|
||||||
import org.alfresco.rest.requests.Audit;
|
import org.alfresco.rest.requests.Audit;
|
||||||
|
import org.alfresco.rest.requests.ContentStorageInformation;
|
||||||
import org.alfresco.rest.requests.Downloads;
|
import org.alfresco.rest.requests.Downloads;
|
||||||
import org.alfresco.rest.requests.Groups;
|
import org.alfresco.rest.requests.Groups;
|
||||||
import org.alfresco.rest.requests.ModelRequest;
|
import org.alfresco.rest.requests.ModelRequest;
|
||||||
@@ -98,6 +99,11 @@ public class RestCoreAPI extends ModelRequest<RestCoreAPI>
|
|||||||
return new Node(restWrapper);
|
return new Node(restWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ContentStorageInformation usingStorageInfo()
|
||||||
|
{
|
||||||
|
return new ContentStorageInformation(restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides DSL of all REST calls under <code>/people</code> API path
|
* Provides DSL of all REST calls under <code>/people</code> API path
|
||||||
*
|
*
|
||||||
|
@@ -0,0 +1,71 @@
|
|||||||
|
package org.alfresco.rest.requests.modelAPI;
|
||||||
|
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import org.alfresco.rest.core.RestRequest;
|
||||||
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||||
|
import org.alfresco.rest.model.*;
|
||||||
|
import org.alfresco.rest.requests.ModelRequest;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the entire Rest Model API
|
||||||
|
* {@link https://api-explorer.alfresco.com/api-explorer/} select "Model API"
|
||||||
|
*/
|
||||||
|
public class RestModelAPI extends ModelRequest<RestModelAPI>
|
||||||
|
{
|
||||||
|
public RestModelAPI(RestWrapper restWrapper)
|
||||||
|
{
|
||||||
|
super(restWrapper);
|
||||||
|
RestAssured.basePath = "alfresco/api/-default-/public/alfresco/versions/1";
|
||||||
|
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all aspects using GET call on "aspects"
|
||||||
|
*
|
||||||
|
* @return RestAspectsCollection
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestAspectsCollection getAspects()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "aspects?{parameters}", restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestAspectsCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve aspect by id using GET call on "aspects/{aspectId}"
|
||||||
|
*
|
||||||
|
* @return RestAspectModel
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestAspectModel getAspect(String aspectId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "aspects/{aspectId}?{parameters}", aspectId, restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestAspectModel.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all types using GET call on "types"
|
||||||
|
*
|
||||||
|
* @return RestTypesCollection
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestTypesCollection getTypes()
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "types?{parameters}", restWrapper.getParameters());
|
||||||
|
return restWrapper.processModels(RestTypesCollection.class, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Type by id using GET call on "types/{typeId}"
|
||||||
|
*
|
||||||
|
* @return RestTypeModel
|
||||||
|
* @throws JsonToModelConversionException
|
||||||
|
*/
|
||||||
|
public RestTypeModel getType(String typeId)
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "types/{typeId}?{parameters}", typeId, restWrapper.getParameters());
|
||||||
|
return restWrapper.processModel(RestTypeModel.class, request);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,12 @@
|
|||||||
package org.alfresco.rest.requests.privateAPI;
|
package org.alfresco.rest.requests.privateAPI;
|
||||||
|
|
||||||
import org.alfresco.rest.core.RestWrapper;
|
import org.alfresco.rest.core.RestWrapper;
|
||||||
|
import org.alfresco.rest.model.RestCustomTypeModel;
|
||||||
import org.alfresco.rest.model.RestSubscriberModel;
|
import org.alfresco.rest.model.RestSubscriberModel;
|
||||||
import org.alfresco.rest.model.RestSyncNodeSubscriptionModel;
|
import org.alfresco.rest.model.RestSyncNodeSubscriptionModel;
|
||||||
import org.alfresco.rest.requests.CustomAspectModelManager;
|
import org.alfresco.rest.requests.CustomAspectModelManager;
|
||||||
import org.alfresco.rest.requests.CustomModelManager;
|
import org.alfresco.rest.requests.CustomModelManager;
|
||||||
|
import org.alfresco.rest.requests.CustomTypeManager;
|
||||||
import org.alfresco.rest.requests.ModelRequest;
|
import org.alfresco.rest.requests.ModelRequest;
|
||||||
import org.alfresco.rest.requests.syncServiceAPI.Healthcheck;
|
import org.alfresco.rest.requests.syncServiceAPI.Healthcheck;
|
||||||
import org.alfresco.rest.requests.syncServiceAPI.Subscribers;
|
import org.alfresco.rest.requests.syncServiceAPI.Subscribers;
|
||||||
@@ -38,6 +40,11 @@ public class RestPrivateAPI extends ModelRequest<RestPrivateAPI>
|
|||||||
return new CustomModelManager(customContentModel, restWrapper);
|
return new CustomModelManager(customContentModel, restWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CustomModelManager usingCustomModel()
|
||||||
|
{
|
||||||
|
return new CustomModelManager(restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides DSL on all REST calls under <code>cmm/{modelName}/aspects/{aspectName}...</code> API path
|
* Provides DSL on all REST calls under <code>cmm/{modelName}/aspects/{aspectName}...</code> API path
|
||||||
*
|
*
|
||||||
@@ -50,6 +57,18 @@ public class RestPrivateAPI extends ModelRequest<RestPrivateAPI>
|
|||||||
return new CustomAspectModelManager(customContentModel, aspectModel, restWrapper);
|
return new CustomAspectModelManager(customContentModel, aspectModel, restWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides DSL on all REST calls under <code>cmm/{modelName}/types/{typeName}...</code> API path
|
||||||
|
*
|
||||||
|
* @param customContentModel {@link CustomContentModel}
|
||||||
|
* @param customType {@link RestCustomTypeModel}
|
||||||
|
* @return {@link CustomTypeManager}
|
||||||
|
*/
|
||||||
|
public CustomTypeManager usingCustomType(CustomContentModel customContentModel, RestCustomTypeModel customType)
|
||||||
|
{
|
||||||
|
return new CustomTypeManager(customContentModel, customType, restWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides DSL on all REST calls under <code>subscribers/</code> API path
|
* Provides DSL on all REST calls under <code>subscribers/</code> API path
|
||||||
*
|
*
|
||||||
|
@@ -35,6 +35,7 @@ public class SearchAPI extends ModelRequest<SearchAPI>
|
|||||||
public SearchAPI(RestWrapper restWrapper)
|
public SearchAPI(RestWrapper restWrapper)
|
||||||
{
|
{
|
||||||
super(restWrapper);
|
super(restWrapper);
|
||||||
|
restWrapper.configureAlfrescoEndpoint();
|
||||||
RestAssured.basePath = "alfresco/api/-default-/public/search/versions/1";
|
RestAssured.basePath = "alfresco/api/-default-/public/search/versions/1";
|
||||||
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||||
}
|
}
|
||||||
|
@@ -127,6 +127,7 @@ public class SearchSQLAPI extends ModelRequest<SearchSQLAPI>
|
|||||||
public SearchSQLAPI(RestWrapper restWrapper)
|
public SearchSQLAPI(RestWrapper restWrapper)
|
||||||
{
|
{
|
||||||
super(restWrapper);
|
super(restWrapper);
|
||||||
|
restWrapper.configureAlfrescoEndpoint();
|
||||||
RestAssured.basePath = "alfresco/api/-default-/public/search/versions/1";
|
RestAssured.basePath = "alfresco/api/-default-/public/search/versions/1";
|
||||||
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||||
}
|
}
|
||||||
|
@@ -42,6 +42,7 @@ public class ShardInfoAPI extends ModelRequest<ShardInfoAPI>
|
|||||||
public ShardInfoAPI(RestWrapper restWrapper)
|
public ShardInfoAPI(RestWrapper restWrapper)
|
||||||
{
|
{
|
||||||
super(restWrapper);
|
super(restWrapper);
|
||||||
|
restWrapper.configureAlfrescoEndpoint();
|
||||||
RestAssured.basePath = "alfresco/api/-default-/private/search/versions/1";
|
RestAssured.basePath = "alfresco/api/-default-/private/search/versions/1";
|
||||||
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
restWrapper.configureRequestSpec().setBasePath(RestAssured.basePath);
|
||||||
}
|
}
|
||||||
|
@@ -67,6 +67,17 @@ public class SolrAPI extends ModelRequest<SolrAPI>
|
|||||||
return restWrapper.processTextResponse(request);
|
return restWrapper.processTextResponse(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes an action (like "delete") on SOLR alfresco core
|
||||||
|
* @param urlActionPath some action name (like "delete")
|
||||||
|
* @param queryBody parameters for the action
|
||||||
|
*/
|
||||||
|
public RestTextResponse postAction(String urlActionPath, String queryBody) throws Exception
|
||||||
|
{
|
||||||
|
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, queryBody, urlActionPath);
|
||||||
|
return restWrapper.processTextResponse(request);
|
||||||
|
}
|
||||||
|
|
||||||
public RestTextResponse getSelectQuery() throws Exception
|
public RestTextResponse getSelectQuery() throws Exception
|
||||||
{
|
{
|
||||||
List<Header> headers = new ArrayList<Header>();
|
List<Header> headers = new ArrayList<Header>();
|
||||||
@@ -77,4 +88,19 @@ public class SolrAPI extends ModelRequest<SolrAPI>
|
|||||||
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "select?q={parameters}", restWrapper.getParameters());
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "select?q={parameters}", restWrapper.getParameters());
|
||||||
return restWrapper.processTextResponse(request);
|
return restWrapper.processTextResponse(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a query in SOLR using JSON format for the results
|
||||||
|
*/
|
||||||
|
public RestTextResponse getSelectQueryJson() throws Exception
|
||||||
|
{
|
||||||
|
List<Header> headers = new ArrayList<Header>();
|
||||||
|
headers.add(new Header("Content-Type", "application/json"));
|
||||||
|
Headers header = new Headers(headers);
|
||||||
|
restWrapper.setResponseHeaders(header);
|
||||||
|
restWrapper.configureRequestSpec().setUrlEncodingEnabled(false);
|
||||||
|
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "select?q={parameters}&wt=json", restWrapper.getParameters());
|
||||||
|
return restWrapper.processTextResponse(request);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package org.alfresco.rest.search;
|
package org.alfresco.rest.search;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import org.alfresco.rest.core.IRestModel;
|
import org.alfresco.rest.core.IRestModel;
|
||||||
import org.alfresco.rest.core.assertion.ModelAssertion;
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
@@ -12,6 +13,16 @@ import java.util.List;
|
|||||||
* Generated from 'Alfresco Content Services REST API' swagger file
|
* Generated from 'Alfresco Content Services REST API' swagger file
|
||||||
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
From Jackson 2.8 this annotation is required to make sure that defaults are read from the actual field values,
|
||||||
|
as opposing to field type defaults. For example, the default for boolean primitive is "false",
|
||||||
|
but the default for the "min" field in this class is "true".
|
||||||
|
This configuration does not affect the product and is only related to test framework and how it serializes the request into JSON.
|
||||||
|
See org.alfresco.utility.model.TestModel#toJson
|
||||||
|
Note: This change was required for org.alfresco.test.search.functional.searchServices.search.StatsSearchTest
|
||||||
|
*/
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
|
||||||
public class RestRequestStatsModel extends TestModel implements IRestModel<RestRequestStatsModel>
|
public class RestRequestStatsModel extends TestModel implements IRestModel<RestRequestStatsModel>
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package org.alfresco.rest.search;
|
package org.alfresco.rest.search;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.rest.core.IRestModel;
|
import org.alfresco.rest.core.IRestModel;
|
||||||
import org.alfresco.rest.core.assertion.ModelAssertion;
|
import org.alfresco.rest.core.assertion.ModelAssertion;
|
||||||
@@ -40,7 +41,10 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
private boolean isFile;
|
private boolean isFile;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private boolean isLocked;
|
private Boolean isLocked;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private Map<String, Object> association;
|
||||||
|
|
||||||
@JsonProperty(required = true)
|
@JsonProperty(required = true)
|
||||||
private String modifiedAt;
|
private String modifiedAt;
|
||||||
@@ -56,7 +60,7 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
|
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
|
||||||
private boolean isLink;
|
private Boolean isLink;
|
||||||
|
|
||||||
private RestContentModel content;
|
private RestContentModel content;
|
||||||
|
|
||||||
@@ -73,6 +77,16 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
|
|
||||||
private String location;
|
private String location;
|
||||||
|
|
||||||
|
public Map<String, Object> getAssociation()
|
||||||
|
{
|
||||||
|
return association;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssociation(Map<String, Object> association)
|
||||||
|
{
|
||||||
|
this.association = association;
|
||||||
|
}
|
||||||
|
|
||||||
public SearchScoreModel getSearch()
|
public SearchScoreModel getSearch()
|
||||||
{
|
{
|
||||||
return search;
|
return search;
|
||||||
@@ -161,12 +175,12 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
this.isFile = isFile;
|
this.isFile = isFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocked()
|
public Boolean isLocked()
|
||||||
{
|
{
|
||||||
return isLocked;
|
return isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLocked(boolean isLocked)
|
public void setLocked(Boolean isLocked)
|
||||||
{
|
{
|
||||||
this.isLocked = isLocked;
|
this.isLocked = isLocked;
|
||||||
}
|
}
|
||||||
@@ -221,12 +235,12 @@ public class SearchNodeModel extends TestModel implements IRestModel<SearchNodeM
|
|||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLink()
|
public Boolean isLink()
|
||||||
{
|
{
|
||||||
return isLink;
|
return isLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLink(boolean isLink)
|
public void setIsLink(Boolean isLink)
|
||||||
{
|
{
|
||||||
this.isLink = isLink;
|
this.isLink = isLink;
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,8 @@ public class RestDemoTests extends RestTest
|
|||||||
* Update existing comment using PUT call, check that comment content is updated <br/>
|
* Update existing comment using PUT call, check that comment content is updated <br/>
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "demo" })
|
//Opened DESKTOPAPP-475 for fixing the failing test
|
||||||
|
// @Test(groups = { "demo" })
|
||||||
public void adminCanPostAndUpdateComments() throws Exception
|
public void adminCanPostAndUpdateComments() throws Exception
|
||||||
{
|
{
|
||||||
FileModel fileModel = dataContent.usingUser(userModel)
|
FileModel fileModel = dataContent.usingUser(userModel)
|
||||||
|
Reference in New Issue
Block a user