mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1541: Unlink Record
* Unlink record UI action added * Unused DeleteLink capability repurposed as Unlink capability * UI evaluator ensuring unlink action only appears for linked record that are not in their primary location * evaluator unit test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@91840 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -384,6 +384,13 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
|
||||
rmNodeValues.put("kind", kind.toString());
|
||||
|
||||
// set the primary parent node reference
|
||||
ChildAssociationRef assoc = nodeService.getPrimaryParent(nodeRef);
|
||||
if (assoc != null)
|
||||
{
|
||||
rmNodeValues.put("primaryParentNodeRef", assoc.getParentRef().toString());
|
||||
}
|
||||
|
||||
Map<String, Object> values = AuthenticationUtil.runAsSystem(new RunAsWork<Map<String, Object>>()
|
||||
{
|
||||
public Map<String, Object> doWork() throws Exception
|
||||
|
@@ -32,27 +32,34 @@ import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
* Determines whether a node has multiple parents within a file plan
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 2.0
|
||||
*/
|
||||
public class MultiParentEvaluator extends BaseEvaluator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.jscript.app.BaseEvaluator#evaluateImpl(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected boolean evaluateImpl(final NodeRef nodeRef)
|
||||
{
|
||||
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public Boolean doWork()
|
||||
{
|
||||
|
||||
// get parent associations
|
||||
List<ChildAssociationRef> parents = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||
int count = 0;
|
||||
for (ChildAssociationRef parent : parents)
|
||||
{
|
||||
// count file plan component parents
|
||||
if (nodeService.hasAspect(parent.getParentRef(), ASPECT_FILE_PLAN_COMPONENT))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
// return true if more than one
|
||||
return (count > 1);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user