Minor fixes for the hold service

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@64903 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-03-19 17:03:46 +00:00
parent 1f24aaab44
commit dd19c12b43
3 changed files with 82 additions and 82 deletions

View File

@@ -159,8 +159,8 @@ public interface RMPermissionModel
String MAP_CLASSIFICATION_GUIDE_METADATA = "MapClassificationGuideMetadata"; String MAP_CLASSIFICATION_GUIDE_METADATA = "MapClassificationGuideMetadata";
String MANAGE_ACCESS_CONTROLS = "ManageAccessControls"; String MANAGE_ACCESS_CONTROLS = "ManageAccessControls";
final String CREATE_HOLD = "CreateHold"; String CREATE_HOLD = "CreateHold";
final String ADD_TO_HOLD = "AddToHold"; String ADD_TO_HOLD = "AddToHold";
final String REMOVE_FROM_HOLD = "RemoveFromHold"; String REMOVE_FROM_HOLD = "RemoveFromHold";
} }

View File

@@ -61,7 +61,7 @@ import org.apache.commons.logging.LogFactory;
*/ */
@BehaviourBean @BehaviourBean
public class HoldServiceImpl extends ServiceBaseImpl public class HoldServiceImpl extends ServiceBaseImpl
implements HoldService, implements HoldService,
NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.BeforeDeleteNodePolicy,
RecordsManagementModel RecordsManagementModel
{ {
@@ -73,7 +73,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
/** Record Service */ /** Record Service */
private RecordService recordService; private RecordService recordService;
/** Record folder service */ /** Record folder service */
private RecordFolderService recordFolderService; private RecordFolderService recordFolderService;
@@ -106,20 +106,20 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
this.recordService = recordService; this.recordService = recordService;
} }
/** /**
* Set the record folder service * Set the record folder service
* *
* @param recordFolderService the record folder service * @param recordFolderService the record folder service
*/ */
public void setRecordFolderService(RecordFolderService recordFolderService) public void setRecordFolderService(RecordFolderService recordFolderService)
{ {
this.recordFolderService = recordFolderService; this.recordFolderService = recordFolderService;
} }
/** /**
* Behaviour unfreezes node's that will no longer he held after delete. * Behaviour unfreezes node's that will no longer he held after delete.
* *
* @see org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy#beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy#beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@Behaviour(kind=BehaviourKind.CLASS, type="rma:hold", notificationFrequency=NotificationFrequency.EVERY_EVENT) @Behaviour(kind=BehaviourKind.CLASS, type="rma:hold", notificationFrequency=NotificationFrequency.EVERY_EVENT)
@@ -138,7 +138,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
removeFreezeAspect(frozenNode, 1); removeFreezeAspect(frozenNode, 1);
} }
return null; return null;
} }
}; };
@@ -147,24 +147,24 @@ public class HoldServiceImpl extends ServiceBaseImpl
runAsSystem(work); runAsSystem(work);
} }
} }
/** /**
* Helper method removes the freeze aspect from the record and record folder if it is no longer * Helper method removes the freeze aspect from the record and record folder if it is no longer
* in a hold. * in a hold.
* *
* @param nodeRef * @param nodeRef
*/ */
private void removeFreezeAspect(NodeRef nodeRef, int index) private void removeFreezeAspect(NodeRef nodeRef, int index)
{ {
List<NodeRef> otherHolds = heldBy(nodeRef, true); List<NodeRef> otherHolds = heldBy(nodeRef, true);
if (otherHolds.size() == index) if (otherHolds.size() == index)
{ {
if (nodeService.hasAspect(nodeRef, ASPECT_FROZEN)) if (nodeService.hasAspect(nodeRef, ASPECT_FROZEN))
{ {
// remove the freeze aspect from the node // remove the freeze aspect from the node
nodeService.removeAspect(nodeRef, ASPECT_FROZEN); nodeService.removeAspect(nodeRef, ASPECT_FROZEN);
} }
if (isRecordFolder(nodeRef)) if (isRecordFolder(nodeRef))
{ {
List<NodeRef> records = recordService.getRecords(nodeRef); List<NodeRef> records = recordService.getRecords(nodeRef);
@@ -182,7 +182,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
} }
} }
} }
} }
/** /**
@@ -195,7 +195,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
// get the root hold container // get the root hold container
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan); NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
// get the children of the root hold container // get the children of the root hold container
List<ChildAssociationRef> holdsAssocs = nodeService.getChildAssocs(holdContainer, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL); List<ChildAssociationRef> holdsAssocs = nodeService.getChildAssocs(holdContainer, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
List<NodeRef> holds = new ArrayList<NodeRef>(holdsAssocs.size()); List<NodeRef> holds = new ArrayList<NodeRef>(holdsAssocs.size());
@@ -220,12 +220,12 @@ public class HoldServiceImpl extends ServiceBaseImpl
public List<NodeRef> heldBy(NodeRef nodeRef, boolean includedInHold) public List<NodeRef> heldBy(NodeRef nodeRef, boolean includedInHold)
{ {
ParameterCheck.mandatory("nodeRef", nodeRef); ParameterCheck.mandatory("nodeRef", nodeRef);
List<NodeRef> result = null; List<NodeRef> result = null;
// get all the immediate parent holds // get all the immediate parent holds
Set<NodeRef> holdsNotIncludingNodeRef = getParentHolds(nodeRef); Set<NodeRef> holdsNotIncludingNodeRef = getParentHolds(nodeRef);
// check whether the record is held by vitue of it's record folder // check whether the record is held by vitue of it's record folder
if (isRecord(nodeRef)) if (isRecord(nodeRef))
{ {
@@ -250,10 +250,10 @@ public class HoldServiceImpl extends ServiceBaseImpl
return result; return result;
} }
/** /**
* Helper method to get holds that are direct parents of the given node. * Helper method to get holds that are direct parents of the given node.
* *
* @param nodeRef node reference * @param nodeRef node reference
* @return Set<{@link NodeRef}> set of parent holds * @return Set<{@link NodeRef}> set of parent holds
*/ */
@@ -265,10 +265,10 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
holds.add(holdAssoc.getParentRef()); holds.add(holdAssoc.getParentRef());
} }
return holds; return holds;
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHold(org.alfresco.service.cmr.repository.NodeRef, java.lang.String) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHold(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
*/ */
@@ -277,20 +277,20 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatory("filePlan", filePlan); ParameterCheck.mandatory("filePlan", filePlan);
ParameterCheck.mandatory("name", name); ParameterCheck.mandatory("name", name);
// get the root hold container // get the root hold container
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan); NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
// get the hold by name // get the hold by name
NodeRef hold = nodeService.getChildByName(holdContainer, ContentModel.ASSOC_CONTAINS, name); NodeRef hold = nodeService.getChildByName(holdContainer, ContentModel.ASSOC_CONTAINS, name);
if (hold != null && !isHold(hold)) if (hold != null && !isHold(hold))
{ {
throw new AlfrescoRuntimeException("Can not get hold, because the named node reference isn't a hold."); throw new AlfrescoRuntimeException("Can not get hold, because the named node reference isn't a hold.");
} }
return hold; return hold;
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHeld(org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHeld(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@@ -299,12 +299,12 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatory("hold", hold); ParameterCheck.mandatory("hold", hold);
List<NodeRef> children = new ArrayList<NodeRef>(); List<NodeRef> children = new ArrayList<NodeRef>();
if (!isHold(hold)) if (!isHold(hold))
{ {
throw new AlfrescoRuntimeException("Can't get the node's held, because passed node reference isn't a hold. (hold=" + hold.toString() + ")"); throw new AlfrescoRuntimeException("Can't get the node's held, because passed node reference isn't a hold. (hold=" + hold.toString() + ")");
} }
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(hold, ASSOC_FROZEN_RECORDS, RegexQNamePattern.MATCH_ALL); List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(hold, ASSOC_FROZEN_RECORDS, RegexQNamePattern.MATCH_ALL);
if (childAssocs != null && !childAssocs.isEmpty()) if (childAssocs != null && !childAssocs.isEmpty())
{ {
@@ -313,10 +313,10 @@ public class HoldServiceImpl extends ServiceBaseImpl
children.add(childAssociationRef.getChildRef()); children.add(childAssociationRef.getChildRef());
} }
} }
return children; return children;
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#createHold(org.alfresco.service.cmr.repository.NodeRef, java.lang.String, java.lang.String, java.lang.String) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#createHold(org.alfresco.service.cmr.repository.NodeRef, java.lang.String, java.lang.String, java.lang.String)
*/ */
@@ -326,11 +326,11 @@ public class HoldServiceImpl extends ServiceBaseImpl
ParameterCheck.mandatory("filePlan", filePlan); ParameterCheck.mandatory("filePlan", filePlan);
ParameterCheck.mandatory("name", name); ParameterCheck.mandatory("name", name);
ParameterCheck.mandatory("reason", reason); ParameterCheck.mandatory("reason", reason);
// get the root hold container // get the root hold container
NodeRef holdContainer = filePlanService.getHoldContainer(filePlan); NodeRef holdContainer = filePlanService.getHoldContainer(filePlan);
// create map of properties // create map of properties
Map<QName, Serializable> properties = new HashMap<QName, Serializable>(3); Map<QName, Serializable> properties = new HashMap<QName, Serializable>(3);
properties.put(ContentModel.PROP_NAME, name); properties.put(ContentModel.PROP_NAME, name);
properties.put(PROP_HOLD_REASON, reason); properties.put(PROP_HOLD_REASON, reason);
@@ -338,16 +338,16 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
properties.put(ContentModel.PROP_DESCRIPTION, description); properties.put(ContentModel.PROP_DESCRIPTION, description);
} }
// create assoc name // create assoc name
QName assocName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name); QName assocName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name);
// create hold // create hold
ChildAssociationRef childAssocRef = nodeService.createNode(holdContainer, ContentModel.ASSOC_CONTAINS, assocName, TYPE_HOLD, properties); ChildAssociationRef childAssocRef = nodeService.createNode(holdContainer, ContentModel.ASSOC_CONTAINS, assocName, TYPE_HOLD, properties);
return childAssocRef.getChildRef(); return childAssocRef.getChildRef();
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHoldReason(org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#getHoldReason(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@@ -355,18 +355,18 @@ public class HoldServiceImpl extends ServiceBaseImpl
public String getHoldReason(NodeRef hold) public String getHoldReason(NodeRef hold)
{ {
ParameterCheck.mandatory("hold", hold); ParameterCheck.mandatory("hold", hold);
String reason = null; String reason = null;
if (nodeService.exists(hold) && isHold(hold)) if (nodeService.exists(hold) && isHold(hold))
{ {
// get the reason // get the reason
reason = (String)nodeService.getProperty(hold, PROP_HOLD_REASON); reason = (String)nodeService.getProperty(hold, PROP_HOLD_REASON);
} }
return reason; return reason;
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#setHoldReason(org.alfresco.service.cmr.repository.NodeRef, java.lang.String) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#setHoldReason(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
*/ */
@@ -375,13 +375,13 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatory("hold", hold); ParameterCheck.mandatory("hold", hold);
ParameterCheck.mandatory("reason", reason); ParameterCheck.mandatory("reason", reason);
if (nodeService.exists(hold) && isHold(hold)) if (nodeService.exists(hold) && isHold(hold))
{ {
nodeService.setProperty(hold, PROP_HOLD_REASON, reason); nodeService.setProperty(hold, PROP_HOLD_REASON, reason);
} }
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#deleteHold(org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#deleteHold(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@@ -389,14 +389,14 @@ public class HoldServiceImpl extends ServiceBaseImpl
public void deleteHold(NodeRef hold) public void deleteHold(NodeRef hold)
{ {
ParameterCheck.mandatory("hold", hold); ParameterCheck.mandatory("hold", hold);
if (!isHold(hold)) if (!isHold(hold))
{ {
throw new AlfrescoRuntimeException("Can't delete hold, becuase passed node is not a hold. (hold=" + hold.toString() + ")"); throw new AlfrescoRuntimeException("Can't delete hold, becuase passed node is not a hold. (hold=" + hold.toString() + ")");
} }
// delete the hold node // delete the hold node
nodeService.deleteNode(hold); nodeService.deleteNode(hold);
} }
/** /**
@@ -412,7 +412,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
holds.add(hold); holds.add(hold);
addToHolds(Collections.unmodifiableList(holds), nodeRef); addToHolds(Collections.unmodifiableList(holds), nodeRef);
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#addToHold(org.alfresco.service.cmr.repository.NodeRef, java.util.List) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#addToHold(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
*/ */
@@ -421,7 +421,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatory("hold", hold); ParameterCheck.mandatory("hold", hold);
ParameterCheck.mandatory("nodeRefs", nodeRefs); ParameterCheck.mandatory("nodeRefs", nodeRefs);
for (NodeRef nodeRef : nodeRefs) for (NodeRef nodeRef : nodeRefs)
{ {
addToHold(hold, nodeRef); addToHold(hold, nodeRef);
@@ -436,7 +436,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatoryCollection("holds", holds); ParameterCheck.mandatoryCollection("holds", holds);
ParameterCheck.mandatory("nodeRef", nodeRef); ParameterCheck.mandatory("nodeRef", nodeRef);
if (!isRecord(nodeRef) && !isRecordFolder(nodeRef)) if (!isRecord(nodeRef) && !isRecordFolder(nodeRef))
{ {
throw new AlfrescoRuntimeException("Can only add records or record folders to a hold."); throw new AlfrescoRuntimeException("Can only add records or record folders to a hold.");
@@ -448,23 +448,23 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
throw new AlfrescoRuntimeException("Can't add to hold, because it isn't a hold. (hold=" + hold.toString() + ")"); throw new AlfrescoRuntimeException("Can't add to hold, because it isn't a hold. (hold=" + hold.toString() + ")");
} }
// check that the node isn't already in the hold // check that the node isn't already in the hold
if (getHeld(hold).contains(nodeRef) == false) if (!getHeld(hold).contains(nodeRef))
{ {
// Link the record to the hold // Link the record to the hold
nodeService.addChild(hold, nodeRef, ASSOC_FROZEN_RECORDS, ASSOC_FROZEN_RECORDS); nodeService.addChild(hold, nodeRef, ASSOC_FROZEN_RECORDS, ASSOC_FROZEN_RECORDS);
// gather freeze properties // gather freeze properties
Map<QName, Serializable> props = new HashMap<QName, Serializable>(2); Map<QName, Serializable> props = new HashMap<QName, Serializable>(2);
props.put(PROP_FROZEN_AT, new Date()); props.put(PROP_FROZEN_AT, new Date());
props.put(PROP_FROZEN_BY, AuthenticationUtil.getFullyAuthenticatedUser()); props.put(PROP_FROZEN_BY, AuthenticationUtil.getFullyAuthenticatedUser());
if (!nodeService.hasAspect(nodeRef, ASPECT_FROZEN)) if (!nodeService.hasAspect(nodeRef, ASPECT_FROZEN))
{ {
// add freeze aspect // add freeze aspect
nodeService.addAspect(nodeRef, ASPECT_FROZEN, props); nodeService.addAspect(nodeRef, ASPECT_FROZEN, props);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
@@ -472,7 +472,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
logger.debug(msg.toString()); logger.debug(msg.toString());
} }
} }
// Mark all the folders contents as frozen // Mark all the folders contents as frozen
if (isRecordFolder(nodeRef)) if (isRecordFolder(nodeRef))
{ {
@@ -483,7 +483,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
if (!nodeService.hasAspect(record, ASPECT_FROZEN)) if (!nodeService.hasAspect(record, ASPECT_FROZEN))
{ {
nodeService.addAspect(record, ASPECT_FROZEN, props); nodeService.addAspect(record, ASPECT_FROZEN, props);
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
@@ -510,7 +510,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
holds.add(hold); holds.add(hold);
removeFromHolds(Collections.unmodifiableList(holds), nodeRef); removeFromHolds(Collections.unmodifiableList(holds), nodeRef);
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromHold(org.alfresco.service.cmr.repository.NodeRef, java.util.List) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromHold(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
*/ */
@@ -534,7 +534,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
ParameterCheck.mandatory("holds", holds); ParameterCheck.mandatory("holds", holds);
ParameterCheck.mandatory("nodeRef", nodeRef); ParameterCheck.mandatory("nodeRef", nodeRef);
if (holds != null && !holds.isEmpty()) if (holds != null && !holds.isEmpty())
{ {
for (NodeRef hold : holds) for (NodeRef hold : holds)
@@ -543,27 +543,27 @@ public class HoldServiceImpl extends ServiceBaseImpl
{ {
throw new AlfrescoRuntimeException("Can't remove from hold, because it isn't a hold. (hold=" + hold + ")"); throw new AlfrescoRuntimeException("Can't remove from hold, because it isn't a hold. (hold=" + hold + ")");
} }
if (getHeld(hold).contains(nodeRef) == true) if (getHeld(hold).contains(nodeRef))
{ {
// remove from hold // remove from hold
nodeService.removeChild(hold, nodeRef); nodeService.removeChild(hold, nodeRef);
} }
} }
// run as system as we can't be sure if have remove aspect rights on node // run as system as we can't be sure if have remove aspect rights on node
runAsSystem(new RunAsWork<Void>() runAsSystem(new RunAsWork<Void>()
{ {
@Override @Override
public Void doWork() public Void doWork()
{ {
removeFreezeAspect(nodeRef, 0); removeFreezeAspect(nodeRef, 0);
return null; return null;
} }
}); });
} }
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromAllHolds(org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromAllHolds(org.alfresco.service.cmr.repository.NodeRef)
*/ */
@@ -571,7 +571,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
public void removeFromAllHolds(NodeRef nodeRef) public void removeFromAllHolds(NodeRef nodeRef)
{ {
ParameterCheck.mandatory("nodeRef", nodeRef); ParameterCheck.mandatory("nodeRef", nodeRef);
// remove the node from all the holds it's held by // remove the node from all the holds it's held by
List<NodeRef> holds = heldBy(nodeRef, true); List<NodeRef> holds = heldBy(nodeRef, true);
for (NodeRef hold : holds) for (NodeRef hold : holds)
@@ -580,7 +580,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
removeFromHold(hold, nodeRef); removeFromHold(hold, nodeRef);
} }
} }
/** /**
* @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromAllHolds(java.util.List) * @see org.alfresco.module.org_alfresco_module_rm.hold.HoldService#removeFromAllHolds(java.util.List)
*/ */
@@ -588,10 +588,10 @@ public class HoldServiceImpl extends ServiceBaseImpl
public void removeFromAllHolds(List<NodeRef> nodeRefs) public void removeFromAllHolds(List<NodeRef> nodeRefs)
{ {
ParameterCheck.mandatory("nodeRefs", nodeRefs); ParameterCheck.mandatory("nodeRefs", nodeRefs);
for (NodeRef nodeRef : nodeRefs) for (NodeRef nodeRef : nodeRefs)
{ {
removeFromAllHolds(nodeRef); removeFromAllHolds(nodeRef);
} }
} }
} }

View File

@@ -61,12 +61,12 @@ public class ServiceBaseImpl implements RecordsManagementModel
{ {
this.dictionaryService = dictionaryService; this.dictionaryService = dictionaryService;
} }
/** /**
* Indicates whether the given node is a record folder or not. * Indicates whether the given node is a record folder or not.
* <p> * <p>
* Exposed in the RecordFolder service. * Exposed in the RecordFolder service.
* *
* @param nodeRef node reference * @param nodeRef node reference
* @return boolean true if record folder, false otherwise * @return boolean true if record folder, false otherwise
*/ */
@@ -88,12 +88,12 @@ public class ServiceBaseImpl implements RecordsManagementModel
return nodeService.hasAspect(nodeRef, ASPECT_RECORD); return nodeService.hasAspect(nodeRef, ASPECT_RECORD);
} }
/** /**
* Indicates whether the given node reference is a hold or not. * Indicates whether the given node reference is a hold or not.
* <p> * <p>
* Exposed publically in the {@link HoldService} * Exposed publicly in the {@link HoldService}
* *
* @param nodeRef node reference * @param nodeRef node reference
* @return boolean true if rma:hold or sub-type, false otherwise * @return boolean true if rma:hold or sub-type, false otherwise
*/ */
@@ -222,25 +222,25 @@ public class ServiceBaseImpl implements RecordsManagementModel
result.add(nodeService.getType(nodeRef)); result.add(nodeService.getType(nodeRef));
return result; return result;
} }
/** /**
* Helper method that executed work as system user. * Helper method that executed work as system user.
* <p> * <p>
* Useful when testing using mocks. * Useful when testing using mocks.
* *
* @param runAsWork work to execute as system user * @param runAsWork work to execute as system user
* @return * @return
*/ */
public <R> R runAsSystem(RunAsWork<R> runAsWork) public <R> R runAsSystem(RunAsWork<R> runAsWork)
{ {
return AuthenticationUtil.runAsSystem(runAsWork); return AuthenticationUtil.runAsSystem(runAsWork);
} }
/** /**
* Helper method that executed work as given user. * Helper method that executed work as given user.
* <p> * <p>
* Useful when testing using mocks. * Useful when testing using mocks.
* *
* @param runAsWork work to execute as given user * @param runAsWork work to execute as given user
* @return * @return
*/ */