mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.1-MNT1 (5.1.0) to HEAD (5.1)
115460 adavis: Merged 5.1.N (5.1.1) to 5.1-MNT1 (5.1.0) 113727 amorarasu: Merged 5.0.N (5.0.3) to 5.1.N (5.1.1) 113684 adavis: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3) (PARTIAL MERGE) 113603 cturlica: Merged DEV to V4.2-BUG-FIX (4.2.6) 113602 cturlica: MNT-14504: Cloud pull process not working after large delete git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@115670 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2238,6 +2238,41 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
return nodeAssocRefs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue)
|
||||
{
|
||||
Pair<Long, NodeRef> sourceNodePair = getNodePairNotNull(sourceRef);
|
||||
Long sourceNodeId = sourceNodePair.getFirst();
|
||||
|
||||
QName qnameFilter = null;
|
||||
if (qnamePattern instanceof QName)
|
||||
{
|
||||
qnameFilter = (QName) qnamePattern;
|
||||
}
|
||||
|
||||
// Check the QName is not one of the "special" system maintained ones.
|
||||
if (getChildAssocsByPropertyValueBannedProps.contains(propertyQName))
|
||||
{
|
||||
throw new IllegalArgumentException(
|
||||
"getTargetAssocsByPropertyValue does not allow search of system maintained properties: " + propertyQName);
|
||||
}
|
||||
|
||||
Collection<Pair<Long, AssociationRef>> assocPairs = nodeDAO.getTargetAssocsByPropertyValue(sourceNodeId, qnameFilter, propertyQName, propertyValue);
|
||||
List<AssociationRef> nodeAssocRefs = new ArrayList<AssociationRef>(assocPairs.size());
|
||||
for (Pair<Long, AssociationRef> assocPair : assocPairs)
|
||||
{
|
||||
AssociationRef assocRef = assocPair.getSecond();
|
||||
// check qname pattern, if not already filtered
|
||||
if (qnameFilter == null && !qnamePattern.isMatch(assocRef.getTypeQName()))
|
||||
{
|
||||
continue; // the assoc name doesn't match the pattern given
|
||||
}
|
||||
nodeAssocRefs.add(assocRef);
|
||||
}
|
||||
// done
|
||||
return nodeAssocRefs;
|
||||
}
|
||||
|
||||
public List<AssociationRef> getSourceAssocs(NodeRef targetRef, QNamePattern qnamePattern)
|
||||
{
|
||||
Pair<Long, NodeRef> targetNodePair = getNodePairNotNull(targetRef);
|
||||
|
Reference in New Issue
Block a user