|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
INodeManager
public interface NodeOps
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.
Node
Method Detail |
---|
Node createHierarchyNode(ID parentId, String newNodeName) throws AuthenticationException, AuthorizationException, NodeExistsException, RepositoryException
INodeManager.addNode(com.bea.content.ContentContext, String, String, com.bea.content.Property[])
}
parentId
- - the ID for the parent (must be Hierarchy Node)
of the node. The uid for the ID is null
if the parent is root. The repository must be defined in the ID.newNodeName
- - the name of Node to create.
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.
NodeExistsException
- - if the name for the node
already exists as a child of the parent.
RepositoryException
- - if validation error occurs.Node createHierarchyNode(ID parentId, String newNodeName, ID objectClassId, Property[] properties) throws AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException
INodeManager.addNode(com.bea.content.ContentContext, String, String, com.bea.content.Property[])
}
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 Workflow and gets published, the Properties and ObjectClass will be updated on the Node.
parentId
- - the id for the parent of the node. It is null
if the parent is root.newNodeName
- - the name of Node to create.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 system error occurs.Node createContentNode(ID parentId, String newNodeName) throws AuthenticationException, AuthorizationException, NodeExistsException, RepositoryException
INodeManager.addNode(com.bea.content.ContentContext, String, String, com.bea.content.Property[])
}
parentId
- - the ID for the parent of the node. The parent
may be either a Hierarchy or Content Node. The uid for the ID is null
if the parent is root. The repositoryName must be defined in the ID.newNodeName
- - the name of Node to create.
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.
NodeExistsException
- - if the name for the node
already exists as a child of the parent.
RepositoryException
- - if system or validation error occurs.Node createContentNode(ID parentId, String newNodeName, ID objectClassId, Property[] properties) throws AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException
INodeManager.addNode(com.bea.content.ContentContext, String, String, com.bea.content.Property[])
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 Workflow and gets published, the Properties and ObjectClass will be updated on the Node.
parentId
- - the id for the parent of the node. It is null
if the parent is root.newNodeName
- - the name of Node to create.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 system error occurs.Node getNode(ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNodeByUUID(com.bea.content.ContentContext, com.bea.content.ID)
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.
nodeId
- - the ID for the node to get. The ID must
include the repository and uid.
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 get can't be found.
RepositoryException
Node getNode(String path) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNode(com.bea.content.ContentContext, String)
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.
path
- - the path for the node to get. The repositoryName
must be defined in the path.
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 get can't be found.
RepositoryException
Node[] getNodes(ID[] nodeIds) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNodes(com.bea.content.ContentContext, com.bea.content.ID[])
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.
nodeIds
- - the Node IDs to retrieve the Nodes for. Each ID
must contain the repositoryName where the Node resides. If nodeIds
is null, or an empty array then an empty Node array will be returned.
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 a node to get can't be found.
RepositoryException
Node[] getNodeChildren(ID parentId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNodes(com.bea.content.ContentContext, com.bea.content.ID)
parentId
- - the ID for the Node that may have children.
The repositoryName must be defined in the id. If the uid is
null then the Nodes at the repository root will be returned.
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 parent node can't be found.
RepositoryException
Node[] getHierarchyNodeChildren(ID parentId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNodes(com.bea.content.ContentContext, com.bea.content.ID, int)
parentId
- - the ID for the Hierarchy Node that may have children.
(Content Nodes can't contain Hierarchy Nodes).
The repositoryName must be defined in the id. If the uid is
null then the Hierarchy Nodes at the repository root will be returned.
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 parent node can't be found.
RepositoryException
Node[] getContentNodeChildren(ID parentId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNodes(com.bea.content.ContentContext, com.bea.content.ID, int)
parentId
- - the Node that may have Content Node children.
The repositoryName must be defined in the id. If the uid is
null then the Hierarchy Nodes at the repository root will be returned.
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 parent node can't be found.
RepositoryException
Node[] getAncestry(ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.getNode(com.bea.content.ContentContext, String)
nodeId
- - the id of the node. The ID must be include the repository
and uid.
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 get ancestry for does not exist.
RepositoryException
void deleteNode(ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.remove(com.bea.content.ContentContext, com.bea.content.ID)
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.
nodeId
- - the ID of the Node to be deleted.
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 delete can't be found.
RepositoryException
- - if validation error occurs.Node moveNode(ID sourceId, ID destinationId) throws AuthenticationException, AuthorizationException, NodeExistsException, NoSuchNodeException, RepositoryException
INodeManager.move(com.bea.content.ContentContext, com.bea.content.ID, com.bea.content.ID)
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.
sourceId
- - the ID of the Node to be moved. Both repositoryName
and the uid must be defined in the ID.destinationId
- - the ID of the Node under which
the sourceId Node is moved. The repositoryName must be defined
in the ID. If the uid is null, the destination will be the
repository root.
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.
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 system or validation error occurs.Node copyNode(ID sourceId, ID destinationId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
INodeManager.copy(com.bea.content.ContentContext, com.bea.content.ID, com.bea.content.ID)
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.
sourceId
- - the ID of the Node to be copied. Both
the repositoroyName and the uid must be defined in the ID.destinationId
- - the ID of the Node under which
the sourceId Node is copied. The repositoryName must
be defined in the ID. If the uid is null, the destination
will be the repository root.
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 source or destination
node can't be found.
RepositoryException
- - if system or validation error occurs.Node renameNode(ID nodeId, String newName) throws AuthenticationException, AuthorizationException, NoSuchNodeException, NodeExistsException, RepositoryException
Node.setName(String)
followed by
INodeManager.save(com.bea.content.ContentContext, com.bea.content.Node)
nodeId
- - the ID for the node to rename. The repositoryName and
uid must be defined in the ID.newName
- - a String for the new node name
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 rename can't be found.
NodeExistsException
- - if the newName already exists as a sibling.
RepositoryException
- - if system or validation error occurs.Node addNodeContent(ID nodeId, ID objectClassId, Property[] properties) throws AuthenticationException, AuthorizationException, NoSuchObjectClassException, NoSuchNodeException, RepositoryException
Node.setObjectClass(com.bea.content.ObjectClass)
and/or
Node.setProperties(com.bea.content.Property[])
followed by
INodeManager.save(com.bea.content.ContentContext, com.bea.content.Node)
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 Workflow and gets published, the Properties and ObjectClass will be updated on the Node.
nodeId
- - the ID of the node to update. The ID must
include the repositoryName and uid.objectClassId
- - the ID of the objectClass to associate the Node to.
The ID must include the repositoryName and the uid.properties
- - the Properties to add or 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.
NoSuchObjectClassException
- thrown if the ObjectClass
to set on the Node does not exist.
NoSuchNodeException
- - if the Node to update does not exist.
RepositoryException
- - if system or validation error occurs.Node removeNodeContent(ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
Node.setObjectClass(com.bea.content.ObjectClass)
with a null value
and Node.setProperties(com.bea.content.Property[])
with a null value followed by
INodeManager.save(com.bea.content.ContentContext, com.bea.content.Node)
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.
nodeId
- - the ID for the Node to remove the ObjectClass from.
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 does not exist.
RepositoryException
- - if system or validation error occurs.Node updateProperties(ID nodeId, Property[] properties) throws AuthenticationException, AuthorizationException, NoSuchNodeException, NoSuchPropertyException, RepositoryException
INodeManager.save(com.bea.content.ContentContext, com.bea.content.Node)
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.
nodeId
- - the ID of the Node to update.
The ID must include the repositoryName and uid.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.InputStream getPropertyBytes(ID nodeId, ID propertyId) throws AuthenticationException, AuthorizationException, NoSuchPropertyException, RepositoryException
INodeManager.getStream(com.bea.content.ContentContext, com.bea.content.ID, String)
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
.
nodeId
- - the ID for the node.propertyId
- - the ID for the Property that contains the binary data. The
ID must include the repositoryName.
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.
NoSuchPropertyException
- - if the Property does not exist.
RepositoryException
NodeIterator getNodeIterator(ID[] ids, int pageSize)
INodeManager.getNodes(com.bea.content.ContentContext, com.bea.content.ID[])
ids
- - the ids to iterate onpageSize
- - the number of nodes to retrieve at one time.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |