org.alfresco.repo.version
Class Node2ServiceImpl

java.lang.Object
  extended by org.alfresco.repo.version.NodeServiceImpl
      extended by org.alfresco.repo.version.Node2ServiceImpl
All Implemented Interfaces:
Version2Model, VersionBaseModel, VersionModel, NodeService

public class Node2ServiceImpl
extends NodeServiceImpl
implements NodeService, Version2Model

The version2 store node service implementation


Field Summary
 
Fields inherited from class org.alfresco.repo.version.NodeServiceImpl
contentDataDAO, dbNodeService, dicitionaryService, MSG_UNSUPPORTED
 
Fields inherited from interface org.alfresco.repo.version.Version2Model
ASPECT_LOCALNAME_VERSION, ASPECT_VERSION, ASPECT_VERSION_STORE_ROOT, ASSOC_ROOT_VERSION, ASSOC_SUCCESSOR, CHILD_QNAME_VERSION_HISTORIES, CHILD_QNAME_VERSIONS, NAMESPACE_URI, PROP_FROZEN_ACCESSED, PROP_FROZEN_CREATED, PROP_FROZEN_CREATOR, PROP_FROZEN_MODIFIED, PROP_FROZEN_MODIFIER, PROP_FROZEN_NODE_DBID, PROP_FROZEN_NODE_REF, PROP_METADATA_PREFIX, PROP_QNAME_FROZEN_ACCESSED, PROP_QNAME_FROZEN_CREATED, PROP_QNAME_FROZEN_CREATOR, PROP_QNAME_FROZEN_MODIFIED, PROP_QNAME_FROZEN_MODIFIER, PROP_QNAME_FROZEN_NODE_DBID, PROP_QNAME_FROZEN_NODE_REF, PROP_QNAME_TRANSLATION_VERSIONS, PROP_QNAME_VERSION_DESCRIPTION, PROP_QNAME_VERSION_LABEL, PROP_QNAME_VERSION_NUMBER, PROP_QNAME_VERSIONED_NODE_ID, PROP_VERSION_DESCRIPTION, PROP_VERSION_TYPE, STORE_ID, TYPE_QNAME_VERSION_HISTORY
 
Fields inherited from interface org.alfresco.repo.version.VersionBaseModel
ASPECT_LOCALNAME_VERSION_STORE_ROOT, ASSOC_LOCALNAME_ROOT_VERSION, CHILD_VERSION_HISTORIES, CHILD_VERSIONS, PROP_CREATED_DATE, PROP_CREATOR, PROP_DESCRIPTION, PROP_TRANSLATION_VERSIONS, PROP_VERSION_LABEL, PROP_VERSION_NUMBER, PROP_VERSIONED_NODE_ID, STORE_PROTOCOL, TYPE_VERSION_HISTORY
 
Fields inherited from interface org.alfresco.repo.version.VersionModel
ASPECT_VERSION_STORE_ROOT, ASSOC_ROOT_VERSION, ASSOC_SUCCESSOR, CHILD_QNAME_VERSION_HISTORIES, CHILD_QNAME_VERSION_META_DATA, CHILD_QNAME_VERSIONED_ASSOCS, CHILD_QNAME_VERSIONED_ATTRIBUTES, CHILD_QNAME_VERSIONED_CHILD_ASSOCS, CHILD_QNAME_VERSIONS, CHILD_VERSION_META_DATA, CHILD_VERSIONED_ASSOCS, CHILD_VERSIONED_ATTRIBUTES, CHILD_VERSIONED_CHILD_ASSOCS, NAMESPACE_URI, PROP_ASSOC_QNAME, PROP_ASSOC_TYPE_QNAME, PROP_FROZEN_ASPECTS, PROP_FROZEN_NODE_ID, PROP_FROZEN_NODE_STORE_ID, PROP_FROZEN_NODE_STORE_PROTOCOL, PROP_FROZEN_NODE_TYPE, PROP_IS_MULTI_VALUE, PROP_IS_PRIMARY, PROP_META_DATA_NAME, PROP_META_DATA_VALUE, PROP_MULTI_VALUE, PROP_NTH_SIBLING, PROP_QNAME, PROP_QNAME_ASSOC_QNAME, PROP_QNAME_ASSOC_TYPE_QNAME, PROP_QNAME_FROZEN_ASPECTS, PROP_QNAME_FROZEN_NODE_ID, PROP_QNAME_FROZEN_NODE_STORE_ID, PROP_QNAME_FROZEN_NODE_STORE_PROTOCOL, PROP_QNAME_FROZEN_NODE_TYPE, PROP_QNAME_IS_MULTI_VALUE, PROP_QNAME_IS_PRIMARY, PROP_QNAME_META_DATA_NAME, PROP_QNAME_META_DATA_VALUE, PROP_QNAME_MULTI_VALUE, PROP_QNAME_NTH_SIBLING, PROP_QNAME_QNAME, PROP_QNAME_TRANSLATION_VERSIONS, PROP_QNAME_VALUE, PROP_QNAME_VERSION_LABEL, PROP_QNAME_VERSION_NUMBER, PROP_QNAME_VERSIONED_NODE_ID, PROP_VALUE, STORE_ID, TYPE_QNAME_VERSION, TYPE_QNAME_VERSION_HISTORY, TYPE_QNAME_VERSION_META_DATA_VALUE, TYPE_QNAME_VERSIONED_ASSOC, TYPE_QNAME_VERSIONED_CHILD_ASSOC, TYPE_QNAME_VERSIONED_PROPERTY, TYPE_VERSION, TYPE_VERSION_META_DATA_VALUE, TYPE_VERSIONED_ASSOC, TYPE_VERSIONED_CHILD_ASSOC, TYPE_VERSIONED_PROPERTY
 
Constructor Summary
Node2ServiceImpl()
           
 
Method Summary
 java.util.Set getAspects(NodeRef nodeRef)
          Translation for version store
 java.util.List getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
          Performs conversion from version store properties to real associations
 java.util.List getParentAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
          The node will apprear to be attached to the root of the version store
 ChildAssociationRef getPrimaryParent(NodeRef nodeRef)
          Simulates the node begin attached to the root node of the version store.
 java.util.Map getProperties(NodeRef nodeRef)
          Property translation for version store
 java.io.Serializable getProperty(NodeRef nodeRef, QName qname)
          Property translation for version store
 java.util.List getTargetAssocs(NodeRef sourceRef, QNamePattern qnamePattern)
          Fetches all associations from the given source where the associations' qualified names match the pattern provided.
 QName getType(NodeRef nodeRef)
          Type translation for version store
 
Methods inherited from class org.alfresco.repo.version.NodeServiceImpl
addAspect, addChild, addChild, addProperties, cleanup, createAssociation, createNode, createNode, createStore, deleteNode, deleteStore, exists, exists, getAssoc, getChildAssocs, getChildAssocs, getChildAssocs, getChildAssocsWithoutParentAssocsOfType, getChildByName, getChildrenByName, getNodeStatus, getParentAssocs, getPath, getPaths, getRootNode, getSourceAssocs, getStoreArchiveNode, getStores, hasAspect, moveNode, removeAspect, removeAssociation, removeChild, removeChildAssociation, removeProperty, removeSeconaryChildAssociation, restoreNode, setChildAssociationIndex, setContentDataDAO, setDbNodeService, setDictionaryService, setProperties, setProperty, setSearcher, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.service.cmr.repository.NodeService
addAspect, addChild, addChild, addProperties, createAssociation, createNode, createNode, createStore, deleteNode, deleteStore, exists, exists, getAssoc, getChildAssocs, getChildAssocs, getChildAssocs, getChildAssocsWithoutParentAssocsOfType, getChildByName, getChildrenByName, getNodeStatus, getParentAssocs, getPath, getPaths, getRootNode, getSourceAssocs, getStoreArchiveNode, getStores, hasAspect, moveNode, removeAspect, removeAssociation, removeChild, removeChildAssociation, removeProperty, removeSeconaryChildAssociation, restoreNode, setChildAssociationIndex, setProperties, setProperty, setType
 

Constructor Detail

Node2ServiceImpl

public Node2ServiceImpl()
Method Detail

getType

public QName getType(NodeRef nodeRef)
              throws InvalidNodeRefException
Type translation for version store

Specified by:
getType in interface NodeService
Overrides:
getType in class NodeServiceImpl
Returns:
Returns the type name
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
DictionaryService

getAspects

public java.util.Set getAspects(NodeRef nodeRef)
                         throws InvalidNodeRefException
Translation for version store

Specified by:
getAspects in interface NodeService
Overrides:
getAspects in class NodeServiceImpl
Returns:
Returns a set of all aspects applied to the node, including mandatory aspects
Throws:
InvalidNodeRefException - if the node could not be found

getProperties

public java.util.Map getProperties(NodeRef nodeRef)
                            throws InvalidNodeRefException
Property translation for version store

Specified by:
getProperties in interface NodeService
Overrides:
getProperties in class NodeServiceImpl
Returns:
Returns all properties keyed by their qualified name
Throws:
InvalidNodeRefException - if the node could not be found

getProperty

public java.io.Serializable getProperty(NodeRef nodeRef,
                                        QName qname)
                                 throws InvalidNodeRefException
Property translation for version store

Specified by:
getProperty in interface NodeService
Overrides:
getProperty in class NodeServiceImpl
qname - the qualified name of the property
Returns:
Returns the value of the property, or null if not yet set
Throws:
InvalidNodeRefException - if the node could not be found

getParentAssocs

public java.util.List getParentAssocs(NodeRef nodeRef,
                                      QNamePattern typeQNamePattern,
                                      QNamePattern qnamePattern)
The node will apprear to be attached to the root of the version store

Specified by:
getParentAssocs in interface NodeService
Overrides:
getParentAssocs in class NodeServiceImpl
Parameters:
nodeRef - the child node
typeQNamePattern - the pattern that the type qualified name of the association must match
qnamePattern - the pattern that the qnames of the assocs must match
Returns:
Returns a list of all parent-child associations that exist where the given node is the child
See Also:
NodeService.getParentAssocs(NodeRef, QNamePattern, QNamePattern)

getChildAssocs

public java.util.List getChildAssocs(NodeRef nodeRef,
                                     QNamePattern typeQNamePattern,
                                     QNamePattern qnamePattern)
                              throws InvalidNodeRefException
Performs conversion from version store properties to real associations

Specified by:
getChildAssocs in interface NodeService
Overrides:
getChildAssocs in class NodeServiceImpl
Parameters:
nodeRef - the parent node - usually a container
typeQNamePattern - the pattern that the type qualified name of the association must match
qnamePattern - the pattern that the qnames of the assocs must match
Returns:
Returns a list of ChildAssociationRef instances. If the node is not a container then the result will be empty.
Throws:
InvalidNodeRefException - if the node could not be found
See Also:
QName, RegexQNamePattern.MATCH_ALL

getPrimaryParent

public ChildAssociationRef getPrimaryParent(NodeRef nodeRef)
                                     throws InvalidNodeRefException
Simulates the node begin attached to the root node of the version store.

Specified by:
getPrimaryParent in interface NodeService
Overrides:
getPrimaryParent in class NodeServiceImpl
Returns:
Returns the primary parent-child association of the node
Throws:
InvalidNodeRefException - if the node could not be found

getTargetAssocs

public java.util.List getTargetAssocs(NodeRef sourceRef,
                                      QNamePattern qnamePattern)
Description copied from interface: NodeService
Fetches all associations from the given source where the associations' qualified names match the pattern provided.

Specified by:
getTargetAssocs in interface NodeService
Overrides:
getTargetAssocs in class NodeServiceImpl
Parameters:
sourceRef - the association source
qnamePattern - the association qname pattern to match against
Returns:
an empty list - ALWAYS.
See Also:
QName, RegexQNamePattern.MATCH_ALL


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.