com.bea.content.federated
Interface IVersionManager


public interface IVersionManager

Interface to manage content node versions in the content system.

Methods returning an ISortableFilterablePagedList may perform sorting and filtering. See the documentation in com.bea.content.paging, VirtualNode and Version.

Note: new methods may be added to this interface periodically -- therefore, this is 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
 void checkIn(ContentContext context, ID nodeId, VersionableContent content)
          Checks in the the specified version of the node with the specified id.
 JobResult checkIn(ContentContext context, List<ID> nodeIds, String description, int endStatus)
          CheckIn a group of nodes with the given end status.
 VirtualNode checkOut(ContentContext context, ID nodeId, String version)
          Check out the specified version of a content node.
 JobResult checkOut(ContentContext context, List<ID> nodeIds)
          CheckOut a list of nodes.
 ISortableFilterablePagedList<VirtualNode> getCheckedOutNodes(ContentContext context)
          Return all the checked-out nodes for the user.
 Version getLatestPublishedVersion(ContentContext context, ID nodeId)
          Return the latest published version for the given node.
 VirtualNode getNode(ContentContext context, ID nodeId)
          Get the VirtualNode representing the Node.
 ISortableFilterablePagedList<VirtualNode> getOnlyAssignedNodes(ContentContext context)
          Return all the assigned nodes for the user.
 InputStream getStream(ContentContext context, ID nodeId, ID versionedPropertyId)
          Gets the property bytes of a given version.
 Version getVersion(ContentContext context, ID nodeId, String versionName)
          Get the specified version for a given node.
 ISortableFilterablePagedList<Version> getVersions(ContentContext context, ID nodeId)
          Returns all the versions for a given node.
 ISortableFilterablePagedList<VirtualNode> getWorkingNodes(ContentContext context)
          Return all the working nodes for the user.
 boolean isCheckedOut(ContentContext context, ID nodeId)
          Convenience method to help determine whether a node is checked out or not.
 void revert(ContentContext context, ID nodeId)
          Reverts a given checked out node.
 void save(ContentContext context, ID nodeId, VersionableContent versionableContent)
          Updates the current version of the node with the specified data.
 ISortableFilterablePagedList<Version> search(ContentContext context, Search search)
          Perform a meta-data search on the versioning system
 

Method Detail

getNode

VirtualNode getNode(ContentContext context,
                    ID nodeId)
                    throws AuthorizationException,
                           NoSuchNodeException,
                           RepositoryException
Get the VirtualNode representing the Node. If the user does not have VIEW privileges on the node, this operation will be disallowed.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node to get.
Returns
A Virtual node representing the checked out node.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

checkOut

VirtualNode checkOut(ContentContext context,
                     ID nodeId,
                     String version)
                     throws AuthorizationException,
                            NoSuchNodeException,
                            RepositoryException
Check out the specified version of a content node. This method will lock the virtual node such that only the user who checked it out or the super user may be able to revert the operation. If the virtual node requires the user to be in a specified role before checking out, only that user may checkout the node, even though the node may not be checked out.

If the user does not have UPDATE privileges on the node, this operation will be disallowed.

A node can only be checked once. Multiple checkouts of a node is not allowed.

With the returned VirtualNode, the user can retrieve the current version and perform updates on it and either save it, then check it in, or simply check it in. A new version, based on the changes to the checked out one, will be created upon checkin.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node to check out
version - The name of the version to be checked out, null if the latest version is desired.
Returns
A Virtual node representing the checked out node.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

checkOut

JobResult checkOut(ContentContext context,
                   List<ID> nodeIds)
                   throws AuthorizationException,
                          NoSuchNodeException,
                          RepositoryException
CheckOut a list of nodes. The nodes must exist and be checkedIn before attempting this operation.

Parameters
context - The content context object which contains the user profile information.
nodeIds - The list of node ids to be checked out.
Returns
JobResult object describing the result of the checkOut process
Throws
AuthorizationException
NoSuchNodeException
RepositoryException

checkIn

void checkIn(ContentContext context,
             ID nodeId,
             VersionableContent content)
             throws AuthorizationException,
                    NoSuchNodeException,
                    RepositoryException
Checks in the the specified version of the node with the specified id. Only the user who has checked out the node will be allowed to check in. This will unlock the node after checking it in to allow other users to perform checkout operations. The VersionableContent is assumed to be retrieved from the API and properly formed when this call is made. Unlike INodeManager, this method will not set missing properties to null, but rather missing properties will remain unchanged. If the user does not have UPDATE privileges on the node, this operation will be disallowed. The following rules for setting the assignedToUser and assignedToRole fields will be applied for different status transitions during a checkin :
--> Status transition to READY : Assigned to user will be null. Assigned To Roles will be set to the roles that can publish this node --> Status transition to PUBLISHED : Assigned to user will be null. Assigned To Roles will be null --> Status transition to REJECTED : Assigned to roles will be null. Assigned to user will be the last user (who is not in the publishers role for that node) that was editing the node. --> Status transition to RETIRED : Assigned to user will be set to null. --> Status transition to DRAFT : Assigned to user will remain as it is.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node being checked in.
content - The content to be checked in. If null, the latest version will be checked in.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

checkIn

JobResult checkIn(ContentContext context,
                  List<ID> nodeIds,
                  String description,
                  int endStatus)
                  throws RepositoryException
CheckIn a group of nodes with the given end status. The nodes must be checked out by the current user. This method will return a JobResult object which will contain information about the nodes which were successfully checked in, and the nodes which did not get checked in, along with the error message.

Parameters
context - The ContentContext object
nodeIds - The list of node id objects
description - The description for the changes
endStatus - The new checkedIn status of the nodes.
Returns
The JobResult object which contains information about nodes which were succesfully checked in and the nodes which failed to check in
Throws
RepositoryException - if there's an error in checking in the nodes

getVersion

Version getVersion(ContentContext context,
                   ID nodeId,
                   String versionName)
                   throws AuthorizationException,
                          NoSuchNodeException,
                          RepositoryException
Get the specified version for a given node. If the user does not have VIEW privileges on the node, this operation will be disallowed.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
versionName - The version to be retrieved.
Returns
Version The version requested for the specified node.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

getVersions

ISortableFilterablePagedList<Version> getVersions(ContentContext context,
                                                  ID nodeId)
                                                  throws AuthorizationException,
                                                         NoSuchNodeException,
                                                         RepositoryException
Returns all the versions for a given node. If the user does not have VIEW privileges on the node, this operation will be disallowed.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
Returns
ISortableFilterablePagedList All of the versions for a particular node.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

getLatestPublishedVersion

Version getLatestPublishedVersion(ContentContext context,
                                  ID nodeId)
                                  throws AuthorizationException,
                                         NoSuchNodeException,
                                         RepositoryException
Return the latest published version for the given node.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
Returns
The latest published version if the node has been published, null otherwise.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node or the virtual node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

getWorkingNodes

ISortableFilterablePagedList<VirtualNode> getWorkingNodes(ContentContext context)
                                                          throws RepositoryException
Return all the working nodes for the user. Working nodes constitute nodes which are checked out by the user or nodes that are assigned to that user. If the user does not have VIEW privileges on any of the returned nodes, they will not be included in the returned list.

Parameters
context - The content context object which contains the user profile information.
Returns
ISortableFilterablePagedList The working nodes for a user.
Throws
RepositoryException - Thrown if an error occurs during this operation.

getCheckedOutNodes

ISortableFilterablePagedList<VirtualNode> getCheckedOutNodes(ContentContext context)
                                                             throws RepositoryException
Return all the checked-out nodes for the user. Checked-out nodes constitute nodes which are checked out by and are assigned to that user. If the user does not have VIEW privileges on any of the returned nodes, they will not be included in the returned list.

Parameters
context - The content context object which contains the user profile information.
Returns
ISortableFilterablePagedList The working nodes for a user.
Throws
RepositoryException - Thrown if an error occurs during this operation.

getOnlyAssignedNodes

ISortableFilterablePagedList<VirtualNode> getOnlyAssignedNodes(ContentContext context)
                                                               throws RepositoryException
Return all the assigned nodes for the user. Assigned nodes constitute nodes which are not checked out by but are assigned to that user explicitly or which are assigned to the user via the role of that user. If the user does not have VIEW privileges on any of the returned nodes, they will not be included in the returned list.

Parameters
context - The content context object which contains the user profile information.
Returns
ISortableFilterablePagedList The working nodes for a user.
Throws
RepositoryException - Thrown if an error occurs during this operation.

revert

void revert(ContentContext context,
            ID nodeId)
            throws AuthorizationException,
                   NoSuchNodeException,
                   RepositoryException
Reverts a given checked out node. If the user does not have UPDATE privileges on the node, this operation will be disallowed. VirtualNode's assignedToUser will go back to the previously assigned to user, before check out.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchNodeException - Thrown if the node does not exist.
RepositoryException - Thrown if an error occurs during this operation.

isCheckedOut

boolean isCheckedOut(ContentContext context,
                     ID nodeId)
                     throws RepositoryException
Convenience method to help determine whether a node is checked out or not.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
Returns
boolean True if checked out, false otheriwse. Will also return false if repository does not support library services or if the node does not exist.
Throws
RepositoryException - Thrown if an error occurs during this operation.

getStream

InputStream getStream(ContentContext context,
                      ID nodeId,
                      ID versionedPropertyId)
                      throws AuthorizationException,
                             NoSuchPropertyException,
                             RepositoryException
Gets the property bytes of a given version. It is assumed that the user already has information about the propertyID of the property whose bytes are to be retrieved. If the user does not have VIEW privileges on the node, this operation will be disallowed.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
versionedPropertyId - The ID of the versioned property. ID should contain a valid repositoryName and a UID.
Returns
An InputStream representing the bytes. It is the developers responsibility to close the InputStream once data has been read from it.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
NoSuchPropertyException - Thrown if the property does not exist.
RepositoryException - Thrown if an error occurs during this operation.

save

void save(ContentContext context,
          ID nodeId,
          VersionableContent versionableContent)
          throws AuthorizationException,
                 RepositoryException
Updates the current version of the node with the specified data. The node must be checked out by the user for this operation to succeed. The VersionableContent is assumed to be retrieved from the API and properly formed when this call is made. Unlike INodeManager, this method will not set missing properties to null, but rather missing properties will remain unchanged. If the user does not have UPDATE privileges on the node, this operation will be disallowed.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node.
versionableContent - The data to save.
Throws
AuthorizationException - Thrown if user is not authorized to perform action.
RepositoryException - If the node is not checked out by the user, or if the repository is non library service enabled, or if any other error occurs.

search

ISortableFilterablePagedList<Version> search(ContentContext context,
                                             Search search)
                                             throws RepositoryException
Perform a meta-data search on the versioning system

Parameters
context - The content context
search - The search object containing the query criteria
Returns
The search results
Throws
RepositoryException - Thrown if the search fails.


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.