Merge remote-tracking branch 'remotes/origin/release/V2.7.0.x' into release/V2.7

This commit is contained in:
cagache
2018-05-18 10:54:20 +03:00
3 changed files with 57 additions and 0 deletions

View File

@@ -1132,6 +1132,19 @@
<tokenised>false</tokenised> <tokenised>false</tokenised>
</index> </index>
</property> </property>
<property name="rma:declassificationReviewCompletedAt">
<type>d:date</type>
<protected>true</protected>
</property>
<property name="rma:declassificationReviewCompletedBy">
<type>d:text</type>
<protected>true</protected>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
</property>
</properties> </properties>
</aspect> </aspect>

View File

@@ -35,11 +35,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry; import org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction; import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction;
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails; import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEvent; import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEvent;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.script.slingshot.RMSearchGet;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -328,6 +330,12 @@ public class DispositionActionImpl implements DispositionAction,
props.put(PROP_EVENT_EXECUTION_COMPLETED_BY, completedByValue); props.put(PROP_EVENT_EXECUTION_COMPLETED_BY, completedByValue);
services.getNodeService().setProperties(eventNodeRef, props); services.getNodeService().setProperties(eventNodeRef, props);
// check a specific event from rmEventConfigBootstrap.json
if (eventName.equals("declassification_review"))
{
setDeclassificationReview(eventNodeRef, completedAtValue, completedByValue);
}
// Check to see if the events eligible property needs to be updated // Check to see if the events eligible property needs to be updated
updateEventEligible(); updateEventEligible();
@@ -518,4 +526,38 @@ public class DispositionActionImpl implements DispositionAction,
return eligible; return eligible;
} }
/**
* Sets declassification review authority and date on records and record folder
*
* @param eventNodeRef Declassification review event node ref
* @param completedAtValue Declassification review authority
* @param completedByValue Declassification review date
*/
private void setDeclassificationReview(NodeRef eventNodeRef, Date completedAtValue, String completedByValue)
{
NodeRef nextDispositionActionNodeRef = services.getNodeService().getPrimaryParent(eventNodeRef).getParentRef();
NodeRef nodeRef = services.getNodeService().getPrimaryParent(nextDispositionActionNodeRef).getParentRef();
setPropsOnContent(nodeRef, completedAtValue, completedByValue);
// check if the node is a record folder then set the declassification review on the records also
if (services.getNodeService().getType(nodeRef).equals(RecordsManagementModel.TYPE_RECORD_FOLDER))
{
// get all the records inside the record folder
List<ChildAssociationRef> records = services.getNodeService().getChildAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef child : records)
{
NodeRef recordNodeRef = child.getChildRef();
setPropsOnContent(recordNodeRef, completedAtValue, completedByValue);
}
}
}
private void setPropsOnContent(NodeRef nodeRef, Date completedAtValue, String completedByValue)
{
Map<QName, Serializable> nodeProps = services.getNodeService().getProperties(nodeRef);
nodeProps.put(PROP_RS_DECLASSIFICATION_REVIEW_COMPLETED_AT, completedAtValue);
nodeProps.put(PROP_RS_DECLASSIFICATION_REVIEW_COMPLETED_BY, completedByValue);
services.getNodeService().setProperties(nodeRef, nodeProps);
}
} }

View File

@@ -247,6 +247,8 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
QName PROP_RS_HAS_DISPOITION_SCHEDULE = QName.createQName(RM_URI, "recordSearchHasDispositionSchedule"); QName PROP_RS_HAS_DISPOITION_SCHEDULE = QName.createQName(RM_URI, "recordSearchHasDispositionSchedule");
QName PROP_RS_DISPOITION_INSTRUCTIONS = QName.createQName(RM_URI, "recordSearchDispositionInstructions"); QName PROP_RS_DISPOITION_INSTRUCTIONS = QName.createQName(RM_URI, "recordSearchDispositionInstructions");
QName PROP_RS_DISPOITION_AUTHORITY = QName.createQName(RM_URI, "recordSearchDispositionAuthority"); QName PROP_RS_DISPOITION_AUTHORITY = QName.createQName(RM_URI, "recordSearchDispositionAuthority");
QName PROP_RS_DECLASSIFICATION_REVIEW_COMPLETED_AT = QName.createQName(RM_URI, "declassificationReviewCompletedAt");
QName PROP_RS_DECLASSIFICATION_REVIEW_COMPLETED_BY = QName.createQName(RM_URI, "declassificationReviewCompletedBy");
/** @depreacted as of 2.2, because disposable items can now be in multiple holds */ /** @depreacted as of 2.2, because disposable items can now be in multiple holds */
@Deprecated @Deprecated
QName PROP_RS_HOLD_REASON = QName.createQName(RM_URI, "recordSearchHoldReason"); QName PROP_RS_HOLD_REASON = QName.createQName(RM_URI, "recordSearchHoldReason");