EJBLocalObject
, Serializable
NodeOps is a service for Node CRUD operations. It is used to manage nodes, including their Properties, in a content repository.
WARNING: If using this interface to retrieve binary content from
a BEA Repository, please read the javadoc for
RepositoryConfig
.
Each repository has specific validation rules that the manager will delegate to. If a repository considers an attempted operation invalid, it will throw a RepositoryException. The rules for the manager are defined below.
All nodes are uniquely identified through:
All Properties are identified through their ID, which must include a repository name and a uid that uniquely identifies the Property in the repository. The uid for a Property should be null for creation, but will always contain a value for other operations.
Node names must not contain either forward, or backslashes.
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.
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 and must always contain a repository name. 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.
All operations with the exception of getNodesAncestry are intended to be performed against a single repository. Therefore, all ID parameters in the same method signature must have the same repositoryName. For example, addNodeContent takes both a Node ID and also an ObjectClass ID, so both of these IDs must have the same repository.
If the Repository is a Managed Repository then some of the methods have different consequences. The basic difference is that if a Repository is Managed, then Node properties are versioned and are passed through a life cycle to get published. Thus, any method that creates new Properties will not create Properties in the Repository, but instead create a VirtualNode that is checked out to the user. The VirtualNode needs to be managed through the WorkspaceOps. If the creation or update of Properties that are already being managed then an UnsupportedRepositoryOperationException will be thrown.
Related Topics
EJBLocalObject
, Serializable
Method Summary |
public |
|
public | |
public |
|
public |
|
public |
|
public |
|
public void |
|
public |
|
public |
|
public |
|
public | |
public | |
public |
|
public |
|
public | |
public |
|
public | |
public |
|
public |
|
public |
|
Methods from interface javax.ejb. |
getEJBLocalHome, getPrimaryKey, isIdentical, remove |
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. A Call to this method will flush the entry in the Node Cache for this Node.Node
addNodeContent(ID
nodeId,ID
objectClassId,Property
[] properties)
throwsAuthenticationException
,AuthorizationException
,NoSuchObjectClassException
,NoSuchNodeException
,RepositoryException
If the Repository is a Managed Repository this method will create the Node in the Repository, but not the Properties. Instead, a VirtualNode will be created in the Virtual Repository with the Properties. When the Node moves through the LifeCycle and gets published, the Properties and ObjectClass will be updated on the Node.
AuthenticationException
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)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
Each Node will get a new ID, parent ID, new Properties and new children if applicable.
The copy may only be performed within the same repository, therefore the repositoryName must be the same in both the sourceId and the destinationId.
The uid must be defined for the sourceId, but if the uid is null for the destinationId, the desination will be the repository root.
A call to this method will flush the entire Node Cache.
If the Repository is a Managed Repository, copy will copy all the Nodes to the Repository without the Properties and ObjectClasses, so it will just copy the structure. For each Node it will create a VirtualNode in the Virtual Repository. Thus each Node will be checked out to the user who performed the copy.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method creates a new Content Node underneath the parent. If the uid for the parent ID is null then the new Node is created under root.Node
createContentNode(ID
parentId,String
newNodeName)
throwsAuthenticationException
,AuthorizationException
,NodeExistsException
,RepositoryException
AuthenticationException
AuthorizationException
NodeExistsException
RepositoryException
publicThis method creates a new Content Node underneath the parent. If the parent 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. The repository for the parentId and the objectClassId must be the same.Node
createContentNode(ID
parentId,String
newNodeName,ID
objectClassId,Property
[] properties)
throwsAuthorizationException
,NodeExistsException
,NoSuchObjectClassException
,RepositoryException
If the Repository is a Managed Repository this method will create the Node in the Repository, but not the Properties. Instead, a VirtualNode will be created in the Virtual Repository with the Properties. When the Node moves through the LifeCycle and gets published, the Properties and ObjectClass will be updated on the Node.
AuthorizationException
NodeExistsException
NoSuchObjectClassException
RepositoryException
publicThis method creates a new Hierarchy Node underneath the parent. The parent may only be another Hierarchy Node or root, not a Content Node. If the uid for the parent id is null then the new Node is created under root.Node
createHierarchyNode(ID
parentId,String
newNodeName)
throwsAuthenticationException
,AuthorizationException
,NodeExistsException
,RepositoryException
AuthenticationException
AuthorizationException
NodeExistsException
RepositoryException
publicThis method creates a new Hierarchy Node underneath the parent. If the parent is null then the new Node is created under root. This method also 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
createHierarchyNode(ID
parentId,String
newNodeName,ID
objectClassId,Property
[] properties)
throwsAuthorizationException
,NodeExistsException
,NoSuchObjectClassException
,RepositoryException
If the Repository is a Managed Repository this method will create the Node in the Repository, but not the Properties. Instead, a VirtualNode will be created in the Virtual Repository with the Properties. When the Node moves through the LifeCycle and gets published, the Properties and ObjectClass will be updated on the Node.
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 of the Nodes Properties are removed in the process.ID
nodeId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
A call to this method will flush the entire Node Cache.
If the Repository is a Managed Repository, delete will be attempted on the history for the Node also. Thus, delete removes all existence of the Node and its properties.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method gets all the nodes in it's path including itself. The array starts at the parent under root and includes each Node down to the Node for the id passed in. This method is a convenience method to build the ancestry. It does not run natively on the SPI so this may be performance intensive and make multiple calls to the SPI.Node
[] getAncestry(ID
nodeId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method returns the Content Node children for the given parent Node or an empty array if none exist.Node
[] getContentNodeChildren(ID
parentId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method returns the children Nodes for the given parent Node or an empty array if none exist.Node
[] getHierarchyNodeChildren(ID
parentId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
AuthenticationException
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 will be contained in the Node.Node
getNode(ID
nodeId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
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.
The Node Cache will be checked first before going to the spi to retrieve the Node.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
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 will be contained in the Node. The repositoryName must be defined in the path in a unix like format. For example, /repository/path.Node
getNode(String
path)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
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.
The Node Cache will be checked first before going to the spi to retrieve the Node.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method returns the children Nodes for the given parent Node. The nodes include their Properties and ObjectClass.Node
[] getNodeChildren(ID
parentId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicGets an Iterator of Nodes. The Iterator will retrieve nodes in chunks based on the pageSize.NodeIterator
getNodeIterator(ID
[] ids, int pageSize)
publicThis method gets the Node for each node ID passed in.Node
[] getNodes(ID
[] nodeIds)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
The IDs may be for different repositories. The IDs are chunked based on continuous repositories so there will only be one call to each repository for the chunk of ids. For example, if the ID array 0-5 contains IDs for repository A and 6-10 contain IDs for repository B, and 11-15 are for repository A, there will be 2 calls to repository A with 0-5 and 11-15 and one call to repository B with 6-10.
The position in the array for the returned Node will match the position where its ID was in the inputed ID array.
The Node Cache will be checked first before going to the spi to retrieve the Node.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicGets the Binary data for the given Node and Property Id.InputStream
getPropertyBytes(ID
nodeId,ID
propertyId)
throwsAuthenticationException
,AuthorizationException
,NoSuchPropertyException
,RepositoryException
After calling this method and retrieving the InputStream, you must close the InputStream when finished reading it in a finally block.
WARNING: If using this interface to retrieve binary content from
a BEA Repository, please read the javadoc for
RepositoryConfig
.
AuthenticationException
AuthorizationException
NoSuchPropertyException
RepositoryException
publicThis method moves a Node to a new location in the hierarchy along with all its descendants.Node
moveNode(ID
sourceId,ID
destinationId)
throwsAuthenticationException
,AuthorizationException
,NodeExistsException
,NoSuchNodeException
,RepositoryException
The parent ID for the source node will be changed, but all descendants of the source node will keep their parent relationships intact.
The move may only be performed within the same repository, therefore the repositoryName must be the same in both the sourceId and the destinationId.
The uid must be defined for the sourceId, but if the uid is null for the destinationId, the desination will be the repository root.
A call to this method will flush the entire Node Cache.
AuthenticationException
AuthorizationException
NodeExistsException
NoSuchNodeException
RepositoryException
publicRemoves the Nodes reference to its ObjectClass and deletes its Properties. A Call to this method will flush the entry in the Node Cache for this Node.Node
removeNodeContent(ID
nodeId)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,RepositoryException
If the Repository is a Managed Repository an UnsupportedRepositoryOperationException will be thrown. The only way to remove content from a managed Node is to Unpublish it.
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
publicThis method renames a node and implicitly all of its descendants paths. A call to this method will flush the entire Node Cache.Node
renameNode(ID
nodeId,String
newName)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,NodeExistsException
,RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
NodeExistsException
RepositoryException
publicUpdates the Node with the Properties. The node must already have an ObjectClass and valid Properties associated with it. All Properties are validated against their respective PropertyDefinition. A Call to this method will flush the entry in the Node Cache for this Node.Node
updateProperties(ID
nodeId,Property
[] properties)
throwsAuthenticationException
,AuthorizationException
,NoSuchNodeException
,NoSuchPropertyException
,RepositoryException
If the Repository is a Managed Repository an UnsupportedRepositoryOperationException will be thrown. The only way to remove content from a managed Node is to Unpublish it.
AuthenticationException
AuthorizationException
NoSuchNodeException
NoSuchPropertyException
RepositoryException