|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface NodeOpsV1
NodeOps is a Ticket interface for Node CRUD operations.
It is used to manage Nodes, including their Property values, in a content repository. Nodes are objects in a hierarchy of nodes, which have Properties. Properties have property Values.
NodeOpsV1 rules are defined below.
All Nodes are uniquely identified through:
The repository root (path /) is an artificial construct and cannot be fetched; no node can have this path. However, it has an ID (UID is empty), and this can be used to retrieve all children at the top level of the repository.
All Properties are identified through their ID, which includes a uid that uniquely identifies the Property (and containing node) in the repository.
A Node may either be a Content Node or a Hierarchy Node as defined by its node type, an attribute of a Node. This concept is deprecated; a newly written repository should only support Content nodes.
If a node has an ObjectClass, it may contain a Property for each PropertyDefinition of its ObjectClass and each Property must match the shape as defined by its corresponding PropertyDefinition. For example, if the ObjectClass has a single-valued property called 'sProp' of type String, a Node of that ObjectClass has a single-valued property called 'sProp' of type String. Properties are associated with PropertyDefinitions by property name.
Many operations use ID objects as parameters. Before a node has been created, or when a new property is being added, the ID (or UID) may be null, because the property has not been created yet. After a node has been created, it must have a non-null ID (and UID). All nodes (and properties) returned by the repository must have a non-null UID.
The ID uid will be null when dealing with the repository root node. For all other nodes in the repository, the ID uid must be non-null. For example a call to getNodeChildren(ID id) with a correct repository name and a null uid will return all Nodes at the top level of that repository.
The repository implementation may have more specific validation rules than those defined above.
If a repository considers an attempted operation invalid, it can throw a RepositoryException
or UnsupportedRepositoryOperationException. If a repository does not implement a certain operation, it should
report this via the method Ticket.getCapabilitySupport(Set
If a Node has an ObjectClass associated with it, whenever it is retrieved, the ObjectClass must be configured
on the Node.
The node's User Properties (the properties defined by the ObjectClass) need not be present on the node when
it is returned by the repository. For performance reasons, these can optionally be lazy loaded by the call
to Node.getProperties().
If the repository is returning all properties immmediately, it should set the properties on the returned Node.
If the repository wants the properties to be lazy-loaded, it should use NULL for the Node properties on the
returned Node.
The properties approach can be selected on a per-method basis. For the getNode implementations, it is best
to initially set the Properties on the return.
Nested Class Summary
static classNodeOpsV1.MethodName
Method Summary
NodeaddNodeContent(ID nodeId,
ID objectClassId,
Property[] properties)
Updates the node with the specified id to contain the specified objectClass and properties
(content and meta-content).
NodecopyNode(ID sourceId,
ID destinationId)
This method copies a Node (and its descendents) to a new location in the node hierarchy.
NodecreateNodeWithNodeType(ID parentId,
String newNodeName,
int type)
This method creates a new Node underneath a parent node.
NodecreateNodeWithNodeTypeAndObjectClass(ID parentId,
String newNodeName,
int type,
ID objectClassId,
Property[] properties)
This method creates a new Node underneath a parent node.
NodecreateNodeWithNodeTypeAndObjectClassAndWorkflow(ID parentId,
String newNodeName,
int type,
ID objectClassId,
Property[] properties,
ID workflowId)
This method creates a new Node underneath a parent node with the specified workflow.
NodecreateNodeWithNodeTypeAndWorkflow(ID parentId,
String newNodeName,
int type,
ID workflowId)
This method creates a new Node underneath a parent node using the specified workflow.
voiddeleteNode(ID nodeId)
This method performs a full cascade delete on a Node and its children.
Set<String>getNativeFilterableProperties(String repositoryName)
Returns a set of property names which the repository can filter natively (within the repository instead of the
federated API) for methods using a QueryCriteria.
Set<String>getNativeSortableProperties(String repositoryName)
Returns a set of property names which the repository can sort natively (within the repository instead of the
federated API) for methods using a QueryCriteria.
Node[]getNodeChildren(ID parentId,
int type)
This method returns an array of all child Nodes for the specified parent Node (and type), which the
caller can view.
ID[]getNodeChildrenAsNodeIds(ID parentId,
int type)
This method returns an array of all child Node IDs for the specified parent Node (and type), which the
caller can view.
QueryResult<Node>getNodeChildrenWithQueryCriteria(ID parentId,
int type,
QueryCriteria queryCriteria)
This method returns a QueryResult of all child Nodes for the specified parent Node (and type), which the
caller can view, according to the QueryCriteria.
ID[]getNodeReferences(ID nodeId)
Retrieve all nodes in this repository which have a link property referring to the specified node.
Node[]getNodesWithIds(ID[] nodeIds)
This method retrieves a batch of Nodes, given a batch of Node IDs.
QueryResult<Node>getNodesWithIdsAndQueryCriteria(ID[] nodeIds,
QueryCriteria queryCriteria,
boolean failSilently)
This method retrieves a batch of Nodes, given a batch of Node IDs.
NodegetNodeWithId(ID nodeId)
This method retrieves a particular Node (and its metadata) based on its ID.
NodegetNodeWithPath(String path)
This method retrieves a particular Node (and its metadata) based on its path.
Property[]getProperties(ID nodeId)
Retrieve all Properties for a Node, except the binary value content of a binary property.
InputStreamgetPropertyBytes(ID propertyId)
Retrieves binary content for the given binary property ID.
NodemoveNode(ID sourceId,
ID destinationId)
This method moves a Node (and its descendents) to a new location in the node hierarchy.
voidorderBefore(ID parentNodeId,
ID srcChildNodeId,
ID destChildNodeId)
If the parent node type supports child node ordering, this method inserts the child node
at srcChildNodeId before its sibling, the child node at destChildNodeId.
NoderemoveNodeContent(ID nodeId)
Removes the Node's properties and its ObjectClass.
NoderenameNode(ID nodeId,
String newName)
This method renames a node.
Nodesave(Node node)
This method updates an existing node (and its metadata) in a single transaction.
NodeupdateProperties(ID nodeId,
Property[] properties)
Updates the node with the specified id with the specified property values.
Method Detail
createNodeWithNodeType
Node createNodeWithNodeType(ID parentId,
String newNodeName,
int type)
throws RepositoryException
parentId - - the id for the parent of the node. The parentId's uid is null
if the parent is the repository root node.newNodeName - - the name of Node to create.type - - the type of the node, either Node.HIERARCHY or #CONTENT. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NodeExistsException - - if the parent Node already has a child with the same name.
RepositoryException - - if a validation error occurs.
createNodeWithNodeTypeAndObjectClass
Node createNodeWithNodeTypeAndObjectClass(ID parentId,
String newNodeName,
int type,
ID objectClassId,
Property[] properties)
throws RepositoryException
parentId - - the id for the parent of the node. The parentId's uid is null
if the parent is the repository root node.newNodeName - - the name of the Node to create.type - - the type of the node, either Node.HIERARCHY or #CONTENT. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.objectClassId - - the ID for the ObjectClass to associate the new Node to.properties - - the properties to add to the new Node. A PropertyDefinition must exist for
each property.
AuthorizationException - for Authorization errors
NodeExistsException - - if the parent Node already has a child with the same name.
NoSuchObjectClassException - - if the ObjectClass doesn't exist.
RepositoryException - - if a validation error occurs.
createNodeWithNodeTypeAndObjectClassAndWorkflow
Node createNodeWithNodeTypeAndObjectClassAndWorkflow(ID parentId,
String newNodeName,
int type,
ID objectClassId,
Property[] properties,
ID workflowId)
throws RepositoryException
parentId - - the id for the parent of the node. The parentId's uid is null
if the parent is the repository root node.newNodeName - - the name of the Node to create.type - - the type of the node, either Node.HIERARCHY or #CONTENT. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.objectClassId - - the ID for the ObjectClass to associate the new Node to.properties - - the properties to add to the new Node. A PropertyDefinition must exist for
each property.workflowId - - the workflow to be associated with the node. If NULL, node uses the default workflow
AuthorizationException - - if the user attempting the operation is not authorized to perform it
NodeExistsException - - if the parent Node already has a child with the same name.
NoSuchObjectClassException - - if the ObjectClass doesn't exist.
RepositoryException - - if a validation error occurs.
createNodeWithNodeTypeAndWorkflow
Node createNodeWithNodeTypeAndWorkflow(ID parentId,
String newNodeName,
int type,
ID workflowId)
throws RepositoryException
parentId - - the id for the parent of the node. The parentId's uid is null
if the parent is the repository root node.newNodeName - - the name of Node to create.type - - the type of the node, either Node.HIERARCHY or #CONTENT. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.workflowId - - the workflow to be associated with the node. If null, node uses the default workflow
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NodeExistsException - - if the parent Node already has a child with the same name.
RepositoryException - - if a validation error occurs.
getNodeWithId
Node getNodeWithId(ID nodeId)
throws RepositoryException
nodeId - - the id for the node to retrieve.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the node can't be found.
RepositoryException
getNodeWithPath
Node getNodeWithPath(String path)
throws RepositoryException
path - - the path for the node to retrieve.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the node can't be found
RepositoryException
getNodesWithIds
Node[] getNodesWithIds(ID[] nodeIds)
throws RepositoryException
nodeIds - - the Node IDs to retrieve the Nodes for.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if a node cannot be retrieved
RepositoryException
getNodesWithIdsAndQueryCriteria
QueryResult<Node> getNodesWithIdsAndQueryCriteria(ID[] nodeIds,
QueryCriteria queryCriteria,
boolean failSilently)
throws RepositoryException
nodeIds - - the Node IDs to retrieve the Nodes for.queryCriteria - - the query criteria (possibly unsorted and unfiltered)failSilently - - if true, then if a node cannot be found, no exception will be thrown
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if a node to get cannot be retrieved and failSilently is false
RepositoryException
getNodeChildrenAsNodeIds
ID[] getNodeChildrenAsNodeIds(ID parentId,
int type)
throws RepositoryException
parentId - - the parent Node ID (if uid is null, the repository root node)type - - the node type of children to return, either Node.HIERARCHY, #CONTENT or
Node.NODE. If the type is Node.NODE then all children (both
Node.HIERARCHY and #CONTENT will be returned. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the parent node can't be found.
RepositoryException
getNodeChildren
Node[] getNodeChildren(ID parentId,
int type)
throws RepositoryException
parentId - - the parent Node ID (if uid is null, the repository root node)type - - the type of children to return, either Node.HIERARCHY, #CONTENT or
Node.NODE. If the type is Node.NODE then all children (both
Node.HIERARCHY and #CONTENT will be returned. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the parent node can't be found.
RepositoryException
getNodeChildrenWithQueryCriteria
QueryResult<Node> getNodeChildrenWithQueryCriteria(ID parentId,
int type,
QueryCriteria queryCriteria)
throws RepositoryException
parentId - - the parent Node ID (if uid is null, the repository root node)type - - the type of children to return, either Node.HIERARCHY, #CONTENT or
Node.NODE. If the type is Node.NODE then all children (both
Node.HIERARCHY and #CONTENT will be returned. Use
of Node.HIERARCHY and Node.CONTENT will be deprecated in future releases.
queryCriteria - - the query criteria (possibly unsorted and unfiltered)
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the parent node can't be found.
RepositoryException
getNodeReferences
ID[] getNodeReferences(ID nodeId)
throws RepositoryException
nodeId - The ID of the referred-to node.
AuthorizationException - - if the user attempting the operation is not authorized to perform it
RepositoryException
orderBefore
void orderBefore(ID parentNodeId,
ID srcChildNodeId,
ID destChildNodeId)
throws RepositoryException
srcChildNodeId before its sibling, the child node at destChildNodeId.
Both nodes must be immediate children of the parent node, parentNodeId. If parentNodeId's uid
is null, then the parent node is the repository root 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 node does not support child node ordering, then a UnsupportedRepositoryOperationException
is thrown.
If one of the nodes 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.
parentNodeId - the parent of both srcChildNodeId and destChildNodeId (null uid for repo root)srcChildNodeId - 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.
ConstraintViolationException - if an implementation-specific constraint is violated
NoSuchNodeException - if neither child node exists
RepositoryException - if another error occurs
AuthorizationException - if the user attempting the operation is not authorized to perform it
deleteNode
void deleteNode(ID nodeId)
throws RepositoryException
nodeId - - the id of the Node to be deleted. Cannot be the repository root node. (uid=null)
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.
moveNode
Node moveNode(ID sourceId,
ID destinationId)
throws RepositoryException
sourceId - - the id of the Node to be moveddestinationId - - the id of the Node under which the sourceId Node is moved. If uid is null,
the repository root node.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NodeExistsException - - if attempting to move a Node to a location that already exists.
NoSuchNodeException - - if the source or destination node can't be found.
RepositoryException - - if validation error occurs.
copyNode
Node copyNode(ID sourceId,
ID destinationId)
throws RepositoryException
sourceId - - the id of the Node to be copieddestinationId - - the id of the Node under which the sourceId Node is copied. If uid is null,
the repository root node.
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 validation error occurs.
renameNode
Node renameNode(ID nodeId,
String newName)
throws RepositoryException
nodeId - - the id for the node to renamenewName - - a String for the new node name
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 validation error occurs.
addNodeContent
Node addNodeContent(ID nodeId,
ID objectClassId,
Property[] properties)
throws RepositoryException
nodeId - - the ID for the node to update.objectClassId - - the ID for new objectClass.properties - - the new properties on the Node. Additional unspecified properties may also exist.
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 validation error occurs.
updateProperties
Node updateProperties(ID nodeId,
Property[] properties)
throws RepositoryException
nodeId - - the ID of the node to update. The ID must include the repositoryName.properties - - the properties to update on the Node. Existing unspecified properties may also exist.
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.
save
Node save(Node node)
throws RepositoryException
node - The node to update with the new state configured.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
RepositoryException - - if validation error occurs.
removeNodeContent
Node removeNodeContent(ID nodeId)
throws RepositoryException
nodeId - - the id for the Node to remove the ObjectClass (and properties) from.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - if the node does not exist.
RepositoryException - - if validation error occurs.
getProperties
Property[] getProperties(ID nodeId)
throws RepositoryException
nodeId - - the id for the node.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchNodeException - - if the node can't be found.
RepositoryException
getPropertyBytes
InputStream getPropertyBytes(ID propertyId)
throws RepositoryException
propertyId - - the id for the binary property that contains the binary data.
InputStream containing the binary data for the given property id. The caller must close the
InputStream.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
NoSuchPropertyException - - if the Property does not exist.
RepositoryException
getNativeSortableProperties
Set<String> getNativeSortableProperties(String repositoryName)
throws RepositoryException
repositoryName - The name of the repository.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
RepositoryException - - if validation error occurs.
getNativeFilterableProperties
Set<String> getNativeFilterableProperties(String repositoryName)
throws RepositoryException
repositoryName - The name of the repository.
AuthorizationException - - if the user attempting the operation is not authorized to perform it.
RepositoryException - - if validation error occurs.
Overview
Package
Class
Tree
Deprecated
Index
Help
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2000, 2008, 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.