com.bea.portal.tools.content.controls
Interface ContentVersionControl


@ControlInterface
public interface ContentVersionControl

Control to represent interface to version methods in content mgmt system.


Method Summary
 void checkIn(ContentContext context, ID nodeId, VersionableContent content)
          Checks in the the specified version of the node with the specified id.
 VirtualNode checkOut(ContentContext context, ID nodeId, String version)
          Check out the specified version of a content node.
 Version getActivePublishedVersion(List<Version> versionList)
          Finds the most recently published Version.
 SortableFilterablePagedResult<VirtualNode> getCheckedOutNodes(ContentContext context)
          Return all the checked-out nodes for the user.
 SortableFilterablePagedResult<VirtualNode> getOnlyAssignedNodes(ContentContext context)
          Return all the assigned nodes for the user.
 InputStream getStream(ContentContext context, ID nodeId, ID propertyId)
          Gets the Binary data for the given Node and Property Id.
 Version getVersion(ContentContext context, ID nodeId, String versionName)
          Get the specified version for a given node.
 SortableFilterablePagedResult<Version> getVersionHistory(ContentContext context, ID nodeId)
          Returns all the versions for a given node.
 List<Version> getVersions(ContentContext context, ID nodeId)
          Returns all the versions for a given node.
 VirtualNode getVirtualNode(ContentContext context, ID nodeId)
          Returns a VirtualNode corresponding to the provided Node id.
 SortableFilterablePagedResult<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.
 boolean isCheckedOutByCurrentUser(ID nodeId, javax.servlet.http.HttpServletRequest request)
          Returns true if the VirtualNode exists and is checked out by the currently logged in user
 void revert(ContentContext context, ID nodeId)
          Reverts a given checked out node.
 void save(ContentContext context, ID id, VersionableContent content)
          Updates the current version of the node with the specified data.
 

Method Detail

getVirtualNode

VirtualNode getVirtualNode(ContentContext context,
                           ID nodeId)
                           throws NoSuchNodeException,
                                  RepositoryException
Returns a VirtualNode corresponding to the provided Node id.

Parameters
context -
nodeId -
Throws
NoSuchNodeException
RepositoryException

isCheckedOut

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

Parameters
context -
nodeId -
Returns
True if checked out, false otheriwse.
Throws
RepositoryException

checkOut

VirtualNode checkOut(ContentContext context,
                     ID nodeId,
                     String version)
                     throws RepositoryException,
                            AuthorizationException,
                            NoSuchNodeException
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 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.

Parameters
context - The content context object which contains the user profile information.
nodeId - The id of the node to check out
version - The version to be checked out, null if the latest version is desired.
Returns
A Virtual node representing the checked out node
Throws
RepositoryException
AuthorizationException
NoSuchNodeException

checkIn

void checkIn(ContentContext context,
             ID nodeId,
             VersionableContent content)
             throws RepositoryException,
                    AuthorizationException,
                    NoSuchNodeException
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 following rules for setting the assignedToUser and assignedToRole fields will be applied for different status transitions during a checkin :

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
RepositoryException
AuthorizationException
NoSuchNodeException

getVersion

Version getVersion(ContentContext context,
                   ID nodeId,
                   String versionName)
                   throws RepositoryException,
                          AuthorizationException,
                          NoSuchNodeException
Get the specified version for a given node. Throws a Authorization exception if the user does not have VIEW capabilities on the node.

Parameters
context -
nodeId -
versionName -
Throws
RepositoryException
AuthorizationException
NoSuchNodeException

getVersions

List<Version> getVersions(ContentContext context,
                          ID nodeId)
                          throws RepositoryException,
                                 AuthorizationException,
                                 NoSuchNodeException
Returns all the versions for a given node. throws RepositoryException, AuthorizationException if the user does not have the VIEW capability on the node.

Parameters
context -
nodeId -
Throws
RepositoryException
AuthorizationException
NoSuchNodeException

getVersionHistory

SortableFilterablePagedResult<Version> getVersionHistory(ContentContext context,
                                                         ID nodeId)
                                                         throws RepositoryException,
                                                                AuthorizationException,
                                                                NoSuchNodeException
Returns all the versions for a given node. throws RepositoryException, AuthorizationException if the user does not have the VIEW capability on the node.

Parameters
context -
nodeId -
Throws
RepositoryException
AuthorizationException
NoSuchNodeException

getWorkingNodes

SortableFilterablePagedResult<VirtualNode> getWorkingNodes(ContentContext context)
                                                           throws RepositoryException
Return all the working nodes for the user.

Parameters
context -
Throws
RepositoryException

getCheckedOutNodes

SortableFilterablePagedResult<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
The checked out nodes for a user.
Throws
RepositoryException - Thrown if an error occurs during this operation.

getOnlyAssignedNodes

SortableFilterablePagedResult<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. 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
The assigned nodes for a user.
Throws
RepositoryException - Thrown if an error occurs during this operation.

revert

void revert(ContentContext context,
            ID nodeId)
            throws RepositoryException,
                   AuthorizationException,
                   NoSuchNodeException
Reverts a given checked out node. Throws an exception if user does not have UPDATE privileges on the node

Parameters
context -
nodeId -
Throws
RepositoryException
AuthorizationException
NoSuchNodeException

getStream

InputStream getStream(ContentContext context,
                      ID nodeId,
                      ID propertyId)
                      throws RepositoryException,
                             AuthorizationException,
                             AuthenticationException,
                             NoSuchPropertyException
Gets the Binary data for the given Node and Property Id.

After calling this method and retrieving the InputStream, you must close the InputStream when finished reading it in a finally block.

If retrieving binary content from a published repository, the uid of the propertyId parameter should be /. If retrieving binary content from a managed repository, the uid should be where uid is the value of PROPERTY_ID column in the CMV_VALUE table.

Parameters
nodeId - - the ID for the node.
propertyId - - the ID for the Property that contains the binary data.
Returns
InputStream - the binary data.
Throws
RepositoryException
AuthorizationException
AuthenticationException
NoSuchPropertyException

save

void save(ContentContext context,
          ID id,
          VersionableContent content)
          throws 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.

Parameters
context - A ContentContext object
id - the node to update
content - the data to save
Throws
RepositoryException

isCheckedOutByCurrentUser

boolean isCheckedOutByCurrentUser(ID nodeId,
                                  javax.servlet.http.HttpServletRequest request)
                                  throws RepositoryException
Returns true if the VirtualNode exists and is checked out by the currently logged in user

Parameters
nodeId -
request -
Returns
true if the VirtualNode exists and is checked out by the currently logged in user
Throws
RepositoryException

getActivePublishedVersion

Version getActivePublishedVersion(List<Version> versionList)
Finds the most recently published Version. Only the most recently published Version is the active published version

Parameters
versionList -
Returns
null if there are no published versions


Copyright © 2006 BEA Systems, Inc. All Rights Reserved