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:
Tuna Aksoy
2014-11-01 21:07:06 +00:00
parent c0f99cf06c
commit a6fb22a8cc
34 changed files with 374 additions and 238 deletions

View File

@@ -64,70 +64,86 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
BeanNameAware BeanNameAware
{ {
/** Namespace service */ /** Namespace service */
protected NamespaceService namespaceService; private NamespaceService namespaceService;
/** Used to control transactional behaviour including post-commit auditing */ /** Used to control transactional behaviour including post-commit auditing */
protected TransactionService transactionService; private TransactionService transactionService;
/** Node service */ /** Node service */
protected NodeService nodeService; private NodeService nodeService;
/** Dictionary service */ /** Dictionary service */
protected DictionaryService dictionaryService; private DictionaryService dictionaryService;
/** Content service */ /** Content service */
protected ContentService contentService; private ContentService contentService;
/** Action service */ /** Action service */
protected ActionService actionService; private ActionService actionService;
/** Records management action service */ /** Records management action service */
protected RecordsManagementAuditService recordsManagementAuditService; private RecordsManagementAuditService recordsManagementAuditService;
/** Records management action service */ /** Records management action service */
protected RecordsManagementActionService recordsManagementActionService; private RecordsManagementActionService recordsManagementActionService;
/** Record service */ /** Record service */
protected RecordService recordService; private RecordService recordService;
/** Disposition service */ /** Disposition service */
protected DispositionService dispositionService; private DispositionService dispositionService;
/** Vital record service */ /** Vital record service */
protected VitalRecordService vitalRecordService; private VitalRecordService vitalRecordService;
/** Records management event service */ /** Records management event service */
protected RecordsManagementEventService recordsManagementEventService; private RecordsManagementEventService recordsManagementEventService;
/** Records management action service */ /** Records management action service */
protected RecordsManagementAdminService recordsManagementAdminService; private RecordsManagementAdminService recordsManagementAdminService;
/** Ownable service **/ /** Ownable service **/
protected OwnableService ownableService; private OwnableService ownableService;
/** Freeze service */ /** Freeze service */
protected FreezeService freezeService; private FreezeService freezeService;
/** Model security service */ /** Model security service */
protected ModelSecurityService modelSecurityService; private ModelSecurityService modelSecurityService;
/** Record folder service */ /** Record folder service */
protected RecordFolderService recordFolderService; private RecordFolderService recordFolderService;
/** Hold service */ /** Hold service */
protected HoldService holdService; private HoldService holdService;
/** List of kinds for which this action is applicable */ /** List of kinds for which this action is applicable */
protected Set<FilePlanComponentKind> applicableKinds = new HashSet<FilePlanComponentKind>(); 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) public void setTransactionService(TransactionService transactionService)
{ {
this.transactionService = transactionService; this.transactionService = transactionService;
} }
/**
* Gets the namespace service
*/
protected NamespaceService getNamespaceService()
{
return this.namespaceService;
}
/** /**
* Set the namespace service * Set the namespace service
*/ */
@@ -136,6 +152,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
} }
/**
* Gets the node service
*/
protected NodeService getNodeService()
{
return this.nodeService;
}
/** /**
* Set node service * Set node service
*/ */
@@ -144,6 +168,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.nodeService = nodeService; this.nodeService = nodeService;
} }
/**
* Gets the dictionary service
*/
protected DictionaryService getDictionaryService()
{
return this.dictionaryService;
}
/** /**
* Set the dictionary service * Set the dictionary service
*/ */
@@ -152,6 +184,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.dictionaryService = dictionaryService; this.dictionaryService = dictionaryService;
} }
/**
* Gets the content service
*/
protected ContentService getContentService()
{
return this.contentService;
}
/** /**
* Set the content service * Set the content service
*/ */
@@ -160,6 +200,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.contentService = contentService; this.contentService = contentService;
} }
/**
* Gets the action service
*/
protected ActionService getActionService()
{
return this.actionService;
}
/** /**
* Set action service * Set action service
*/ */
@@ -168,6 +216,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.actionService = actionService; 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 * Set the audit service that action details will be sent to
*/ */
@@ -176,6 +232,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.recordsManagementAuditService = recordsManagementAuditService; this.recordsManagementAuditService = recordsManagementAuditService;
} }
/**
* Gets the records management action service
*/
protected RecordsManagementActionService getRecordsManagementActionService()
{
return this.recordsManagementActionService;
}
/** /**
* Set records management service * Set records management service
*/ */
@@ -184,6 +248,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.recordsManagementActionService = recordsManagementActionService; this.recordsManagementActionService = recordsManagementActionService;
} }
/**
* Gets the disposition service
*/
protected DispositionService getDispositionService()
{
return this.dispositionService;
}
/** /**
* Set the disposition service * Set the disposition service
*/ */
@@ -192,6 +264,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.dispositionService = dispositionService; this.dispositionService = dispositionService;
} }
/**
* Gets the vital record service
*/
protected VitalRecordService getVitalRecordService()
{
return this.vitalRecordService;
}
/** /**
* @param vitalRecordService vital record service * @param vitalRecordService vital record service
*/ */
@@ -200,6 +280,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.vitalRecordService = vitalRecordService; this.vitalRecordService = vitalRecordService;
} }
/**
* Gets the records management event service
*/
protected RecordsManagementEventService getRecordsManagementEventService()
{
return this.recordsManagementEventService;
}
/** /**
* Set records management event service * Set records management event service
*/ */
@@ -208,6 +296,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.recordsManagementEventService = recordsManagementEventService; this.recordsManagementEventService = recordsManagementEventService;
} }
/**
* Gets the ownable service
*/
protected OwnableService getOwnableService()
{
return this.ownableService;
}
/** /**
* Set the ownable service * Set the ownable service
* @param ownableSerice * @param ownableSerice
@@ -217,6 +313,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.ownableService = ownableService; this.ownableService = ownableService;
} }
/**
* Gets the freeze service
*/
protected FreezeService getFreezeService()
{
return this.freezeService;
}
/** /**
* Set freeze service * Set freeze service
* *
@@ -227,6 +331,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.freezeService = freezeService; this.freezeService = freezeService;
} }
/**
* Gets the record service
*/
protected RecordService getRecordService()
{
return this.recordService;
}
/** /**
* Set record service * Set record service
* *
@@ -237,6 +349,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.recordService = recordService; this.recordService = recordService;
} }
/**
* @return records management admin service
*/
protected RecordsManagementAdminService getRecordsManagementAdminService()
{
return recordsManagementAdminService;
}
/** /**
* @param recordsManagementAdminService records management admin service * @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; this.modelSecurityService = modelSecurityService;
} }
/**
* Gets the record folder service
*/
protected RecordFolderService getRecordFolderService()
{
return this.recordFolderService;
}
/** /**
* @param recordFolderService record folder service * @param recordFolderService record folder service
*/ */
@@ -269,6 +397,14 @@ public abstract class RMActionExecuterAbstractBase extends PropertySubActionExe
this.recordFolderService = recordFolderService; this.recordFolderService = recordFolderService;
} }
/**
* Gets the hold service
*/
protected HoldService getHoldService()
{
return this.holdService;
}
/** /**
* @param holdService hold service * @param holdService hold service
*/ */

View File

@@ -117,28 +117,28 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
{ {
// Check the eligibility of the action // Check the eligibility of the action
if (!checkEligibility(actionedUponNodeRef) || if (!checkEligibility(actionedUponNodeRef) ||
dispositionService.isNextDispositionActionEligible(actionedUponNodeRef)) getDispositionService().isNextDispositionActionEligible(actionedUponNodeRef))
{ {
if (di.isRecordLevelDisposition()) if (di.isRecordLevelDisposition())
{ {
// Check that we do indeed have a record // 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 // Can only execute disposition action on record if declared
if (recordService.isDeclared(actionedUponNodeRef)) if (getRecordService().isDeclared(actionedUponNodeRef))
{ {
// Indicate that the disposition action is underway // Indicate that the disposition action is underway
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date()); getNodeService().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_BY, AuthenticationUtil.getRunAsUser());
// Execute record level disposition // Execute record level disposition
executeRecordLevelDisposition(action, actionedUponNodeRef); executeRecordLevelDisposition(action, actionedUponNodeRef);
if (nodeService.exists(nextDispositionActionNodeRef) && if (getNodeService().exists(nextDispositionActionNodeRef) &&
getSetDispositionActionComplete()) getSetDispositionActionComplete())
{ {
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date()); getNodeService().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_BY, AuthenticationUtil.getRunAsUser());
} }
} }
else else
@@ -153,22 +153,22 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
} }
else else
{ {
if (recordFolderService.isRecordFolder(actionedUponNodeRef)) if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
{ {
if (recordFolderService.isRecordFolderDeclared(actionedUponNodeRef)) if (getRecordFolderService().isRecordFolderDeclared(actionedUponNodeRef))
{ {
// Indicate that the disposition action is underway // Indicate that the disposition action is underway
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_STARTED_AT, new Date()); getNodeService().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_BY, AuthenticationUtil.getRunAsUser());
executeRecordFolderLevelDisposition(action, actionedUponNodeRef); executeRecordFolderLevelDisposition(action, actionedUponNodeRef);
// Indicate that the disposition action is compelte // Indicate that the disposition action is compelte
if (nodeService.exists(nextDispositionActionNodeRef) && if (getNodeService().exists(nextDispositionActionNodeRef) &&
getSetDispositionActionComplete()) getSetDispositionActionComplete())
{ {
nodeService.setProperty(nextDispositionActionNodeRef, PROP_DISPOSITION_ACTION_COMPLETED_AT, new Date()); getNodeService().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_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 // Update the disposition schedule
dispositionService.updateNextDispositionAction(actionedUponNodeRef); getDispositionService().updateNextDispositionAction(actionedUponNodeRef);
} }
} }
else else
@@ -225,7 +225,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
protected DispositionSchedule checkDispositionActionExecutionValidity(NodeRef nodeRef, NodeRef nextDispositionActionNodeRef, boolean throwError) protected DispositionSchedule checkDispositionActionExecutionValidity(NodeRef nodeRef, NodeRef nextDispositionActionNodeRef, boolean throwError)
{ {
// Check the node has associated disposition instructions // Check the node has associated disposition instructions
DispositionSchedule di = dispositionService.getDispositionSchedule(nodeRef); DispositionSchedule di = getDispositionService().getDispositionSchedule(nodeRef);
if (di == null) if (di == null)
{ {
if (throwError) if (throwError)
@@ -239,7 +239,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
} }
// Check the node has the disposition schedule aspect applied // 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) if (throwError)
{ {
@@ -266,7 +266,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
return null; 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 (actionName == null || !actionName.equals(getName()))
{ {
if (throwError) if (throwError)
@@ -293,7 +293,7 @@ public abstract class RMDispositionActionExecuterAbstractBase extends RMActionEx
private NodeRef getNextDispostionAction(NodeRef nodeRef) private NodeRef getNextDispostionAction(NodeRef nodeRef)
{ {
NodeRef result = null; 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) if (assocs.size() != 0)
{ {
result = assocs.get(0).getChildRef(); result = assocs.get(0).getChildRef();

View File

@@ -65,7 +65,7 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
{ {
for (String type : getRecordTypes(action)) for (String type : getRecordTypes(action))
{ {
recordService.addRecordType(actionedUponNodeRef, QName.createQName(type, namespaceService)); getRecordService().addRecordType(actionedUponNodeRef, QName.createQName(type, getNamespaceService()));
} }
} }
else if (logger.isWarnEnabled()) else if (logger.isWarnEnabled())
@@ -88,10 +88,10 @@ public class AddRecordTypeAction extends RMActionExecuterAbstractBase
private boolean eligibleForAction(NodeRef actionedUponNodeRef) private boolean eligibleForAction(NodeRef actionedUponNodeRef)
{ {
boolean result = false; boolean result = false;
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef) &&
recordService.isRecord(actionedUponNodeRef) && getRecordService().isRecord(actionedUponNodeRef) &&
!recordService.isDeclared(actionedUponNodeRef)) !getRecordService().isDeclared(actionedUponNodeRef))
{ {
result = true; result = true;
} }

View File

@@ -55,7 +55,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
public void setCustomTypeAspect(String customTypeAspect) 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); logger.debug("Executing action [" + action.getActionDefinitionName() + "] on " + actionedUponNodeRef);
} }
if (recordService.isRecord(actionedUponNodeRef)) if (getRecordService().isRecord(actionedUponNodeRef))
{ {
// Apply the appropriate aspect and set the properties. // Apply the appropriate aspect and set the properties.
Map<QName, Serializable> aspectProps = getPropertyValues(action); Map<QName, Serializable> aspectProps = getPropertyValues(action);
this.nodeService.addAspect(actionedUponNodeRef, customTypeAspect, aspectProps); this.getNodeService().addAspect(actionedUponNodeRef, customTypeAspect, aspectProps);
} }
else if (logger.isWarnEnabled()) else if (logger.isWarnEnabled())
{ {
@@ -88,7 +88,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
@Override @Override
protected final void addParameterDefinitions(List<ParameterDefinition> paramList) protected final void addParameterDefinitions(List<ParameterDefinition> paramList)
{ {
AspectDefinition aspectDef = dictionaryService.getAspect(customTypeAspect); AspectDefinition aspectDef = getDictionaryService().getAspect(customTypeAspect);
for (PropertyDefinition propDef : aspectDef.getProperties().values()) for (PropertyDefinition propDef : aspectDef.getProperties().values())
{ {
QName propName = propDef.getName(); QName propName = propDef.getName();
@@ -109,7 +109,7 @@ public class ApplyCustomTypeAction extends RMActionExecuterAbstractBase
Map<QName, Serializable> result = new HashMap<QName, Serializable>(paramValues.size()); Map<QName, Serializable> result = new HashMap<QName, Serializable>(paramValues.size());
for (Map.Entry<String, Serializable> entry : paramValues.entrySet()) 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()); 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. // We can take these parameter definitions from the properties defined in the dod model.
if (this.parameterDefinitions == null) if (this.parameterDefinitions == null)
{ {
AspectDefinition aspectDefinition = dictionaryService.getAspect(customTypeAspect); AspectDefinition aspectDefinition = getDictionaryService().getAspect(customTypeAspect);
if (aspectDefinition == null) if (aspectDefinition == null)
{ {
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CUSTOM_ASPECT_NOT_RECOGNISED, customTypeAspect)); 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()) for (Map.Entry<QName, PropertyDefinition> entry : props.entrySet())
{ {
String paramName = entry.getKey().toPrefixString(namespaceService); String paramName = entry.getKey().toPrefixString(getNamespaceService());
PropertyDefinition value = entry.getValue(); PropertyDefinition value = entry.getValue();
QName paramType = value.getDataType().getName(); QName paramType = value.getDataType().getName();
boolean paramIsMandatory = value.isMandatory(); boolean paramIsMandatory = value.isMandatory();

View File

@@ -69,7 +69,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) 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; return;
} }
@@ -77,14 +77,14 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
List<QName> changedProps = (List<QName>)action.getParameterValue(CHANGED_PROPERTIES); List<QName> changedProps = (List<QName>)action.getParameterValue(CHANGED_PROPERTIES);
// Navigate up the containment hierarchy to get the record category grandparent and schedule. // Navigate up the containment hierarchy to get the record category grandparent and schedule.
NodeRef dispositionScheduleNode = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef(); NodeRef dispositionScheduleNode = getNodeService().getPrimaryParent(actionedUponNodeRef).getParentRef();
NodeRef rmContainer = nodeService.getPrimaryParent(dispositionScheduleNode).getParentRef(); NodeRef rmContainer = getNodeService().getPrimaryParent(dispositionScheduleNode).getParentRef();
DispositionSchedule dispositionSchedule = dispositionService.getAssociatedDispositionSchedule(rmContainer); DispositionSchedule dispositionSchedule = getDispositionService().getAssociatedDispositionSchedule(rmContainer);
behaviourFilter.disableBehaviour(); behaviourFilter.disableBehaviour();
try try
{ {
List<NodeRef> disposableItems = dispositionService.getDisposableItems(dispositionSchedule); List<NodeRef> disposableItems = getDispositionService().getDisposableItems(dispositionSchedule);
for (NodeRef disposableItem : disposableItems) for (NodeRef disposableItem : disposableItems)
{ {
updateDisposableItem(dispositionSchedule, disposableItem, actionedUponNodeRef, changedProps); 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 // We need to check that this folder is under the management of the disposition schedule that
// has been updated // has been updated
DispositionSchedule itemDs = dispositionService.getDispositionSchedule(disposableItem); DispositionSchedule itemDs = getDispositionService().getDispositionSchedule(disposableItem);
if (itemDs != null && if (itemDs != null &&
itemDs.getNodeRef().equals(ds.getNodeRef())) 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 // disposition lifecycle already exists for node so process changes
processActionDefinitionChanges(dispositionActionDefinition, changedProps, disposableItem); processActionDefinitionChanges(dispositionActionDefinition, changedProps, disposableItem);
@@ -119,7 +119,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
else else
{ {
// disposition lifecycle does not exist on the node so setup disposition // disposition lifecycle does not exist on the node so setup disposition
dispositionService.updateNextDispositionAction(disposableItem); getDispositionService().updateNextDispositionAction(disposableItem);
} }
// update rolled up search information // update rolled up search information
@@ -134,14 +134,14 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
*/ */
private void rollupSearchProperties(NodeRef disposableItem) private void rollupSearchProperties(NodeRef disposableItem)
{ {
DispositionAction da = dispositionService.getNextDispositionAction(disposableItem); DispositionAction da = getDispositionService().getNextDispositionAction(disposableItem);
if (da != null) 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_NAME, da.getName());
props.put(PROP_RS_DISPOSITION_ACTION_AS_OF, da.getAsOfDate()); 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(); DispositionActionDefinition daDefinition = da.getDispositionActionDefinition();
Period period = daDefinition.getPeriod(); Period period = daDefinition.getPeriod();
@@ -164,7 +164,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
} }
props.put(PROP_RS_DISPOSITION_EVENTS, (Serializable)list); 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, // 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 // 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)) if (doesChangedStepAffectNextAction(dispositionActionDef, nextAction))
{ {
// the change does effect the nextAction for this node // 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)) if (changedProps.contains(PROP_DISPOSITION_ACTION_NAME))
{ {
String action = (String)nodeService.getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME); String action = (String)getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_ACTION_NAME);
nodeService.setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_ACTION, action); getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_ACTION, action);
} }
} }
} }
@@ -240,7 +240,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
private void persistPeriodChanges(NodeRef dispositionActionDef, DispositionAction nextAction) private void persistPeriodChanges(NodeRef dispositionActionDef, DispositionAction nextAction)
{ {
Date newAsOfDate = null; Date newAsOfDate = null;
Period dispositionPeriod = (Period) nodeService.getProperty(dispositionActionDef, PROP_DISPOSITION_PERIOD); Period dispositionPeriod = (Period) getNodeService().getProperty(dispositionActionDef, PROP_DISPOSITION_PERIOD);
if (dispositionPeriod != null) if (dispositionPeriod != null)
{ {
@@ -255,7 +255,7 @@ public class BroadcastDispositionActionDefinitionUpdateAction extends RMActionEx
"' (" + nextAction.getNodeRef() + ") to: " + newAsOfDate); "' (" + nextAction.getNodeRef() + ") to: " + newAsOfDate);
} }
nodeService.setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_AS_OF, newAsOfDate); getNodeService().setProperty(nextAction.getNodeRef(), PROP_DISPOSITION_AS_OF, newAsOfDate);
} }
@Override @Override

View File

@@ -49,7 +49,7 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
@Override @Override
public Void doWork() public Void doWork()
{ {
recordFolderService.closeRecordFolder(actionedUponNodeRef); getRecordFolderService().closeRecordFolder(actionedUponNodeRef);
return null; return null;
} }
@@ -69,9 +69,9 @@ public class CloseRecordFolderAction extends RMActionExecuterAbstractBase
private boolean eligibleForAction(NodeRef actionedUponNodeRef) private boolean eligibleForAction(NodeRef actionedUponNodeRef)
{ {
boolean result = false; boolean result = false;
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef) &&
!TYPE_UNFILED_RECORD_FOLDER.equals(nodeService.getType(actionedUponNodeRef))) !TYPE_UNFILED_RECORD_FOLDER.equals(getNodeService().getType(actionedUponNodeRef)))
{ {
result = true; result = true;
} }

View File

@@ -66,18 +66,18 @@ public class CompleteEventAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef)) !getFreezeService().isFrozen(actionedUponNodeRef))
{ {
/** get parameter values */ /** get parameter values */
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME); String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME);
String eventCompletedBy = (String)action.getParameterValue(PARAM_EVENT_COMPLETED_BY); String eventCompletedBy = (String)action.getParameterValue(PARAM_EVENT_COMPLETED_BY);
Date eventCompletedAt = (Date)action.getParameterValue(PARAM_EVENT_COMPLETED_AT); 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 // Get the next disposition action
DispositionAction da = this.dispositionService.getNextDispositionAction(actionedUponNodeRef); DispositionAction da = this.getDispositionService().getNextDispositionAction(actionedUponNodeRef);
if (da != null) if (da != null)
{ {
// complete event // complete event

View File

@@ -108,7 +108,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
String actionName = action.getActionDefinitionName(); String actionName = action.getActionDefinitionName();
if (isOkToProceedWithAction(actionedUponNodeRef, actionName)) if (isOkToProceedWithAction(actionedUponNodeRef, actionName))
{ {
QName actionedUponType = nodeService.getType(actionedUponNodeRef); QName actionedUponType = getNodeService().getType(actionedUponNodeRef);
boolean targetIsUnfiledRecords; boolean targetIsUnfiledRecords;
if (ACTION_FILETO.equals(action.getActionDefinitionName())) if (ACTION_FILETO.equals(action.getActionDefinitionName()))
@@ -117,7 +117,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
else 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); || TYPE_UNFILED_RECORD_FOLDER.equals(actionedUponType);
} }
@@ -150,7 +150,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
else if(getMode() == CopyMoveLinkFileToActionMode.LINK) else if(getMode() == CopyMoveLinkFileToActionMode.LINK)
{ {
recordService.link(actionedUponNodeRef, finalRecordFolder); getRecordService().link(actionedUponNodeRef, finalRecordFolder);
} }
} }
catch (FileNotFoundException fileNotFound) 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 // Check that the incoming parameters are valid prior to performing any action
boolean okToProceed = false; 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)) if(ACTION_FILETO.equals(actionName))
{ {
// file to action can only be performed on unfiled records // 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()) 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"); 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)) else if(ACTION_LINKTO.equals(actionName))
{ {
// link to action can only be performed on filed records // 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()) 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"); 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) 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 // 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) if (target == null)
{ {
@@ -225,7 +225,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
if(targetIsUnfiledRecords) 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)) 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."); 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 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"); 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"); 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) if(create)
{ {
creating = true; 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); nodeRef = createChild(action, parent, childName, targetisUnfiledRecords, lastAsFolder);
} }
else else
@@ -309,7 +309,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
else else
{ {
QName nodeType = nodeService.getType(nodeRef); QName nodeType = getNodeService().getType(nodeRef);
if(nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) || if(nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) ||
nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) || nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) ||
nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_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) private NodeRef getChild(NodeRef parent, String childName)
{ {
NodeRef child = null; NodeRef child = null;
List<ChildAssociationRef> children = nodeService.getChildAssocs(parent); List<ChildAssociationRef> children = getNodeService().getChildAssocs(parent);
for (ChildAssociationRef childAssoc : children) { for (ChildAssociationRef childAssoc : children) {
NodeRef childNodeRef = childAssoc.getChildRef(); 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)) if(existingChildName.equals(childName))
{ {
child = childNodeRef; child = childNodeRef;
@@ -371,11 +371,11 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
} }
else if(lastAsFolder) else if(lastAsFolder)
{ {
child = recordFolderService.createRecordFolder(parent, childName); child = getRecordFolderService().createRecordFolder(parent, childName);
} }
else 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."); 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) private NodeRef getContext(Action action, NodeRef actionedUponNodeRef, boolean targetisUnfiledRecords)
{ {
NodeRef context = filePlanService.getFilePlan(actionedUponNodeRef); NodeRef context = filePlanService.getFilePlan(actionedUponNodeRef);
if(targetisUnfiledRecords && (context != null) && nodeService.exists(context)) if(targetisUnfiledRecords && (context != null) && getNodeService().exists(context))
{ {
context = filePlanService.getUnfiledContainer(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."); throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the path resolution context could not be determined.");
} }

View File

@@ -55,7 +55,7 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
if (eligibleForAction(actionedUponNodeRef)) if (eligibleForAction(actionedUponNodeRef))
{ {
// Create the disposition schedule // Create the disposition schedule
dispositionService.createDispositionSchedule(actionedUponNodeRef, null); getDispositionService().createDispositionSchedule(actionedUponNodeRef, null);
} }
else else
{ {
@@ -75,7 +75,7 @@ public class CreateDispositionScheduleAction extends RMActionExecuterAbstractBas
private boolean eligibleForAction(NodeRef actionedUponNodeRef) private boolean eligibleForAction(NodeRef actionedUponNodeRef)
{ {
boolean result = false; boolean result = false;
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
filePlanService.isRecordCategory(actionedUponNodeRef)) filePlanService.isRecordCategory(actionedUponNodeRef))
{ {
result = true; result = true;

View File

@@ -42,7 +42,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
if(checkUncutOffStatus(action, recordFolder)) if(checkUncutOffStatus(action, recordFolder))
{ {
// Mark the folder as cut off // 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)) if(checkUncutOffStatus(action, record))
{ {
// Mark the record as cut off // 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) private boolean checkUncutOffStatus(Action action, NodeRef recordOrFolder)
{ {
boolean okToCutOff = true; 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) if(action.getParameterValue(PARAM_NO_ERROR_CHECK) != null)
{ {
@@ -81,7 +81,7 @@ public class CutOffAction extends RMDispositionActionExecuterAbstractBase
} }
else else
{ {
nodeService.removeAspect(recordOrFolder, ASPECT_UNCUT_OFF); getNodeService().removeAspect(recordOrFolder, ASPECT_UNCUT_OFF);
} }
} }
return okToCutOff; return okToCutOff;

View File

@@ -61,24 +61,24 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(final Action action, final NodeRef actionedUponNodeRef) protected void executeImpl(final Action action, final NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
recordService.isRecord(actionedUponNodeRef) && getRecordService().isRecord(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef)) !getFreezeService().isFrozen(actionedUponNodeRef))
{ {
if (!recordService.isDeclared(actionedUponNodeRef)) if (!getRecordService().isDeclared(actionedUponNodeRef))
{ {
List<String> missingProperties = new ArrayList<String>(5); List<String> missingProperties = new ArrayList<String>(5);
// Aspect not already defined - check mandatory properties then add // Aspect not already defined - check mandatory properties then add
if (mandatoryPropertiesSet(actionedUponNodeRef, missingProperties)) if (mandatoryPropertiesSet(actionedUponNodeRef, missingProperties))
{ {
recordService.disablePropertyEditableCheck(); getRecordService().disablePropertyEditableCheck();
try try
{ {
// Add the declared aspect // Add the declared aspect
Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2); Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2);
declaredProps.put(PROP_DECLARED_AT, new Date()); declaredProps.put(PROP_DECLARED_AT, new Date());
declaredProps.put(PROP_DECLARED_BY, AuthenticationUtil.getRunAsUser()); 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>() AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{ {
@@ -86,14 +86,14 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
public Void doWork() public Void doWork()
{ {
// remove all owner related rights // remove all owner related rights
ownableService.setOwner(actionedUponNodeRef, OwnableService.NO_OWNER); getOwnableService().setOwner(actionedUponNodeRef, OwnableService.NO_OWNER);
return null; return null;
} }
}); });
} }
finally finally
{ {
recordService.enablePropertyEditableCheck(); getRecordService().enablePropertyEditableCheck();
} }
} }
else else
@@ -134,11 +134,11 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
{ {
boolean result = true; 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()) for (PropertyDefinition propDef : typeDef.getProperties().values())
{ {
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)
@@ -152,10 +152,10 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
if (result) if (result)
{ {
Set<QName> aspects = this.nodeService.getAspects(nodeRef); Set<QName> aspects = this.getNodeService().getAspects(nodeRef);
for (QName aspect : aspects) for (QName aspect : aspects)
{ {
AspectDefinition aspectDef = this.dictionaryService.getAspect(aspect); AspectDefinition aspectDef = this.getDictionaryService().getAspect(aspect);
for (PropertyDefinition propDef : aspectDef.getProperties().values()) for (PropertyDefinition propDef : aspectDef.getProperties().values())
{ {
if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null) if (propDef.isMandatory() && nodeRefProps.get(propDef.getName()) == null)

View File

@@ -64,8 +64,8 @@ public class DelegateAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
(!checkFrozen || !freezeService.isFrozen(actionedUponNodeRef))) (!checkFrozen || !getFreezeService().isFrozen(actionedUponNodeRef)))
{ {
// do the property subs (if any exist) // do the property subs (if any exist)
if (isAllowParameterSubstitutions()) if (isAllowParameterSubstitutions())

View File

@@ -41,9 +41,9 @@ public class DeleteHoldAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (holdService.isHold(actionedUponNodeRef)) if (getHoldService().isHold(actionedUponNodeRef))
{ {
holdService.deleteHold(actionedUponNodeRef); getHoldService().deleteHold(actionedUponNodeRef);
} }
else else
{ {

View File

@@ -121,18 +121,18 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
@Override @Override
protected void executeRecordFolderLevelDisposition(Action action, NodeRef recordFolder) protected void executeRecordFolderLevelDisposition(Action action, NodeRef recordFolder)
{ {
List<NodeRef> records = recordService.getRecords(recordFolder); List<NodeRef> records = getRecordService().getRecords(recordFolder);
for (NodeRef record : records) for (NodeRef record : records)
{ {
executeRecordLevelDisposition(action, record); executeRecordLevelDisposition(action, record);
} }
if (isGhostOnDestroySetForAction(action, recordFolder)) if (isGhostOnDestroySetForAction(action, recordFolder))
{ {
nodeService.addAspect(recordFolder, ASPECT_GHOSTED, Collections.<QName, Serializable> emptyMap()); getNodeService().addAspect(recordFolder, ASPECT_GHOSTED, Collections.<QName, Serializable> emptyMap());
} }
else else
{ {
nodeService.deleteNode(recordFolder); getNodeService().deleteNode(recordFolder);
} }
} }
@@ -151,12 +151,12 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
if (isGhostOnDestroySetForAction(action, record)) if (isGhostOnDestroySetForAction(action, record))
{ {
// Add the ghosted aspect // Add the ghosted aspect
nodeService.addAspect(record, ASPECT_GHOSTED, null); getNodeService().addAspect(record, ASPECT_GHOSTED, null);
} }
else else
{ {
// If ghosting is not enabled, delete the node // 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) private void clearAllContent(NodeRef nodeRef)
{ {
Set<QName> props = this.nodeService.getProperties(nodeRef).keySet(); Set<QName> props = this.getNodeService().getProperties(nodeRef).keySet();
props.retainAll(this.dictionaryService.getAllProperties(DataTypeDefinition.CONTENT)); props.retainAll(this.getDictionaryService().getAllProperties(DataTypeDefinition.CONTENT));
for (QName prop : props) for (QName prop : props)
{ {
// Clear the content // Clear the content
clearContent(nodeRef, prop); clearContent(nodeRef, prop);
// Remove the property // 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 // 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 // that there is Alfresco 3.2-era data with the cm:thumbnailed aspect
// applied, we must consider removing it too. // applied, we must consider removing it too.
if (nodeService.hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) || if (getNodeService().hasAspect(nodeRef, RenditionModel.ASPECT_RENDITIONED) ||
nodeService.hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED)) getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_THUMBNAILED))
{ {
// Add the ghosted aspect to all the renditioned children, so that they will not be archived when the // Add the ghosted aspect to all the renditioned children, so that they will not be archived when the
// renditioned aspect is removed // renditioned aspect is removed
Set<QName> childAssocTypes = dictionaryService.getAspect(RenditionModel.ASPECT_RENDITIONED).getChildAssociations().keySet(); Set<QName> childAssocTypes = getDictionaryService().getAspect(RenditionModel.ASPECT_RENDITIONED).getChildAssociations().keySet();
for (ChildAssociationRef child : nodeService.getChildAssocs(nodeRef)) for (ChildAssociationRef child : getNodeService().getChildAssocs(nodeRef))
{ {
if (childAssocTypes.contains(child.getTypeQName())) if (childAssocTypes.contains(child.getTypeQName()))
{ {
// Clear the content and delete the rendition // Clear the content and delete the rendition
clearAllContent(child.getChildRef()); 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) private void clearContent(NodeRef nodeRef, QName contentProperty)
{ {
// Ensure the content is cleaned at the end of the transaction // 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) if (contentData != null && contentData.getContentUrl() != null)
{ {
eagerContentStoreCleaner.registerOrphanedContentUrl(contentData.getContentUrl(), true); eagerContentStoreCleaner.registerOrphanedContentUrl(contentData.getContentUrl(), true);
@@ -244,7 +244,7 @@ public class DestroyAction extends RMDispositionActionExecuterAbstractBase
String actionDefinitionName = action.getActionDefinitionName(); String actionDefinitionName = action.getActionDefinitionName();
if (!StringUtils.isEmpty(actionDefinitionName)) if (!StringUtils.isEmpty(actionDefinitionName))
{ {
DispositionSchedule dispositionSchedule = this.dispositionService.getDispositionSchedule(nodeRef); DispositionSchedule dispositionSchedule = this.getDispositionService().getDispositionSchedule(nodeRef);
if (dispositionSchedule != null) if (dispositionSchedule != null)
{ {
DispositionActionDefinition actionDefinition = dispositionSchedule DispositionActionDefinition actionDefinition = dispositionSchedule

View File

@@ -48,7 +48,7 @@ public class EditDispositionActionAsOfDateAction extends RMActionExecuterAbstrac
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) 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 // Get the action parameter
Date asOfDate = (Date)action.getParameterValue(PARAM_AS_OF_DATE); 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 // Set the dispostion action as of date
DispositionAction da = dispositionService.getNextDispositionAction(actionedUponNodeRef); DispositionAction da = getDispositionService().getNextDispositionAction(actionedUponNodeRef);
if (da != null) if (da != null)
{ {
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_AS_OF, asOfDate); getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_AS_OF, asOfDate);
} }
} }
else else

View File

@@ -45,7 +45,7 @@ public class EditHoldReasonAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (freezeService.isHold(actionedUponNodeRef)) if (getFreezeService().isHold(actionedUponNodeRef))
{ {
// Get the property values // Get the property values
String reason = (String) action.getParameterValue(PARAM_REASON); String reason = (String) action.getParameterValue(PARAM_REASON);
@@ -55,7 +55,7 @@ public class EditHoldReasonAction extends RMActionExecuterAbstractBase
} }
// Update hold reason // Update hold reason
freezeService.updateReason(actionedUponNodeRef, reason); getFreezeService().updateReason(actionedUponNodeRef, reason);
} }
else else
{ {

View File

@@ -47,8 +47,8 @@ public class EditReviewAsOfDateAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (recordService.isRecord(actionedUponNodeRef) && if (getRecordService().isRecord(actionedUponNodeRef) &&
nodeService.hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD)) getNodeService().hasAspect(actionedUponNodeRef, ASPECT_VITAL_RECORD))
{ {
// Get the action parameter // Get the action parameter
Date reviewAsOf = (Date)action.getParameterValue(PARAM_AS_OF_DATE); Date reviewAsOf = (Date)action.getParameterValue(PARAM_AS_OF_DATE);
@@ -58,7 +58,7 @@ public class EditReviewAsOfDateAction extends RMActionExecuterAbstractBase
} }
// Set the as of date // Set the as of date
this.nodeService.setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf); this.getNodeService().setProperty(actionedUponNodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
} }
else else

View File

@@ -132,7 +132,7 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
}); });
// return the report name // 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); action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT, filedReportName);
} }
@@ -186,6 +186,6 @@ public class FileReportAction extends RMActionExecuterAbstractBase implements Re
private QName getReportType(Action action) private QName getReportType(Action action)
{ {
String reportType = getParameterValue(action, REPORT_TYPE); String reportType = getParameterValue(action, REPORT_TYPE);
return QName.createQName(reportType, namespaceService); return QName.createQName(reportType, getNamespaceService());
} }
} }

View File

@@ -55,13 +55,13 @@ public class FreezeAction extends RMActionExecuterAbstractBase
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
// NOTE: we can only freeze records and record folders so ignore everything else // NOTE: we can only freeze records and record folders so ignore everything else
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) && !getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
(recordService.isRecord(actionedUponNodeRef) || (getRecordService().isRecord(actionedUponNodeRef) ||
recordFolderService.isRecordFolder(actionedUponNodeRef)) && getRecordFolderService().isRecordFolder(actionedUponNodeRef)) &&
!freezeService.isFrozen(actionedUponNodeRef)) !getFreezeService().isFrozen(actionedUponNodeRef))
{ {
freezeService.freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef); getFreezeService().freeze((String) action.getParameterValue(PARAM_REASON), actionedUponNodeRef);
} }
} }
} }

View File

@@ -50,28 +50,28 @@ public class OpenRecordFolderAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef) &&
!(dictionaryService.isSubClass(nodeService.getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !recordService.isFiled(actionedUponNodeRef))) !(getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) && !getRecordService().isFiled(actionedUponNodeRef)))
{ {
// TODO move re-open logic into a service method // 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 // 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) if (assocRef != null)
{ {
actionedUponNodeRef = assocRef.getParentRef(); 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)) if (Boolean.TRUE.equals(isClosed))
{ {
nodeService.setProperty(actionedUponNodeRef, PROP_IS_CLOSED, false); getNodeService().setProperty(actionedUponNodeRef, PROP_IS_CLOSED, false);
} }
} }
else else

View File

@@ -47,11 +47,11 @@ public class RejectAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef) && !getFreezeService().isFrozen(actionedUponNodeRef) &&
nodeService.getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null) getNodeService().getProperty(actionedUponNodeRef, PROP_RECORD_ORIGINATING_LOCATION) != null)
{ {
recordService.rejectRecord(actionedUponNodeRef, (String) action.getParameterValue(PARAM_REASON)); getRecordService().rejectRecord(actionedUponNodeRef, (String) action.getParameterValue(PARAM_REASON));
} }
} }

View File

@@ -41,9 +41,9 @@ public class RelinquishHoldAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (freezeService.isHold(actionedUponNodeRef)) if (getFreezeService().isHold(actionedUponNodeRef))
{ {
freezeService.relinquish(actionedUponNodeRef); getFreezeService().relinquish(actionedUponNodeRef);
} }
else else
{ {

View File

@@ -79,10 +79,10 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.exists(actionedUponNodeRef) && if (getNodeService().exists(actionedUponNodeRef) &&
!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) && !getNodeService().hasAspect(actionedUponNodeRef, ContentModel.ASPECT_PENDING_DELETE) &&
recordService.isRecord(actionedUponNodeRef) && getRecordService().isRecord(actionedUponNodeRef) &&
!recordService.isDeclared(actionedUponNodeRef)) !getRecordService().isDeclared(actionedUponNodeRef))
{ {
String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId(); String workflowDefinitionId = workflowService.getDefinitionByName(REQUEST_INFO_WORKFLOW_DEFINITION_NAME).getId();
Map<QName, Serializable> parameters = new HashMap<QName, Serializable>(); Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
@@ -120,10 +120,10 @@ public class RequestInfoAction extends RMActionExecuterAbstractBase
*/ */
private NodeRef getWorkflowPackage(Action action, NodeRef actionedUponNodeRef) 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); workflowPackage = workflowService.createPackage(workflowPackage);
ChildAssociationRef childAssoc = nodeService.getPrimaryParent(actionedUponNodeRef); ChildAssociationRef childAssoc = getNodeService().getPrimaryParent(actionedUponNodeRef);
nodeService.addChild(workflowPackage, actionedUponNodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName()); getNodeService().addChild(workflowPackage, actionedUponNodeRef, WorkflowModel.ASSOC_PACKAGE_CONTAINS, childAssoc.getQName());
return workflowPackage; return workflowPackage;
} }

View File

@@ -137,23 +137,23 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
// get node type // get node type
nodeService.getType(actionedUponNodeRef); getNodeService().getType(actionedUponNodeRef);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
logger.debug("split email:" + actionedUponNodeRef); 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 * 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(refs.size() > 0)
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
@@ -168,7 +168,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
*/ */
try try
{ {
ContentReader reader = contentService.getReader(actionedUponNodeRef, ContentModel.PROP_CONTENT); ContentReader reader = getContentService().getReader(actionedUponNodeRef, ContentModel.PROP_CONTENT);
InputStream is = reader.getContentInputStream(); InputStream is = reader.getContentInputStream();
MimeMessage mimeMessage = new MimeMessage(null, is); MimeMessage mimeMessage = new MimeMessage(null, is);
Object content = mimeMessage.getContent(); 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); String messageTitle = (String)messageProperties.get(ContentModel.PROP_NAME);
if(messageTitle == null) if(messageTitle == null)
{ {
@@ -245,7 +245,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
/** /**
* Create an attachment node in the same folder as the message * Create an attachment node in the same folder as the message
*/ */
ChildAssociationRef attachmentRef = nodeService.createNode(parentNodeRef, ChildAssociationRef attachmentRef = getNodeService().createNode(parentNodeRef,
ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName), QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, fileName),
ContentModel.TYPE_CONTENT, ContentModel.TYPE_CONTENT,
@@ -254,7 +254,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
/** /**
* Write the content into the new attachment node * 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()); writer.setMimetype(contentType.getBaseType());
OutputStream os = writer.getContentOutputStream(); OutputStream os = writer.getContentOutputStream();
FileCopyUtils.copy(part.getInputStream(), os); FileCopyUtils.copy(part.getInputStream(), os);
@@ -281,7 +281,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
getRelationshipService().addRelationship(relationshipUniqueName, parentRef, childRef); getRelationshipService().addRelationship(relationshipUniqueName, parentRef, childRef);
// add the IMAP attachment aspect // add the IMAP attachment aspect
nodeService.createAssociation( getNodeService().createAssociation(
parentRef, parentRef,
childRef, childRef,
ImapModel.ASSOC_IMAP_ATTACHMENT); ImapModel.ASSOC_IMAP_ATTACHMENT);

View File

@@ -101,9 +101,9 @@ public class TransferAction extends RMDispositionActionExecuterAbstractBase
action.setParameterValue(ActionExecuter.PARAM_RESULT, transferNodeRef); action.setParameterValue(ActionExecuter.PARAM_RESULT, transferNodeRef);
// Cut off the disposable item if it's not cut off already // 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);
} }
} }
} }

View File

@@ -73,8 +73,8 @@ public class TransferCompleteAction extends RMActionExecuterAbstractBase
*/ */
private void checkTransferSubClass(NodeRef actionedUponNodeRef) private void checkTransferSubClass(NodeRef actionedUponNodeRef)
{ {
QName type = nodeService.getType(actionedUponNodeRef); QName type = getNodeService().getType(actionedUponNodeRef);
if (!dictionaryService.isSubClass(type, TYPE_TRANSFER)) if (!getDictionaryService().isSubClass(type, TYPE_TRANSFER))
{ {
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NODE_NOT_TRANSFER)); throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NODE_NOT_TRANSFER));
} }

View File

@@ -43,11 +43,11 @@ public class UnCutoffAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
if (nodeService.hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE) && if (getNodeService().hasAspect(actionedUponNodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
nodeService.hasAspect(actionedUponNodeRef, ASPECT_CUT_OFF)) getNodeService().hasAspect(actionedUponNodeRef, ASPECT_CUT_OFF))
{ {
// Get the last disposition action // Get the last disposition action
DispositionAction da = dispositionService.getLastCompletedDispostionAction(actionedUponNodeRef); DispositionAction da = getDispositionService().getLastCompletedDispostionAction(actionedUponNodeRef);
// Check that the last disposition action was a cutoff // Check that the last disposition action was a cutoff
if (da == null || !da.getName().equals("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 // Remove the cutoff aspect and add the uncutoff aspect
nodeService.removeAspect(actionedUponNodeRef, ASPECT_CUT_OFF); getNodeService().removeAspect(actionedUponNodeRef, ASPECT_CUT_OFF);
nodeService.addAspect(actionedUponNodeRef, ASPECT_UNCUT_OFF, null); getNodeService().addAspect(actionedUponNodeRef, ASPECT_UNCUT_OFF, null);
if (recordFolderService.isRecordFolder(actionedUponNodeRef)) if (getRecordFolderService().isRecordFolder(actionedUponNodeRef))
{ {
List<NodeRef> records = recordService.getRecords(actionedUponNodeRef); List<NodeRef> records = getRecordService().getRecords(actionedUponNodeRef);
for (NodeRef record : records) for (NodeRef record : records)
{ {
nodeService.removeAspect(record, ASPECT_CUT_OFF); getNodeService().removeAspect(record, ASPECT_CUT_OFF);
nodeService.addAspect(record, ASPECT_UNCUT_OFF, null); getNodeService().addAspect(record, ASPECT_UNCUT_OFF, null);
} }
} }
// Delete the current disposition action // Delete the current disposition action
DispositionAction currentDa = dispositionService.getNextDispositionAction(actionedUponNodeRef); DispositionAction currentDa = getDispositionService().getNextDispositionAction(actionedUponNodeRef);
if (currentDa != null) if (currentDa != null)
{ {
nodeService.deleteNode(currentDa.getNodeRef()); getNodeService().deleteNode(currentDa.getNodeRef());
} }
// Move the previous (cutoff) disposition back to be current // 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 // Reset the started and completed property values
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_AT, null); getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_AT, null);
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_BY, null); getNodeService().setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_STARTED_BY, null);
nodeService.setProperty(da.getNodeRef(), PROP_DISPOSITION_ACTION_COMPLETED_AT, null); getNodeService().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_COMPLETED_BY, null);
} }
} }
} }

View File

@@ -44,16 +44,16 @@ public class UndeclareRecordAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) 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 // repoen if already complete and not frozen
if (recordService.isDeclared(actionedUponNodeRef) && if (getRecordService().isDeclared(actionedUponNodeRef) &&
!freezeService.isFrozen(actionedUponNodeRef)) !getFreezeService().isFrozen(actionedUponNodeRef))
{ {
// Remove the declared aspect // Remove the declared aspect
this.nodeService.removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD); this.getNodeService().removeAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD);
} }
} }
else else

View File

@@ -45,10 +45,10 @@ public class UndoEventAction extends RMActionExecuterAbstractBase
{ {
String eventName = (String)action.getParameterValue(PARAM_EVENT_NAME); 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 // Get the next disposition action
DispositionAction da = this.dispositionService.getNextDispositionAction(actionedUponNodeRef); DispositionAction da = this.getDispositionService().getNextDispositionAction(actionedUponNodeRef);
if (da != null) if (da != null)
{ {
// undo completed event // undo completed event

View File

@@ -36,6 +36,6 @@ public class UnfreezeAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
freezeService.unFreeze(actionedUponNodeRef); getFreezeService().unFreeze(actionedUponNodeRef);
} }
} }

View File

@@ -78,7 +78,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
*/ */
private void propagateChangeToChildrenOf(NodeRef actionedUponNodeRef) 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 // parent vital record indicator, default to null if not set
boolean parentVri = false; boolean parentVri = false;
@@ -90,41 +90,41 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra
Period parentReviewPeriod = (Period) parentProps.get(PROP_REVIEW_PERIOD); 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) for (ChildAssociationRef nextAssoc : assocs)
{ {
NodeRef nextChild = nextAssoc.getChildRef(); NodeRef nextChild = nextAssoc.getChildRef();
if (filePlanService.isFilePlanComponent(nextChild) && 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 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) if (parentVri)
{ {
VitalRecordDefinition vrDefn = vitalRecordService.getVitalRecordDefinition(nextChild); VitalRecordDefinition vrDefn = getVitalRecordService().getVitalRecordDefinition(nextChild);
Map<QName, Serializable> aspectProps = new HashMap<QName, Serializable>(); Map<QName, Serializable> aspectProps = new HashMap<QName, Serializable>();
aspectProps.put(PROP_REVIEW_AS_OF, vrDefn.getNextReviewDate()); 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 else
{ {
nodeService.removeAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD); getNodeService().removeAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD);
} }
} }
else else
// copy the vitalRecordDefinition properties from the parent to the child // 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_REVIEW_PERIOD, parentReviewPeriod);
childProps.put(PROP_VITAL_RECORD_INDICATOR, parentVri); childProps.put(PROP_VITAL_RECORD_INDICATOR, parentVri);
nodeService.setProperties(nextChild, childProps); getNodeService().setProperties(nextChild, childProps);
} }
// Recurse down the containment hierarchy to all containers // Recurse down the containment hierarchy to all containers
if (!recordService.isRecord(nextChild)) if (!getRecordService().isRecord(nextChild))
{ {
this.propagateChangeToChildrenOf(nextChild); this.propagateChangeToChildrenOf(nextChild);
} }

View File

@@ -43,16 +43,16 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{ {
VitalRecordDefinition vrDef = vitalRecordService.getVitalRecordDefinition(actionedUponNodeRef); VitalRecordDefinition vrDef = getVitalRecordService().getVitalRecordDefinition(actionedUponNodeRef);
if (vrDef != null && vrDef.isEnabled()) if (vrDef != null && vrDef.isEnabled())
{ {
if (recordService.isRecord(actionedUponNodeRef)) if (getRecordService().isRecord(actionedUponNodeRef))
{ {
reviewRecord(actionedUponNodeRef, vrDef); 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); reviewRecord(record, vrDef);
} }
@@ -83,7 +83,7 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
logger.debug(msg.toString()); 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 //TODO And record previous review date, time, user
} }
} }

View File

@@ -35,7 +35,7 @@ public class TestAction extends RMActionExecuterAbstractBase
{ {
throw new RuntimeException("Unexpected parameter value. Expected " + PARAM_VALUE + " actual " + action.getParameterValue(PARAM)); throw new RuntimeException("Unexpected parameter value. Expected " + PARAM_VALUE + " actual " + action.getParameterValue(PARAM));
} }
this.nodeService.addAspect(actionedUponNodeRef, ASPECT_RECORD, null); this.getNodeService().addAspect(actionedUponNodeRef, ASPECT_RECORD, null);
} }
@Override @Override

View File

@@ -71,7 +71,7 @@ public class TestActionPropertySubs extends RMActionExecuterAbstractBase
String yearShort = new SimpleDateFormat("yy").format(date); String yearShort = new SimpleDateFormat("yy").format(date);
String yearLong = new SimpleDateFormat("yyyy").format(date); String yearLong = new SimpleDateFormat("yyyy").format(date);
String yearWeek = new SimpleDateFormat("ww").format(date); String yearWeek = new SimpleDateFormat("ww").format(date);
String name = (String) nodeService.getProperty(actionedUponNodeRef, ContentModel.PROP_NAME); String name = (String) getNodeService().getProperty(actionedUponNodeRef, ContentModel.PROP_NAME);
String company = I18NUtil.getMessage("test.company"); String company = I18NUtil.getMessage("test.company");
assertEquals(dayShort, (String) action.getParameterValue("dayShort")); assertEquals(dayShort, (String) action.getParameterValue("dayShort"));