mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Add ASPECT_HELD_CHILDREN on active content parent
This commit is contained in:
@@ -28,8 +28,13 @@
|
|||||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.aspect;
|
package org.alfresco.module.org_alfresco_module_rm.model.rma.aspect;
|
||||||
|
|
||||||
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
import static org.alfresco.model.ContentModel.TYPE_CONTENT;
|
||||||
|
import static org.alfresco.model.ContentModel.TYPE_FOLDER;
|
||||||
|
import static org.alfresco.repo.site.SiteModel.ASPECT_SITE_CONTAINER;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||||
@@ -169,6 +174,16 @@ public class FrozenAspect extends BaseBehaviourBean
|
|||||||
currentCount = currentCount + 1;
|
currentCount = currentCount + 1;
|
||||||
nodeService.setProperty(parentRef, PROP_HELD_CHILDREN_COUNT, currentCount);
|
nodeService.setProperty(parentRef, PROP_HELD_CHILDREN_COUNT, currentCount);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(instanceOf(parentRef, TYPE_FOLDER) && !nodeService.hasAspect(parentRef, ASPECT_SITE_CONTAINER))
|
||||||
|
{
|
||||||
|
// add aspect and set count to 1
|
||||||
|
Map<QName, Serializable> props = new HashMap<>(1);
|
||||||
|
props.put(PROP_HELD_CHILDREN_COUNT, 1);
|
||||||
|
getInternalNodeService().addAspect(parentRef, ASPECT_HELD_CHILDREN, props);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user