mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge remote-tracking branch 'origin/release/V2.5' into merge/Merge25RulesTestsApiFixes
# Conflicts: # rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/community/level2/rules/CopyToRuleOnFolders.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/community/level2/rules/FileToRuleAppliedOnUnfiledRecords.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/community/level2/rules/LinkToRuleOnFolders.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/community/level2/rules/MoveToRuleOnFolders.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/community/level2/rules/SetPropertyValueCollSiteAndFilePlan.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/enterprise/level2/rules/FileToRuleAppliedOnClassifiedUnfiledRecords.java # rm-automation/rm-automation-ui/src/test/java/org/alfresco/test/enterprise/level2/rules/RulesAppliedOnWholeFilePlanClassifiedContent.java # rm-automation/rm-automation-ui/src/test/resources/level2Tests.xml # rm-automation/src/test/java/org/alfresco/dataprep/RecordsManagementService.java
This commit is contained in:
@@ -74,8 +74,6 @@ public abstract class BaseAPI
|
|||||||
|
|
||||||
/** exception key in JSON response body */
|
/** exception key in JSON response body */
|
||||||
private static final String EXCEPTION_KEY = "exception";
|
private static final String EXCEPTION_KEY = "exception";
|
||||||
protected static final String FILE_PLAN_PATH = "Sites/rm/documentLibrary";
|
|
||||||
protected static final String NODE_REF_WORKSPACE_SPACES_STORE = "workspace://SpacesStore/";
|
|
||||||
protected static final String NODE_PREFIX = "workspace/SpacesStore/";
|
protected static final String NODE_PREFIX = "workspace/SpacesStore/";
|
||||||
protected static final String UPDATE_METADATA_API = "{0}node/{1}/formprocessor";
|
protected static final String UPDATE_METADATA_API = "{0}node/{1}/formprocessor";
|
||||||
protected static final String ACTIONS_API = "{0}actionQueue";
|
protected static final String ACTIONS_API = "{0}actionQueue";
|
||||||
@@ -85,10 +83,12 @@ public abstract class BaseAPI
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AlfrescoHttpClientFactory alfrescoHttpClientFactory;
|
private AlfrescoHttpClientFactory alfrescoHttpClientFactory;
|
||||||
|
@Autowired
|
||||||
@Autowired
|
|
||||||
private ContentService contentService;
|
private ContentService contentService;
|
||||||
|
|
||||||
|
private static final String NODE_REF_WORKSPACE_SPACES_STORE = "workspace://SpacesStore/";
|
||||||
|
private static final String FILE_PLAN_PATH = "Sites/rm/documentLibrary";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to extract list of properties values from result.
|
* Helper method to extract list of properties values from result.
|
||||||
*
|
*
|
||||||
@@ -615,4 +615,24 @@ public abstract class BaseAPI
|
|||||||
}
|
}
|
||||||
return getObjectByPath(username, password, itemPath) == null;
|
return getObjectByPath(username, password, itemPath) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the node ref spaces store value
|
||||||
|
*
|
||||||
|
* @return node ref spaces store
|
||||||
|
*/
|
||||||
|
public static String getNodeRefSpacesStore()
|
||||||
|
{
|
||||||
|
return NODE_REF_WORKSPACE_SPACES_STORE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the File Plan path
|
||||||
|
*
|
||||||
|
* @return the File Plan path
|
||||||
|
*/
|
||||||
|
public static String getFilePlanPath()
|
||||||
|
{
|
||||||
|
return FILE_PLAN_PATH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -155,7 +155,7 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean moveTo(String user, String password, String contentPath, String destinationPath)
|
public boolean moveTo(String user, String password, String contentPath, String destinationPath)
|
||||||
{
|
{
|
||||||
String contentNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + getItemNodeRef(user, password, contentPath);
|
String contentNodeRef = getNodeRefSpacesStore() + getItemNodeRef(user, password, contentPath);
|
||||||
AlfrescoHttpClient client = alfrescoHttpClientFactory.getObject();
|
AlfrescoHttpClient client = alfrescoHttpClientFactory.getObject();
|
||||||
String url = MessageFormat.format(client.getAlfrescoUrl() + "alfresco/s/slingshot/doclib/" + MOVE_ACTIONS_API, destinationPath);
|
String url = MessageFormat.format(client.getAlfrescoUrl() + "alfresco/s/slingshot/doclib/" + MOVE_ACTIONS_API, destinationPath);
|
||||||
HttpPost request = new HttpPost(url);
|
HttpPost request = new HttpPost(url);
|
||||||
@@ -224,7 +224,7 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean executeAction(String user, String password, String contentName, RM_ACTIONS action, ZonedDateTime date)
|
public boolean executeAction(String user, String password, String contentName, RM_ACTIONS action, ZonedDateTime date)
|
||||||
{
|
{
|
||||||
String recNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + contentService.getNodeRef(user, password, RM_SITE_ID, contentName);
|
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, contentName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
JSONObject requestParams = new JSONObject();
|
JSONObject requestParams = new JSONObject();
|
||||||
@@ -293,7 +293,7 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
|||||||
public boolean createHold(String user, String password, String holdName, String reason, String description)
|
public boolean createHold(String user, String password, String holdName, String reason, String description)
|
||||||
{
|
{
|
||||||
// if the hold already exists don't try to create it again
|
// if the hold already exists don't try to create it again
|
||||||
String holdsContainerPath = FILE_PLAN_PATH + "/Holds";
|
String holdsContainerPath = getFilePlanPath() + "/Holds";
|
||||||
|
|
||||||
CmisObject hold = getObjectByPath(user, password, holdsContainerPath + "/" + holdName);
|
CmisObject hold = getObjectByPath(user, password, holdsContainerPath + "/" + holdName);
|
||||||
if (hold != null)
|
if (hold != null)
|
||||||
@@ -306,7 +306,7 @@ public class RMRolesAndActionsAPI extends BaseAPI
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
JSONObject requestParams = new JSONObject();
|
JSONObject requestParams = new JSONObject();
|
||||||
requestParams.put("alf_destination", NODE_REF_WORKSPACE_SPACES_STORE + parentNodeRef);
|
requestParams.put("alf_destination", getNodeRefSpacesStore() + parentNodeRef);
|
||||||
requestParams.put("prop_cm_name", holdName);
|
requestParams.put("prop_cm_name", holdName);
|
||||||
requestParams.put("prop_cm_description", description);
|
requestParams.put("prop_cm_description", description);
|
||||||
requestParams.put("prop_rma_holdReason", reason);
|
requestParams.put("prop_rma_holdReason", reason);
|
||||||
|
@@ -60,7 +60,7 @@ public class RecordCategoriesAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean createRetentionSchedule(String user, String password, String categoryName)
|
public boolean createRetentionSchedule(String user, String password, String categoryName)
|
||||||
{
|
{
|
||||||
String catNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + getItemNodeRef(user, password, "/" + categoryName);
|
String catNodeRef = getNodeRefSpacesStore() + getItemNodeRef(user, password, "/" + categoryName);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@@ -59,7 +59,7 @@ public class RecordFoldersAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean closeRecordFolder(String user, String password, String recordFolder)
|
public boolean closeRecordFolder(String user, String password, String recordFolder)
|
||||||
{
|
{
|
||||||
String recNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + contentService.getNodeRef(user, password, RM_SITE_ID, recordFolder);
|
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, recordFolder);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@@ -55,12 +55,9 @@ public class RecordsAPI extends BaseAPI
|
|||||||
|
|
||||||
private static final String CREATE_NON_ELECTRONIC_RECORD_API = "{0}type/rma:nonElectronicDocument/formprocessor";
|
private static final String CREATE_NON_ELECTRONIC_RECORD_API = "{0}type/rma:nonElectronicDocument/formprocessor";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ContentService contentService;
|
private ContentService contentService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare documents as records
|
* Declare documents as records
|
||||||
*
|
*
|
||||||
@@ -72,7 +69,7 @@ public class RecordsAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean declareDocumentAsRecord(String user, String password, String siteID, String documentName)
|
public boolean declareDocumentAsRecord(String user, String password, String siteID, String documentName)
|
||||||
{
|
{
|
||||||
String docNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + contentService.getNodeRef(user, password, siteID, documentName);
|
String docNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, siteID, documentName);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -99,7 +96,7 @@ public class RecordsAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean completeRecord(String user, String password, String recordName)
|
public boolean completeRecord(String user, String password, String recordName)
|
||||||
{
|
{
|
||||||
String recNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + contentService.getNodeRef(user, password, RM_SITE_ID, recordName);
|
String recNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, RM_SITE_ID, recordName);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -128,7 +125,7 @@ public class RecordsAPI extends BaseAPI
|
|||||||
*/
|
*/
|
||||||
public boolean declareDocumentVersionAsRecord(String user, String password, String siteID, String documentName)
|
public boolean declareDocumentVersionAsRecord(String user, String password, String siteID, String documentName)
|
||||||
{
|
{
|
||||||
String docNodeRef = NODE_REF_WORKSPACE_SPACES_STORE + contentService.getNodeRef(user, password, siteID, documentName);
|
String docNodeRef = getNodeRefSpacesStore() + contentService.getNodeRef(user, password, siteID, documentName);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -171,7 +168,7 @@ public class RecordsAPI extends BaseAPI
|
|||||||
recordPath = recordPath + "/" + folderName;
|
recordPath = recordPath + "/" + folderName;
|
||||||
}
|
}
|
||||||
// if the record already exists don't try to create it again
|
// if the record already exists don't try to create it again
|
||||||
CmisObject record = getObjectByPath(username, password, FILE_PLAN_PATH + recordPath + "/" + recordName);
|
CmisObject record = getObjectByPath(username, password, getFilePlanPath() + recordPath + "/" + recordName);
|
||||||
|
|
||||||
if (record != null)
|
if (record != null)
|
||||||
{
|
{
|
||||||
@@ -193,7 +190,7 @@ public class RecordsAPI extends BaseAPI
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
JSONObject requestParams = new JSONObject();
|
JSONObject requestParams = new JSONObject();
|
||||||
requestParams.put("alf_destination", NODE_REF_WORKSPACE_SPACES_STORE + parentNodeRef);
|
requestParams.put("alf_destination", getNodeRefSpacesStore() + parentNodeRef);
|
||||||
requestParams.put("prop_cm_name", recordName);
|
requestParams.put("prop_cm_name", recordName);
|
||||||
requestParams.put("prop_cm_title", recordTitle);
|
requestParams.put("prop_cm_title", recordTitle);
|
||||||
requestParams.put("prop_cm_description", description);
|
requestParams.put("prop_cm_description", description);
|
||||||
|
Reference in New Issue
Block a user