mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
44 Commits
tas-restap
...
tas-restap
Author | SHA1 | Date | |
---|---|---|---|
|
3a8fde44ec | ||
|
646bbe3436 | ||
|
7c706dbac6 | ||
|
2ab4c70217 | ||
|
ed0bbf576d | ||
|
f3e43badfe | ||
|
e99b6a98de | ||
|
64644505b3 | ||
|
aca9e15668 | ||
|
1852309798 | ||
|
ee2e248e39 | ||
|
b2f90ff6bc | ||
|
59641e833e | ||
|
6dd7d32b2e | ||
|
83bf4d0a2f | ||
|
1af9f31b68 | ||
|
2b98e73468 | ||
|
966dd7d144 | ||
|
375c68f932 | ||
|
8ce6117a95 | ||
|
08e393c39f | ||
|
2f4303f4eb | ||
|
953a1cc3f9 | ||
|
23a1ddca6a | ||
|
439dd3771f | ||
|
df7ebe30b3 | ||
|
c482153183 | ||
|
cdbd153151 | ||
|
8564f9eace | ||
|
b5d7500ecc | ||
|
e875e1fbbe | ||
|
32179dc810 | ||
|
97ed056103 | ||
|
af97fd5d6a | ||
|
cef6e8fc7b | ||
|
31d0578a98 | ||
|
2e1ae3bb69 | ||
|
9af05df046 | ||
|
71801e9e5e | ||
|
52149bf292 | ||
|
6cb07e1b86 | ||
|
fa3df0987d | ||
|
fde20c948f | ||
|
9ea1336a18 |
@@ -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>
|
||||
|
@@ -178,7 +178,7 @@ public class RestRequest
|
||||
.append(getHttpMethod())
|
||||
.append(" ")
|
||||
.append(RestAssured.baseURI)
|
||||
.append("://")
|
||||
.append(":")
|
||||
.append(RestAssured.port)
|
||||
.append("/")
|
||||
.append(RestAssured.basePath)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user