use of org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind in project records-management by Alfresco.
the class ExtendedActionServiceImpl method getActionDefinitions.
/**
* @see org.alfresco.repo.action.ActionServiceImpl#getActionDefinitions(org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
public List<ActionDefinition> getActionDefinitions(NodeRef nodeRef) {
List<ActionDefinition> result = null;
// first use the base implementation to get the list of action definitions
List<ActionDefinition> actionDefinitions = super.getActionDefinitions(nodeRef);
if (nodeRef == null) {
// nothing to filter
result = actionDefinitions;
} else {
// get the file component kind of the node reference
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
result = new ArrayList<ActionDefinition>(actionDefinitions.size());
// check each action definition
for (ActionDefinition actionDefinition : actionDefinitions) {
if (actionDefinition instanceof RecordsManagementActionDefinition) {
if (kind != null) {
Set<FilePlanComponentKind> applicableKinds = ((RecordsManagementActionDefinition) actionDefinition).getApplicableKinds();
if (applicableKinds == null || applicableKinds.size() == 0 || applicableKinds.contains(kind)) {
// an RM action can only act on a RM artifact
result.add(actionDefinition);
}
}
} else {
if (kind == null) {
// a non-RM action can only act on a non-RM artifact
result.add(actionDefinition);
}
}
}
}
return result;
}
use of org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind in project records-management by Alfresco.
the class IsTransferAccessionCapabilityCondition method evaluateImpl.
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.declarative.CapabilityCondition#evaluate(org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
public boolean evaluateImpl(NodeRef nodeRef) {
boolean result = false;
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
if (FilePlanComponentKind.TRANSFER.equals(kind)) {
Boolean value = (Boolean) nodeService.getProperty(nodeRef, PROP_TRANSFER_ACCESSION_INDICATOR);
if (value != null) {
result = value.booleanValue();
}
}
return result;
}
use of org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind 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);
}
}
}
}
use of org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind in project records-management by Alfresco.
the class JSONConversionComponent method getUIType.
/**
* Gets the rm 'type' used as a UI convenience and compatibility flag.
*/
private String getUIType(NodeRef nodeRef) {
String result = "unknown";
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
if (kind != null) {
switch(kind) {
case FILE_PLAN:
{
result = "fileplan";
break;
}
case RECORD_CATEGORY:
{
result = "record-category";
break;
}
case RECORD_FOLDER:
{
if (recordService.isMetadataStub(nodeRef)) {
result = "metadata-stub-folder";
} else {
result = "record-folder";
}
break;
}
case RECORD:
{
if (recordService.isMetadataStub(nodeRef)) {
result = "metadata-stub";
} else {
if (recordService.isDeclared(nodeRef)) {
result = "record";
} else {
result = "undeclared-record";
}
}
break;
}
case HOLD:
{
result = "hold";
break;
}
case TRANSFER:
{
result = "transfer-container";
break;
}
case UNFILED_RECORD_FOLDER:
{
result = "unfiled-record-folder";
break;
}
default:
{
break;
}
}
}
return result;
}
use of org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanComponentKind in project records-management by Alfresco.
the class ServiceBaseImpl method getFilePlanComponentKind.
/**
* Gets the file plan component kind from the given node reference
*
* @see FilePlanService#getFilePlanComponentKind(org.alfresco.service.cmr.repository.NodeRef)
*/
public FilePlanComponentKind getFilePlanComponentKind(NodeRef nodeRef) {
FilePlanComponentKind result = null;
Map<NodeRef, FilePlanComponentKind> map = transactionalResourceHelper.getMap("rm.transaction.filePlanComponentByNodeRef");
if (map.containsKey(nodeRef)) {
result = map.get(nodeRef);
} else {
if (isFilePlanComponent(nodeRef)) {
result = FilePlanComponentKind.FILE_PLAN_COMPONENT;
if (isFilePlan(nodeRef)) {
result = FilePlanComponentKind.FILE_PLAN;
} else if (isRecordCategory(nodeRef)) {
result = FilePlanComponentKind.RECORD_CATEGORY;
} else if (isRecordFolder(nodeRef)) {
result = FilePlanComponentKind.RECORD_FOLDER;
} else if (isRecord(nodeRef)) {
result = FilePlanComponentKind.RECORD;
} else if (instanceOf(nodeRef, TYPE_HOLD_CONTAINER)) {
result = FilePlanComponentKind.HOLD_CONTAINER;
} else if (isHold(nodeRef)) {
result = FilePlanComponentKind.HOLD;
} else if (instanceOf(nodeRef, TYPE_TRANSFER_CONTAINER)) {
result = FilePlanComponentKind.TRANSFER_CONTAINER;
} else if (isTransfer(nodeRef)) {
result = FilePlanComponentKind.TRANSFER;
} else if (instanceOf(nodeRef, TYPE_DISPOSITION_SCHEDULE) || instanceOf(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION)) {
result = FilePlanComponentKind.DISPOSITION_SCHEDULE;
} else if (instanceOf(nodeRef, TYPE_UNFILED_RECORD_CONTAINER)) {
result = FilePlanComponentKind.UNFILED_RECORD_CONTAINER;
} else if (instanceOf(nodeRef, TYPE_UNFILED_RECORD_FOLDER)) {
result = FilePlanComponentKind.UNFILED_RECORD_FOLDER;
}
}
if (result != null) {
map.put(nodeRef, result);
}
}
return result;
}
Aggregations