|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INodeManager
Interface to access and manage content node information in the repository, while honoring security(DA/Visitor) constraints placed on them.
Methods returning an ISortableFilterablePagedList
may perform sorting and filtering. See the documentation
in com.bea.content.paging
and Node
.
Note: new methods may be added to this interface periodically -- therefore, this not a good CM extension point.
The recommended extension point is at the Service Provider Interface, in package com.bea.content.spi
.
Method Summary | |
---|---|
Node |
addNode(ContentContext context,
String relPath,
String primaryNodeTypeName,
Property[] props)
This method adds a new node to the repository. |
Node |
addNode(ContentContext context,
String relPath,
String primaryNodeTypeName,
Property[] props,
ID workflowId)
This method adds a new node to the repository. |
Node |
copy(ContentContext context,
ID sourceId,
ID destinationId)
This method copies a Node to a new location in the hierarchy along with all its descendants. |
Node |
getNode(ContentContext context,
String path)
This method gets a particular Node based on its path. |
Node |
getNodeByUUID(ContentContext context,
ID nodeId)
This method gets a particular Node based on its ID. |
ISortableFilterablePagedList<Node> |
getNodeReferences(ContentContext context,
ID nodeId)
This method retrieve nodes which have a link property referring to the specified node. |
ISortableFilterablePagedList<Node> |
getNodes(ContentContext context,
ID parentId)
Return all the children of the node. |
ISortableFilterablePagedList<Node> |
getNodes(ContentContext context,
ID[] nodeIds)
Return an node array out of the id's. |
ISortableFilterablePagedList<Node> |
getNodes(ContentContext context,
ID parentId,
int type)
Deprecated -- use getNodes(ContentContext, ID) |
ISortableFilterablePagedList<Node> |
getNodes(ContentContext context,
String parentPath)
This method returns the children Nodes for the given parent Node. |
ISortableFilterablePagedList<Node> |
getNodes(ContentContext context,
String parentPath,
int type)
Deprecated -- use getNodes(ContentContext, String) |
InputStream |
getStream(ContentContext context,
ID nodeId,
String propertyName)
This method retrieves the Binary data for the given Node and its property. |
boolean |
hasCapability(ContentContext context,
String repositoryName,
Node node,
NodeCapability capability)
Check to see if the caller has the specified security capability on a node |
boolean |
hasNodeReferences(ContentContext context,
ID nodeId)
This method determines if there are any nodes (including possibly some which cannot be accessed) which have a link property referring to the specified node. |
Node |
move(ContentContext context,
ID sourceId,
ID destinationId)
This method moves a Node to a new location in the hierarchy along with all its descendants. |
void |
orderBefore(ContentContext context,
ID srcChildNodeId,
ID destChildNodeId)
If the repository supports child node ordering, and the parent node type supports child node ordering, this method inserts the child node at srcChildNodeId before its sibling,
the child node at destChildNodeId , in the child node list. |
void |
remove(ContentContext context,
ID nodeId)
This method performs a full cascade delete on a Node. |
void |
remove(ContentContext context,
String path)
This method performs a full cascade delete on a Node. |
void |
removeIfAllowed(ContentContext context,
ID nodeId)
This method performs a full cascade delete on a Node. |
void |
removeIfAllowed(ContentContext context,
String path)
This method performs a full cascade delete on a Node. |
Node |
save(ContentContext context,
Node node)
This method updates an existing node in a single transaction. |
Method Detail |
---|
Node addNode(ContentContext context, String relPath, String primaryNodeTypeName, Property[] props) throws AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException
context
- The ContentContext ObjectrelPath
- The absolute path to this node, appended with the node's name. For example /A/B/C indicates a
node C being added under the parent node B.primaryNodeTypeName
- The type name of the node to create.props
- The properties of the node
AuthorizationException
- - if the user does not have CREATE capability on the parent node, or if the user does not have
INSTANTIATE capability on the type of the node. This exception will also be thrown if the user is not authorizated by the repository.
NodeExistsException
- - if the parent Node already has a child with the same name.
NoSuchObjectClassException
- - if the node's ObjectClass doesn't exist.
RepositoryException
- - for any other exceptionNode addNode(ContentContext context, String relPath, String primaryNodeTypeName, Property[] props, ID workflowId) throws AuthorizationException, NodeExistsException, NoSuchObjectClassException, RepositoryException
context
- The ContentContext ObjectrelPath
- The absolute path to this node, appended with the node's name. For example /A/B/C indicates a
node C being added under the parent node B.primaryNodeTypeName
- The type name of the node to create.props
- The properties of the nodeworkflowId
- Optional workflow Id for the node. Null will cause it to inherit the workflow.
AuthorizationException
- - if the user does not have CREATE capability on the parent node, or if the user does not have
INSTANTIATE capability on the type of the node. This exception will also be thrown if the user is not authorizated by the repository.
NodeExistsException
- - if the parent Node already has a child with the same name.
NoSuchObjectClassException
- - if the node's ObjectClass doesn't exist.
RepositoryException
- - for any other exceptionNode getNodeByUUID(ContentContext context, ID nodeId) throws AuthenticationException, 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 #getStream} is necessary. Before retrieving the node it will see if the node has VIEW capability on it. If the capability is not set, the method will disallow the operation & throw an exception.
context
- The contentContext objectnodeId
- - 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 does not have VIEW capability on the node
This exception will also be thrown if the user is not authorizated by the repository.
NoSuchNodeException
- - if the node to get can't be found.
RepositoryException
- - for any other exceptionISortableFilterablePagedList<Node> getNodes(ContentContext context, ID[] nodeIds) throws RepositoryException
context
- The ContentContext objectnodeIds
- An array of nodeIds
RepositoryException
- - if the operation does not succeed.Node getNode(ContentContext context, String path) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The content context objectpath
- - The absolute path to this node, appended with the node's name.
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if the user does not have the VIEW capability on the node.
This exception will also be thrown if the user is not authorizated by the repository.
NoSuchNodeException
- - if the node to get can't be found.
RepositoryException
- - for any other exceptionISortableFilterablePagedList<Node> getNodes(ContentContext context, ID parentId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
parentId
-
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 nodes to get can't be found
RepositoryException
- - for any other exceptionISortableFilterablePagedList<Node> getNodes(ContentContext context, ID parentId, int type) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
ISortableFilterablePagedList<Node> getNodes(ContentContext context, String parentPath) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The ContentContext objectparentPath
- The path from which to get the children of.
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 nodes to get can't be found
RepositoryException
- - for any other exceptionISortableFilterablePagedList<Node> getNodes(ContentContext context, String parentPath, int type) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException
void removeIfAllowed(ContentContext context, ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The ContentContext objectnodeId
- The nodeId representing the node
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if the user does not have DELETE capabilities on the node
or its children. This exception will also be thrown if the user is not authorizated by the repository.
NoSuchNodeException
- - if the nodes does not exist
RepositoryException
- - for any other exceptionvoid remove(ContentContext context, ID nodeId) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The ContentContext objectnodeId
- The nodeId representing the node
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if user does not have DELETE capabilities on the node.
This exception will also be thrown if the user is not authorizated by the repository.
NoSuchNodeException
- - if the node does not exist.
RepositoryException
- - for any other exceptionvoid remove(ContentContext context, String path) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The ContentContext objectpath
- The path to the node being deleted ie: /MyRepository/MyNode
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if the user does not have DELETE capabilities on the node.
NoSuchNodeException
- - if the node does not exist
RepositoryException
- - for any other exceptionvoid removeIfAllowed(ContentContext context, String path) throws AuthenticationException, AuthorizationException, NoSuchNodeException, RepositoryException
context
- The ContentContext objectpath
- The path to the node being deleted ie: /MyRepository/MyNode
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
- - for any other exception.Node copy(ContentContext context, ID sourceId, ID destinationId) throws AuthenticationException, 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.
If the repository supports child node ordering, and the parent node type supports child node ordering, this method copies the node tree to the end of the child node list of the source node.
context
- - The ContentContext objectsourceId
- - 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 does not have CREATE capability on the destination.
This exception will also be thrown if the user is not authorizated by the repository.
NoSuchNodeException
- - if the node to copy does not exist
RepositoryException
- - for any other exceptionNode move(ContentContext context, ID sourceId, ID destinationId) throws AuthenticationException, AuthorizationException, 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. This method throws AuthorizationException if user does not have DELETE capabilities on the node to be moved, or CREATE capabilities on destination. This method does NOT check if the user has DELETE capabilities on the descendants of the source node.
If the repository supports child node ordering, and the parent node type supports child node ordering, this method moves the new node tree to the end of the child node list of the source node.
context
- - The ContentContext objectsourceId
- - the ID of the Node to be moved.destinationId
- - the ID of the Node under which
the sourceId Node is moved.
AuthenticationException
- - if the user attempting
the operation isn't authenticated against the repository.
AuthorizationException
- - if user does not have DELETE permission on source or CREATE permission on destination.
NoSuchNodeException
- - if the node does not exist
RepositoryException
- - for any other exceptionboolean hasNodeReferences(ContentContext context, ID nodeId) throws AuthorizationException, AuthenticationException, RepositoryException
context
- - The ContentContext objectnodeId
- - the ID of 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.
RepositoryException
- - for any other exceptionISortableFilterablePagedList<Node> getNodeReferences(ContentContext context, ID nodeId) throws AuthenticationException, AuthorizationException, RepositoryException
context
- - The ContentContext objectnodeId
- - the ID of the node
AuthenticationException
- - if the user attempting the
operation is not authenticated to perform it.
AuthorizationException
- - if the user does not have VIEW capabilities on the node.
RepositoryException
- - for any other exceptionInputStream getStream(ContentContext context, ID nodeId, String propertyName) throws AuthenticationException, AuthorizationException, NoSuchPropertyException, RepositoryException
NESTED_DELIMITER
between each parent and child property name.
The delimiter is not valid for use within the actual name, only to seperate the parent/child names.
If the nested property type is multi-valued, then the name passed through should be the indexed name,
which contains an index representing which multivalued property is being referenced.
See Property
indexedName
.
nodeId
- - the node IdpropertyName
- - the name for the Property that contains the binary data.
AuthenticationException
- - if the user attempting the
operation is not authenticated to perform it.
AuthorizationException
- if the user does not have VIEW capabilities on the node.
This exception will also be thrown if the user is not authorizated by the repository.
NoSuchPropertyException
- - if the Property does not exist.
RepositoryException
void orderBefore(ContentContext context, ID srcChildNodeId, ID destChildNodeId) throws UnsupportedRepositoryOperationException, ConstraintViolationException, NoSuchNodeException, AuthorizationException, RepositoryException
srcChildNodeId
before its sibling,
the child node at destChildNodeId
, in the child node list.
The caller must have UPDATE capability on the parent node, and VIEW capability on both child nodes, which
must be children of the parent node.
To place the node srcChildNodeId
at the end of the list, a destChildNodeId
of null
is used.
If srcChildNodeId
and destChildNodeId
are the same, then no change is made.
If this repository or node do not support child node ordering, then a UnsupportedRepositoryOperationException
is thrown.
If srcChildNodeId
does not exist, then a NoSuchNodeException
is thrown.
If destChildNodeId
is neither null
nor a sibling of srcChildNodeId,
then a NoSuchNodeException
is also thrown.
If this operation would violate a node type or implementation-specific constraint,
a ConstraintViolationException
will be thrown.
If the caller does not have UPDATE capability on the parent node, then a AuthorizationException
is thrown.
If the caller does not have VIEW capability on either child node, then a AuthorizationException
is thrown.
context
- the ContentContext objectsrcChildNodeId
- the child node to be moved in the orderingdestChildNodeId
- the child node before which the node srcChildNodeId
will be placed, or
null to move the srcChildNode to the last position.
UnsupportedRepositoryOperationException
- if ordering is not supported.
ConstraintViolationException
- if an implementation-specific constraint is violated
NoSuchNodeException
- if neither child node exists
AuthorizationException
- if the caller does not have UPDATE capability on the node parent,
or VIEW capability on both child nodes.
RepositoryException
- if another error occurs.Node save(ContentContext context, Node node) throws AuthenticationException, AuthorizationException, RepositoryException
node
- The node to update with the various changes set accordingly.
AuthenticationException
- - if the user attempting the
operation is not authenticated to perform it.
AuthorizationException
- - if the user does not have UPDATE capability on the node.
This exception will also be thrown if the user is not authorizated by the repository.
RepositoryException
- - for any other exceptionboolean hasCapability(ContentContext context, String repositoryName, Node node, NodeCapability capability) throws AuthorizationException
context
- The ContentContext objectrepositoryName
- The name of the repositorynode
- The node. Null checks at the rootcapability
- The capability to check for.
AuthorizationException
- - if the user attempting the
operation is not authorized to perform it.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |