mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed major issues (Visibility Modifier) reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@89725 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -64,70 +64,86 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
BeanNameAware
|
||||
{
|
||||
/** Namespace service */
|
||||
protected NamespaceService namespaceService;
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
/** Used to control transactional behaviour including post-commit auditing */
|
||||
protected TransactionService transactionService;
|
||||
private TransactionService transactionService;
|
||||
|
||||
/** Node service */
|
||||
protected NodeService nodeService;
|
||||
private NodeService nodeService;
|
||||
|
||||
/** Dictionary service */
|
||||
protected DictionaryService dictionaryService;
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
/** Content service */
|
||||
protected ContentService contentService;
|
||||
private ContentService contentService;
|
||||
|
||||
/** Action service */
|
||||
protected ActionService actionService;
|
||||
private ActionService actionService;
|
||||
|
||||
/** Records management action service */
|
||||
protected RecordsManagementAuditService recordsManagementAuditService;
|
||||
private RecordsManagementAuditService recordsManagementAuditService;
|
||||
|
||||
/** Records management action service */
|
||||
protected RecordsManagementActionService recordsManagementActionService;
|
||||
private RecordsManagementActionService recordsManagementActionService;
|
||||
|
||||
/** Record service */
|
||||
protected RecordService recordService;
|
||||
private RecordService recordService;
|
||||
|
||||
/** Disposition service */
|
||||
protected DispositionService dispositionService;
|
||||
private DispositionService dispositionService;
|
||||
|
||||
/** Vital record service */
|
||||
protected VitalRecordService vitalRecordService;
|
||||
private VitalRecordService vitalRecordService;
|
||||
|
||||
/** Records management event service */
|
||||
protected RecordsManagementEventService recordsManagementEventService;
|
||||
private RecordsManagementEventService recordsManagementEventService;
|
||||
|
||||
/** Records management action service */
|
||||
protected RecordsManagementAdminService recordsManagementAdminService;
|
||||
private RecordsManagementAdminService recordsManagementAdminService;
|
||||
|
||||
/** Ownable service **/
|
||||
protected OwnableService ownableService;
|
||||
private OwnableService ownableService;
|
||||
|
||||
/** Freeze service */
|
||||
protected FreezeService freezeService;
|
||||
private FreezeService freezeService;
|
||||
|
||||
/** Model security service */
|
||||
protected ModelSecurityService modelSecurityService;
|
||||
private ModelSecurityService modelSecurityService;
|
||||
|
||||
/** Record folder service */
|
||||
protected RecordFolderService recordFolderService;
|
||||
private RecordFolderService recordFolderService;
|
||||
|
||||
/** Hold service */
|
||||
protected HoldService holdService;
|
||||
private HoldService holdService;
|
||||
|
||||
/** List of kinds for which this action is applicable */
|
||||
protected Set<FilePlanComponentKind> applicableKinds = new HashSet<FilePlanComponentKind>();
|
||||
|
||||
/**
|
||||
* Set the namespace service
|
||||
* Get the transaction service
|
||||
*/
|
||||
protected TransactionService getTransactionService()
|
||||
{
|
||||
return this.transactionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the transaction service
|
||||
*/
|
||||
public void setTransactionService(TransactionService transactionService)
|
||||
{
|
||||
this.transactionService = transactionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the namespace service
|
||||
*/
|
||||
protected NamespaceService getNamespaceService()
|
||||
{
|
||||
return this.namespaceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the namespace service
|
||||
*/
|
||||
@@ -136,6 +152,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.namespaceService = namespaceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the node service
|
||||
*/
|
||||
protected NodeService getNodeService()
|
||||
{
|
||||
return this.nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set node service
|
||||
*/
|
||||
@@ -144,6 +168,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the dictionary service
|
||||
*/
|
||||
protected DictionaryService getDictionaryService()
|
||||
{
|
||||
return this.dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dictionary service
|
||||
*/
|
||||
@@ -152,6 +184,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the content service
|
||||
*/
|
||||
protected ContentService getContentService()
|
||||
{
|
||||
return this.contentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content service
|
||||
*/
|
||||
@@ -160,6 +200,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the action service
|
||||
*/
|
||||
protected ActionService getActionService()
|
||||
{
|
||||
return this.actionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set action service
|
||||
*/
|
||||
@@ -168,6 +216,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the records management audit service
|
||||
*/
|
||||
protected RecordsManagementAuditService getRecordsManagementAuditService()
|
||||
{
|
||||
return this.recordsManagementAuditService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the audit service that action details will be sent to
|
||||
*/
|
||||
@@ -176,6 +232,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.recordsManagementAuditService = recordsManagementAuditService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the records management action service
|
||||
*/
|
||||
protected RecordsManagementActionService getRecordsManagementActionService()
|
||||
{
|
||||
return this.recordsManagementActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set records management service
|
||||
*/
|
||||
@@ -184,6 +248,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.recordsManagementActionService = recordsManagementActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the disposition service
|
||||
*/
|
||||
protected DispositionService getDispositionService()
|
||||
{
|
||||
return this.dispositionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the disposition service
|
||||
*/
|
||||
@@ -192,6 +264,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.dispositionService = dispositionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vital record service
|
||||
*/
|
||||
protected VitalRecordService getVitalRecordService()
|
||||
{
|
||||
return this.vitalRecordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vitalRecordService vital record service
|
||||
*/
|
||||
@@ -200,6 +280,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.vitalRecordService = vitalRecordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the records management event service
|
||||
*/
|
||||
protected RecordsManagementEventService getRecordsManagementEventService()
|
||||
{
|
||||
return this.recordsManagementEventService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set records management event service
|
||||
*/
|
||||
@@ -208,6 +296,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.recordsManagementEventService = recordsManagementEventService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ownable service
|
||||
*/
|
||||
protected OwnableService getOwnableService()
|
||||
{
|
||||
return this.ownableService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ownable service
|
||||
* @param ownableSerice
|
||||
@@ -217,6 +313,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.ownableService = ownableService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the freeze service
|
||||
*/
|
||||
protected FreezeService getFreezeService()
|
||||
{
|
||||
return this.freezeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set freeze service
|
||||
*
|
||||
@@ -227,6 +331,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.freezeService = freezeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the record service
|
||||
*/
|
||||
protected RecordService getRecordService()
|
||||
{
|
||||
return this.recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set record service
|
||||
*
|
||||
@@ -237,6 +349,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.recordService = recordService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return records management admin service
|
||||
*/
|
||||
protected RecordsManagementAdminService getRecordsManagementAdminService()
|
||||
{
|
||||
return recordsManagementAdminService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordsManagementAdminService records management admin service
|
||||
*/
|
||||
@@ -246,11 +366,11 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
}
|
||||
|
||||
/**
|
||||
* @return records management admin service
|
||||
* Gets the model security service
|
||||
*/
|
||||
public RecordsManagementAdminService getRecordsManagementAdminService()
|
||||
protected ModelSecurityService getModelSecurityService()
|
||||
{
|
||||
return recordsManagementAdminService;
|
||||
return this.modelSecurityService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,6 +381,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.modelSecurityService = modelSecurityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the record folder service
|
||||
*/
|
||||
protected RecordFolderService getRecordFolderService()
|
||||
{
|
||||
return this.recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
@@ -269,6 +397,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hold service
|
||||
*/
|
||||
protected HoldService getHoldService()
|
||||
{
|
||||
return this.holdService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param holdService hold service
|
||||
*/
|
||||
|
@@ -117,28 +117,28 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
{
|
||||
// Check the eligibility of the action
|
||||
if (!checkEligibility(actionedUponNodeRef) ||
|
||||
dispositionService.isNextDispositionActionEligible(actionedUponNodeRef))
|
||||
getDispositionService().isNextDispositionActionEligible(actionedUponNodeRef))
|
||||
{
|
||||
if (di.isRecordLevelDisposition())
|
||||
{
|
||||
// Check that we do indeed have a record
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// Can only execute disposition action on record if declared
|
||||
if (recordService.isDeclared(actionedUponNodeRef))
|
||||
if (getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
// Indicate that the disposition action is underway
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date());
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_BY, AuthenticationUtil.getRunAsUser());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_BY, AuthenticationUtil.getRunAsUser());
|
||||
|
||||
// Execute record level disposition
|
||||
executeRecordLevelDisposition(action, actionedUponNodeRef);
|
||||
|
||||
if (nodeService.exists(nextDispositionActionNodeRef) &&
|
||||
if (getNodeService().exists(nextDispositionActionNodeRef) &&
|
||||
getSetDispositionActionComplete())
|
||||
{
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -153,22 +153,22 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
}
|
||||
else
|
||||
{
|
||||
if (recordFolderService.isRecordFolder(actionedUponNodeRef))
|
||||
if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
|
||||
{
|
||||
if (recordFolderService.isRecordFolderDeclared(actionedUponNodeRef))
|
||||
if (getRecordFolderService().isRecordFolderDeclared(actionedUponNodeRef))
|
||||
{
|
||||
// Indicate that the disposition action is underway
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date());
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_BY, AuthenticationUtil.getRunAsUser());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_BY, AuthenticationUtil.getRunAsUser());
|
||||
|
||||
executeRecordFolderLevelDisposition(action, actionedUponNodeRef);
|
||||
|
||||
// Indicate that the disposition action is compelte
|
||||
if (nodeService.exists(nextDispositionActionNodeRef) &&
|
||||
if (getNodeService().exists(nextDispositionActionNodeRef) &&
|
||||
getSetDispositionActionComplete())
|
||||
{
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date());
|
||||
getNodeService().setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_BY, AuthenticationUtil.getRunAsUser());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,10 +184,10 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
|
||||
}
|
||||
|
||||
if (nodeService.exists(actionedUponNodeRef) && getSetDispositionActionComplete())
|
||||
if (getNodeService().exists(actionedUponNodeRef) && getSetDispositionActionComplete())
|
||||
{
|
||||
// Update the disposition schedule
|
||||
dispositionService.updateNextDispositionAction(actionedUponNodeRef);
|
||||
getDispositionService().updateNextDispositionAction(actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -225,7 +225,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
protected DispositionSchedule checkDispositionActionExecutionValidity(NodeRef nodeRef, NodeRef nextDispositionActionNodeRef, boolean throwError)
|
||||
{
|
||||
// Check the node has associated disposition instructions
|
||||
DispositionSchedule di = dispositionService.getDispositionSchedule(nodeRef);
|
||||
DispositionSchedule di = getDispositionService().getDispositionSchedule(nodeRef);
|
||||
if (di == null)
|
||||
{
|
||||
if (throwError)
|
||||
@@ -239,7 +239,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
}
|
||||
|
||||
// Check the node has the disposition schedule aspect applied
|
||||
if (!nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
if (!getNodeService().hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
if (throwError)
|
||||
{
|
||||
@@ -266,7 +266,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
return null;
|
||||
}
|
||||
}
|
||||
String actionName = (String) nodeService.getProperty(nextDispositionAction, PROP_DISPOSITION_ACTION);
|
||||
String actionName = (String) getNodeService().getProperty(nextDispositionAction, PROP_DISPOSITION_ACTION);
|
||||
if (actionName == null || !actionName.equals(getName()))
|
||||
{
|
||||
if (throwError)
|
||||
@@ -293,7 +293,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
|
||||
private NodeRef getNextDispostionAction(NodeRef nodeRef)
|
||||
{
|
||||
NodeRef result = null;
|
||||
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, ASSOC_NEXT_DISPOSITION_ACTION, RegexQNamePattern.MATCH_ALL);
|
||||
List<ChildAssociationRef> assocs = getNodeService().getChildAssocs(nodeRef, ASSOC_NEXT_DISPOSITION_ACTION, RegexQNamePattern.MATCH_ALL);
|
||||
if (assocs.size() != 0)
|
||||
{
|
||||
result = assocs.get(0).getChildRef();
|
||||
|
@@ -65,7 +65,7 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
for (String type : getRecordTypes(action))
|
||||
{
|
||||
recordService.addRecordType(actionedUponNodeRef, QName.createQName(type, namespaceService));
|
||||
getRecordService().addRecordType(actionedUponNodeRef, QName.createQName(type, getNamespaceService()));
|
||||
}
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
@@ -88,10 +88,10 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef) &&
|
||||
recordService.isRecord(actionedUponNodeRef) &&
|
||||
!recordService.isDeclared(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
|
||||
public void setCustomTypeAspect(String customTypeAspect)
|
||||
{
|
||||
this.customTypeAspect = QName.createQName(customTypeAspect, namespaceService);
|
||||
this.customTypeAspect = QName.createQName(customTypeAspect, getNamespaceService());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,11 +69,11 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
logger.debug("Executing action [" + action.getActionDefinitionName() + "] on " + actionedUponNodeRef);
|
||||
}
|
||||
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// Apply the appropriate aspect and set the properties.
|
||||
Map<QName, Serializable> aspectProps = getPropertyValues(action);
|
||||
this.nodeService.addAspect(actionedUponNodeRef, customTypeAspect, aspectProps);
|
||||
this.getNodeService().addAspect(actionedUponNodeRef, customTypeAspect, aspectProps);
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected final void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
AspectDefinition aspectDef = dictionaryService.getAspect(customTypeAspect);
|
||||
AspectDefinition aspectDef = getDictionaryService().getAspect(customTypeAspect);
|
||||
for (PropertyDefinition propDef : aspectDef.getProperties().values())
|
||||
{
|
||||
QName propName = propDef.getName();
|
||||
@@ -109,7 +109,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
Map<QName, Serializable> result = new HashMap<QName, Serializable>(paramValues.size());
|
||||
for (Map.Entry<String, Serializable> entry : paramValues.entrySet())
|
||||
{
|
||||
QName propQName = QName.createQName(entry.getKey(), this.namespaceService);
|
||||
QName propQName = QName.createQName(entry.getKey(), this.getNamespaceService());
|
||||
result.put(propQName, entry.getValue());
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
// We can take these parameter definitions from the properties defined in the dod model.
|
||||
if (this.parameterDefinitions == null)
|
||||
{
|
||||
AspectDefinition aspectDefinition = dictionaryService.getAspect(customTypeAspect);
|
||||
AspectDefinition aspectDefinition = getDictionaryService().getAspect(customTypeAspect);
|
||||
if (aspectDefinition == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_ASPECT_NOT_RECOGNISED, customTypeAspect));
|
||||
@@ -134,7 +134,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
|
||||
|
||||
for (Map.Entry<QName, PropertyDefinition> entry : props.entrySet())
|
||||
{
|
||||
String paramName = entry.getKey().toPrefixString(namespaceService);
|
||||
String paramName = entry.getKey().toPrefixString(getNamespaceService());
|
||||
PropertyDefinition value = entry.getValue();
|
||||
QName paramType = value.getDataType().getName();
|
||||
boolean paramIsMandatory = value.isMandatory();
|
||||
|
@@ -69,7 +69,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (!RecordsManagementModel.TYPE_DISPOSITION_ACTION_DEFINITION.equals(nodeService.getType(actionedUponNodeRef)))
|
||||
if (!RecordsManagementModel.TYPE_DISPOSITION_ACTION_DEFINITION.equals(getNodeService().getType(actionedUponNodeRef)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -77,14 +77,14 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
List<QName> changedProps = (List<QName>)action.getParameterValue(CHANGED_PROPERTIES);
|
||||
|
||||
// Navigate up the containment hierarchy to get the record category grandparent and schedule.
|
||||
NodeRef dispositionScheduleNode = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
|
||||
NodeRef rmContainer = nodeService.getPrimaryParent(dispositionScheduleNode).getParentRef();
|
||||
DispositionSchedule dispositionSchedule = dispositionService.getAssociatedDispositionSchedule(rmContainer);
|
||||
NodeRef dispositionScheduleNode = getNodeService().getPrimaryParent(actionedUponNodeRef).getParentRef();
|
||||
NodeRef rmContainer = getNodeService().getPrimaryParent(dispositionScheduleNode).getParentRef();
|
||||
DispositionSchedule dispositionSchedule = getDispositionService().getAssociatedDispositionSchedule(rmContainer);
|
||||
|
||||
behaviourFilter.disableBehaviour();
|
||||
try
|
||||
{
|
||||
List<NodeRef> disposableItems = dispositionService.getDisposableItems(dispositionSchedule);
|
||||
List<NodeRef> disposableItems = getDispositionService().getDisposableItems(dispositionSchedule);
|
||||
for (NodeRef disposableItem : disposableItems)
|
||||
{
|
||||
updateDisposableItem(dispositionSchedule, disposableItem, actionedUponNodeRef, changedProps);
|
||||
@@ -107,11 +107,11 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
{
|
||||
// We need to check that this folder is under the management of the disposition schedule that
|
||||
// has been updated
|
||||
DispositionSchedule itemDs = dispositionService.getDispositionSchedule(disposableItem);
|
||||
DispositionSchedule itemDs = getDispositionService().getDispositionSchedule(disposableItem);
|
||||
if (itemDs != null &&
|
||||
itemDs.getNodeRef().equals(ds.getNodeRef()))
|
||||
{
|
||||
if (nodeService.hasAspect(disposableItem, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
if (getNodeService().hasAspect(disposableItem, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
// disposition lifecycle already exists for node so process changes
|
||||
processActionDefinitionChanges(dispositionActionDefinition, changedProps, disposableItem);
|
||||
@@ -119,7 +119,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
else
|
||||
{
|
||||
// disposition lifecycle does not exist on the node so setup disposition
|
||||
dispositionService.updateNextDispositionAction(disposableItem);
|
||||
getDispositionService().updateNextDispositionAction(disposableItem);
|
||||
}
|
||||
|
||||
// update rolled up search information
|
||||
@@ -134,14 +134,14 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
*/
|
||||
private void rollupSearchProperties(NodeRef disposableItem)
|
||||
{
|
||||
DispositionAction da = dispositionService.getNextDispositionAction(disposableItem);
|
||||
DispositionAction da = getDispositionService().getNextDispositionAction(disposableItem);
|
||||
if (da != null)
|
||||
{
|
||||
Map<QName, Serializable> props = nodeService.getProperties(disposableItem);
|
||||
Map<QName, Serializable> props = getNodeService().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, nodeService.getProperty(da.getNodeRef(), PROP_DISPOSITION_EVENTS_ELIGIBLE));
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS_ELIGIBLE, getNodeService().getProperty(da.getNodeRef(), PROP_DISPOSITION_EVENTS_ELIGIBLE));
|
||||
|
||||
DispositionActionDefinition daDefinition = da.getDispositionActionDefinition();
|
||||
Period period = daDefinition.getPeriod();
|
||||
@@ -164,7 +164,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
}
|
||||
props.put(PROP_RS_DISPOSITION_EVENTS, (Serializable)list);
|
||||
|
||||
nodeService.setProperties(disposableItem, props);
|
||||
getNodeService().setProperties(disposableItem, props);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
{
|
||||
// check that the step being edited is the current step for the folder,
|
||||
// if not, the change has no effect on the current step so ignore
|
||||
DispositionAction nextAction = dispositionService.getNextDispositionAction(recordOrFolder);
|
||||
DispositionAction nextAction = getDispositionService().getNextDispositionAction(recordOrFolder);
|
||||
if (doesChangedStepAffectNextAction(dispositionActionDef, nextAction))
|
||||
{
|
||||
// the change does effect the nextAction for this node
|
||||
@@ -197,8 +197,8 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
|
||||
if (changedProps.contains(PROP_DISPOSITION_ACTION_NAME))
|
||||
{
|
||||
String action = (String)nodeService.getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME);
|
||||
nodeService.setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_ACTION, action);
|
||||
String action = (String)getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME);
|
||||
getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_ACTION, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
private void persistPeriodChanges(NodeRef dispositionActionDef, DispositionAction nextAction)
|
||||
{
|
||||
Date newAsOfDate = null;
|
||||
Period dispositionPeriod = (Period) nodeService.getProperty(dispositionActionDef, PROP_DISPOSITION_PERIOD);
|
||||
Period dispositionPeriod = (Period) getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_PERIOD);
|
||||
|
||||
if (dispositionPeriod != null)
|
||||
{
|
||||
@@ -255,7 +255,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
|
||||
"' (" + nextAction.getNodeRef() + ") to: " + newAsOfDate);
|
||||
}
|
||||
|
||||
nodeService.setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_AS_OF, newAsOfDate);
|
||||
getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_AS_OF, newAsOfDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -49,7 +49,7 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
recordFolderService.closeRecordFolder(actionedUponNodeRef);
|
||||
getRecordFolderService().closeRecordFolder(actionedUponNodeRef);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -69,9 +69,9 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef) &&
|
||||
!TYPE_UNFILED_RECORD_FOLDER.equals(nodeService.getType(actionedUponNodeRef)))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
!TYPE_UNFILED_RECORD_FOLDER.equals(getNodeService().getType(actionedUponNodeRef)))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
/** action name */
|
||||
public static final String NAME = "completeEvent";
|
||||
|
||||
|
||||
/** action parameter names */
|
||||
public static final String PARAM_EVENT_NAME = "eventName";
|
||||
public static final String PARAM_EVENT_COMPLETED_BY = "eventCompletedBy";
|
||||
@@ -51,11 +51,11 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_EVENT_NAME,
|
||||
DataTypeDefinition.TEXT,
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_EVENT_NAME,
|
||||
DataTypeDefinition.TEXT,
|
||||
true,
|
||||
getParamDisplayLabel(PARAM_EVENT_NAME),
|
||||
false,
|
||||
getParamDisplayLabel(PARAM_EVENT_NAME),
|
||||
false,
|
||||
"rm-ac-manual-events"));
|
||||
}
|
||||
|
||||
@@ -66,18 +66,18 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
/** get parameter values */
|
||||
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
|
||||
String eventCompletedBy = (String)action.getParameterValue(PARAM_EVENT_COMPLETED_BY);
|
||||
Date eventCompletedAt = (Date)action.getParameterValue(PARAM_EVENT_COMPLETED_AT);
|
||||
|
||||
if (this.nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
// Get the next disposition action
|
||||
DispositionAction da = this.dispositionService.getNextDispositionAction(actionedUponNodeRef);
|
||||
DispositionAction da = this.getDispositionService().getNextDispositionAction(actionedUponNodeRef);
|
||||
if (da != null)
|
||||
{
|
||||
// complete event
|
||||
|
@@ -108,7 +108,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
String actionName = action.getActionDefinitionName();
|
||||
if (isOkToProceedWithAction(actionedUponNodeRef, actionName))
|
||||
{
|
||||
QName actionedUponType = nodeService.getType(actionedUponNodeRef);
|
||||
QName actionedUponType = getNodeService().getType(actionedUponNodeRef);
|
||||
|
||||
boolean targetIsUnfiledRecords;
|
||||
if (ACTION_FILETO.equals(action.getActionDefinitionName()))
|
||||
@@ -117,7 +117,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
else
|
||||
{
|
||||
targetIsUnfiledRecords = (dictionaryService.isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && !recordService.isFiled(actionedUponNodeRef))
|
||||
targetIsUnfiledRecords = (getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && !getRecordService().isFiled(actionedUponNodeRef))
|
||||
|| TYPE_UNFILED_RECORD_FOLDER.equals(actionedUponType);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
else if(getMode() == CopyMoveLinkFileToActionMode.LINK)
|
||||
{
|
||||
recordService.link(actionedUponNodeRef, finalRecordFolder);
|
||||
getRecordService().link(actionedUponNodeRef, finalRecordFolder);
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException fileNotFound)
|
||||
@@ -178,13 +178,13 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
{
|
||||
// Check that the incoming parameters are valid prior to performing any action
|
||||
boolean okToProceed = false;
|
||||
if(nodeService.exists(actionedUponNodeRef) && !freezeService.isFrozen(actionedUponNodeRef))
|
||||
if(getNodeService().exists(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
QName actionedUponType = nodeService.getType(actionedUponNodeRef);
|
||||
QName actionedUponType = getNodeService().getType(actionedUponNodeRef);
|
||||
if(ACTION_FILETO.equals(actionName))
|
||||
{
|
||||
// file to action can only be performed on unfiled records
|
||||
okToProceed = !recordService.isFiled(actionedUponNodeRef) && dictionaryService.isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
okToProceed = !getRecordService().isFiled(actionedUponNodeRef) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
if(!okToProceed && logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unable to run " + actionName + " action on a node that isn't unfiled and a sub-class of content type");
|
||||
@@ -193,7 +193,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
else if(ACTION_LINKTO.equals(actionName))
|
||||
{
|
||||
// link to action can only be performed on filed records
|
||||
okToProceed = recordService.isFiled(actionedUponNodeRef) && dictionaryService.isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
okToProceed = getRecordService().isFiled(actionedUponNodeRef) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT);
|
||||
if(!okToProceed && logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unable to run " + actionName + " action on a node that isn't filed and a sub-class of content type");
|
||||
@@ -217,7 +217,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
*/
|
||||
private void validateActionPostPathResolution(NodeRef actionedUponNodeRef, NodeRef target, String actionName, boolean targetIsUnfiledRecords)
|
||||
{
|
||||
QName actionedUponType = nodeService.getType(actionedUponNodeRef);
|
||||
QName actionedUponType = getNodeService().getType(actionedUponNodeRef);
|
||||
// now we have the reference to the target folder we can do some final checks to see if the action is valid
|
||||
if (target == null)
|
||||
{
|
||||
@@ -225,7 +225,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
if(targetIsUnfiledRecords)
|
||||
{
|
||||
QName targetFolderType = nodeService.getType(target);
|
||||
QName targetFolderType = getNodeService().getType(target);
|
||||
if(!TYPE_UNFILED_RECORD_CONTAINER.equals(targetFolderType) && !TYPE_UNFILED_RECORD_FOLDER.equals(targetFolderType))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type.");
|
||||
@@ -233,11 +233,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
else
|
||||
{
|
||||
if(recordFolderService.isRecordFolder(target) && !dictionaryService.isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && (recordFolderService.isRecordFolder(actionedUponNodeRef) || filePlanService.isRecordCategory(actionedUponNodeRef)))
|
||||
if(getRecordFolderService().isRecordFolder(target) && !getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT) && (getRecordFolderService().isRecordFolder(actionedUponNodeRef) || filePlanService.isRecordCategory(actionedUponNodeRef)))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type. A record folder cannot contain another folder or a category");
|
||||
}
|
||||
else if(filePlanService.isRecordCategory(target) && dictionaryService.isSubClass(actionedUponType, ContentModel.TYPE_CONTENT))
|
||||
else if(filePlanService.isRecordCategory(target) && getDictionaryService().isSubClass(actionedUponType, ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to run " + actionName + " action, because the destination record folder is an inappropriate type. A record category cannot contain a record");
|
||||
}
|
||||
@@ -299,7 +299,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
if(create)
|
||||
{
|
||||
creating = true;
|
||||
boolean lastAsFolder = lastPathElement && (dictionaryService.isSubClass(nodeService.getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) || RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT.equals(nodeService.getType(actionedUponNodeRef)));
|
||||
boolean lastAsFolder = lastPathElement && (getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) || RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT.equals(getNodeService().getType(actionedUponNodeRef)));
|
||||
nodeRef = createChild(action, parent, childName, targetisUnfiledRecords, lastAsFolder);
|
||||
}
|
||||
else
|
||||
@@ -309,7 +309,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
else
|
||||
{
|
||||
QName nodeType = nodeService.getType(nodeRef);
|
||||
QName nodeType = getNodeService().getType(nodeRef);
|
||||
if(nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) ||
|
||||
nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) ||
|
||||
nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER))
|
||||
@@ -334,10 +334,10 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
private NodeRef getChild(NodeRef parent, String childName)
|
||||
{
|
||||
NodeRef child = null;
|
||||
List<ChildAssociationRef> children = nodeService.getChildAssocs(parent);
|
||||
List<ChildAssociationRef> children = getNodeService().getChildAssocs(parent);
|
||||
for (ChildAssociationRef childAssoc : children) {
|
||||
NodeRef childNodeRef = childAssoc.getChildRef();
|
||||
String existingChildName = (String)nodeService.getProperty(childNodeRef, ContentModel.PROP_NAME);
|
||||
String existingChildName = (String)getNodeService().getProperty(childNodeRef, ContentModel.PROP_NAME);
|
||||
if(existingChildName.equals(childName))
|
||||
{
|
||||
child = childNodeRef;
|
||||
@@ -371,11 +371,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
}
|
||||
else if(lastAsFolder)
|
||||
{
|
||||
child = recordFolderService.createRecordFolder(parent, childName);
|
||||
child = getRecordFolderService().createRecordFolder(parent, childName);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RecordsManagementModel.TYPE_RECORD_FOLDER.equals(nodeService.getType(parent)))
|
||||
if(RecordsManagementModel.TYPE_RECORD_FOLDER.equals(getNodeService().getType(parent)))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the destination path could not be created.");
|
||||
}
|
||||
@@ -397,11 +397,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
||||
private NodeRef getContext(Action action, NodeRef actionedUponNodeRef, boolean targetisUnfiledRecords)
|
||||
{
|
||||
NodeRef context = filePlanService.getFilePlan(actionedUponNodeRef);
|
||||
if(targetisUnfiledRecords && (context != null) && nodeService.exists(context))
|
||||
if(targetisUnfiledRecords && (context != null) && getNodeService().exists(context))
|
||||
{
|
||||
context = filePlanService.getUnfiledContainer(context);
|
||||
}
|
||||
if((context == null) || (!nodeService.exists(context)))
|
||||
if((context == null) || (!getNodeService().exists(context)))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the path resolution context could not be determined.");
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
|
||||
if (eligibleForAction(actionedUponNodeRef))
|
||||
{
|
||||
// Create the disposition schedule
|
||||
dispositionService.createDispositionSchedule(actionedUponNodeRef, null);
|
||||
getDispositionService().createDispositionSchedule(actionedUponNodeRef, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -75,7 +75,7 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
|
||||
private boolean eligibleForAction(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
filePlanService.isRecordCategory(actionedUponNodeRef))
|
||||
{
|
||||
result = true;
|
||||
|
@@ -42,7 +42,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
if(checkUncutOffStatus(action, recordFolder))
|
||||
{
|
||||
// Mark the folder as cut off
|
||||
dispositionService.cutoffDisposableItem(recordFolder);
|
||||
getDispositionService().cutoffDisposableItem(recordFolder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
if(checkUncutOffStatus(action, record))
|
||||
{
|
||||
// Mark the record as cut off
|
||||
dispositionService.cutoffDisposableItem(record);
|
||||
getDispositionService().cutoffDisposableItem(record);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
private boolean checkUncutOffStatus(Action action, NodeRef recordOrFolder)
|
||||
{
|
||||
boolean okToCutOff = true;
|
||||
if(nodeService.hasAspect(recordOrFolder, ASPECT_UNCUT_OFF))
|
||||
if(getNodeService().hasAspect(recordOrFolder, ASPECT_UNCUT_OFF))
|
||||
{
|
||||
if(action.getParameterValue(PARAM_NO_ERROR_CHECK) != null)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeService.removeAspect(recordOrFolder, ASPECT_UNCUT_OFF);
|
||||
getNodeService().removeAspect(recordOrFolder, ASPECT_UNCUT_OFF);
|
||||
}
|
||||
}
|
||||
return okToCutOff;
|
||||
|
@@ -61,24 +61,24 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(final Action action, final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
recordService.isRecord(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
if (!recordService.isDeclared(actionedUponNodeRef))
|
||||
if (!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
List<String> missingProperties = new ArrayList<String>(5);
|
||||
// Aspect not already defined - check mandatory properties then add
|
||||
if (mandatoryPropertiesSet(actionedUponNodeRef, missingProperties))
|
||||
{
|
||||
recordService.disablePropertyEditableCheck();
|
||||
getRecordService().disablePropertyEditableCheck();
|
||||
try
|
||||
{
|
||||
// Add the declared aspect
|
||||
Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2);
|
||||
declaredProps.put(PROP_DECLARED_AT, new Date());
|
||||
declaredProps.put(PROP_DECLARED_BY, AuthenticationUtil.getRunAsUser());
|
||||
this.nodeService.addAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD, declaredProps);
|
||||
this.getNodeService().addAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD, declaredProps);
|
||||
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@@ -86,14 +86,14 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
public Void doWork()
|
||||
{
|
||||
// remove all owner related rights
|
||||
ownableService.setOwner(actionedUponNodeRef, OwnableService.NO_OWNER);
|
||||
getOwnableService().setOwner(actionedUponNodeRef, OwnableService.NO_OWNER);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
finally
|
||||
{
|
||||
recordService.enablePropertyEditableCheck();
|
||||
getRecordService().enablePropertyEditableCheck();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -134,11 +134,11 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
boolean result = true;
|
||||
|
||||
Map<QName, Serializable> nodeRefProps = this.nodeService.getProperties(nodeRef);
|
||||
Map<QName, Serializable> nodeRefProps = this.getNodeService().getProperties(nodeRef);
|
||||
|
||||
QName nodeRefType = this.nodeService.getType(nodeRef);
|
||||
QName nodeRefType = this.getNodeService().getType(nodeRef);
|
||||
|
||||
TypeDefinition typeDef = this.dictionaryService.getType(nodeRefType);
|
||||
TypeDefinition typeDef = this.getDictionaryService().getType(nodeRefType);
|
||||
for (PropertyDefinition propDef : typeDef.getProperties().values())
|
||||
{
|
||||
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)
|
||||
@@ -152,10 +152,10 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
|
||||
if (result)
|
||||
{
|
||||
Set<QName> aspects = this.nodeService.getAspects(nodeRef);
|
||||
Set<QName> aspects = this.getNodeService().getAspects(nodeRef);
|
||||
for (QName aspect : aspects)
|
||||
{
|
||||
AspectDefinition aspectDef = this.dictionaryService.getAspect(aspect);
|
||||
AspectDefinition aspectDef = this.getDictionaryService().getAspect(aspect);
|
||||
for (PropertyDefinition propDef : aspectDef.getProperties().values())
|
||||
{
|
||||
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)
|
||||
|
@@ -64,8 +64,8 @@ public class DelegateAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
(!checkFrozen || !freezeService.isFrozen(actionedUponNodeRef)))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
(!checkFrozen || !getFreezeService().isFrozen(actionedUponNodeRef)))
|
||||
{
|
||||
// do the property subs (if any exist)
|
||||
if (isAllowParameterSubstitutions())
|
||||
|
@@ -41,9 +41,9 @@ public class DeleteHoldAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (holdService.isHold(actionedUponNodeRef))
|
||||
if (getHoldService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
holdService.deleteHold(actionedUponNodeRef);
|
||||
getHoldService().deleteHold(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -121,18 +121,18 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeRecordFolderLevelDisposition(Action action, NodeRef recordFolder)
|
||||
{
|
||||
List<NodeRef> records = recordService.getRecords(recordFolder);
|
||||
List<NodeRef> records = getRecordService().getRecords(recordFolder);
|
||||
for (NodeRef record : records)
|
||||
{
|
||||
executeRecordLevelDisposition(action, record);
|
||||
}
|
||||
if (isGhostOnDestroySetForAction(action, recordFolder))
|
||||
{
|
||||
nodeService.addAspect(recordFolder, ASPECT_GHOSTED, Collections.<QName, Serializable> emptyMap());
|
||||
getNodeService().addAspect(recordFolder, ASPECT_GHOSTED, Collections.<QName, Serializable> emptyMap());
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeService.deleteNode(recordFolder);
|
||||
getNodeService().deleteNode(recordFolder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,12 +151,12 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
if (isGhostOnDestroySetForAction(action, record))
|
||||
{
|
||||
// Add the ghosted aspect
|
||||
nodeService.addAspect(record, ASPECT_GHOSTED, null);
|
||||
getNodeService().addAspect(record, ASPECT_GHOSTED, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If ghosting is not enabled, delete the node
|
||||
nodeService.deleteNode(record);
|
||||
getNodeService().deleteNode(record);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,15 +167,15 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
*/
|
||||
private void clearAllContent(NodeRef nodeRef)
|
||||
{
|
||||
Set<QName> props = this.nodeService.getProperties(nodeRef).keySet();
|
||||
props.retainAll(this.dictionaryService.getAllProperties(DataTypeDefinition.CONTENT));
|
||||
Set<QName> props = this.getNodeService().getProperties(nodeRef).keySet();
|
||||
props.retainAll(this.getDictionaryService().getAllProperties(DataTypeDefinition.CONTENT));
|
||||
for (QName prop : props)
|
||||
{
|
||||
// Clear the content
|
||||
clearContent(nodeRef, prop);
|
||||
|
||||
// Remove the property
|
||||
this.nodeService.removeProperty(nodeRef, prop);
|
||||
this.getNodeService().removeProperty(nodeRef, prop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,19 +196,19 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
// We want to remove the rn:renditioned aspect, but due to the possibility
|
||||
// that there is Alfresco 3.2-era data with the cm:thumbnailed aspect
|
||||
// applied, we must consider removing it too.
|
||||
if (nodeService.hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) ||
|
||||
nodeService.hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED))
|
||||
if (getNodeService().hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) ||
|
||||
getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED))
|
||||
{
|
||||
// Add the ghosted aspect to all the renditioned children, so that they will not be archived when the
|
||||
// renditioned aspect is removed
|
||||
Set<QName> childAssocTypes = dictionaryService.getAspect(RenditionModel.ASPECT_RENDITIONED).getChildAssociations().keySet();
|
||||
for (ChildAssociationRef child : nodeService.getChildAssocs(nodeRef))
|
||||
Set<QName> childAssocTypes = getDictionaryService().getAspect(RenditionModel.ASPECT_RENDITIONED).getChildAssociations().keySet();
|
||||
for (ChildAssociationRef child : getNodeService().getChildAssocs(nodeRef))
|
||||
{
|
||||
if (childAssocTypes.contains(child.getTypeQName()))
|
||||
{
|
||||
// Clear the content and delete the rendition
|
||||
clearAllContent(child.getChildRef());
|
||||
nodeService.deleteNode(child.getChildRef());
|
||||
getNodeService().deleteNode(child.getChildRef());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
private void clearContent(NodeRef nodeRef, QName contentProperty)
|
||||
{
|
||||
// Ensure the content is cleaned at the end of the transaction
|
||||
ContentData contentData = (ContentData)nodeService.getProperty(nodeRef, contentProperty);
|
||||
ContentData contentData = (ContentData)getNodeService().getProperty(nodeRef, contentProperty);
|
||||
if (contentData != null && contentData.getContentUrl() != null)
|
||||
{
|
||||
eagerContentStoreCleaner.registerOrphanedContentUrl(contentData.getContentUrl(), true);
|
||||
@@ -233,7 +233,7 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
/**
|
||||
* Return true if the ghost on destroy property is set against the
|
||||
* definition for the passed action on the specified node
|
||||
*
|
||||
*
|
||||
* @param action
|
||||
* @param nodeRef
|
||||
* @return
|
||||
@@ -244,7 +244,7 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
|
||||
String actionDefinitionName = action.getActionDefinitionName();
|
||||
if (!StringUtils.isEmpty(actionDefinitionName))
|
||||
{
|
||||
DispositionSchedule dispositionSchedule = this.dispositionService.getDispositionSchedule(nodeRef);
|
||||
DispositionSchedule dispositionSchedule = this.getDispositionService().getDispositionSchedule(nodeRef);
|
||||
if (dispositionSchedule != null)
|
||||
{
|
||||
DispositionActionDefinition actionDefinition = dispositionSchedule
|
||||
|
@@ -48,7 +48,7 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
// Get the action parameter
|
||||
Date asOfDate = (Date)action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
@@ -58,10 +58,10 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
|
||||
}
|
||||
|
||||
// Set the dispostion action as of date
|
||||
DispositionAction da = dispositionService.getNextDispositionAction(actionedUponNodeRef);
|
||||
DispositionAction da = getDispositionService().getNextDispositionAction(actionedUponNodeRef);
|
||||
if (da != null)
|
||||
{
|
||||
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_AS_OF, asOfDate);
|
||||
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_AS_OF, asOfDate);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -27,7 +27,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Edit freeze reason Action
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class EditHoldReasonAction extends RMActionExecuterAbstractBase
|
||||
@@ -45,7 +45,7 @@ public class EditHoldReasonAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (freezeService.isHold(actionedUponNodeRef))
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
// Get the property values
|
||||
String reason = (String) action.getParameterValue(PARAM_REASON);
|
||||
@@ -55,7 +55,7 @@ public class EditHoldReasonAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
// Update hold reason
|
||||
freezeService.updateReason(actionedUponNodeRef, reason);
|
||||
getFreezeService().updateReason(actionedUponNodeRef, reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -47,8 +47,8 @@ public class EditReviewAsOfDateAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (recordService.isRecord(actionedUponNodeRef) &&
|
||||
nodeService.hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
getNodeService().hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
|
||||
{
|
||||
// Get the action parameter
|
||||
Date reviewAsOf = (Date)action.getParameterValue(PARAM_AS_OF_DATE);
|
||||
@@ -58,7 +58,7 @@ public class EditReviewAsOfDateAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
// Set the as of date
|
||||
this.nodeService.setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
this.getNodeService().setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
|
||||
}
|
||||
else
|
||||
|
@@ -132,7 +132,7 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
});
|
||||
|
||||
// return the report name
|
||||
String filedReportName = (String) nodeService.getProperty(filedReport, ContentModel.PROP_NAME);
|
||||
String filedReportName = (String) getNodeService().getProperty(filedReport, ContentModel.PROP_NAME);
|
||||
action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT, filedReportName);
|
||||
}
|
||||
|
||||
@@ -186,6 +186,6 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
|
||||
private QName getReportType(Action action)
|
||||
{
|
||||
String reportType = getParameterValue(action, REPORT_TYPE);
|
||||
return QName.createQName(reportType, namespaceService);
|
||||
return QName.createQName(reportType, getNamespaceService());
|
||||
}
|
||||
}
|
||||
|
@@ -55,13 +55,13 @@ public class FreezeAction extends RMActionExecuterAbstractBase
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// NOTE: we can only freeze records and record folders so ignore everything else
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
(recordService.isRecord(actionedUponNodeRef) ||
|
||||
recordFolderService.isRecordFolder(actionedUponNodeRef)) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
(getRecordService().isRecord(actionedUponNodeRef) ||
|
||||
getRecordFolderService().isRecordFolder(actionedUponNodeRef)) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
freezeService.freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef);
|
||||
getFreezeService().freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
@@ -50,28 +50,28 @@ public class OpenRecordFolderAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef) &&
|
||||
!(dictionaryService.isSubClass(nodeService.getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !recordService.isFiled(actionedUponNodeRef)))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
!(getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !getRecordService().isFiled(actionedUponNodeRef)))
|
||||
{
|
||||
// TODO move re-open logic into a service method
|
||||
// TODO check that the user in question has the correct permission to re-open a records folder
|
||||
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
ChildAssociationRef assocRef = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
ChildAssociationRef assocRef = getNodeService().getPrimaryParent(actionedUponNodeRef);
|
||||
if (assocRef != null)
|
||||
{
|
||||
actionedUponNodeRef = assocRef.getParentRef();
|
||||
}
|
||||
}
|
||||
|
||||
if (recordFolderService.isRecordFolder(actionedUponNodeRef))
|
||||
if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
|
||||
{
|
||||
Boolean isClosed = (Boolean) nodeService.getProperty(actionedUponNodeRef, PROP_IS_CLOSED);
|
||||
Boolean isClosed = (Boolean) getNodeService().getProperty(actionedUponNodeRef, PROP_IS_CLOSED);
|
||||
if (Boolean.TRUE.equals(isClosed))
|
||||
{
|
||||
nodeService.setProperty(actionedUponNodeRef, PROP_IS_CLOSED, false);
|
||||
getNodeService().setProperty(actionedUponNodeRef, PROP_IS_CLOSED, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -47,11 +47,11 @@ public class RejectAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef) &&
|
||||
nodeService.getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null)
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef) &&
|
||||
getNodeService().getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null)
|
||||
{
|
||||
recordService.rejectRecord(actionedUponNodeRef, (String) action.getParameterValue(PARAM_REASON));
|
||||
getRecordService().rejectRecord(actionedUponNodeRef, (String) action.getParameterValue(PARAM_REASON));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Relinquish Hold Action
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class RelinquishHoldAction extends RMActionExecuterAbstractBase
|
||||
@@ -41,9 +41,9 @@ public class RelinquishHoldAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (freezeService.isHold(actionedUponNodeRef))
|
||||
if (getFreezeService().isHold(actionedUponNodeRef))
|
||||
{
|
||||
freezeService.relinquish(actionedUponNodeRef);
|
||||
getFreezeService().relinquish(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -79,10 +79,10 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) &&
|
||||
!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
recordService.isRecord(actionedUponNodeRef) &&
|
||||
!recordService.isDeclared(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef) &&
|
||||
!getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
|
||||
getRecordService().isRecord(actionedUponNodeRef) &&
|
||||
!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
|
||||
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
|
||||
@@ -120,10 +120,10 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
|
||||
*/
|
||||
private NodeRef getWorkflowPackage(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
NodeRef workflowPackage = (NodeRef) action.getParameterValue(WorkflowModel.ASSOC_PACKAGE.toPrefixString(namespaceService));
|
||||
NodeRef workflowPackage = (NodeRef) action.getParameterValue(WorkflowModel.ASSOC_PACKAGE.toPrefixString(getNamespaceService()));
|
||||
workflowPackage = workflowService.createPackage(workflowPackage);
|
||||
ChildAssociationRef childAssoc = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
nodeService.addChild(workflowPackage, actionedUponNodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName());
|
||||
ChildAssociationRef childAssoc = getNodeService().getPrimaryParent(actionedUponNodeRef);
|
||||
getNodeService().addChild(workflowPackage, actionedUponNodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName());
|
||||
return workflowPackage;
|
||||
}
|
||||
|
||||
|
@@ -137,23 +137,23 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// get node type
|
||||
nodeService.getType(actionedUponNodeRef);
|
||||
getNodeService().getType(actionedUponNodeRef);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("split email:" + actionedUponNodeRef);
|
||||
}
|
||||
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
if (!recordService.isDeclared(actionedUponNodeRef))
|
||||
if (!getRecordService().isDeclared(actionedUponNodeRef))
|
||||
{
|
||||
ChildAssociationRef parent = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
ChildAssociationRef parent = getNodeService().getPrimaryParent(actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Check whether the email message has already been split - do nothing if it has already been split
|
||||
*/
|
||||
List<AssociationRef> refs = nodeService.getTargetAssocs(actionedUponNodeRef, ImapModel.ASSOC_IMAP_ATTACHMENT);
|
||||
List<AssociationRef> refs = getNodeService().getTargetAssocs(actionedUponNodeRef, ImapModel.ASSOC_IMAP_ATTACHMENT);
|
||||
if(refs.size() > 0)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -168,7 +168,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
*/
|
||||
try
|
||||
{
|
||||
ContentReader reader = contentService.getReader(actionedUponNodeRef, ContentModel.PROP_CONTENT);
|
||||
ContentReader reader = getContentService().getReader(actionedUponNodeRef, ContentModel.PROP_CONTENT);
|
||||
InputStream is = reader.getContentInputStream();
|
||||
MimeMessage mimeMessage = new MimeMessage(null, is);
|
||||
Object content = mimeMessage.getContent();
|
||||
@@ -225,7 +225,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
Map<QName, Serializable> messageProperties = nodeService.getProperties(messageNodeRef);
|
||||
Map<QName, Serializable> messageProperties = getNodeService().getProperties(messageNodeRef);
|
||||
String messageTitle = (String)messageProperties.get(ContentModel.PROP_NAME);
|
||||
if(messageTitle == null)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Create an attachment node in the same folder as the message
|
||||
*/
|
||||
ChildAssociationRef attachmentRef = nodeService.createNode(parentNodeRef,
|
||||
ChildAssociationRef attachmentRef = getNodeService().createNode(parentNodeRef,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName),
|
||||
ContentModel.TYPE_CONTENT,
|
||||
@@ -254,7 +254,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
/**
|
||||
* Write the content into the new attachment node
|
||||
*/
|
||||
ContentWriter writer = contentService.getWriter(attachmentRef.getChildRef(), ContentModel.PROP_CONTENT, true);
|
||||
ContentWriter writer = getContentService().getWriter(attachmentRef.getChildRef(), ContentModel.PROP_CONTENT, true);
|
||||
writer.setMimetype(contentType.getBaseType());
|
||||
OutputStream os = writer.getContentOutputStream();
|
||||
FileCopyUtils.copy(part.getInputStream(), os);
|
||||
@@ -281,7 +281,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
|
||||
getRelationshipService().addRelationship(relationshipUniqueName, parentRef, childRef);
|
||||
|
||||
// add the IMAP attachment aspect
|
||||
nodeService.createAssociation(
|
||||
getNodeService().createAssociation(
|
||||
parentRef,
|
||||
childRef,
|
||||
ImapModel.ASSOC_IMAP_ATTACHMENT);
|
||||
|
@@ -101,9 +101,9 @@ public class TransferAction extends RMDispositionActionExecuterAbstractBase
|
||||
action.setParameterValue(ActionExecuter.PARAM_RESULT, transferNodeRef);
|
||||
|
||||
// Cut off the disposable item if it's not cut off already
|
||||
if (!dispositionService.isDisposableItemCutoff(dispositionLifeCycleNodeRef))
|
||||
if (!getDispositionService().isDisposableItemCutoff(dispositionLifeCycleNodeRef))
|
||||
{
|
||||
dispositionService.cutoffDisposableItem(dispositionLifeCycleNodeRef);
|
||||
getDispositionService().cutoffDisposableItem(dispositionLifeCycleNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -73,8 +73,8 @@ public class TransferCompleteAction extends RMActionExecuterAbstractBase
|
||||
*/
|
||||
private void checkTransferSubClass(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
QName type = nodeService.getType(actionedUponNodeRef);
|
||||
if (!dictionaryService.isSubClass(type, TYPE_TRANSFER))
|
||||
QName type = getNodeService().getType(actionedUponNodeRef);
|
||||
if (!getDictionaryService().isSubClass(type, TYPE_TRANSFER))
|
||||
{
|
||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NODE_NOT_TRANSFER));
|
||||
}
|
||||
|
@@ -43,11 +43,11 @@ public class UnCutoffAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
||||
nodeService.hasAspect(actionedUponNodeRef, ASPECT_CUT_OFF))
|
||||
if (getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
||||
getNodeService().hasAspect(actionedUponNodeRef, ASPECT_CUT_OFF))
|
||||
{
|
||||
// Get the last disposition action
|
||||
DispositionAction da = dispositionService.getLastCompletedDispostionAction(actionedUponNodeRef);
|
||||
DispositionAction da = getDispositionService().getLastCompletedDispostionAction(actionedUponNodeRef);
|
||||
|
||||
// Check that the last disposition action was a cutoff
|
||||
if (da == null || !da.getName().equals("cutoff"))
|
||||
@@ -57,33 +57,33 @@ public class UnCutoffAction extends RMActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
// Remove the cutoff aspect and add the uncutoff aspect
|
||||
nodeService.removeAspect(actionedUponNodeRef, ASPECT_CUT_OFF);
|
||||
nodeService.addAspect(actionedUponNodeRef, ASPECT_UNCUT_OFF, null);
|
||||
if (recordFolderService.isRecordFolder(actionedUponNodeRef))
|
||||
getNodeService().removeAspect(actionedUponNodeRef, ASPECT_CUT_OFF);
|
||||
getNodeService().addAspect(actionedUponNodeRef, ASPECT_UNCUT_OFF, null);
|
||||
if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
|
||||
{
|
||||
List<NodeRef> records = recordService.getRecords(actionedUponNodeRef);
|
||||
List<NodeRef> records = getRecordService().getRecords(actionedUponNodeRef);
|
||||
for (NodeRef record : records)
|
||||
{
|
||||
nodeService.removeAspect(record, ASPECT_CUT_OFF);
|
||||
nodeService.addAspect(record, ASPECT_UNCUT_OFF, null);
|
||||
getNodeService().removeAspect(record, ASPECT_CUT_OFF);
|
||||
getNodeService().addAspect(record, ASPECT_UNCUT_OFF, null);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete the current disposition action
|
||||
DispositionAction currentDa = dispositionService.getNextDispositionAction(actionedUponNodeRef);
|
||||
DispositionAction currentDa = getDispositionService().getNextDispositionAction(actionedUponNodeRef);
|
||||
if (currentDa != null)
|
||||
{
|
||||
nodeService.deleteNode(currentDa.getNodeRef());
|
||||
getNodeService().deleteNode(currentDa.getNodeRef());
|
||||
}
|
||||
|
||||
// Move the previous (cutoff) disposition back to be current
|
||||
nodeService.moveNode(da.getNodeRef(), actionedUponNodeRef, ASSOC_NEXT_DISPOSITION_ACTION, ASSOC_NEXT_DISPOSITION_ACTION);
|
||||
getNodeService().moveNode(da.getNodeRef(), actionedUponNodeRef, ASSOC_NEXT_DISPOSITION_ACTION, ASSOC_NEXT_DISPOSITION_ACTION);
|
||||
|
||||
// Reset the started and completed property values
|
||||
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_AT, null);
|
||||
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_BY, null);
|
||||
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_COMPLETED_AT, null);
|
||||
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_COMPLETED_BY, null);
|
||||
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_AT, null);
|
||||
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_BY, null);
|
||||
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_COMPLETED_AT, null);
|
||||
getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_COMPLETED_BY, null);
|
||||
}
|
||||
}
|
||||
}
|
@@ -44,16 +44,16 @@ public class UndeclareRecordAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef))
|
||||
if (getNodeService().exists(actionedUponNodeRef))
|
||||
{
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
// repoen if already complete and not frozen
|
||||
if (recordService.isDeclared(actionedUponNodeRef) &&
|
||||
!freezeService.isFrozen(actionedUponNodeRef))
|
||||
if (getRecordService().isDeclared(actionedUponNodeRef) &&
|
||||
!getFreezeService().isFrozen(actionedUponNodeRef))
|
||||
{
|
||||
// Remove the declared aspect
|
||||
this.nodeService.removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD);
|
||||
this.getNodeService().removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -45,10 +45,10 @@ public class UndoEventAction extends RMActionExecuterAbstractBase
|
||||
{
|
||||
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
|
||||
|
||||
if (this.nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
if (this.getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE))
|
||||
{
|
||||
// Get the next disposition action
|
||||
DispositionAction da = this.dispositionService.getNextDispositionAction(actionedUponNodeRef);
|
||||
DispositionAction da = this.getDispositionService().getNextDispositionAction(actionedUponNodeRef);
|
||||
if (da != null)
|
||||
{
|
||||
// undo completed event
|
||||
|
@@ -24,7 +24,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* Unfreeze Action
|
||||
*
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class UnfreezeAction extends RMActionExecuterAbstractBase
|
||||
@@ -36,6 +36,6 @@ public class UnfreezeAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
freezeService.unFreeze(actionedUponNodeRef);
|
||||
getFreezeService().unFreeze(actionedUponNodeRef);
|
||||
}
|
||||
}
|
@@ -78,7 +78,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
|
||||
*/
|
||||
private void propagateChangeToChildrenOf(NodeRef actionedUponNodeRef)
|
||||
{
|
||||
Map<QName, Serializable> parentProps = nodeService.getProperties(actionedUponNodeRef);
|
||||
Map<QName, Serializable> parentProps = getNodeService().getProperties(actionedUponNodeRef);
|
||||
|
||||
// parent vital record indicator, default to null if not set
|
||||
boolean parentVri = false;
|
||||
@@ -90,41 +90,41 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
|
||||
|
||||
Period parentReviewPeriod = (Period) parentProps.get(PROP_REVIEW_PERIOD);
|
||||
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(actionedUponNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
List<ChildAssociationRef> assocs = this.getNodeService().getChildAssocs(actionedUponNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
for (ChildAssociationRef nextAssoc : assocs)
|
||||
{
|
||||
NodeRef nextChild = nextAssoc.getChildRef();
|
||||
|
||||
if (filePlanService.isFilePlanComponent(nextChild) &&
|
||||
!freezeService.isFrozen(nextChild))
|
||||
!getFreezeService().isFrozen(nextChild))
|
||||
{
|
||||
// If the child is a record, then the VitalRecord aspect needs to be applied or updated
|
||||
if (recordService.isRecord(nextChild))
|
||||
if (getRecordService().isRecord(nextChild))
|
||||
{
|
||||
if (parentVri)
|
||||
{
|
||||
VitalRecordDefinition vrDefn = vitalRecordService.getVitalRecordDefinition(nextChild);
|
||||
VitalRecordDefinition vrDefn = getVitalRecordService().getVitalRecordDefinition(nextChild);
|
||||
Map<QName, Serializable> aspectProps = new HashMap<QName, Serializable>();
|
||||
aspectProps.put(PROP_REVIEW_AS_OF, vrDefn.getNextReviewDate());
|
||||
|
||||
nodeService.addAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD, aspectProps);
|
||||
getNodeService().addAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD, aspectProps);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeService.removeAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD);
|
||||
getNodeService().removeAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD);
|
||||
}
|
||||
}
|
||||
else
|
||||
// copy the vitalRecordDefinition properties from the parent to the child
|
||||
{
|
||||
Map<QName, Serializable> childProps = nodeService.getProperties(nextChild);
|
||||
Map<QName, Serializable> childProps = getNodeService().getProperties(nextChild);
|
||||
childProps.put(PROP_REVIEW_PERIOD, parentReviewPeriod);
|
||||
childProps.put(PROP_VITAL_RECORD_INDICATOR, parentVri);
|
||||
nodeService.setProperties(nextChild, childProps);
|
||||
getNodeService().setProperties(nextChild, childProps);
|
||||
}
|
||||
|
||||
// Recurse down the containment hierarchy to all containers
|
||||
if (!recordService.isRecord(nextChild))
|
||||
if (!getRecordService().isRecord(nextChild))
|
||||
{
|
||||
this.propagateChangeToChildrenOf(nextChild);
|
||||
}
|
||||
|
@@ -43,16 +43,16 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
VitalRecordDefinition vrDef = vitalRecordService.getVitalRecordDefinition(actionedUponNodeRef);
|
||||
VitalRecordDefinition vrDef = getVitalRecordService().getVitalRecordDefinition(actionedUponNodeRef);
|
||||
if (vrDef != null && vrDef.isEnabled())
|
||||
{
|
||||
if (recordService.isRecord(actionedUponNodeRef))
|
||||
if (getRecordService().isRecord(actionedUponNodeRef))
|
||||
{
|
||||
reviewRecord(actionedUponNodeRef, vrDef);
|
||||
}
|
||||
else if (recordFolderService.isRecordFolder(actionedUponNodeRef))
|
||||
else if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
|
||||
{
|
||||
for (NodeRef record : recordService.getRecords(actionedUponNodeRef))
|
||||
for (NodeRef record : getRecordService().getRecords(actionedUponNodeRef))
|
||||
{
|
||||
reviewRecord(record, vrDef);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
this.nodeService.setProperty(nodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
this.getNodeService().setProperty(nodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||
//TODO And record previous review date, time, user
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user