mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-386: Rolled up search information out of date
* Rollup of search properties happens manually during the update of the disposition actions (for performance reasons) * Associated unit test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@37272 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,10 +29,10 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementSearchBehaviour;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
@@ -124,6 +124,50 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
// disposition lifecycle does not exist on the node so setup disposition
|
||||
updateNextDispositionAction(disposableItem);
|
||||
}
|
||||
|
||||
// update rolled up search information
|
||||
rollupSearchProperties(disposableItem);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually update the rolled up search properties
|
||||
*
|
||||
* @param disposableItem disposable item
|
||||
*/
|
||||
private void rollupSearchProperties(NodeRef disposableItem)
|
||||
{
|
||||
DispositionAction da = dispositionService.getNextDispositionAction(disposableItem);
|
||||
if (da != null)
|
||||
{
|
||||
Map<QName, Serializable> props = nodeService.getProperties(disposableItem);
|
||||
|
||||
props.put(PROP_RS_DISPOSITION_ACTION_NAME, da.getName());
|
||||
props.put(PROP_RS_DISPOSITION_ACTION_AS_OF, da.getAsOfDate());
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS_ELIGIBLE, this.nodeService.getProperty(da.getNodeRef(), PROP_DISPOSITION_EVENTS_ELIGIBLE));
|
||||
|
||||
DispositionActionDefinition daDefinition = da.getDispositionActionDefinition();
|
||||
Period period = daDefinition.getPeriod();
|
||||
if (period != null)
|
||||
{
|
||||
props.put(PROP_RS_DISPOSITION_PERIOD, period.getPeriodType());
|
||||
props.put(PROP_RS_DISPOSITION_PERIOD_EXPRESSION, period.getExpression());
|
||||
}
|
||||
else
|
||||
{
|
||||
props.put(PROP_RS_DISPOSITION_PERIOD, null);
|
||||
props.put(PROP_RS_DISPOSITION_PERIOD_EXPRESSION, null);
|
||||
}
|
||||
|
||||
List<EventCompletionDetails> events = da.getEventCompletionDetails();
|
||||
List<String> list = new ArrayList<String>(events.size());
|
||||
for (EventCompletionDetails event : events)
|
||||
{
|
||||
list.add(event.getEventName());
|
||||
}
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS, (Serializable)list);
|
||||
|
||||
nodeService.setProperties(disposableItem, props);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -204,4 +204,19 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
||||
|
||||
// Ghosted aspect
|
||||
public static QName ASPECT_GHOSTED = QName.createQName(RM_URI, "ghosted");
|
||||
|
||||
// Search rollup aspect
|
||||
public static final QName ASPECT_RM_SEARCH = QName.createQName(RM_URI, "recordSearch");
|
||||
public static final QName PROP_RS_DISPOSITION_ACTION_NAME = QName.createQName(RM_URI, "recordSearchDispositionActionName");
|
||||
public static final QName PROP_RS_DISPOSITION_ACTION_AS_OF = QName.createQName(RM_URI, "recordSearchDispositionActionAsOf");
|
||||
public static final QName PROP_RS_DISPOSITION_EVENTS_ELIGIBLE = QName.createQName(RM_URI, "recordSearchDispositionEventsEligible");
|
||||
public static final QName PROP_RS_DISPOSITION_EVENTS = QName.createQName(RM_URI, "recordSearchDispositionEvents");
|
||||
public static final QName PROP_RS_VITAL_RECORD_REVIEW_PERIOD = QName.createQName(RM_URI, "recordSearchVitalRecordReviewPeriod");
|
||||
public static final QName PROP_RS_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION = QName.createQName(RM_URI, "recordSearchVitalRecordReviewPeriodExpression");
|
||||
public static final QName PROP_RS_DISPOSITION_PERIOD = QName.createQName(RM_URI, "recordSearchDispositionPeriod");
|
||||
public static final QName PROP_RS_DISPOSITION_PERIOD_EXPRESSION = QName.createQName(RM_URI, "recordSearchDispositionPeriodExpression");
|
||||
public static final QName PROP_RS_HAS_DISPOITION_SCHEDULE = QName.createQName(RM_URI, "recordSearchHasDispositionSchedule");
|
||||
public static final QName PROP_RS_DISPOITION_INSTRUCTIONS = QName.createQName(RM_URI, "recordSearchDispositionInstructions");
|
||||
public static final QName PROP_RS_DISPOITION_AUTHORITY = QName.createQName(RM_URI, "recordSearchDispositionAuthority");
|
||||
public static final QName PROP_RS_HOLD_REASON = QName.createQName(RM_URI, "recordSearchHoldReason");
|
||||
}
|
||||
|
@@ -62,22 +62,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public class RecordsManagementSearchBehaviour implements RecordsManagementModel
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(RecordsManagementSearchBehaviour.class);
|
||||
|
||||
/** Search specific elements of the RM model */
|
||||
public static final QName ASPECT_RM_SEARCH = QName.createQName(RM_URI, "recordSearch");
|
||||
public static final QName PROP_RS_DISPOSITION_ACTION_NAME = QName.createQName(RM_URI, "recordSearchDispositionActionName");
|
||||
public static final QName PROP_RS_DISPOSITION_ACTION_AS_OF = QName.createQName(RM_URI, "recordSearchDispositionActionAsOf");
|
||||
public static final QName PROP_RS_DISPOSITION_EVENTS_ELIGIBLE = QName.createQName(RM_URI, "recordSearchDispositionEventsEligible");
|
||||
public static final QName PROP_RS_DISPOSITION_EVENTS = QName.createQName(RM_URI, "recordSearchDispositionEvents");
|
||||
public static final QName PROP_RS_VITAL_RECORD_REVIEW_PERIOD = QName.createQName(RM_URI, "recordSearchVitalRecordReviewPeriod");
|
||||
public static final QName PROP_RS_VITAL_RECORD_REVIEW_PERIOD_EXPRESSION = QName.createQName(RM_URI, "recordSearchVitalRecordReviewPeriodExpression");
|
||||
public static final QName PROP_RS_DISPOSITION_PERIOD = QName.createQName(RM_URI, "recordSearchDispositionPeriod");
|
||||
public static final QName PROP_RS_DISPOSITION_PERIOD_EXPRESSION = QName.createQName(RM_URI, "recordSearchDispositionPeriodExpression");
|
||||
public static final QName PROP_RS_HAS_DISPOITION_SCHEDULE = QName.createQName(RM_URI, "recordSearchHasDispositionSchedule");
|
||||
public static final QName PROP_RS_DISPOITION_INSTRUCTIONS = QName.createQName(RM_URI, "recordSearchDispositionInstructions");
|
||||
public static final QName PROP_RS_DISPOITION_AUTHORITY = QName.createQName(RM_URI, "recordSearchDispositionAuthority");
|
||||
public static final QName PROP_RS_HOLD_REASON = QName.createQName(RM_URI, "recordSearchHoldReason");
|
||||
private static Log logger = LogFactory.getLog(RecordsManagementSearchBehaviour.class);
|
||||
|
||||
/** Policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
Reference in New Issue
Block a user