mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
RM-6873 code review changes
This commit is contained in:
@@ -192,30 +192,25 @@ public class FrozenAspect extends BaseBehaviourBean
|
||||
)
|
||||
public void onRemoveAspect(final NodeRef nodeRef, QName aspectTypeQName)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork()
|
||||
AuthenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
|
||||
if (nodeService.exists(nodeRef) &&
|
||||
(isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
||||
{
|
||||
if (nodeService.exists(nodeRef) &&
|
||||
(isRecord(nodeRef) || instanceOf(nodeRef, TYPE_CONTENT)))
|
||||
// get the owning folder
|
||||
NodeRef owningFolder = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||
|
||||
// check that the aspect has been added
|
||||
if (nodeService.hasAspect(owningFolder, ASPECT_HELD_CHILDREN))
|
||||
{
|
||||
// get the owning folder
|
||||
NodeRef owningFolder = nodeService.getPrimaryParent(nodeRef).getParentRef();
|
||||
|
||||
// check that the aspect has been added
|
||||
if (nodeService.hasAspect(owningFolder, ASPECT_HELD_CHILDREN))
|
||||
// decrement current count
|
||||
int currentCount = (Integer) nodeService.getProperty(owningFolder, PROP_HELD_CHILDREN_COUNT);
|
||||
if (currentCount > 0)
|
||||
{
|
||||
// decrement current count
|
||||
int currentCount = (Integer)nodeService.getProperty(owningFolder, PROP_HELD_CHILDREN_COUNT);
|
||||
if (currentCount > 0)
|
||||
{
|
||||
nodeService.setProperty(owningFolder, PROP_HELD_CHILDREN_COUNT, currentCount - 1 );
|
||||
}
|
||||
}
|
||||
nodeService.setProperty(owningFolder, PROP_HELD_CHILDREN_COUNT, currentCount - 1);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user