mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
code review comments
This commit is contained in:
@@ -616,7 +616,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
||||
*/
|
||||
private void checkNodeCanBeAddedToHold(NodeRef nodeRef)
|
||||
{
|
||||
if (!isRecord(nodeRef) && !isRecordFolder(nodeRef) && !instanceOf(nodeRef, ContentModel.TYPE_CONTENT))
|
||||
if (!isRecordFolder(nodeRef) && !instanceOf(nodeRef, ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
final String nodeName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
throw new IntegrityException(I18NUtil.getMessage("rm.hold.add-to-hold-invalid-type", nodeName), null);
|
||||
|
@@ -140,7 +140,7 @@ public class FrozenAspect extends BaseBehaviourBean
|
||||
public void onAddAspect(final NodeRef nodeRef, final QName aspectTypeQName)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
|
||||
if (nodeService.exists(nodeRef) && (isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
||||
if (nodeService.exists(nodeRef) && instanceOf(nodeRef, TYPE_CONTENT))
|
||||
{
|
||||
// get the owning folder
|
||||
final NodeRef parentRef = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||
@@ -177,8 +177,7 @@ public class FrozenAspect extends BaseBehaviourBean
|
||||
{
|
||||
AuthenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
|
||||
|
||||
if (nodeService.exists(nodeRef) &&
|
||||
(isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
||||
if (nodeService.exists(nodeRef) && instanceOf(nodeRef, TYPE_CONTENT))
|
||||
{
|
||||
// get the owning folder
|
||||
final NodeRef owningFolder = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||
|
@@ -219,7 +219,7 @@ public abstract class BaseHold extends DeclarativeWebScript
|
||||
}
|
||||
|
||||
// ensure that the node we are adding to the hold is a record or record folder or active content
|
||||
if (!recordService.isRecord(nodeRef) && !recordFolderService.isRecordFolder(nodeRef) &&
|
||||
if (!recordFolderService.isRecordFolder(nodeRef) &&
|
||||
!nodeTypeUtility.instanceOf(nodeService.getType(nodeRef), ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Items added to a hold must be either a record, a record folder or active content.");
|
||||
|
Reference in New Issue
Block a user