com.bea.content.federated
Interface INodeManager


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.

This interface is intended to be implemented only by BEA Weblogic Portal.BEA Systems reserves the right to add abstract methods to this interface without notice. Implementations of this interface by other parties must not be expected to compile without change in future versions of BEA Weblogic Portal.

Method Summary
 Node addNode(ContentContext context, String relPath, String primaryNodeTypeName, Property[] props)
          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 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

addNode

Node addNode(ContentContext context,
             String relPath,
             String primaryNodeTypeName,
             Property[] props)
             throws AuthorizationException,
                    NodeExistsException,
                    NoSuchObjectClassException,
                    RepositoryException
This method adds a new node to the repository. This operation will honor the security capabilities set on the parent node. For example, if the user does not have CREATE capabilities on the parent node, or INSTANTIATE capabilities on the type of the node, the operation might fail.

Parameters
context - The ContentContext Object
relPath - 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
Returns
The newly created node.
Throws
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 exception

getNodeByUUID

Node getNodeByUUID(ContentContext context,
                   ID nodeId)
                   throws AuthenticationException,
                          AuthorizationException,
                          NoSuchNodeException,
                          RepositoryException
This 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.

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.

Parameters
context - The contentContext object
nodeId - - the ID for the node to get. The ID must include the repository and uid.
Returns
Node - the retrieved Node.
Throws
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 exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            ID[] nodeIds)
                                            throws RepositoryException
Return an node array out of the id's. This method will honor security constraints and will not return any nodes the user does not have VIEW Privileges on. If a node does not exist for a given id in the nodeIds argument, that node will not be present in the results.

Parameters
context - The ContentContext object
nodeIds - An array of nodeIds
Returns
An array of Nodes containing only the nodes to which the user has proper privileges.
Throws
RepositoryException - - if the operation does not succeed.

getNode

Node getNode(ContentContext context,
             String path)
             throws AuthenticationException,
                    AuthorizationException,
                    NoSuchNodeException,
                    RepositoryException
This method gets a particular Node based on its path. Throws AuthorizationException if node does not have VIEW capability.

Parameters
context - The content context object
path - - The absolute path to this node, appended with the node's name.
Returns
the retrieved node
Throws
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 exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            ID parentId)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
Return all the children of the node. This will return only the children that have the VIEW capability. This method returns the children Nodes for the given parent Node. This will return only the children that have the VIEW capability.

Parameters
parentId -
Returns
A PageIterator which allows users to iterate through the nodes.
Throws
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 exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            ID parentId,
                                            int type)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
Deprecated -- use getNodes(ContentContext, ID)

The node type construct is deprecated. This method is provided as a convenience to users still dependent on the node type functionality.

Throws
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            String parentPath)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
This method returns the children Nodes for the given parent Node. This will return only the children that have the VIEW capability.

Parameters
context - The ContentContext object
parentPath - The path from which to get the children of.
Returns
The PageIterator object containing Nodes.
Throws
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 exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            String parentPath,
                                            int type)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
Deprecated -- use getNodes(ContentContext, String)

The node type construct is deprecated. This method is provided as a convenience to users still dependent on the node type functionality.

Throws
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException

removeIfAllowed

void removeIfAllowed(ContentContext context,
                     ID nodeId)
                     throws AuthenticationException,
                            AuthorizationException,
                            NoSuchNodeException,
                            RepositoryException
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. Throws AuthorizationException if user does not have DELETE capabilities on the node or its children. This method also checks if the user has delete rights on child nodes.

Parameters
context - The ContentContext object
nodeId - The nodeId representing the node
Throws
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 exception

remove

void remove(ContentContext context,
            ID nodeId)
            throws AuthenticationException,
                   AuthorizationException,
                   NoSuchNodeException,
                   RepositoryException
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. Throws AuthorizationException if user does not have DELETE capabilities on the node. This method DOES NOT check the delete rights on the child nodes.

Parameters
context - The ContentContext object
nodeId - The nodeId representing the node
Throws
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 exception

remove

void remove(ContentContext context,
            String path)
            throws AuthenticationException,
                   AuthorizationException,
                   NoSuchNodeException,
                   RepositoryException
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. Throws AuthorizationException if user does not have DELETE capabilities on the node This method DOES NOT check the delete rights on the child nodes.

Parameters
context - The ContentContext object
path - The path to the node being deleted ie: /MyRepository/MyNode
Throws
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 exception

removeIfAllowed

void removeIfAllowed(ContentContext context,
                     String path)
                     throws AuthenticationException,
                            AuthorizationException,
                            NoSuchNodeException,
                            RepositoryException
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. THis method throws AuthorizationException if user does not have DELETE capabilities on the node and its children. This method also checks if the user has delete rights on child nodes.

Parameters
context - The ContentContext object
path - The path to the node being deleted ie: /MyRepository/MyNode
Throws
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.

copy

Node copy(ContentContext context,
          ID sourceId,
          ID destinationId)
          throws AuthenticationException,
                 AuthorizationException,
                 NoSuchNodeException,
                 RepositoryException
This method copies a Node to a new location in the hierarchy along with all its descendants.

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.

Parameters
context - - The ContentContext object
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.
Returns
Node - the copied Node, with a new uid and path.
Throws
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 exception

move

Node move(ContentContext context,
          ID sourceId,
          ID destinationId)
          throws AuthenticationException,
                 AuthorizationException,
                 NoSuchNodeException,
                 RepositoryException
This method moves a Node to a new location in the hierarchy along with all its descendants.

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.

Parameters
context - - The ContentContext object
sourceId - - the ID of the Node to be moved.
destinationId - - the ID of the Node under which the sourceId Node is moved.
Returns
Node - the moved Node, with a new path
Throws
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 exception

hasNodeReferences

boolean hasNodeReferences(ContentContext context,
                          ID nodeId)
                          throws AuthorizationException,
                                 AuthenticationException,
                                 RepositoryException
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.

Parameters
context - - The ContentContext object
nodeId - - the ID of the node
Returns
boolean - returns true if there are any nodes referring to the specified node
Throws
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 exception

getNodeReferences

ISortableFilterablePagedList<Node> getNodeReferences(ContentContext context,
                                                     ID nodeId)
                                                     throws AuthenticationException,
                                                            AuthorizationException,
                                                            RepositoryException
This method retrieve nodes which have a link property referring to the specified node. This will return only the nodes that have the VIEW capability. It's possible there are additional nodes which the current caller does not have access to, which refer to the specified node. To check if any nodes have link properties referring to a node, use hasNodeReferences( );

Parameters
context - - The ContentContext object
nodeId - - the ID of the node
Returns
ISortableFilterablePagedList - which allows users to iterate through the nodes.
Throws
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 exception

getStream

InputStream getStream(ContentContext context,
                      ID nodeId,
                      String propertyName)
                      throws AuthenticationException,
                             AuthorizationException,
                             NoSuchPropertyException,
                             RepositoryException
This method retrieves the Binary data for the given Node and its property. This method returns the binary data of the property of the PUBLISHED node [if you have a versioning enabled repository] After calling this method and retrieving the InputStream, you must close the InputStream when finished reading it in a finally block. If this is a nested property type, the name will reflect the nested hierarchy with 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.

Parameters
nodeId - - the node Id
propertyName - - the name for the Property that contains the binary data.
Returns
InputStream - the binary data.
Throws
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

save

Node save(ContentContext context,
          Node node)
          throws AuthenticationException,
                 AuthorizationException,
                 RepositoryException
This method updates an existing node in a single transaction. The changed node attributes will be updated accordingly, including changed properties. This is a less granular way of performing similar actions like addNodeContent, moveNode, renameNode, and updateProperties. Additionally this provides access to modify a node's workflow status and workflow id. The node is assumed to be retrieved from this API and therefore properly formed when this call is made. Therefore if this method is called and some property values are not specified, those property values will be made null. The following node attributes cannot be modified via this API. created by, created date, modified by, modified date and path (modifying the parent will cause the node path to be updated properly). Please note that if the node is library services enabled, this method will not change any properties of the node. You need to use the VersionManager.save method to accomplish that.

Parameters
node - The node to update with the various changes set accordingly.
Returns
The updated node
Throws
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 exception

hasCapability

boolean hasCapability(ContentContext context,
                      String repositoryName,
                      Node node,
                      NodeCapability capability)
                      throws AuthorizationException
Check to see if the caller has the specified security capability on a node

Parameters
context - The ContentContext object
repositoryName - The name of the repository
node - The node. Null checks at the root
capability - The capability to check for.
Returns
true or false depending on whether the caller has the capability on the node or not.
Throws
AuthorizationException - - if the user attempting the operation is not authorized to perform it.


Copyright © 2006 BEA Systems, Inc. All Rights Reserved