Merged HEAD (5.1) to 5.1.N (5.1.1)

117487 bhorje: CM-690 extensions


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117571 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-11-14 13:35:46 +00:00
parent 7ec342be8b
commit a64d5324e9
4 changed files with 118 additions and 2 deletions

View File

@@ -51,6 +51,8 @@ import org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy;
import org.alfresco.repo.node.NodeServicePolicies.OnSetNodeTypePolicy;
import org.alfresco.repo.node.NodeServicePolicies.OnUpdateNodePolicy;
import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
import org.alfresco.repo.node.db.traitextender.NodeServiceExtension;
import org.alfresco.repo.node.db.traitextender.NodeServiceTrait;
import org.alfresco.repo.policy.AssociationPolicyDelegate;
import org.alfresco.repo.policy.ClassPolicyDelegate;
import org.alfresco.repo.policy.PolicyComponent;
@@ -70,6 +72,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.QNamePattern;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.traitextender.Extend;
import org.alfresco.util.GUID;
import org.alfresco.util.PropertyMap;
import org.apache.commons.logging.Log;
@@ -854,6 +857,7 @@ public abstract class AbstractNodeServiceImpl implements NodeService
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public final boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
{
return removeSecondaryChildAssociation(childAssocRef);

View File

@@ -45,6 +45,8 @@ import org.alfresco.repo.node.AbstractNodeServiceImpl;
import org.alfresco.repo.node.StoreArchiveMap;
import org.alfresco.repo.node.archive.NodeArchiveService;
import org.alfresco.repo.node.db.NodeHierarchyWalker.VisitedNode;
import org.alfresco.repo.node.db.traitextender.NodeServiceExtension;
import org.alfresco.repo.node.db.traitextender.NodeServiceTrait;
import org.alfresco.repo.node.index.NodeIndexer;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -69,6 +71,7 @@ import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.InvalidStoreRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeRef.Status;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
@@ -80,6 +83,11 @@ 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.traitextender.Extend;
import org.alfresco.traitextender.ExtendedTrait;
import org.alfresco.traitextender.Extensible;
import org.alfresco.traitextender.AJProxyTrait;
import org.alfresco.traitextender.Trait;
import org.alfresco.util.EqualsHelper;
import org.alfresco.util.GUID;
import org.alfresco.util.Pair;
@@ -95,7 +103,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
*
* @author Derek Hulley
*/
public class DbNodeServiceImpl extends AbstractNodeServiceImpl
public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extensible , NodeService
{
public static final String KEY_PENDING_DELETE_NODES = "DbNodeServiceImpl.pendingDeleteNodes";
@@ -108,9 +116,11 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
private NodeIndexer nodeIndexer;
private BehaviourFilter policyBehaviourFilter;
private boolean enableTimestampPropagation;
private final ExtendedTrait<NodeServiceTrait> nodeServiceTrait;
public DbNodeServiceImpl()
{
nodeServiceTrait = new ExtendedTrait<NodeServiceTrait>(AJProxyTrait.create(this, NodeServiceTrait.class));
storeArchiveMap = new StoreArchiveMap(); // in case it is not set
}
@@ -184,17 +194,20 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return unchecked;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean exists(StoreRef storeRef)
{
return nodeDAO.exists(storeRef);
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean exists(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
return nodeDAO.exists(nodeRef);
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Status getNodeStatus(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
@@ -203,6 +216,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public NodeRef getNodeRef(Long nodeId)
{
Pair<Long, NodeRef> nodePair = nodeDAO.getNodePair(nodeId);
@@ -212,6 +226,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* {@inheritDoc}
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<StoreRef> getStores()
{
// Get the ADM stores
@@ -234,6 +249,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* Defers to the typed service
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public StoreRef createStore(String protocol, String identifier)
{
StoreRef storeRef = new StoreRef(protocol, identifier);
@@ -259,6 +275,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* @throws UnsupportedOperationException Always
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void deleteStore(StoreRef storeRef) throws InvalidStoreRefException
{
// Delete the index
@@ -283,6 +300,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public NodeRef getRootNode(StoreRef storeRef) throws InvalidStoreRefException
{
Pair<Long, NodeRef> rootNodePair = nodeDAO.getRootNode(storeRef);
@@ -295,6 +313,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Set<NodeRef> getAllRootNodes(StoreRef storeRef)
{
return nodeDAO.getAllRootNodes(storeRef);
@@ -303,6 +322,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* @see #createNode(NodeRef, QName, QName, QName, Map)
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public ChildAssociationRef createNode(
NodeRef parentRef,
QName assocTypeQName,
@@ -312,9 +332,24 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return this.createNode(parentRef, assocTypeQName, assocQName, nodeTypeQName, null);
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef) throws InvalidNodeRefException
{
return super.getChildAssocs(nodeRef);
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<NodeRef> findNodes(FindNodeParameters params)
{
return super.findNodes(params);
}
/**
* {@inheritDoc}
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public ChildAssociationRef createNode(
NodeRef parentRef,
QName assocTypeQName,
@@ -676,6 +711,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return missingProperties;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setChildAssociationIndex(ChildAssociationRef childAssocRef, int index)
{
// get nodes
@@ -700,6 +736,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public QName getType(NodeRef nodeRef) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -709,6 +746,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* @see org.alfresco.service.cmr.repository.NodeService#setType(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setType(NodeRef nodeRef, QName typeQName) throws InvalidNodeRefException
{
// The node(s) involved may not be pending deletion
@@ -746,6 +784,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void addAspect(
NodeRef nodeRef,
QName aspectTypeQName,
@@ -797,6 +836,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public int countChildAssocs(NodeRef nodeRef, boolean isPrimary) throws InvalidNodeRefException
{
final Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -805,6 +845,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void removeAspect(NodeRef nodeRef, QName aspectTypeQName)
throws InvalidNodeRefException, InvalidAspectException
{
@@ -984,6 +1025,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* Performs a check on the set of node aspects
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean hasAspect(NodeRef nodeRef, QName aspectQName) throws InvalidNodeRefException, InvalidAspectException
{
if (aspectQName.equals(ContentModel.ASPECT_PENDING_DELETE))
@@ -994,6 +1036,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return nodeDAO.hasNodeAspect(nodePair.getFirst(), aspectQName);
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Set<QName> getAspects(NodeRef nodeRef) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -1040,6 +1083,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
* Delete Node
*/
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void deleteNode(NodeRef nodeRef)
{
deleteNode(nodeRef, true);
@@ -1262,11 +1306,13 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
nodesPendingDeleteTxn.removeAll(nodesPendingDelete);
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName)
{
return addChild(Collections.singletonList(parentRef), childRef, assocTypeQName, assocQName).get(0);
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> addChild(Collection<NodeRef> parentRefs, NodeRef childRef, QName assocTypeQName, QName assocQName)
{
// The node(s) involved may not be pending deletion
@@ -1327,6 +1373,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return childAssociationRefs;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void removeChild(NodeRef parentRef, NodeRef childRef) throws InvalidNodeRefException
{
// The node(s) involved may not be pending deletion
@@ -1406,6 +1453,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// Done
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean removeChildAssociation(ChildAssociationRef childAssocRef)
{
// The node(s) involved may not be pending deletion
@@ -1447,6 +1495,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean removeSecondaryChildAssociation(ChildAssociationRef childAssocRef)
{
// The node(s) involved may not be pending deletion
@@ -1481,6 +1530,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return true;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Serializable getProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
{
Long nodeId = getNodePairNotNull(nodeRef).getFirst();
@@ -1514,6 +1564,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return property;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Map<QName, Serializable> getProperties(NodeRef nodeRef) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -1531,6 +1582,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return nodeProperties;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Long getNodeAclId(NodeRef nodeRef) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -1579,6 +1631,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
* of properties is valid.
*
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setProperty(NodeRef nodeRef, QName qname, Serializable value) throws InvalidNodeRefException
{
ParameterCheck.mandatory("nodeRef", nodeRef);
@@ -1627,6 +1680,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
* a real nulls when the properties are requested again.
*
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -1649,6 +1703,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void addProperties(NodeRef nodeRef, Map<QName, Serializable> properties) throws InvalidNodeRefException
{
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
@@ -1671,6 +1726,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void removeProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
{
// Get the node
@@ -1724,6 +1780,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* Filters out any associations if their qname is not a match to the given pattern.
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getParentAssocs(
final NodeRef nodeRef,
final QNamePattern typeQNamePattern,
@@ -1779,9 +1836,17 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return results;
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getParentAssocs(NodeRef nodeRef) throws InvalidNodeRefException
{
return super.getParentAssocs(nodeRef);
}
/**
* Filters out any associations if their qname is not a match to the given pattern.
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, final QNamePattern typeQNamePattern, final QNamePattern qnamePattern)
{
return getChildAssocs(nodeRef, typeQNamePattern, qnamePattern, true) ;
@@ -1790,6 +1855,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* Filters out any associations if their qname is not a match to the given pattern.
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocs(
NodeRef nodeRef,
final QNamePattern typeQNamePattern,
@@ -1802,6 +1868,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* Fetches the first n child associations in an efficient manner
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocs(
NodeRef nodeRef,
final QNamePattern typeQNamePattern,
@@ -1857,6 +1924,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return results;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, Set<QName> childNodeTypeQNames)
{
// Get the node
@@ -1898,6 +1966,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return results;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public NodeRef getChildByName(NodeRef nodeRef, QName assocTypeQName, String childName)
{
ParameterCheck.mandatory("childName", childName);
@@ -1919,6 +1988,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildrenByName(NodeRef nodeRef, QName assocTypeQName, Collection<String> childNames)
{
// Get the node
@@ -1960,6 +2030,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return results;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public ChildAssociationRef getPrimaryParent(NodeRef nodeRef) throws InvalidNodeRefException
{
// Get the node
@@ -1983,6 +2054,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public AssociationRef createAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName)
throws InvalidNodeRefException, AssociationExistsException
{
@@ -2009,6 +2081,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setAssociations(NodeRef sourceRef, QName assocTypeQName, List<NodeRef> targetRefs)
{
// The node(s) involved may not be pending deletion
@@ -2073,6 +2146,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Collection<ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType(NodeRef parent, QName assocTypeQName)
{
// Get the parent node
@@ -2128,6 +2202,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<ChildAssociationRef> getChildAssocsByPropertyValue(
NodeRef nodeRef,
QName propertyQName,
@@ -2179,6 +2254,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return results;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void removeAssociation(NodeRef sourceRef, NodeRef targetRef, QName assocTypeQName)
throws InvalidNodeRefException
{
@@ -2206,12 +2282,14 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public AssociationRef getAssoc(Long id)
{
Pair<Long, AssociationRef> nodeAssocPair = nodeDAO.getNodeAssocOrNull(id);
return nodeAssocPair == null ? null : nodeAssocPair.getSecond();
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<AssociationRef> getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern)
{
Pair<Long, NodeRef> sourceNodePair = getNodePairNotNull(sourceRef);
@@ -2239,6 +2317,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<AssociationRef> getTargetAssocsByPropertyValue(NodeRef sourceRef, QNamePattern qnamePattern, QName propertyQName, Serializable propertyValue)
{
Pair<Long, NodeRef> sourceNodePair = getNodePairNotNull(sourceRef);
@@ -2272,7 +2351,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// done
return nodeAssocRefs;
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<AssociationRef> getSourceAssocs(NodeRef targetRef, QNamePattern qnamePattern)
{
Pair<Long, NodeRef> targetNodePair = getNodePairNotNull(targetRef);
@@ -2302,6 +2381,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
/**
* @see #getPaths(NodeRef, boolean)
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public Path getPath(NodeRef nodeRef) throws InvalidNodeRefException
{
List<Path> paths = getPaths(nodeRef, true); // checks primary path count
@@ -2316,6 +2396,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
* When searching for <code>primaryOnly == true</code>, checks that there is exactly
* one path.
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public List<Path> getPaths(NodeRef nodeRef, boolean primaryOnly) throws InvalidNodeRefException
{
// get the starting node
@@ -2555,6 +2636,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
*
* Archives the node without the <b>cm:auditable</b> aspect behaviour
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public NodeRef restoreNode(NodeRef archivedNodeRef, NodeRef destinationParentNodeRef, QName assocTypeQName, QName assocQName)
{
policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE);
@@ -2665,6 +2747,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
*
* Drops the old primary association and creates a new one
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public ChildAssociationRef moveNode(
NodeRef nodeToMoveRef,
NodeRef newParentRef,
@@ -2891,6 +2974,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public NodeRef getStoreArchiveNode(StoreRef storeRef)
{
StoreRef archiveStoreRef = storeArchiveMap.get(storeRef);
@@ -3191,4 +3275,11 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
}
}
}
@Override
public <M extends Trait> ExtendedTrait<M> getTrait(Class<? extends M> traitAPI)
{
return (ExtendedTrait<M>) nodeServiceTrait;
}
}

View File

@@ -0,0 +1,9 @@
package org.alfresco.repo.node.db.traitextender;
import org.alfresco.service.cmr.repository.NodeService;
public interface NodeServiceExtension extends NodeService
{
}

View File

@@ -0,0 +1,12 @@
package org.alfresco.repo.node.db.traitextender;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.traitextender.Trait;
public interface NodeServiceTrait extends Trait,NodeService
{
}