Merge remote-tracking branch 'remotes/origin/release/V2.6' into merge-2.7/MNT_20145_RM_6758_ChangesFrom2_6

This commit is contained in:
Rodica Sutu
2019-02-25 09:19:23 +02:00
9 changed files with 459 additions and 56 deletions

View File

@@ -30,7 +30,6 @@ package org.alfresco.rest.v0.service;
import java.util.HashMap;
import org.alfresco.rest.core.v0.BaseAPI;
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
import org.alfresco.rest.v0.RecordCategoriesAPI;
import org.alfresco.utility.data.DataUser;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,16 +55,15 @@ public class DispositionScheduleService extends BaseAPI
*
* @param categoryName the category in whose schedule the step will be added
* @param period
* @return
*/
public void addRetainAfterPeriodStep(String categoryName, String period)
{
HashMap<RETENTION_SCHEDULE, String> cutOffStep = new HashMap<>();
cutOffStep.put(RETENTION_SCHEDULE.NAME, "retain");
cutOffStep.put(RETENTION_SCHEDULE.RETENTION_PERIOD, period);
cutOffStep.put(RETENTION_SCHEDULE.DESCRIPTION, "Retain after a period step");
HashMap<RETENTION_SCHEDULE, String> retainStep = new HashMap<>();
retainStep.put(RETENTION_SCHEDULE.NAME, "retain");
retainStep.put(RETENTION_SCHEDULE.RETENTION_PERIOD, period);
retainStep.put(RETENTION_SCHEDULE.DESCRIPTION, "Retain after a period step");
recordCategoriesAPI.addDispositionScheduleSteps(dataUser.getAdminUser().getUsername(),
dataUser.getAdminUser().getPassword(), categoryName, cutOffStep);
dataUser.getAdminUser().getPassword(), categoryName, retainStep);
}
/**
@@ -73,7 +71,6 @@ public class DispositionScheduleService extends BaseAPI
*
* @param categoryName the category in whose schedule the step will be added
* @param period
* @return
*/
public void addCutOffAfterPeriodStep(String categoryName, String period)
{
@@ -85,6 +82,23 @@ public class DispositionScheduleService extends BaseAPI
dataUser.getAdminUser().getPassword(), categoryName, cutOffStep);
}
/**
* Helper method for adding a destroy with ghosting after period
*
* @param categoryName the category in whose schedule the step will be added
* @param period
*/
public void addDestroyWithGhostingAfterPeriodStep(String categoryName, String period)
{
HashMap<RETENTION_SCHEDULE, String> destroyStep = new HashMap<>();
destroyStep.put(RETENTION_SCHEDULE.NAME, "destroy");
destroyStep.put(RETENTION_SCHEDULE.RETENTION_PERIOD, period);
destroyStep.put(RETENTION_SCHEDULE.DESCRIPTION, "Destroy after a period step");
destroyStep.put(RETENTION_SCHEDULE.RETENTION_GHOST, "on");
recordCategoriesAPI.addDispositionScheduleSteps(dataUser.getAdminUser().getUsername(),
dataUser.getAdminUser().getPassword(), categoryName, destroyStep);
}
/**
* Helper method for adding a cut off after an event occurs step
*