Skip navigation links


com.fatwire.services
Interface VersioningService

All Superinterfaces:
Service

public interface VersioningService
extends Service

The Versioning Service is the interface providing services related to versioning of assets when revision tracking has been enabled for the asset type.

.

Methods from this service will invoke operations like "Check out", "Check in" and "Undo Checkout". Once an asset is checked out by a user, it cannot be operated on by another user unless the check out is cleared by undoing the check out or by checking the asset in.


Method Summary
 VersionBean checkin(AssetId assetId, java.lang.String comment, boolean keepCheckedOut, MessageCollectors.VersioningMessageCollector collector)
          Commits changes to the specified asset and hence creates a new revision for it.
 VersionBean checkout(AssetId assetId, MessageCollectors.VersioningMessageCollector collector)
          Checks out an asset for the logged in user and returns the current revision.
 java.util.List<AssetId> getCheckedoutAssets()
          Returns the list of assets checked out by the logged in user.
 VersionBean getCurrentRevision(AssetId assetId)
          Returns metadata for the current revision for the specified asset.
 boolean isTracked(java.lang.String assetType)
          Checks if revision tracking is enabled for the specified asset type.
 VersionBean undoCheckout(AssetId assetId, MessageCollectors.VersioningMessageCollector collector)
          Reverts the changes made to the specified checked-out asset, and reverts its state back to what it was before being checked out.

 

Methods inherited from interface com.fatwire.services.Service
getManager, getResponse, setManager

 

Method Detail

checkout

VersionBean checkout(AssetId assetId,
                     MessageCollectors.VersioningMessageCollector collector)
                     throws ServiceException
Checks out an asset for the logged in user and returns the current revision. If the type of the specified asset is not enabled for revisions, or, if the asset is already checked out, this method returns null. In checking out the specified asset, this method assumes the currently logged in user is performing the action.
Parameters:
assetId - the identifier for the asset to check out.
collector - the message collector for acquiring messages from this method.
Returns:
a VersionBean with the current revision status.
Throws:
ServiceException - wraps any exception underlying the service call.

undoCheckout

VersionBean undoCheckout(AssetId assetId,
                         MessageCollectors.VersioningMessageCollector collector)
                         throws ServiceException
Reverts the changes made to the specified checked-out asset, and reverts its state back to what it was before being checked out. If the type of the specified asset is not enabled for revisions, or, if the asset is already checked out, this method returns null.
Parameters:
assetId - the identifier for the asset being reverted.
collector - the message collector for acquiring messages logged by this method.
Returns:
a VersionBean with the revision status prior to check out.
Throws:
ServiceException - wraps any exception underlying the service call.

checkin

VersionBean checkin(AssetId assetId,
                    java.lang.String comment,
                    boolean keepCheckedOut,
                    MessageCollectors.VersioningMessageCollector collector)
                    throws ServiceException
Commits changes to the specified asset and hence creates a new revision for it. The method accepts a flag to keep the asset checked out once the revision is committed. However, a new revision number increments as if the asset was again checked out after the check in was completed.
Parameters:
assetId - the identifier for the asset being reverted.
comment - the message associated with this check in.
collector - the message collector for acquiring messages logged by this method.
keepCheckedOut - set to true to keep the asset checked out even after checking in the new version.
Returns:
a VersionBean with the new revision.
Throws:
ServiceException - wraps any exception underlying the service call.

getCheckedoutAssets

java.util.List<AssetId> getCheckedoutAssets()
                                            throws ServiceException
Returns the list of assets checked out by the logged in user. If there are no assets checked out this method returns an empty list.
Returns:
a list of assets which are currently checked out.
Throws:
ServiceException - wraps any exception underlying the service call.

isTracked

boolean isTracked(java.lang.String assetType)
                  throws ServiceException
Checks if revision tracking is enabled for the specified asset type. Versions are maintained only for asset types for which revision tracking has been enabled. If revision tracking is not enabled for an asset type, then for a specified asset of that type, checkin(), checkout() and undoCheckout() methods will always return null.
Parameters:
assetType - the asset type to check if revision tracking is enabled.
Returns:
true if revision tracking is enabled for the specified asset type, false otherwise.
Throws:
ServiceException - wraps any exception underlying the service call.

getCurrentRevision

VersionBean getCurrentRevision(AssetId assetId)
                               throws ServiceException
Returns metadata for the current revision for the specified asset. Metadata include properties specified by VersionBean.
Parameters:
assetId - the identifier for the asset whose version is to be retrieved.
Returns:
the current version of the specified asset.
Throws:
ServiceException - wraps any exception underlying the service call.

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.