Merged V3.2 to HEAD

16939: Merged V3.1 to V3.2
      16938: ETHREEOH-622: AuthorityServiceImpl uses userNameMatcher to check for admin users according to case sensitivity settings
      16934: ETHREEOH-2584: Coding error in BaseSSOAuthenticationFilter
   16924: LDAP Performance
      - Created NodeService addChild variants that can add associations to multiple parents (groups/zones) at the same time with a single path check.
      - Created AuthorityService addAuthority variant that can add an authority to multiple groups at the same time, using the above
      - Optimized group association creation strategy. Groups and Persons created in 'depth first' order (root groups first, parents last). Prevents the nodes having to be reindexed.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-10-21 15:52:13 +00:00
parent 055b18fb70
commit 8f6773284f
14 changed files with 1151 additions and 905 deletions

View File

@@ -949,6 +949,28 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
NodeRef childRef,
QName assocTypeQName,
QName qname) throws InvalidNodeRefException
{
return addChild(Collections.singletonList(parentRef), childRef, assocTypeQName, qname).get(0);
}
/**
* Associates a given child node with a given collection of parents. All nodes must belong to the same store.
* <p>
*
*
* @param parentRefs
* @param childRef
* @param assocTypeQName the qualified name of the association type as defined in the datadictionary
* @param qname the qualified name of the association
* @return Returns a reference to the newly created child association
* @throws InvalidNodeRefException if the parent or child nodes could not be found
* @throws CyclicChildRelationshipException if the child partakes in a cyclic relationship after the add
*/
public List<ChildAssociationRef> addChild(
Collection<NodeRef> parentRefs,
NodeRef childRef,
QName assocTypeQName,
QName qname) throws InvalidNodeRefException
{
Pair<Integer, String> childVersionPath = AVMNodeConverter.ToAVMVersionPath(childRef);
AVMNodeDescriptor child = fAVMService.lookup(childVersionPath.getFirst(),
@@ -957,24 +979,29 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
{
throw new InvalidNodeRefException(childVersionPath.getSecond() + " not found.", childRef);
}
Pair<Integer, String> parentVersionPath = AVMNodeConverter.ToAVMVersionPath(parentRef);
if (parentVersionPath.getFirst() >= 0)
List<ChildAssociationRef> childAssociationRefs = new ArrayList<ChildAssociationRef>(parentRefs.size());
for (NodeRef parentRef : parentRefs)
{
throw new InvalidNodeRefException("Read Only.", parentRef);
}
try
{
fAVMService.link(parentVersionPath.getSecond(), qname.getLocalName(), child);
ChildAssociationRef newChild =
new ChildAssociationRef(assocTypeQName, parentRef, qname,
AVMNodeConverter.ToNodeRef(-1,
AVMNodeConverter.ExtendAVMPath(parentVersionPath.getSecond(), qname.getLocalName())));
return newChild;
}
catch (AVMException e)
{
throw new InvalidNodeRefException("Could not link.", childRef);
Pair<Integer, String> parentVersionPath = AVMNodeConverter.ToAVMVersionPath(parentRef);
if (parentVersionPath.getFirst() >= 0)
{
throw new InvalidNodeRefException("Read Only.", parentRef);
}
try
{
fAVMService.link(parentVersionPath.getSecond(), qname.getLocalName(), child);
ChildAssociationRef newChild = new ChildAssociationRef(assocTypeQName, parentRef, qname,
AVMNodeConverter.ToNodeRef(-1, AVMNodeConverter.ExtendAVMPath(parentVersionPath.getSecond(),
qname.getLocalName())));
childAssociationRefs.add(newChild);
}
catch (AVMException e)
{
throw new InvalidNodeRefException("Could not link.", childRef);
}
}
return childAssociationRefs;
}
/**