mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature/RM-6302_EditDispositionSchedule' into 'release/V2.7'
merging edit disposition schedule to 2.7 See merge request records-management/records-management!997
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -4,7 +4,7 @@
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
<name>Alfresco Records Management</name>
|
||||
|
||||
<parent>
|
||||
@@ -24,7 +24,7 @@
|
||||
<connection>scm:git:https://git.alfresco.com/records-management/records-management.git</connection>
|
||||
<developerConnection>scm:git:https://git.alfresco.com/records-management/records-management.git</developerConnection>
|
||||
<url>https://git.alfresco.com/records-management/records-management</url>
|
||||
<tag>V2.7.0</tag>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm</artifactId>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<licenses>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-automation</artifactId>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm</artifactId>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<licenses>
|
||||
|
@@ -70,6 +70,11 @@
|
||||
"eventType" : "rmEventType.simple",
|
||||
"eventName" : "case_complete",
|
||||
"eventDisplayLabel" : "rmevent.case_complete"
|
||||
},
|
||||
{
|
||||
"eventType": "rmEventType.simple",
|
||||
"eventName": "declassification_review",
|
||||
"eventDisplayLabel": "rmevent.declassification_review"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -242,6 +242,12 @@
|
||||
</index>
|
||||
</property>
|
||||
|
||||
<property name="rma:combineDispositionStepConditions">
|
||||
<title>Disposition Evaluator Combination</title>
|
||||
<type>d:boolean</type>
|
||||
<mandatory>false</mandatory>
|
||||
</property>
|
||||
|
||||
</properties>
|
||||
<mandatory-aspects>
|
||||
<aspect>rma:filePlanComponent</aspect>
|
||||
|
@@ -20,6 +20,7 @@
|
||||
<property name="policyComponent" ref="policyComponent" />
|
||||
<property name="jsonConversionComponentCache" ref="jsonConversionComponentCache" />
|
||||
<property name="mimetypeService" ref="MimetypeService" />
|
||||
<property name="dispositionService" ref="dispositionService" />
|
||||
</bean>
|
||||
|
||||
<!-- extends core bean with RM extensions -->
|
||||
|
@@ -37,6 +37,7 @@
|
||||
<#if action.period??>"period": "${action.period}",</#if>
|
||||
<#if action.periodProperty??>"periodProperty": "${action.periodProperty}",</#if>
|
||||
<#if action.location??>"location": "${action.location}",</#if>
|
||||
<#if action.combineDispositionStepConditions??>"combineDispositionStepConditions": "${action.combineDispositionStepConditions?string}",</#if>
|
||||
<#if action.events??>"events": [<#list action.events as event>"${event}"<#if event_has_next>,</#if></#list>],</#if>
|
||||
"eligibleOnFirstCompleteEvent": ${action.eligibleOnFirstCompleteEvent?string}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-community</artifactId>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -28,6 +28,8 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.jscript.app;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel.READ_RECORDS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_RS_DISPOSITION_EVENTS;
|
||||
import static org.alfresco.service.cmr.security.AccessStatus.ALLOWED;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -38,6 +40,9 @@ import java.util.Map;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
@@ -99,6 +104,11 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
||||
/** site service */
|
||||
private SiteService siteService;
|
||||
|
||||
/**
|
||||
* Disposition service
|
||||
*/
|
||||
private DispositionService dispositionService;
|
||||
|
||||
/** Indicators */
|
||||
private List<BaseEvaluator> indicators = new ArrayList<BaseEvaluator>();
|
||||
|
||||
@@ -230,6 +240,14 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
||||
this.jsonConversionComponentCache = jsonConversionComponentCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dispositionService the disposition service
|
||||
*/
|
||||
public void setDispositionService(DispositionService dispositionService)
|
||||
{
|
||||
this.dispositionService = dispositionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialise method
|
||||
*/
|
||||
@@ -456,6 +474,22 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
||||
// Set the actions array
|
||||
setActions(rmNodeValues, nodeRef);
|
||||
|
||||
|
||||
//Add details of the next incomplete event in the disposition schedule
|
||||
if(dispositionService.getNextDispositionAction(nodeRef) != null)
|
||||
{
|
||||
for(EventCompletionDetails details: dispositionService.getNextDispositionAction(nodeRef).getEventCompletionDetails())
|
||||
{
|
||||
if(!details.isEventComplete())
|
||||
{
|
||||
HashMap properties = ((HashMap) rmNodeValues.get("properties"));
|
||||
properties.put("combineDispositionStepConditions", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||
properties.put("incompleteDispositionEvent", details.getEventName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rmNodeValues;
|
||||
}
|
||||
|
||||
|
@@ -99,6 +99,7 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
QName PROP_DISPOSITION_PERIOD_PROPERTY = QName.createQName(RM_URI, "dispositionPeriodProperty");
|
||||
QName PROP_DISPOSITION_EVENT = QName.createQName(RM_URI, "dispositionEvent");
|
||||
QName PROP_DISPOSITION_EVENT_COMBINATION = QName.createQName(RM_URI, "dispositionEventCombination");
|
||||
QName PROP_COMBINE_DISPOSITION_STEP_CONDITIONS = QName.createQName(RM_URI, "combineDispositionStepConditions");
|
||||
QName PROP_DISPOSITION_LOCATION = QName.createQName(RM_URI, "dispositionLocation");
|
||||
QName PROP_DISPOSITION_ACTION_GHOST_ON_DESTROY = QName.createQName(RM_URI, "dispositionActionGhostOnDestroy");
|
||||
|
||||
|
@@ -27,6 +27,8 @@
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.script;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -49,6 +51,8 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
*/
|
||||
public class DispositionAbstractBase extends AbstractRmWebScript
|
||||
{
|
||||
|
||||
public final static String COMBINE_DISPOSITION_STEP_CONDITIONS = "combineDispositionStepConditions";
|
||||
/**
|
||||
* Parses the request and providing it's valid returns the DispositionSchedule object.
|
||||
*
|
||||
@@ -165,6 +169,11 @@ public class DispositionAbstractBase extends AbstractRmWebScript
|
||||
model.put("events", eventNames);
|
||||
}
|
||||
|
||||
if(getNodeService().getProperty(actionDef.getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS) != null)
|
||||
{
|
||||
model.put("combineDispositionStepConditions", getNodeService().getProperty(actionDef.getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
@@ -133,6 +133,12 @@ public class DispositionActionDefinitionPost extends DispositionAbstractBase
|
||||
json.getBoolean("eligibleOnFirstCompleteEvent") ? "or" : "and");
|
||||
}
|
||||
|
||||
if (json.has(COMBINE_DISPOSITION_STEP_CONDITIONS))
|
||||
{
|
||||
props.put(RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS,
|
||||
json.getBoolean(COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||
}
|
||||
|
||||
if (json.has("location"))
|
||||
{
|
||||
props.put(RecordsManagementModel.PROP_DISPOSITION_LOCATION,
|
||||
|
@@ -96,7 +96,6 @@ public class DispositionActionDefinitionPut extends DispositionAbstractBase
|
||||
*
|
||||
* @param actionDef The action definition to update
|
||||
* @param json The JSON to use to create the action definition
|
||||
* @param schedule The DispositionSchedule the action definition belongs to
|
||||
* @return The updated DispositionActionDefinition
|
||||
*/
|
||||
protected DispositionActionDefinition updateActionDefinition(DispositionActionDefinition actionDef,
|
||||
@@ -132,6 +131,12 @@ public class DispositionActionDefinitionPut extends DispositionAbstractBase
|
||||
json.getBoolean("eligibleOnFirstCompleteEvent") ? "or" : "and");
|
||||
}
|
||||
|
||||
if (json.has(COMBINE_DISPOSITION_STEP_CONDITIONS))
|
||||
{
|
||||
props.put(RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS,
|
||||
json.getBoolean(COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||
}
|
||||
|
||||
if (json.has("location"))
|
||||
{
|
||||
props.put(RecordsManagementModel.PROP_DISPOSITION_LOCATION,
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-rm-community</artifactId>
|
||||
<version>2.7.1-SNAPSHOT</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
Reference in New Issue
Block a user