mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1813 (Not possible to create from-parent-to-child reference via add reference dialog)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@93176 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -47,6 +47,7 @@ public abstract class AbstractRmWebScript extends DeclarativeWebScript
|
||||
protected static final String STORE_ID = "store_id";
|
||||
protected static final String ID = "id";
|
||||
protected static final String SUCCESS = "success";
|
||||
protected static final String INVERT = "__invert";
|
||||
|
||||
/** Disposition service */
|
||||
private DispositionService dispositionService;
|
||||
|
@@ -126,7 +126,15 @@ public class CustomRefPost extends AbstractRmWebScript
|
||||
NodeRef target = getTargetNode(json);
|
||||
NodeRef source = parseRequestForNodeRef(req);
|
||||
|
||||
getRelationshipService().addRelationship(uniqueName, source, target);
|
||||
if (uniqueName.endsWith(INVERT))
|
||||
{
|
||||
String uniqueNameStem = uniqueName.split(INVERT)[0];
|
||||
getRelationshipService().addRelationship(uniqueNameStem, target, source);
|
||||
}
|
||||
else
|
||||
{
|
||||
getRelationshipService().addRelationship(uniqueName, source, target);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -104,7 +104,7 @@ public class RelationshipLabelsGet extends AbstractRmWebScript
|
||||
|
||||
if (RelationshipType.PARENTCHILD.equals(type))
|
||||
{
|
||||
relationshipLabels.add(new RelationshipLabel(sourceText, uniqueName));
|
||||
relationshipLabels.add(new RelationshipLabel(sourceText, uniqueName + INVERT));
|
||||
relationshipLabels.add(new RelationshipLabel(targetText, uniqueName));
|
||||
}
|
||||
else if (RelationshipType.BIDIRECTIONAL.equals(type))
|
||||
|
Reference in New Issue
Block a user