Serializable
NodeOps is a service for Node CRUD operations. It is used to manage nodes, including their Properties, in a content repository.
NodeOps rules are defined below.
All nodes are uniquely identified through:
All Properties are identified through their ID, which includes the uid that uniquely identifies the Property in the repository.
A Node may either be a Content Node or a Hierarchy Node as defined by its type. A Hierarchy Node may contain both Hierarchy and Content Nodes, but a Conent Node may only contain other Content Nodes.
Node names must not contain either forward, or backslashes.
If a node contains an ObjectClass, it will also contain a Property for each PropertyDefinition of its ObjectClass and each Property will be in the shape as defined by its corresponding PropertyDefinition.
Most operations use ID objects as parameters. Whenever an ID is used, it must not be null. The uid may be null when dealing with root. For example a call to getNodeChildren(ID id) with a correct repository name and a null uid will return all Nodes at root for that repository. It may also be null on create operations, in which the uid has not been created yet, but will be created and returned by the repository.
The repository implementation may have more specific validation rules than that defined above. If a repository considers an attempted operation invalid, it will throw a RepositoryException.
If a Node has an ObjectClass associated with it, whenever it is retrieved it must contain the ObjectClass. However, the Node Properties need not be present as they may be lazy loaded by the call to getProperties() on the Node. For the getNode implementations, it is best to initially set the Properties on the return.
NodeOpsImpl
Serializable
Method Summary |
public |
|
public | |
public |
|
public |
|
public void |
|
public | |
public | |
public |
|
public | |
public |
|
public |
|
public | |
public |
|
public |
|
public |
|
Method Detail |
publicUpdates the node with the given id to contain the given objectClass and properties (content and meta-content). If the node already has an ObjectClass and properties, they will be replaced. If there is a PropertyDefintion in the given ObjectClass with no corresponding Property in the properties array a Property will be created with a null value, unless the Property is required, in which case a validation exception will be thrown.Node
addNodeContent(ID
nodeId,ID
objectClassId,Property
[] properties)
throwsAuthorizationException
,NoSuchObjectClassException
,NoSuchNodeException
,RepositoryException
AuthorizationException
NoSuchObjectClassException
NoSuchNodeException
RepositoryException
publicThis method copies a Node to a new location in the hierarchy along with all its descendants.Node
copyNode(ID
sourceId,ID
destinationId)
throwsAuthorizationException
,NoSuchNodeException
,RepositoryException
A Hierarchy Node may only be copied to another Hierarchy Node. Each Node will get a new Id, parent id and new Properties.
If the uid is null for the destinationId, the desination will be the repository root.
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method creates a new Node underneath the parent. If the parentId's uid is null then the new Node is created under root.Node
createNode(ID
parentId,String
newNodeName, int type)
throwsAuthorizationException
,NodeExistsException
,RepositoryException
AuthorizationException
NodeExistsException
RepositoryException
publicThis method creates a new Node underneath the parent. If the parent uid is null then the new Node is created under root. It associates the ObjectClass with the given id to the new Node and adds the given properties (content and meta-content) to the Node. If there is a PropertyDefintion in the given ObjectClass with no corresponding Property in the properties array a Property will be created with a null value, unless the Property is required, in which case a validation exception will be thrown.Node
createNode(ID
parentId,String
newNodeName, int type,ID
objectClassId,Property
[] properties)
throwsAuthorizationException
,NodeExistsException
,NoSuchObjectClassException
,RepositoryException
AuthorizationException
NodeExistsException
NoSuchObjectClassException
RepositoryException
public void deleteNode(This method performs a full cascade delete on a Node. As such, the node - all its descendant Nodes and each Nodes Properties are removed in the process.ID
nodeId)
throwsAuthorizationException
,NoSuchNodeException
,RepositoryException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method gets a particular Node based on its id. If there is an ObjectClass associated with it then it along with the Node Properties should be contained in the Node.Node
getNode(ID
nodeId)
throwsAuthorizationException
,NoSuchNodeException
AuthorizationException
NoSuchNodeException
publicThis method gets a particular Node based on its path. If there is an ObjectClass associated with it then it along with the Node Properties should be contained in the Node.Node
getNode(String
path)
throwsAuthorizationException
,NoSuchNodeException
AuthorizationException
NoSuchNodeException
publicThis method returns an array of all children Nodes for the parent Node.Node
[] getNodeChildren(ID
parentId, int type)
throwsAuthorizationException
,NoSuchNodeException
AuthorizationException
NoSuchNodeException
publicThis method gets the Node for each node ID passed in. If the current credential is not allowed access to a particular node, then there may be a null in the returned array at that nodes place.Node
[] getNodes(ID
[] nodeIds)
throwsAuthorizationException
,NoSuchNodeException
AuthorizationException
NoSuchNodeException
publicGets all Properties for a Node. If a Property is Binary, then the bytes will not be contained in the BinaryValue. In order to get the bytes a call to (@link #getPropertyBytes} is necessary.Property
[] getProperties(ID
nodeId)
throwsAuthorizationException
,NoSuchNodeException
AuthorizationException
NoSuchNodeException
publicGets the Binary data for the given Property Id.InputStream
getPropertyBytes(ID
propertyId)
throwsAuthorizationException
,NoSuchPropertyException
AuthorizationException
NoSuchPropertyException
publicThis method moves a Node to a new location in the hierarchy along with all its descendants.Node
moveNode(ID
sourceId,ID
destinationId)
throwsAuthorizationException
,NodeExistsException
,NoSuchNodeException
,RepositoryException
A Hierarchy Node may only be moved under another Hierarchy Node. The parent id for the source node will be changed, but all descendants of the source node will keep their parent relationships intact.
If the uid is null for the destinationId, the desination will be the repository root.
AuthorizationException
NodeExistsException
NoSuchNodeException
RepositoryException
publicRemoves the ObjectClass reference from the given Node and deletes the Node's properties.Node
removeNodeContent(ID
nodeId)
throwsAuthorizationException
,NoSuchNodeException
,RepositoryException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method renames a node and implicitly all of its descendants paths. A Node may not be renamed to a Node name that exists at the same level in the hierarchy.Node
renameNode(ID
nodeId,String
newName)
throwsAuthorizationException
,NoSuchNodeException
,NodeExistsException
,RepositoryException
AuthorizationException
NoSuchNodeException
NodeExistsException
RepositoryException
publicUpdates the node with the given id with the given properties. The node must already have a ObjectClass and valid properties associated with it. All Properties are validated against their respective PropertyDefinition.Node
updateProperties(ID
nodeId,Property
[] properties)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,NoSuchPropertyException
,RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
NoSuchPropertyException
RepositoryException