Interface IVersionPolicy

All Superinterfaces:
IBizPolicy, IComponent, IInitializable, ISystemHandler

public interface IVersionPolicy extends IBizPolicy
Exposes business logic on the top of embeded version control system. Provides various methods to add an item in the versioning, to check it in/out, to undo checkout, and to set any version as the current one.
  • Method Details

    • addToVersion

      IThingID addToVersion(IContext context, IThingID itemId) throws BizException
      Adds an item into the versioning. Once the item becomes versioned, it can not be changed back to be unversioned.
      Parameters:
      context - The current IContext.
      itemId - The item IThingID is to be versioned.
      Returns:
      New IThingID of the item once it becomes versioned.
      Throws:
      BizException - if any error occurs while adding the item into the versioning
      See Also:
    • checkOut

      void checkOut(IContext context, IThingID itemId) throws BizException
      Checks a versioned item out. Once the item is checked out, it can be modified just by the user, who checks the item out. Or, the item can be unchecked out by Portal Administrator.
      Parameters:
      context - The current IContext.
      itemId - The item IThingID is to be checked out.
      Throws:
      BizException - if any error occurs while checking in the item
      See Also:
    • undoCheckOut

      void undoCheckOut(IContext context, IThingID itemId) throws BizException
      Unchecks out a versioned item. The item can only be unchecked by the user, who checks the item out or by Portal Administrator.
      Parameters:
      context - The current IContext.
      itemId - The item IThingID is to be unchecked out.
      Throws:
      BizException - if any error occurs while unchecking out the item
      See Also:
    • checkIn

      void checkIn(IContext context, IThingID itemId, Object dataToBeCheckedIn, String sComment, String encoding) throws BizException
      Checks an item in. The item has to be checked out before it is being checked in. The item can only be checked in by the user, who checks the item out.
      Parameters:
      context - The current IContext.
      itemId - The item IThingID is to be checked in.
      dataToBeCheckedIn - The data to be checked in. This strongly depends on type of an item to be checked in.
      sComment - The comment, which is to be added in the version history for the version is checked in. See the implementation for more detail.
      Throws:
      BizException - if any error occurs while checking the item in
      See Also:
    • setCurrentVersion

      void setCurrentVersion(IContext context, IThingID itemId, String sVersionId) throws BizException
      Updates an item by grabbing a version pointed by the specified version id. If the version id points to not most current version, new version is created on the top of the version history.
      Parameters:
      context - The current IContext.
      itemId - The item IThingID is to be checked in.
      sVersionId - The version id, which points a version to be set as the current one.
      Throws:
      BizException - if any error occurs while setting version
      See Also:
    • listVersions

      IListView<IView> listVersions(IContext context, IThingID itemID) throws BizException
      List the versions for a given versioned item
      Parameters:
      context - the current users context
      itemID - the item whose versions will be listed
      Returns:
      a list of IView objects describing each version of the document
      Throws:
      BizException