Search in sources :

Example 1 with DispositionScheduleImpl

use of org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl in project records-management by Alfresco.

the class RecordsManagementNodeFormFilter method afterGenerate.

/**
 * @see org.alfresco.repo.forms.processor.Filter#afterGenerate(java.lang.Object, java.util.List, java.util.List, org.alfresco.repo.forms.Form, java.util.Map)
 */
@Override
public void afterGenerate(NodeRef nodeRef, List<String> fields, List<String> forcedFields, Form form, Map<String, Object> context) {
    if (getFilePlanService().isFilePlanComponent(nodeRef)) {
        // add all the custom properties
        addCustomPropertyFieldsToGroup(form, nodeRef);
        FilePlanComponentKind kind = getFilePlanService().getFilePlanComponentKind(nodeRef);
        if (FilePlanComponentKind.RECORD.equals(kind)) {
            // add all the record meta-data aspect properties
            addRecordMetadataPropertyFieldsToGroup(form, nodeRef);
            // add required transient properties
            addTransientProperties(form, nodeRef);
            // add the supplemental marking list property
            forceSupplementalMarkingListProperty(form, nodeRef);
            // protect uneditable properties
            protectRecordProperties(form, nodeRef);
            // if the record is the result of an email we need to 'protect' some fields
            if (this.nodeService.hasAspect(nodeRef, ImapModel.ASPECT_IMAP_CONTENT)) {
                protectEmailExtractedFields(form, nodeRef);
            }
        } else if (FilePlanComponentKind.RECORD_FOLDER.equals(kind)) {
            // add the supplemental marking list property
            forceSupplementalMarkingListProperty(form, nodeRef);
            // add required transient properties
            addTransientProperties(form, nodeRef);
        } else if (FilePlanComponentKind.DISPOSITION_SCHEDULE.equals(kind)) {
            // use the same mechanism used to determine whether steps can be removed from the
            // schedule to determine whether the disposition level can be changed i.e. record
            // level or folder level.
            DispositionSchedule schedule = new DispositionScheduleImpl(this.rmServiceRegistry, this.nodeService, nodeRef);
            if (getDispositionService().hasDisposableItems(schedule)) {
                protectRecordLevelDispositionPropertyField(form);
            }
        }
    }
}
Also used : DispositionScheduleImpl(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl) DispositionSchedule(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule) FilePlanComponentKind(org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind)

Example 2 with DispositionScheduleImpl

use of org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl in project records-management by Alfresco.

the class RecordsManagementSearchBehaviour method dispositionSchedulePropertiesUpdate.

/**
 * Updates the disposition schedule properties
 *
 * @param nodeRef   node reference
 * @param before    properties before
 * @param after     properties after
 */
public void dispositionSchedulePropertiesUpdate(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after) {
    if (nodeService.exists(nodeRef)) {
        // create the schedule object and get the record category for it
        DispositionSchedule schedule = new DispositionScheduleImpl(recordsManagementServiceRegistry, nodeService, nodeRef);
        NodeRef recordCategoryNode = nodeService.getPrimaryParent(schedule.getNodeRef()).getParentRef();
        if (schedule.isRecordLevelDisposition()) {
            for (NodeRef recordFolder : getRecordFolders(recordCategoryNode)) {
                for (NodeRef record : recordService.getRecords(recordFolder)) {
                    applySearchAspect(record);
                    setDispositionScheduleProperties(record, schedule);
                }
            }
        } else {
            for (NodeRef recordFolder : getRecordFolders(recordCategoryNode)) {
                applySearchAspect(recordFolder);
                setDispositionScheduleProperties(recordFolder, schedule);
            }
        }
    }
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) DispositionScheduleImpl(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl) DispositionSchedule(org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule)

Aggregations

DispositionSchedule (org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule)2 DispositionScheduleImpl (org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl)2 FilePlanComponentKind (org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1