Skip navigation links


com.fatwire.services.dao
Interface VersioningDao

All Superinterfaces:
DataAccessObject

public interface VersioningDao
extends DataAccessObject

The Versioning Data Access Object provides access to asset revision data.

The versioning service depends on the VersioningDao to provide the access it requires to pull up this data.


Method Summary
 VersionBean checkin(AssetId assetId, java.lang.String userId, 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, java.lang.String userId, MessageCollectors.VersioningMessageCollector collector)
          Checks out an asset for the logged in user and returns the current revision.
 java.util.List<AssetId> getCheckedoutAssets(java.lang.String userId, long siteId)
          Returns the list of assets checked out by the specified user in the specified site.
 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, java.lang.String userId, 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.dao.DataAccessObject
getResponse, getService, setService

 

Method Detail

checkout

VersionBean checkout(AssetId assetId,
                     java.lang.String userId,
                     MessageCollectors.VersioningMessageCollector collector)
                     throws DataAccessException
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.
userId - the id of the user who is checking out the asset.
collector - the message collector for acquiring messages from this method.
Returns:
a VersionBean with the current revision status.
Throws:
DataAccessException - wraps any underlying exception caused during data access.

undoCheckout

VersionBean undoCheckout(AssetId assetId,
                         java.lang.String userId,
                         MessageCollectors.VersioningMessageCollector collector)
                         throws DataAccessException
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 not checked out, this method returns null.
Parameters:
assetId - the identifier for the asset being reverted.
userId - the id of the user who is undoing the check out on the asset.
collector - the message collector for acquiring messages logged by this method.
Returns:
a VersionBean with the revision status prior to check out.
Throws:
DataAccessException - wraps any underlying exception caused during data access.

checkin

VersionBean checkin(AssetId assetId,
                    java.lang.String userId,
                    java.lang.String comment,
                    boolean keepCheckedOut,
                    MessageCollectors.VersioningMessageCollector collector)
                    throws DataAccessException
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. If the type of the specified asset is not enabled for revisions, or, if the asset is not checked out, this method returns null.
Parameters:
assetId - the identifier for the asset being reverted.
userId - the id of the user who is checking in the asset.
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:
DataAccessException - wraps any underlying exception caused during data access.

getCheckedoutAssets

java.util.List<AssetId> getCheckedoutAssets(java.lang.String userId,
                                            long siteId)
                                            throws DataAccessException
Returns the list of assets checked out by the specified user in the specified site. If there are no assets checked out this method returns an empty list.
Parameters:
userId - the id of the user by whom the assets are checked out.
siteId - the id of the site in which the assets are checked out.
Returns:
a list of assets which are currently checked out.
Throws:
DataAccessException - wraps any underlying exception caused during data access.

isTracked

boolean isTracked(java.lang.String assetType)
                  throws DataAccessException
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:
DataAccessException - wraps any underlying exception caused during data access.

getCurrentRevision

VersionBean getCurrentRevision(AssetId assetId)
                               throws DataAccessException
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:
DataAccessException - wraps any underlying exception caused during data access.

Skip navigation links


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