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/BRANCHES/DEV/5.1.N/root@113727 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2015-10-06 08:58:59 +00:00
parent 98f27883be
commit 998ebb98de
10 changed files with 327 additions and 8 deletions

View File

@@ -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);