Merge feature-2.3/RM-3386_ManuallySetDate into release/V2.3.

This commit is contained in:
Tom Page
2016-10-20 15:20:00 +01:00
5 changed files with 19 additions and 2 deletions

View File

@@ -18,6 +18,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;
@@ -185,7 +187,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

@@ -65,6 +65,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

@@ -18,6 +18,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;
@@ -211,7 +213,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

@@ -149,6 +149,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");