|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
Node |
addNodeContent(ID nodeId,
ID objectClassId,
Property[] properties)
Updates the node with the given id to contain the given objectClass and properties (content and meta-content). |
Node |
copyNode(ID sourceId,
ID destinationId)
This method copies a Node to a new location in the hierarchy along with all its descendants. |
Node |
createNode(ID parentId,
String newNodeName,
int type)
This method creates a new Node underneath the parent. |
Node |
createNode(ID parentId,
String newNodeName,
int type,
ID objectClassId,
Property[] properties)
This method creates a new Node underneath the parent. |
void |
deleteNode(ID nodeId)
This method performs a full cascade delete on a Node. |
Node |
getNode(ID nodeId)
This method gets a particular Node based on its id. |
Node |
getNode(String path)
This method gets a particular Node based on its path. |
Node[] |
getNodeChildren(ID parentId,
int type)
This method returns an array of all children Nodes for the parent Node. |
Node[] |
getNodes(ID[] nodeIds)
This method gets the Node for each node ID passed in. |
Property[] |
getProperties(ID nodeId)
Gets all Properties for a Node. |
InputStream |
getPropertyBytes(ID propertyId)
Gets the Binary data for the given Property Id. |
Node |
moveNode(ID sourceId,
ID destinationId)
This method moves a Node to a new location in the hierarchy along with all its descendants. |
Node |
removeNodeContent(ID nodeId)
Removes the ObjectClass reference from the given Node and deletes the Node's properties. |
Node |
renameNode(ID nodeId,
String newName)
This method renames a node and implicitly all of its descendants paths. |
Node |
updateProperties(ID nodeId,
Property[] properties)
Updates the node with the given id with the given properties. |
Method Detail |
public Node addNodeContent(ID nodeId, ID objectClassId, Property[] properties) throws AuthorizationException, NoSuchObjectClassException, NoSuchNodeException, RepositoryException
nodeId
- - the ID for the node to update.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchObjectClassException
- thrown if the ObjectClass
to set on the Node does not exist.
NoSuchNodeException
- - if the Node to update does not exist.
RepositoryException
- - if validation error occurs.public Node copyNode(ID sourceId, ID destinationId) throws AuthorizationException, 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.
sourceId
- - the id of the Node to be copieddestinationId
- - the id of the Node under which
the sourceId Node is copied
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the source or destination
node can't be found.
RepositoryException
- - if validation error occurs.public Node createNode(ID parentId, String newNodeName, int type) throws AuthorizationException, NodeExistsException, RepositoryException
parentId
- - the id for the parent of the node. The uid is null
if the parent is root.newNodeName
- - the name of Node to create.type
- - the type of node - either com.bea.content.Node.HIERARCHY or
com.bea.content.Node.CONTENT.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NodeExistsException
- - if the name for the node
already exists as a child of the parent.
RepositoryException
- - if validation error occurs.public Node createNode(ID parentId, String newNodeName, int type, ID objectClassId, Property[] properties) throws AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException
parentId
- - the id for the parent of the node. The parentId's uid is null
if the parent is root.newNodeName
- - the name of Node to create.type
- - the type of node - either com.bea.content.Node.HIERARCHY or
com.bea.content.Node.CONTENT.objectClassId
- - the ID for the ObjectClass to associate the new Node to.properties
- - the properties to add to the new Node.
AuthorizationException
NodeExistsException
- - if the parent Node already has a child with the same name.
NoSuchObjectClassException
- - if the ObjectClass doesn't exist.
RepositoryException
- - if a validation error occurs.public void deleteNode(ID nodeId) throws AuthorizationException, NoSuchNodeException, RepositoryException
nodeId
- - the id of the Node to be deleted
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the node to delete can't be found.
RepositoryException
- - if validation error occurs.public Node getNode(ID nodeId) throws AuthorizationException, NoSuchNodeException
nodeId
- - the id for the node to get.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the node to get can't be found.public Node getNode(String path) throws AuthorizationException, NoSuchNodeException
path
- - the path for the node to get.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the node to get can't be found.public Node[] getNodeChildren(ID parentId, int type) throws AuthorizationException, NoSuchNodeException
parentId
- - the Node which may have childrentype
- - the type of children to return, either
com.bea.content.Node.HIERARCHY, com.bea.content.Node.CONTENT or
or com.bea.content.Node.NODE.
If the type is com.bea.content.Node.NODE then all children (both HIERARCHY
and CONTENT) will be returned.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the parent node can't be found.public Node[] getNodes(ID[] nodeIds) throws AuthorizationException, NoSuchNodeException
nodeIds
- - the Node IDs to retrieve the Nodes for.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if a node to get can't be found.public Property[] getProperties(ID nodeId) throws AuthorizationException, NoSuchNodeException
nodeId
- - the id for the node.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the node can't be found.public InputStream getPropertyBytes(ID propertyId) throws AuthorizationException, NoSuchPropertyException
propertyId
- - the id for the Property that contains the binary data.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchPropertyException
- - if the Property does not exist.public Node moveNode(ID sourceId, ID destinationId) throws AuthorizationException, 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.
sourceId
- - the id of the Node to be moveddestinationId
- - the id of the Node under which
the sourceId Node is moved
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NodeExistsException
- - if attempting to move a Node to a path that already exists.
NoSuchNodeException
- - if the source or destination
node can't be found.
RepositoryException
- - if validation error occurs.public Node removeNodeContent(ID nodeId) throws AuthorizationException, NoSuchNodeException, RepositoryException
nodeId
- - the id for the Node to remove the ObjectClass from.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- if the node does not exist.
RepositoryException
- - if validation error occurs.public Node renameNode(ID nodeId, String newName) throws AuthorizationException, NoSuchNodeException, NodeExistsException, RepositoryException
nodeId
- - the id for the node to renamenewName
- - a String for the new node name
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the node to rename can't be found.
NodeExistsException
- - if the newName already exists as a sibling.
RepositoryException
- - if validation error occurs.public Node updateProperties(ID nodeId, Property[] properties) throws AuthenticationException, AuthorizationException, NoSuchNodeException, NoSuchPropertyException, RepositoryException
nodeId
- - the ID of the node to update. The ID must include the repositoryName.properties
- - the properties to update on the Node.
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
NoSuchNodeException
- - if the Node to update does not exist.
NoSuchPropertyException
- - if a Property does not exist on the Node.
RepositoryException
- - if system or validation error occurs.
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |