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:
@@ -238,4 +238,57 @@ public class Node2ServiceImpl extends NodeServiceImpl implements NodeService, Ve
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p>
|
||||
*
|
||||
* Implementation for version store v2
|
||||
*/
|
||||
@Override
|
||||
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue)
|
||||
{
|
||||
// If lightWeightVersionStore call default version store implementation.
|
||||
if (sourceRef.getStoreRef().getIdentifier().equals(VersionModel.STORE_ID))
|
||||
{
|
||||
return super.getTargetAssocsByPropertyValue(sourceRef, qnamePattern, propertyQName, propertyValue);
|
||||
}
|
||||
|
||||
// Get the assoc references from the version store.
|
||||
List<ChildAssociationRef> childAssocRefs = this.dbNodeService.getChildAssocs(VersionUtil.convertNodeRef(sourceRef),
|
||||
Version2Model.CHILD_QNAME_VERSIONED_ASSOCS, qnamePattern);
|
||||
|
||||
List<AssociationRef> result = new ArrayList<AssociationRef>(childAssocRefs.size());
|
||||
|
||||
for (ChildAssociationRef childAssocRef : childAssocRefs)
|
||||
{
|
||||
// Get the assoc reference.
|
||||
NodeRef childRef = childAssocRef.getChildRef();
|
||||
NodeRef referencedNode = (NodeRef) this.dbNodeService.getProperty(childRef, ContentModel.PROP_REFERENCE);
|
||||
|
||||
if (this.dbNodeService.exists(referencedNode))
|
||||
{
|
||||
Long assocDbId = (Long) this.dbNodeService.getProperty(childRef, Version2Model.PROP_QNAME_ASSOC_DBID);
|
||||
|
||||
// Check if property type validation has to be done.
|
||||
if (propertyQName != null)
|
||||
{
|
||||
Serializable propertyValueRetrieved = this.dbNodeService.getProperty(referencedNode, propertyQName);
|
||||
|
||||
// Check if property value has been retrieved (property
|
||||
// exists) and is equal to the requested value.
|
||||
if (propertyValueRetrieved == null || !propertyValueRetrieved.equals(propertyValue))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Build an assoc ref to add to the returned list.
|
||||
AssociationRef newAssocRef = new AssociationRef(assocDbId, sourceRef, childAssocRef.getQName(), referencedNode);
|
||||
result.add(newAssocRef);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -69,6 +69,8 @@ public class NodeServiceImpl implements NodeService, VersionModel
|
||||
*/
|
||||
protected final static String MSG_UNSUPPORTED =
|
||||
"This operation is not supported by a version store implementation of the node service.";
|
||||
|
||||
private final static String MSG_UNSUPPORTED_V1 = "Versioning V1 is not implemented or supported. Patches exist to upgrade your data to use Versioning V2. Please contact support.";
|
||||
|
||||
/**
|
||||
* The name of the spoofed root association
|
||||
@@ -691,6 +693,16 @@ public class NodeServiceImpl implements NodeService, VersionModel
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
@Override
|
||||
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue)
|
||||
{
|
||||
// This operation is not supported for versioning V1
|
||||
throw new UnsupportedOperationException(MSG_UNSUPPORTED_V1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
|
Reference in New Issue
Block a user