Interface IVersionPolicy
- All Superinterfaces:
IBizPolicy
,IComponent
,IInitializable
,ISystemHandler
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 Summary
Modifier and TypeMethodDescriptionaddToVersion
(IContext context, IThingID itemId) Adds an item into the versioning.void
checkIn
(IContext context, IThingID itemId, Object dataToBeCheckedIn, String sComment, String encoding) Checks an item in.void
Checks a versioned item out.listVersions
(IContext context, IThingID itemID) List the versions for a given versioned itemvoid
setCurrentVersion
(IContext context, IThingID itemId, String sVersionId) Updates an item by grabbing a version pointed by the specified version id.void
undoCheckOut
(IContext context, IThingID itemId) Unchecks out a versioned item.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
-
Method Details
-
addToVersion
Adds an item into the versioning. Once the item becomes versioned, it can not be changed back to be unversioned.- Parameters:
context
- The currentIContext
.itemId
- The itemIThingID
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
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 currentIContext
.itemId
- The itemIThingID
is to be checked out.- Throws:
BizException
- if any error occurs while checking in the item- See Also:
-
undoCheckOut
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 currentIContext
.itemId
- The itemIThingID
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 currentIContext
.itemId
- The itemIThingID
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
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 currentIContext
.itemId
- The itemIThingID
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
List the versions for a given versioned item- Parameters:
context
- the current users contextitemID
- the item whose versions will be listed- Returns:
- a list of
IView
objects describing each version of the document - Throws:
BizException
-