Compare commits

...

44 Commits

Author SHA1 Message Date
Travis CI User
3a8fde44ec [maven-release-plugin][skip ci] prepare release v1.128 2022-09-29 17:39:58 +00:00
krdabrowski
646bbe3436 ACS-3525: API for manual triggering rules on a folder (#257)
ACS-3525: API for manual triggering rules on a folder
2022-09-29 19:35:01 +02:00
Travis CI User
7c706dbac6 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 14:27:29 +00:00
Travis CI User
2ab4c70217 [maven-release-plugin][skip ci] prepare release v1.127 2022-09-29 14:27:27 +00:00
Kristian Dimitrov
ed0bbf576d ACS-3601 add e2e unlink functionality (#259)
* ACS-3601: Add unlink/delete request
2022-09-29 15:22:29 +01:00
Travis CI User
f3e43badfe [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 12:52:31 +00:00
Travis CI User
e99b6a98de [maven-release-plugin][skip ci] prepare release v1.126 2022-09-29 12:52:29 +00:00
Tom Page
64644505b3 ACS-3376 ACS-3377 Support GET and PUT rule id list. (#256) 2022-09-29 13:47:41 +01:00
Travis CI User
aca9e15668 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-29 11:49:12 +00:00
Travis CI User
1852309798 [maven-release-plugin][skip ci] prepare release v1.125 2022-09-29 11:49:10 +00:00
Kristian Dimitrov
ee2e248e39 ACS-3601: Add unlink/delete request (#258) 2022-09-29 12:44:10 +01:00
Travis CI User
b2f90ff6bc [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-28 06:40:00 +00:00
Travis CI User
59641e833e [maven-release-plugin][skip ci] prepare release v1.124 2022-09-28 06:39:58 +00:00
Sara
6dd7d32b2e ACS-3560 Add custom embedded workflow to entitlements model (#255)
* ACS-3560 Add custom embedded workflow to entitlements model

* add header
2022-09-28 07:35:19 +01:00
Travis CI User
83bf4d0a2f [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-26 12:03:10 +00:00
Travis CI User
1af9f31b68 [maven-release-plugin][skip ci] prepare release v1.123 2022-09-26 12:03:09 +00:00
Tom Page
2b98e73468 ACS-3359 Rename boolean fields. (#253) 2022-09-26 12:58:42 +01:00
Travis CI User
966dd7d144 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 14:58:56 +00:00
Travis CI User
375c68f932 [maven-release-plugin][skip ci] prepare release v1.122 2022-09-20 14:58:54 +00:00
Tom Page
8ce6117a95 ACS-3577 Use reload4j from TAS utility. 2022-09-20 15:54:19 +01:00
Travis CI User
08e393c39f [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 11:31:17 +00:00
Travis CI User
2f4303f4eb [maven-release-plugin][skip ci] prepare release v1.121 2022-09-20 11:31:15 +00:00
Tom Page
953a1cc3f9 Fix setter and getter naming for GET rule set fields. (#252) 2022-09-20 12:26:28 +01:00
Travis CI User
23a1ddca6a [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-20 11:08:16 +00:00
Travis CI User
439dd3771f [maven-release-plugin][skip ci] prepare release v1.120 2022-09-20 11:08:14 +00:00
dependabot[bot]
df7ebe30b3 Bump utility from 3.0.54 to 3.0.55 (#249)
Bumps [utility](https://github.com/Alfresco/alfresco-tas-utility) from 3.0.54 to 3.0.55.
- [Release notes](https://github.com/Alfresco/alfresco-tas-utility/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-utility/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-utility/compare/utility-3.0.54...utility-3.0.55)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:utility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 12:03:23 +01:00
Travis CI User
c482153183 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-16 13:49:06 +00:00
Travis CI User
cdbd153151 [maven-release-plugin][skip ci] prepare release v1.119 2022-09-16 13:49:01 +00:00
Tom Page
8564f9eace ACS-3364 ACS-3365 ACS-3366 Add extra fields to rule set. (#248) 2022-09-16 14:44:14 +01:00
Travis CI User
b5d7500ecc [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-16 13:27:58 +00:00
Travis CI User
e875e1fbbe [maven-release-plugin][skip ci] prepare release v1.118 2022-09-16 13:27:57 +00:00
dependabot[bot]
32179dc810 Bump utility from 3.0.53 to 3.0.54 (#243)
Bumps [utility](https://github.com/Alfresco/alfresco-tas-utility) from 3.0.53 to 3.0.54.
- [Release notes](https://github.com/Alfresco/alfresco-tas-utility/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-utility/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-utility/compare/utility-3.0.53...utility-3.0.54)

---
updated-dependencies:
- dependency-name: org.alfresco.tas:utility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:23:29 +01:00
dependabot[bot]
97ed056103 Bump maven-project-info-reports-plugin from 3.4.0 to 3.4.1 (#234)
Bumps [maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-project-info-reports-plugin/releases)
- [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.4.0...maven-project-info-reports-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:20:00 +01:00
dependabot[bot]
af97fd5d6a Bump jackson-databind from 2.13.3 to 2.13.4 (#242)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.3 to 2.13.4.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:52 +01:00
dependabot[bot]
cef6e8fc7b Bump mockito-core from 4.2.0 to 4.8.0 (#244)
Bumps [mockito-core](https://github.com/mockito/mockito) from 4.2.0 to 4.8.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v4.2.0...v4.8.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:12 +01:00
dependabot[bot]
31d0578a98 Bump rest-assured.version from 5.1.1 to 5.2.0 (#245)
Bumps `rest-assured.version` from 5.1.1 to 5.2.0.

Updates `rest-assured` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `json-path` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `xml-path` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/rest-assured/rest-assured/releases)
- [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt)
- [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.1.1...rest-assured-5.2.0)

Updates `json-schema-validator` from 5.1.1 to 5.2.0

---
updated-dependencies:
- dependency-name: io.rest-assured:rest-assured
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:json-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:xml-path
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.rest-assured:json-schema-validator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:19:00 +01:00
dependabot[bot]
2e1ae3bb69 Bump slf4j-api from 1.7.36 to 2.0.1 (#246)
Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.36 to 2.0.1.
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.36...v_2.0.1)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 14:18:46 +01:00
Travis CI User
9af05df046 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-15 11:37:13 +00:00
Travis CI User
71801e9e5e [maven-release-plugin][skip ci] prepare release v1.117 2022-09-15 11:37:12 +00:00
Tom Page
52149bf292 ACS-3363 Add inheritedBy to rule set. (#247) 2022-09-15 12:32:32 +01:00
Travis CI User
6cb07e1b86 [maven-release-plugin][skip ci] prepare for next development iteration 2022-09-01 16:01:29 +00:00
Travis CI User
fa3df0987d [maven-release-plugin][skip ci] prepare release v1.116 2022-09-01 16:01:27 +00:00
Tom Page
fde20c948f Upgrade tas-utility version to use latest TestNG. (#241) 2022-09-01 16:56:40 +01:00
Travis CI User
9ea1336a18 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-30 12:01:40 +00:00
10 changed files with 397 additions and 51 deletions

View File

@@ -4,7 +4,7 @@
<groupId>org.alfresco.tas</groupId>
<artifactId>restapi</artifactId>
<name>alfresco-tas-restapi</name>
<version>1.115</version>
<version>1.128</version>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-super-pom</artifactId>
@@ -28,10 +28,10 @@
<suiteXmlFile>src/main/resources/shared-resources/testCount.xml</suiteXmlFile>
<maven.build.sourceVersion>11</maven.build.sourceVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tas.utility.version>3.0.49</tas.utility.version>
<rest-assured.version>5.1.1</rest-assured.version>
<tas.utility.version>3.0.56</tas.utility.version>
<rest-assured.version>5.2.0</rest-assured.version>
<httpclient-osgi-version>4.5.6</httpclient-osgi-version>
<jackson-databind.version>2.13.3</jackson-databind.version>
<jackson-databind.version>2.13.4</jackson-databind.version>
<maven-release.version>2.5.3</maven-release.version>
<org.glassfish.version>1.1.4</org.glassfish.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
@@ -67,7 +67,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-tas-restapi</url>
<tag>v1.115</tag>
<tag>v1.128</tag>
</scm>
<issueManagement>
@@ -308,13 +308,6 @@
<version>${org.glassfish.version}</version>
</dependency>
<!-- needed for swagger parser bellow -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<!-- swagger parser -->
<dependency>
<groupId>io.swagger</groupId>
@@ -352,7 +345,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.2.0</version>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -362,7 +355,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<reportSets>
<reportSet>
<reports>

View File

@@ -178,7 +178,7 @@ public class RestRequest
.append(getHttpMethod())
.append(" ")
.append(RestAssured.baseURI)
.append("://")
.append(":")
.append(RestAssured.port)
.append("/")
.append(RestAssured.basePath)

View File

@@ -305,7 +305,19 @@ public class ModelAssertion<T>
public T contains(String value)
{
if (!fieldValue.toString().contains(value))
{
Assert.fail(errorMessage("does NOT contain expected value: " + value + ", Current Value: " + fieldValue.toString()));
}
return (T) model;
}
public T notContains(String value)
{
if (fieldValue.toString().contains(value))
{
Assert.fail(errorMessage("does contain unexpected value: " + value + ", Current Value: " + fieldValue.toString()));
}
return (T) model;
}

View File

@@ -4,34 +4,34 @@
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
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 'saspery' on '2022-09-28 06:54' from 'Alfresco Content Services REST API' swagger file
* Generated from 'Alfresco Content Services REST API' swagger file
* Base Path {@linkplain /alfresco/api}
*/
@@ -55,6 +55,8 @@ public class RestEntitlementsInfoModel extends TestModel implements IRestModel<R
private boolean isCryptodocEnabled;
private boolean isCustomEmbeddedWorkflowEnabled;
public int getMaxUsers()
{
return this.maxUsers;
@@ -94,5 +96,15 @@ public class RestEntitlementsInfoModel extends TestModel implements IRestModel<R
{
this.isCryptodocEnabled = isCryptodocEnabled;
}
public boolean getIsCustomEmbeddedWorkflowEnabled()
{
return this.isCustomEmbeddedWorkflowEnabled;
}
public void setIsCustomEmbeddedWorkflowEnabled(boolean isCustomEmbeddedWorkflowEnabled)
{
this.isCustomEmbeddedWorkflowEnabled = isCustomEmbeddedWorkflowEnabled;
}
}

View File

@@ -0,0 +1,106 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.List;
import java.util.Objects;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Generated by 'krystian' on '2022-09-28 11:33' 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 RestRuleExecutionBodyModel extends TestModel implements IRestModel<RestRuleExecutionBodyModel>
{
@JsonProperty(value = "entry")
RestRuleExecutionBodyModel model;
@Override
public RestRuleExecutionBodyModel onModel()
{
return model;
}
/**
Execute rules against the given folder and all sub-folders
*/
private boolean isEachSubFolderIncluded;
/**
Execute also inherited rules
*/
private boolean isEachInheritedRuleExecuted;
public boolean getIsEachSubFolderIncluded()
{
return this.isEachSubFolderIncluded;
}
public void setIsEachSubFolderIncluded(boolean isEachSubFolderIncluded)
{
this.isEachSubFolderIncluded = isEachSubFolderIncluded;
}
public boolean getIsEachInheritedRuleExecuted()
{
return this.isEachInheritedRuleExecuted;
}
public void setIsEachInheritedRuleExecuted(boolean isEachInheritedRuleExecuted)
{
this.isEachInheritedRuleExecuted = isEachInheritedRuleExecuted;
}
@Override
public String toString()
{
return "RestRuleExecutionBodyModel{" + "isEachSubFolderIncluded=" + isEachSubFolderIncluded + ", isEachInheritedRuleExecuted=" + isEachInheritedRuleExecuted + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestRuleExecutionBodyModel that = (RestRuleExecutionBodyModel) o;
return isEachSubFolderIncluded == that.isEachSubFolderIncluded && isEachInheritedRuleExecuted == that.isEachInheritedRuleExecuted;
}
@Override
public int hashCode()
{
return Objects.hash(isEachSubFolderIncluded, isEachInheritedRuleExecuted);
}
}

View File

@@ -0,0 +1,107 @@
/*-
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'krystian' on '2022-09-28 11:33' 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 RestRuleExecutionModel extends TestModel implements IRestModel<RestRuleExecutionModel>
{
@JsonProperty(value = "entry")
RestRuleExecutionModel model;
@Override
public RestRuleExecutionModel onModel()
{
return model;
}
/**
Whether the rules were executed also against sub-folders
*/
@JsonProperty(required = true)
private boolean isEachSubFolderIncluded;
/**
Whether the inherited rules were also executed
*/
@JsonProperty(required = true)
private boolean isEachInheritedRuleExecuted;
public boolean getIsEachSubFolderIncluded()
{
return this.isEachSubFolderIncluded;
}
public void setIsEachSubFolderIncluded(boolean isEachSubFolderIncluded)
{
this.isEachSubFolderIncluded = isEachSubFolderIncluded;
}
public boolean getIsEachInheritedRuleExecuted()
{
return this.isEachInheritedRuleExecuted;
}
public void setIsEachInheritedRuleExecuted(boolean isEachInheritedRuleExecuted)
{
this.isEachInheritedRuleExecuted = isEachInheritedRuleExecuted;
}
@Override
public String toString()
{
return "RestRuleExecutionModel{" + "isEachSubFolderIncluded=" + isEachSubFolderIncluded + ", isEachInheritedRuleExecuted=" + isEachInheritedRuleExecuted + '}';
}
@Override
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
RestRuleExecutionModel that = (RestRuleExecutionModel) o;
return isEachSubFolderIncluded == that.isEachSubFolderIncluded && isEachInheritedRuleExecuted == that.isEachInheritedRuleExecuted;
}
@Override
public int hashCode()
{
return Objects.hash(isEachSubFolderIncluded, isEachInheritedRuleExecuted);
}
}

View File

@@ -70,17 +70,17 @@ public class RestRuleModel extends TestModel implements IRestModel<RestRuleModel
Whether the rule is enabled
*/
private boolean enabled;
private boolean isEnabled;
/**
Whether the rule also applies to subfolders
*/
private boolean cascade;
private boolean isInheritable;
/**
Whether the rule should be run in the background
*/
private boolean asynchronous;
private boolean isAsynchronous;
/**
If the rule should be run in the background then an optional error script can be referenced
*/
@@ -146,34 +146,34 @@ If the field is omitted then the rule will apply to all nodes.
this.description = description;
}
public boolean getEnabled()
public boolean getIsEnabled()
{
return this.enabled;
return this.isEnabled;
}
public void setEnabled(boolean enabled)
public void setIsEnabled(boolean isEnabled)
{
this.enabled = enabled;
this.isEnabled = isEnabled;
}
public boolean getCascade()
public boolean getIsInheritable()
{
return this.cascade;
return this.isInheritable;
}
public void setCascade(boolean cascade)
public void setIsInheritable(boolean isInheritable)
{
this.cascade = cascade;
this.isInheritable = isInheritable;
}
public boolean getAsynchronous()
public boolean getIsAsynchronous()
{
return this.asynchronous;
return this.isAsynchronous;
}
public void setAsynchronous(boolean asynchronous)
public void setIsAsynchronous(boolean isAsynchronous)
{
this.asynchronous = asynchronous;
this.isAsynchronous = isAsynchronous;
}
public String getErrorScript()
@@ -229,8 +229,8 @@ If the field is omitted then the rule will apply to all nodes.
@Override
public String toString()
{
return "RestRuleModel{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", enabled=" + enabled + ", cascade=" + cascade
+ ", asynchronous=" + asynchronous + ", errorScript='" + errorScript + '\'' + ", isShared=" + isShared + ", triggers=" + triggers + ", conditions=" + conditions
return "RestRuleModel{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", isEnabled=" + isEnabled + ", isInheritable=" + isInheritable
+ ", isAsynchronous=" + isAsynchronous + ", errorScript='" + errorScript + '\'' + ", isShared=" + isShared + ", triggers=" + triggers + ", conditions=" + conditions
+ ", actions=" + actions + '}';
}
@@ -242,7 +242,7 @@ If the field is omitted then the rule will apply to all nodes.
if (o == null || getClass() != o.getClass())
return false;
RestRuleModel ruleModel = (RestRuleModel) o;
return enabled == ruleModel.enabled && cascade == ruleModel.cascade && asynchronous == ruleModel.asynchronous && Objects.equals(id, ruleModel.id) && Objects.equals(
return isEnabled == ruleModel.isEnabled && isInheritable == ruleModel.isInheritable && isAsynchronous == ruleModel.isAsynchronous && Objects.equals(id, ruleModel.id) && Objects.equals(
name, ruleModel.name) && Objects.equals(description, ruleModel.description) && Objects.equals(errorScript, ruleModel.errorScript) && Objects.equals(
isShared, ruleModel.isShared) && Objects.equals(triggers, ruleModel.triggers) && Objects.equals(conditions, ruleModel.conditions) && Objects.equals(
actions, ruleModel.actions);
@@ -251,7 +251,7 @@ If the field is omitted then the rule will apply to all nodes.
@Override
public int hashCode()
{
return Objects.hash(id, name, description, enabled, cascade, asynchronous, errorScript, isShared, triggers, conditions, actions);
return Objects.hash(id, name, description, isEnabled, isInheritable, isAsynchronous, errorScript, isShared, triggers, conditions, actions);
}
}

View File

@@ -25,6 +25,7 @@
*/
package org.alfresco.rest.model;
import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -57,6 +58,16 @@ public class RestRuleSetModel extends TestModel implements IRestModel<RestRuleSe
private String owningFolder;
/** The reason why the rule set is included for the folder. */
private String inclusionType;
/** A list of node ids for folders that inherit this rule set. */
private List<String> inheritedBy;
/** A list of node ids for folders that link to this rule set. */
private List<String> linkedToBy;
/** Whether any folders inherit this rule set. */
private Boolean isInherited;
/** Whether any folders link to this rule set. */
private Boolean isLinkedTo;
/** Ordered list of ids for the rules in this rule set. */
private List<String> ruleIds;
public String getId()
{
@@ -88,19 +99,83 @@ public class RestRuleSetModel extends TestModel implements IRestModel<RestRuleSe
this.inclusionType = inclusionType;
}
public List<String> getInheritedBy()
{
return inheritedBy;
}
public void setInheritedBy(List<String> inheritedBy)
{
this.inheritedBy = inheritedBy;
}
public List<String> getLinkedToBy()
{
return linkedToBy;
}
public void setLinkedToBy(List<String> linkedToBy)
{
this.linkedToBy = linkedToBy;
}
public Boolean getIsInherited()
{
return isInherited;
}
public void setIsInherited(Boolean isInherited)
{
this.isInherited = isInherited;
}
public Boolean getIsLinkedTo()
{
return isLinkedTo;
}
public void setIsLinkedTo(Boolean isLinkedTo)
{
this.isLinkedTo = isLinkedTo;
}
public List<String> getRuleIds()
{
return ruleIds;
}
public void setRuleIds(List<String> ruleIds)
{
this.ruleIds = ruleIds;
}
@Override
public String toString()
{
return "RestRuleSetModel{id='" + id + "', owningFolder='" + owningFolder + "', inclusionType='" + inclusionType
+ "', inheritedBy=" + inheritedBy + ", linkedToBy=" + linkedToBy + ", isInherited=" + isInherited
+ ", isLinkedTo=" + isLinkedTo + ", ruleIds=" + ruleIds + "}";
}
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RestRuleSetModel that = (RestRuleSetModel) o;
return Objects.equals(id, that.id) && Objects.equals(owningFolder, that.owningFolder) &&
Objects.equals(inclusionType, that.inclusionType);
return Objects.equals(id, that.id)
&& Objects.equals(owningFolder, that.owningFolder)
&& Objects.equals(inclusionType, that.inclusionType)
&& Objects.equals(inheritedBy, that.inheritedBy)
&& Objects.equals(linkedToBy, that.linkedToBy)
&& Objects.equals(isInherited, that.isInherited)
&& Objects.equals(isLinkedTo, that.isLinkedTo)
&& Objects.equals(ruleIds, that.ruleIds);
}
@Override
public int hashCode()
{
return Objects.hash(id, owningFolder, inclusionType);
return Objects.hash(id, owningFolder, inclusionType, inheritedBy, linkedToBy, isInherited, isLinkedTo, ruleIds);
}
}

View File

@@ -27,9 +27,11 @@
package org.alfresco.rest.requests;
import static org.alfresco.rest.requests.RuleSettings.IS_INHERITANCE_ENABLED;
import static org.springframework.http.HttpMethod.PUT;
import javax.json.JsonArrayBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import io.restassured.http.ContentType;
@@ -53,6 +55,8 @@ import org.alfresco.rest.model.RestRatingModel;
import org.alfresco.rest.model.RestRatingModelsCollection;
import org.alfresco.rest.model.RestRenditionInfoModel;
import org.alfresco.rest.model.RestRenditionInfoModelCollection;
import org.alfresco.rest.model.RestRuleExecutionBodyModel;
import org.alfresco.rest.model.RestRuleExecutionModel;
import org.alfresco.rest.model.RestRuleSetLinkModel;
import org.alfresco.rest.model.RestRuleSetModel;
import org.alfresco.rest.model.RestRuleSetModelsCollection;
@@ -162,7 +166,7 @@ public class Node extends ModelRequest<Node>
public RestCommentModel updateComment(RestCommentModel commentModel, String commentContent)
{
String postBody = JsonBodyGenerator.keyValueJson("content", commentContent);
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, postBody, "nodes/{nodeId}/comments/{commentId}?{parameters}", repoModel.getNodeRef(), commentModel.getId(), restWrapper.getParameters());
RestRequest request = RestRequest.requestWithBody(PUT, postBody, "nodes/{nodeId}/comments/{commentId}?{parameters}", repoModel.getNodeRef(), commentModel.getId(), restWrapper.getParameters());
request.setContentType("UTF-8");
RestCommentModel response = restWrapper.processModel(RestCommentModel.class, request);
return response;
@@ -706,7 +710,7 @@ public class Node extends ModelRequest<Node>
*/
public RestNodeModel updateNode(String putBody)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, putBody, "nodes/{nodeId}?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
RestRequest request = RestRequest.requestWithBody(PUT, putBody, "nodes/{nodeId}?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
request.setContentType("UTF-8");
return restWrapper.processModel(RestNodeModel.class, request);
}
@@ -769,8 +773,8 @@ public class Node extends ModelRequest<Node>
try
{
restWrapper.usingContentType(ContentType.BINARY);
String body = Files.readFile(nodeContent);
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, body, "nodes/{nodeId}/content?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
String body = Files.readFile(new FileInputStream(nodeContent));
RestRequest request = RestRequest.requestWithBody(PUT, body, "nodes/{nodeId}/content?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters());
request.setContentType("UTF-8");
restWrapper.usingContentType(ContentType.JSON);
return restWrapper.processModel(RestNodeModel.class, request);
@@ -1037,6 +1041,19 @@ public class Node extends ModelRequest<Node>
return restWrapper.processModel(RestRuleSetModel.class, request);
}
/**
* Update a rule set on this folder - for example to reorder the rules.
*
* @param ruleSet The updated rule set.
* @return The updated rule set returned by the server.
*/
public RestRuleSetModel updateRuleSet(RestRuleSetModel ruleSet)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, ruleSet.toJson(), RULE_SET_BY_ID,
repoModel.getNodeRef(), ruleSet.getId());
return restWrapper.processModel(RestRuleSetModel.class, request);
}
/**
* Get the default rule set from a folder.
*
@@ -1066,4 +1083,28 @@ public class Node extends ModelRequest<Node>
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, body.toJson(), "nodes/{nodeId}/rule-set-links", repoModel.getNodeRef());
return restWrapper.processModel(RestRuleSetLinkModel.class, request);
}
/**
* Try to delete a ruleset link performing a DELETE call on "/nodes/{folderNodeId}/rule-set-links/{rulesetId}"
*
* @param ruleSetId the id of the ruleset to be unlinked from the folder
* @return
*/
public void unlinkRuleSet(String ruleSetId)
{
RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/rule-set-links/{ruleSetId}", repoModel.getNodeRef(), ruleSetId);
restWrapper.processEmptyModel(request);
}
/**
* Trigger rules on a folder performing POST call on "/nodes/{folderNodeId}/rule-executions"
*
* @param body - rules execution request
* @return execution result
*/
public RestRuleExecutionModel executeRules(RestRuleExecutionBodyModel body)
{
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, body.toJson(), "nodes/{nodeId}/rule-executions", repoModel.getNodeRef());
return restWrapper.processModel(RestRuleExecutionModel.class, request);
}
}

View File

@@ -121,7 +121,7 @@ public class RestRequestTest
RestRequest restRequest = requestWithBody(GET, "BODY", "nodes/{nodeId}", "nodeId", "key1=value1", "key2=value2");
String expected = "Request: GET BASE://1234/BASE_PATH/nodes/nodeId?key1=value1&key2=value2\nbody:BODY\n";
String expected = "Request: GET BASE:1234/BASE_PATH/nodes/nodeId?key1=value1&key2=value2\nbody:BODY\n";
assertEquals(restRequest.toString(), expected, "Unexpected toString representation");
RestAssured.reset();