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.

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 Oracle Weblogic Portal. Oracle 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 Oracle Weblogic Portal.

Method Summary
 Node addNode(ContentContext context, String absPath, String objectClassName, Property[] props)
          This method adds a new node to a repository.
 Node addNode(ContentContext context, String absPath, String objectClassName, Property[] props, ID workflowId)
          This method adds a new node to a repository.
 Node copy(ContentContext context, ID sourceId, ID destinationId)
          This method copies a Node and all its descendents to a new location in the node hierarchy.
 Node getNode(ContentContext context, String absPath)
          This method retrieves a specific Node based on its absolute path.
 Node getNodeByUUID(ContentContext context, ID nodeId)
          This method retrieves a particular Node based on its ID.
 ISortableFilterablePagedList<Node> getNodeReferences(ContentContext context, ID nodeId)
          This method retrieve nodes in any federated repositories which have a link property referring to the specified node.
 ISortableFilterablePagedList<Node> getNodes(ContentContext context, ID parentId)
          Return all the immediate children of the specified node.
 ISortableFilterablePagedList<Node> getNodes(ContentContext context, ID[] nodeIds)
          Retrieve a collection of nodes associated with the array of node id's.
 ISortableFilterablePagedList<Node> getNodes(ContentContext context, ID parentId, int type)
          Deprecated -- use getNodes(ContentContext, ID)
 ISortableFilterablePagedList<Node> getNodes(ContentContext context, String absParentPath)
          This method returns all the immediate child 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 value 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 in any federated repositories (including possibly some nodes which cannot be accessed) that 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 node 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 ObjectClass 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 and its children.
 void remove(ContentContext context, String absPath)
          This method performs a full cascade delete on a Node and its children.
 void removeIfAllowed(ContentContext context, ID nodeId)
          This method performs a full cascade delete on a Node and its children.
 void removeIfAllowed(ContentContext context, String absPath)
          This method performs a full cascade delete on a Node and its children.
 Node save(ContentContext context, Node node)
          This method updates an existing node in a single transaction.
 

Method Detail

addNode

Node addNode(ContentContext context,
             String absPath,
             String objectClassName,
             Property[] props)
             throws AuthorizationException,
                    NodeExistsException,
                    NoSuchObjectClassException,
                    RepositoryException
This method adds a new node to a 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 ObjectClass of the node, the operation might fail.

If the repository supports child node ordering, and the parent node's ObjectClass supports child node ordering, this method creates the new child node at the end of the child node list.

Will throw a RepositoryException if the repository specified in the path does not support the NodeFeatureCapability.NodeCreate capability.

Parameters
context - The ContentContext Object
absPath - The absolute path to this node, including the repository name and ending with the node's name. For example /A/B/C indicates a node C being added under the parent node B in repository A.
objectClassName - The name of the ObjectClass to use. This can be null, meaning there is no ObjectClass associated with the node. Without an ObjectClass, the node cannot have properties.
props - The properties (and values) of the node. This can be null, even if the 'objectClassName' is non-null.
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 ObjectClass 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

addNode

Node addNode(ContentContext context,
             String absPath,
             String objectClassName,
             Property[] props,
             ID workflowId)
             throws AuthorizationException,
                    NodeExistsException,
                    NoSuchObjectClassException,
                    RepositoryException
This method adds a new node to a 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 ObjectClass of the node, the operation might fail.

If the repository supports child node ordering, and the parent ObjectClass supports child node ordering, this method creates the new child node at the end of the child node list.

Will throw a RepositoryException if the repository specified in the path does not support the NodeFeatureCapability.NodeCreate capability.

Parameters
context - The ContentContext Object
absPath - The absolute path to this node, including the repository name and ending with the node's name. For example /A/B/C indicates a node C being added under the parent node B in repository A.
objectClassName - The name of the ObjectClass to use. This can be null, meaning there is no ObjectClass associated with the node. Without an ObjectClass, the node cannot have properties.
props - The properties (and values) of the node. This can be null, even if the 'objectClassName' is non-null.
workflowId - Optional workflow Id for the node. Null will cause it to inherit the workflow.
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 ObjectClass 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 retrieves a particular Node based on its ID. If there is an ObjectClass associated with it then the ObjectClass and its associated Properties will be contained in the Node.

Note that the repository root node (uid=null or empty string) cannot be retrieved.

Binary properties are not contained in the Property's BinaryValue. In order to retrieve the binary value a call to (@link #getStream} is necessary. This method requires the caller to have VIEW capability on the node, or the operation will be disallowed and an exception will be thrown. Will throw a RepositoryException if the repository specified in the nodeId does not support the NodeFeatureCapability.NodeRetrieval capability.

Parameters
context - The contentContext object
nodeId - - the ID for the node to get. Must have both the repositoryName and uid set. Cannot be the repository root node.
Returns
Node - the retrieved Node.
Throws
AuthenticationException - - if the user attempting the operation isn't authenticated against the repository. 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, or if the user does not have VIEW capability on the node
AuthorizationException - - if the user is not authorizated by the repository.
RepositoryException - - for any other exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            ID[] nodeIds)
                                            throws RepositoryException
Retrieve a collection of nodes associated with the array of node id's. This method only returns nodes the user has VIEW capability on. The nodes are in the same order as the ID positions, though some IDs may not have associated nodes because some nodes may no longer exist or because the caller does not have VIEW capability on some nodes. In this case, the ID position will contain a null value.

Note that the repository root node (uid=null or empty string) cannot be retrieved.

Will throw a RepositoryException if the repository specified in the ID[] does not support the NodeFeatureCapability.NodeRetrieval capability.

Parameters
context - The ContentContext object
nodeIds - An array of nodeIds to retrieve
Returns
A collection of associated Nodes that the user can view.
Throws
RepositoryException - - if the operation does not succeed.

getNode

Node getNode(ContentContext context,
             String absPath)
             throws AuthenticationException,
                    AuthorizationException,
                    NoSuchNodeException,
                    RepositoryException
This method retrieves a specific Node based on its absolute path. The absolute path to this node must include the repository name and the path to the node within the repository. For example, path /A/B/C would retrieve from repository A the node at /B/C

Note that the repository root node cannot be retrieved.

Will throw a RepositoryException if the repository specified in the path does not support the NodeFeatureCapability.NodeRetrieval capability. Throws AuthorizationException if node does not have VIEW capability.

Parameters
context - The content context object
absPath - - The absolute path to this node, including the repository name and ending 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 is not authorizated by the repository.
NoSuchNodeException - - if the node can't be found, or if the user does not have the VIEW capability on the node..
RepositoryException - - for any other exception

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            ID parentId)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
Return all the immediate children of the specified node. This will return only the children for which the caller has VIEW capability.

If an initial sort order is specified, then the sort order will be used and results will be returned according to that sort order.

If an initial sort order is not specified, and the repository and node ObjectClass support the child node ordering feature, then results are returned in a deterministic order (the child node order).

If an initial sort order is not specified, and the repository or node ObjectClass do not support the child node ordering feature, then result ordering may vary from call-to-call.

This method returns the immediate child Nodes for the given parent Node. This will return only the children that have the VIEW capability.

Will throw a RepositoryException if the repository specified in the parentId does not support the NodeFeatureCapability.NodeRetrieval capability.

Parameters
context - The contentContext object
parentId- - the ID for the parent node. Must have both the repositoryName and uid set. Set the uid to null to fetch children of the repository root node.
Returns
A PagedList which allows callers to iterate through the results.
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 can't be found or if the user doesn't have VIEW rights to the parent node.
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 (content/hierarchy) construct is deprecated. This method is provided as a convenience to users still dependent on the node type functionality. Will throw a RepositoryException if the repository specified in the parentId does not support the NodeFeatureCapability.NodeRetrieval capability.

Throws
AuthenticationException
AuthorizationException
NoSuchNodeException
RepositoryException

getNodes

ISortableFilterablePagedList<Node> getNodes(ContentContext context,
                                            String absParentPath)
                                            throws AuthenticationException,
                                                   AuthorizationException,
                                                   NoSuchNodeException,
                                                   RepositoryException
This method returns all the immediate child Nodes for the given parent Node. This will return only the children for which the caller has VIEW capability.

If an initial sort order is specified, then the sort order will be used and results will be returned according to that sort order.

If an initial sort order is not specified, and the repository and node ObjectClass support the child node ordering feature, then results are returned in a deterministic order (the child node order).

If an initial sort order is not specified, and the repository or node ObjectClass do not support the child node ordering feature, then result ordering may vary from call-to-call.

This method returns the immediate child Nodes for the given parent Node. This will return only the children that have the VIEW capability.

The absolute path to the parent node must include the repository name and the path to the parent node within the repository. For example, path /A/B/C would retrieve from repository A all immediate children of the parent node at /B/C. To fetch children of the repository root, use a path of the form /RepositoryName.

Will throw a RepositoryException if the repository specified in the parentPath does not support the NodeFeatureCapability.NodeRetrieval capability.

Parameters
context - The ContentContext object
absParentPath - The absolute path from which to retrieve children, including the repository name and ending with the parent node name.
Returns
The PagedList allowing callers to iterate over the results
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 or it the user doesn't have VIEW rights to the parent node
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. Will throw a RepositoryException if the repository specified in the parentPath does not support the NodeFeatureCapability.NodeRetrieval capability.

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 and its children. The node, all its descendant Nodes and each of the Node Properties are removed in the process.

Throws AuthorizationException if user does not have DELETE capabilities on the node or its children.

This method checks if the user has delete rights on child nodes. Will throw a RepositoryException if the repository specified in the nodeId does not support the NodeFeatureCapability.NodeRemove capability.

Parameters
context - The ContentContext object
nodeId- - the ID representing the node. Must have both the repositoryName and uid set. Cannot be the repository root 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 a node does not exist or if the user doesn't have VIEW rights to the node
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 and its children. The node, all its descendant Nodes and each of the Node 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. Will throw a RepositoryException if the repository specified in the nodeId does not support the NodeFeatureCapability.NodeRemove capability.

Parameters
context - The ContentContext object
nodeId- - the ID representing the node. Must have both the repositoryName and uid set. Cannot be the repository root 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 or if the user doesn't have VIEW rights to the node.
RepositoryException - - for any other exception

remove

void remove(ContentContext context,
            String absPath)
            throws AuthenticationException,
                   AuthorizationException,
                   NoSuchNodeException,
                   RepositoryException
This method performs a full cascade delete on a Node and its children. The node, all its descendant Nodes and each of the Node 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. Will throw a RepositoryException if the repository specified in the path does not support the NodeFeatureCapability.NodeRemove capability.

Parameters
context - The ContentContext object
absPath - The absolute path to the node being deleted, including the repository name and the path within the repository to the node, ie: /MyRepository/a/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 or if the user doesn't have VIEW rights to the node.
RepositoryException - - for any other exception

removeIfAllowed

void removeIfAllowed(ContentContext context,
                     String absPath)
                     throws AuthenticationException,
                            AuthorizationException,
                            NoSuchNodeException,
                            RepositoryException
This method performs a full cascade delete on a Node and its children. The node, all its descendant Nodes and each of the Node Properties are removed in the process.

This method throws AuthorizationException if user does not have DELETE capabilities on the node and its children. Will throw a RepositoryException if the repository specified in the path does not support the NodeFeatureCapability.NodeRemove capability.

Parameters
context - The ContentContext object
absPath - The absolute path to the node being deleted, including the repository name and the path within the repository to the node, ie: /MyRepository/a/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 or if the user doesn't have VIEW rights to the parent node.
RepositoryException - - for any other exception.

copy

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

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. The repository root node (uid=null or empty string) cannot be used as the sourceId, but can be used as the destinationId.

If the repository supports child node ordering, and the destination node ObjectClass supports child node ordering, this method copies the node tree to the end of the child node list of the destination node.

Will throw a RepositoryException if the repository specified in the sourceId or destinationId does not support the NodeFeatureCapability.NodeCopy capability.

Parameters
context - - The ContentContext object
sourceId - - the ID of the Node to be copied. Must have both the repositoryName and uid set. Cannot be the repository root node.
destinationId - - the ID of the Node under which the sourceId Node (and its descendents) will be copied. The repositoryName must be defined in the ID and must be the same repositoryId as in sourceId. Can be the repository root node.
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 or the user doesn't have VIEW rights to this node
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 node 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. The repository root node (uid=null or empty string) cannot be used as the sourceId, but can be used as the destinationId. 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 destination node ObjectClass supports child node ordering, this method moves the node tree to the end of the child node list of the destination node.

Will throw a RepositoryException if the repository specified in the sourceId or destinationId does not support the NodeFeatureCapability.NodeCopy capability.

Parameters
context - - The ContentContext object
sourceId - - the ID of the Node to be moved. Must have both the repositoryName and uid set. Cannot be the repository root node.
destinationId - - the ID of the Node under which the sourceId Node is moved. The repositoryName must be defined in the ID and must be the same repositoryId as in sourceId. Can be the repository root node.
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 or the user doesn't have VIEW rights to this node
RepositoryException - - for any other exception

hasNodeReferences

boolean hasNodeReferences(ContentContext context,
                          ID nodeId)
                          throws AuthorizationException,
                                 AuthenticationException,
                                 RepositoryException
This method determines if there are any nodes in any federated repositories (including possibly some nodes which cannot be accessed) that have a link property referring to the specified node.

Note that the repository root node cannot be used.

Will throw a RepositoryException if the repository specified in the nodeId does not support the TypeFeatureCapability.TypePropertyLink capability.

Parameters
context - - The ContentContext object
nodeId - - the ID of the Node. Must have both the repositoryName and uid set. Cannot be the repository root node.
Returns
boolean - returns true if there are any nodes in any federated repositories 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.
NoSuchNodeException - if the node does not exist or the user doesn't have VIEW rights to this node
RepositoryException - - for any other exception

getNodeReferences

ISortableFilterablePagedList<Node> getNodeReferences(ContentContext context,
                                                     ID nodeId)
                                                     throws AuthenticationException,
                                                            AuthorizationException,
                                                            RepositoryException
This method retrieve nodes in any federated repositories which have a link property referring to the specified node.

Note that the repository root node cannot be used.

This will return only nodes for which the caller has 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( ); Will throw a RepositoryException if the repository specified in the nodeId does not support the TypeFeatureCapability.TypePropertyLink capability.

Parameters
context - - The ContentContext object
nodeId - - the ID of the Node. Must have both the repositoryName and uid set. Cannot be the repository root 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.
NoSuchNodeException - if the node does not exist or the user doesn't have VIEW rights to this node
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 value 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, 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. Will throw a RepositoryException if the repository specified in the nodeId does not support the TypeFeatureCapability.TypePropertyBinary capability.

Parameters
nodeId - - the node Id. Must have both the repositoryName and uid set. Cannot be the repository root node.
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.
NoSuchNodeException - if the node does not exist or the user doesn't have VIEW rights to this node
AuthorizationException - if the user is not authorizated by the repository.
NoSuchPropertyException - - if the Property does not exist.
RepositoryException

orderBefore

void orderBefore(ContentContext context,
                 ID srcChildNodeId,
                 ID destChildNodeId)
                 throws UnsupportedRepositoryOperationException,
                        ConstraintViolationException,
                        NoSuchNodeException,
                        AuthorizationException,
                        RepositoryException
If the repository supports child node ordering, and the parent node ObjectClass 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.

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 ObjectClass 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.

Will throw a RepositoryException if the repository specified in the srcChildNodeId does not support the NodeFeatureCapability.NodeChildNodeReordering capability.

Parameters
context - the ContentContext object
srcChildNodeId - the child node to be moved in the ordering. Must have both the repositoryName and uid set. Cannot be the repository root node.
destChildNodeId - the child node before which the node srcChildNodeId will be placed, or null to move the srcChildNode to the last position. If non-null, must have both the repositoryName and uid set. Cannot be the repository root node.

Throws
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.

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 (and its ID) are 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).

Also, the deprecated node type (eg, Node.HIERARCHY) is not reset if the ObjectClass changes. The user must explicitly reset the node type prior to calling save() if any internal client logic depends on the node type. 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. Will throw a RepositoryException if the repository specified by node.getId() does not support the NodeFeatureCapability.NodeUpdate capability.

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 © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.