mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged 1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4229 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4230 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4232 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4233 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4234 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4235 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4239 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4240 . svn resolved root\projects\web-client\source\java\org\alfresco\web\app\AlfrescoNavigationHandler.java svn resolved root\projects\web-client\source\web\WEB-INF\faces-config-beans.xml svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4241 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4242 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4243 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4244 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4244 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4245 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4245 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4246 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4247 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4248 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4248 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4249 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4250 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4251 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4251 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4252 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4633 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -65,6 +65,7 @@ import org.alfresco.service.cmr.repository.NodeRef.Status;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.QNamePattern;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -1041,8 +1042,39 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
|
||||
{
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
// get the assocs pointing from it
|
||||
Collection<ChildAssociationRef> childAssocRefs = nodeDaoService.getChildAssocRefs(node);
|
||||
|
||||
Collection<ChildAssociationRef> childAssocRefs = null;
|
||||
// if the type is the wildcard type, and the qname is not a search, then use a shortcut query
|
||||
if (typeQNamePattern.equals(RegexQNamePattern.MATCH_ALL) && qnamePattern instanceof QName)
|
||||
{
|
||||
// get all child associations with the specific qualified name
|
||||
childAssocRefs = nodeDaoService.getChildAssocRefs(node, (QName)qnamePattern);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get all child associations
|
||||
childAssocRefs = nodeDaoService.getChildAssocRefs(node);
|
||||
// remove non-matching assocs
|
||||
Iterator<ChildAssociationRef> iterator = childAssocRefs.iterator();
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
ChildAssociationRef childAssocRef = iterator.next();
|
||||
// does the qname match the pattern?
|
||||
if (!qnamePattern.isMatch(childAssocRef.getQName()) || !typeQNamePattern.isMatch(childAssocRef.getTypeQName()))
|
||||
{
|
||||
// no match - remove
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
// sort the results
|
||||
List<ChildAssociationRef> orderedList = reorderChildAssocs(childAssocRefs);
|
||||
// done
|
||||
return orderedList;
|
||||
}
|
||||
|
||||
private List<ChildAssociationRef> reorderChildAssocs(Collection<ChildAssociationRef> childAssocRefs)
|
||||
{
|
||||
// shortcut if there are no assocs
|
||||
if (childAssocRefs.size() == 0)
|
||||
{
|
||||
@@ -1058,17 +1090,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
ChildAssociationRef childAssocRef = iterator.next();
|
||||
// does the qname match the pattern?
|
||||
if (!qnamePattern.isMatch(childAssocRef.getQName()) || !typeQNamePattern.isMatch(childAssocRef.getTypeQName()))
|
||||
{
|
||||
// no match - remove
|
||||
iterator.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
childAssocRef.setNthSibling(nthSibling);
|
||||
nthSibling++;
|
||||
}
|
||||
childAssocRef.setNthSibling(nthSibling);
|
||||
nthSibling++;
|
||||
}
|
||||
// done
|
||||
return orderedList;
|
||||
|
Reference in New Issue
Block a user