Class NodeContext

  • All Implemented Interfaces:
    ImportNode

    public class NodeContext
    extends ElementContext
    implements ImportNode
    Maintains state about the currently imported node.
    Author:
    David Caruana
    • Constructor Detail

      • NodeContext

        public NodeContext​(org.alfresco.service.namespace.QName elementName,
                           ParentContext parentContext,
                           org.alfresco.service.cmr.dictionary.TypeDefinition typeDef)
        Construct
        Parameters:
        elementName - QName
        parentContext - ParentContext
        typeDef - TypeDefinition
    • Method Detail

      • getTypeDefinition

        public org.alfresco.service.cmr.dictionary.TypeDefinition getTypeDefinition()
        Specified by:
        getTypeDefinition in interface ImportNode
        Returns:
        the type definition
      • isReference

        public boolean isReference()
        Specified by:
        isReference in interface ImportNode
        Returns:
        is this a node reference
      • setReference

        public void setReference​(boolean isReference)
        Parameters:
        isReference - true => this is a node reference
      • setTypeDefinition

        public void setTypeDefinition​(org.alfresco.service.cmr.dictionary.TypeDefinition typeDef)
        Set Type Definition
        Parameters:
        typeDef - TypeDefinition
      • getNodeRef

        public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
        Specified by:
        getNodeRef in interface ImportNode
        Returns:
        the node ref
      • setNodeRef

        public void setNodeRef​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Parameters:
        nodeRef - the node ref
      • getUUID

        public String getUUID()
        Specified by:
        getUUID in interface ImportNode
        Returns:
        node uuid to create node with
      • setUUID

        public void setUUID​(String uuid)
        Parameters:
        uuid - uuid
      • getImportId

        public String getImportId()
      • setImportId

        public void setImportId​(String importId)
        Parameters:
        importId - import scoped id
      • setChildName

        public void setChildName​(String childName)
        Parameters:
        childName - the child name
      • setInheritPermissions

        public void setInheritPermissions​(boolean inherit)
      • getInheritPermissions

        public boolean getInheritPermissions()
        Specified by:
        getInheritPermissions in interface ImportNode
        Returns:
        true => node inherits permissions from parent
      • addPropertyCollection

        public void addPropertyCollection​(org.alfresco.service.namespace.QName property)
        Adds a collection property to the node
        Parameters:
        property - QName
      • addProperty

        public void addProperty​(org.alfresco.service.namespace.QName property,
                                Serializable value)
        Adds a property to the node
        Parameters:
        property - the property name
        value - the property value
      • addDatatype

        public void addDatatype​(org.alfresco.service.namespace.QName property,
                                org.alfresco.service.cmr.dictionary.DataTypeDefinition datatype)
        Adds a property datatype to the node
        Parameters:
        property - property name
        datatype - property datatype
      • getPropertyDatatypes

        public Map<org.alfresco.service.namespace.QName,​org.alfresco.service.cmr.dictionary.DataTypeDefinition> getPropertyDatatypes()
      • getProperties

        public Map<org.alfresco.service.namespace.QName,​Serializable> getProperties()
        Description copied from interface: ImportNode
        Gets all properties for the node
        Specified by:
        getProperties in interface ImportNode
        Returns:
        the properties
      • getPropertyDataType

        public org.alfresco.service.cmr.dictionary.DataTypeDefinition getPropertyDataType​(org.alfresco.service.namespace.QName propertyName)
        Description copied from interface: ImportNode
        Gets the property data type
        Specified by:
        getPropertyDataType in interface ImportNode
        Parameters:
        propertyName - name of property
        Returns:
        data type of named property
      • addAspect

        public void addAspect​(org.alfresco.service.cmr.dictionary.AspectDefinition aspect)
        Adds an aspect to the node
        Parameters:
        aspect - the aspect
      • getNodeAspects

        public Set<org.alfresco.service.namespace.QName> getNodeAspects()
        Specified by:
        getNodeAspects in interface ImportNode
        Returns:
        the aspects of this node
      • addAccessControlEntry

        public void addAccessControlEntry​(org.alfresco.service.cmr.security.AccessStatus accessStatus,
                                          String authority,
                                          String permission)
        Adds an Access Control Entry
        Parameters:
        accessStatus - AccessStatus
        authority - String
        permission - String
      • getAccessControlEntries

        public List<org.alfresco.service.cmr.security.AccessPermission> getAccessControlEntries()
        Gets the Access Control Entries
        Specified by:
        getAccessControlEntries in interface ImportNode
        Returns:
        access control entries
      • determineDefinition

        public Object determineDefinition​(org.alfresco.service.namespace.QName defName)
        Determine the type of definition (aspect, property, association) from the specified name
        Parameters:
        defName - QName
        Returns:
        the dictionary definition
      • determineAspect

        public org.alfresco.service.cmr.dictionary.AspectDefinition determineAspect​(org.alfresco.service.namespace.QName defName)
        Determine if name referes to an aspect
        Parameters:
        defName - QName
        Returns:
        AspectDefinition
      • determineProperty

        public org.alfresco.service.cmr.dictionary.PropertyDefinition determineProperty​(org.alfresco.service.namespace.QName defName)
        Determine if name refers to a property
        Parameters:
        defName - QName
        Returns:
        PropertyDefinition
      • determineAssociation

        public org.alfresco.service.cmr.dictionary.AssociationDefinition determineAssociation​(org.alfresco.service.namespace.QName defName)
        Determine if name referes to an association
        Parameters:
        defName - QName
        Returns:
        AssociationDefinition