RM-3386 Merge commit '48a65f5' into merge-2.4/RM-2526_BlendedDispositionSchedules.

This commit is contained in:
Tom Page
2016-10-21 11:03:36 +01:00
5 changed files with 19 additions and 2 deletions

View File

@@ -389,6 +389,11 @@
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="rma:manuallySetAsOf">
<title>Manually Set Disposition Date Flag</title>
<type>d:boolean</type>
<default>false</default>
</property>
<property name="rma:dispositionEventsEligible">
<title>Disposition Events Eligible</title>
<type>d:boolean</type>

View File

@@ -27,6 +27,8 @@
package org.alfresco.module.org_alfresco_module_rm.action.impl;
import static org.apache.commons.lang3.BooleanUtils.isNotTrue;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
@@ -194,7 +196,8 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
{
// the change does effect the nextAction for this node
// so go ahead and determine what needs updating
if (changedProps.contains(PROP_DISPOSITION_PERIOD))
if (changedProps.contains(PROP_DISPOSITION_PERIOD)
&& isNotTrue((Boolean) getNodeService().getProperty(nextAction.getNodeRef(), PROP_MANUALLY_SET_AS_OF)))
{
persistPeriodChanges(dispositionActionDef, nextAction);
}

View File

@@ -74,6 +74,7 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
if (da != null)
{
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_AS_OF, asOfDate);
getNodeService().setProperty(da.getNodeRef(), PROP_MANUALLY_SET_AS_OF, true);
}
}
else

View File

@@ -27,6 +27,8 @@
package org.alfresco.module.org_alfresco_module_rm.disposition.property;
import static org.apache.commons.lang3.BooleanUtils.isNotTrue;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
@@ -220,7 +222,11 @@ public class DispositionProperty extends BaseBehaviourBean
// update asOf date on the disposition action based on the new property value
NodeRef daNodeRef = dispositionAction.getNodeRef();
nodeService.setProperty(daNodeRef, PROP_DISPOSITION_AS_OF, updatedAsOf);
// Don't overwrite a manually set "disposition as of" date.
if (isNotTrue((Boolean) nodeService.getProperty(daNodeRef, PROP_MANUALLY_SET_AS_OF)))
{
nodeService.setProperty(daNodeRef, PROP_DISPOSITION_AS_OF, updatedAsOf);
}
}
}
}

View File

@@ -158,6 +158,8 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
QName PROP_DISPOSITION_ACTION_ID = QName.createQName(RM_URI, "dispositionActionId");
QName PROP_DISPOSITION_ACTION = QName.createQName(RM_URI, "dispositionAction");
QName PROP_DISPOSITION_AS_OF = QName.createQName(RM_URI, "dispositionAsOf");
/** A flag indicating that the "disposition as of" date has been manually set and shouldn't be changed. */
QName PROP_MANUALLY_SET_AS_OF = QName.createQName(RM_URI, "manuallySetAsOf");
QName PROP_DISPOSITION_EVENTS_ELIGIBLE = QName.createQName(RM_URI, "dispositionEventsEligible");
QName PROP_DISPOSITION_ACTION_STARTED_AT = QName.createQName(RM_URI, "dispositionActionStartedAt");
QName PROP_DISPOSITION_ACTION_STARTED_BY = QName.createQName(RM_URI, "dispositionActionStartedBy");