Class NodeContext

java.lang.Object
org.alfresco.repo.importer.view.ElementContext
org.alfresco.repo.importer.view.NodeContext
All Implemented Interfaces:
ImportNode

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

    • NodeContext

      public NodeContext(QName elementName, ParentContext parentContext, TypeDefinition typeDef)
      Construct
      Parameters:
      elementName - QName
      parentContext - ParentContext
      typeDef - TypeDefinition
  • Method Details

    • getParentContext

      public ParentContext getParentContext()
      Specified by:
      getParentContext in interface ImportNode
      Returns:
      the parent context
    • getTypeDefinition

      public 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(TypeDefinition typeDef)
      Set Type Definition
      Parameters:
      typeDef - TypeDefinition
    • getNodeRef

      public NodeRef getNodeRef()
      Specified by:
      getNodeRef in interface ImportNode
      Returns:
      the node ref
    • setNodeRef

      public void setNodeRef(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
    • getChildName

      public String getChildName()
      Specified by:
      getChildName in interface ImportNode
      Returns:
      the child name
    • 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(QName property)
      Adds a collection property to the node
      Parameters:
      property - QName
    • addProperty

      public void addProperty(QName property, Serializable value)
      Adds a property to the node
      Parameters:
      property - the property name
      value - the property value
    • addDatatype

      public void addDatatype(QName property, DataTypeDefinition datatype)
      Adds a property datatype to the node
      Parameters:
      property - property name
      datatype - property datatype
    • getPropertyDatatypes

      public Map<QName,DataTypeDefinition> getPropertyDatatypes()
    • getProperties

      public Map<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 DataTypeDefinition getPropertyDataType(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(AspectDefinition aspect)
      Adds an aspect to the node
      Parameters:
      aspect - the aspect
    • getNodeAspects

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

      public void addAccessControlEntry(AccessStatus accessStatus, String authority, String permission)
      Adds an Access Control Entry
      Parameters:
      accessStatus - AccessStatus
      authority - String
      permission - String
    • getAccessControlEntries

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

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

      public AspectDefinition determineAspect(QName defName)
      Determine if name referes to an aspect
      Parameters:
      defName - QName
      Returns:
      AspectDefinition
    • determineProperty

      public PropertyDefinition determineProperty(QName defName)
      Determine if name refers to a property
      Parameters:
      defName - QName
      Returns:
      PropertyDefinition
    • determineAssociation

      public AssociationDefinition determineAssociation(QName defName)
      Determine if name referes to an association
      Parameters:
      defName - QName
      Returns:
      AssociationDefinition
    • toString

      public String toString()
      Overrides:
      toString in class Object