Package org.alfresco.repo.importer.view
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeContext.ACEAccess Control Entry
-
Constructor Summary
Constructors Constructor Description NodeContext(QName elementName, ParentContext parentContext, TypeDefinition typeDef)Construct
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAccessControlEntry(AccessStatus accessStatus, String authority, String permission)Adds an Access Control EntryvoidaddAspect(AspectDefinition aspect)Adds an aspect to the nodevoidaddDatatype(QName property, DataTypeDefinition datatype)Adds a property datatype to the nodevoidaddProperty(QName property, Serializable value)Adds a property to the nodevoidaddPropertyCollection(QName property)Adds a collection property to the nodeAspectDefinitiondetermineAspect(QName defName)Determine if name referes to an aspectAssociationDefinitiondetermineAssociation(QName defName)Determine if name referes to an associationObjectdetermineDefinition(QName defName)Determine the type of definition (aspect, property, association) from the specified namePropertyDefinitiondetermineProperty(QName defName)Determine if name refers to a propertyList<AccessPermission>getAccessControlEntries()Gets the Access Control EntriesStringgetChildName()StringgetImportId()booleangetInheritPermissions()Set<QName>getNodeAspects()NodeRefgetNodeRef()ParentContextgetParentContext()Map<QName,Serializable>getProperties()Gets all properties for the nodeDataTypeDefinitiongetPropertyDataType(QName propertyName)Gets the property data typeMap<QName,DataTypeDefinition>getPropertyDatatypes()TypeDefinitiongetTypeDefinition()StringgetUUID()booleanisReference()voidsetChildName(String childName)voidsetImportId(String importId)voidsetInheritPermissions(boolean inherit)voidsetNodeRef(NodeRef nodeRef)voidsetReference(boolean isReference)voidsetTypeDefinition(TypeDefinition typeDef)Set Type DefinitionvoidsetUUID(String uuid)StringtoString()-
Methods inherited from class org.alfresco.repo.importer.view.ElementContext
getDictionaryService, getElementName, getImporter
-
-
-
-
Constructor Detail
-
NodeContext
public NodeContext(QName elementName, ParentContext parentContext, TypeDefinition typeDef)
Construct- Parameters:
elementName- QNameparentContext- ParentContexttypeDef- TypeDefinition
-
-
Method Detail
-
getParentContext
public ParentContext getParentContext()
- Specified by:
getParentContextin interfaceImportNode- Returns:
- the parent context
-
getTypeDefinition
public TypeDefinition getTypeDefinition()
- Specified by:
getTypeDefinitionin interfaceImportNode- Returns:
- the type definition
-
isReference
public boolean isReference()
- Specified by:
isReferencein interfaceImportNode- 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:
getNodeRefin interfaceImportNode- Returns:
- the node ref
-
setNodeRef
public void setNodeRef(NodeRef nodeRef)
- Parameters:
nodeRef- the node ref
-
getUUID
public String getUUID()
- Specified by:
getUUIDin interfaceImportNode- 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:
getChildNamein interfaceImportNode- 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:
getInheritPermissionsin interfaceImportNode- 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 namevalue- the property value
-
addDatatype
public void addDatatype(QName property, DataTypeDefinition datatype)
Adds a property datatype to the node- Parameters:
property- property namedatatype- property datatype
-
getPropertyDatatypes
public Map<QName,DataTypeDefinition> getPropertyDatatypes()
-
getProperties
public Map<QName,Serializable> getProperties()
Description copied from interface:ImportNodeGets all properties for the node- Specified by:
getPropertiesin interfaceImportNode- Returns:
- the properties
-
getPropertyDataType
public DataTypeDefinition getPropertyDataType(QName propertyName)
Description copied from interface:ImportNodeGets the property data type- Specified by:
getPropertyDataTypein interfaceImportNode- 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:
getNodeAspectsin interfaceImportNode- Returns:
- the aspects of this node
-
addAccessControlEntry
public void addAccessControlEntry(AccessStatus accessStatus, String authority, String permission)
Adds an Access Control Entry- Parameters:
accessStatus- AccessStatusauthority- Stringpermission- String
-
getAccessControlEntries
public List<AccessPermission> getAccessControlEntries()
Gets the Access Control Entries- Specified by:
getAccessControlEntriesin interfaceImportNode- 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
-
-