atg.versionmanager
Interface AssetVersion

All Superinterfaces:
ManagedElement
All Known Subinterfaces:
WorkingVersion

public interface AssetVersion
extends ManagedElement

An immutable wrapper for a specific version of an asset under version control. A version holds versioning metadata, and ways to get at specific versions of an asset.

Versions are constructed as side-effects of other versioning operations: creating a new asset, and checking-in a working version. When a resource is first put under version control:

Resources are updated indirectly by creating new versions:

Versions are managed by the asset they represent. Versions maintain references to their predecessors and successors within the version hierarchy. The initial version does not have any predecessors.

A version has an identifier that is unique within the history of the associated asset.


Field Summary
static java.lang.String CLASS_VERSION
           
static int STATUS_ALL_CODE
           
static java.lang.String STATUS_DELETED
           
static int STATUS_DELETED_CODE
           
static java.lang.String STATUS_MODIFIED
           
static int STATUS_MODIFIED_CODE
           
 
Method Summary
 java.util.Set getAllParentVersions()
          Gets a set of all prior versions of this asset back to the original.
 Asset getAsset()
          Versions are associated with an asset.
 Workspace getCreatedInWorkspace()
          Versions have a workspace that created them containing comment, user agent, creation time.
 DevelopmentLine getDevelopmentLine()
          Returns the development line that owns this asset version.
 java.util.Set getLaterVersions()
          Get the set of successor versions.
 AssetVersion getParentVersion()
          Get the version immediately before this one.
 RepositoryItem getRepositoryItem()
          Get the underlying RepositoryItem
 java.lang.Class getResourceType()
          Returns the type of the resource that backs up this AssetVersion.
 java.lang.String getStatus()
          Gets the status of the asset (one of STATUS_ADDED, STATUS_DELETED, STATUS_MODIFIED)
 int getStatusCode()
          Gets the status of the asset (one of STATUS_ADDED_CODE, STATUS_DELETED_CODE, STATUS_MODIFIED_CODE)
 VersionID getVersion()
          Returns the version
 atg.vfs.repository.RepositoryVirtualFile getVirtualFile()
          Gets the VirtualFile that backs this resource.
 VirtualFileSystem getVirtualFileSystem()
          Gets the VirtualFileSystem that this resource is drawn from
 WorkingVersion getWorkingVersion()
          Returns the existing working version if this asset version is already checked out.
 java.util.Set getWorkingVersions()
          Get the current checked-out working versions for all development lines.
 boolean hasLaterVersion(AssetVersion version)
          Test if the given version is a newer version of this asset.
 boolean hasParentVersion(AssetVersion version)
          Check to see if the given AssetVersion is an earlier version of this asset.
 boolean isCheckedOut()
          A version may have been checked-out into one or more workspaces.
 boolean isDeleted()
          Test if this version of the asset has been marked as deleted.
 boolean isHeadOfLine(DevelopmentLine line)
          Returns true if this version of the asset is the current head version on the given development line.
 
Methods inherited from interface atg.versionmanager.ManagedElement
getDisplayName, getName, getURI, getVersionManager
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

STATUS_MODIFIED_CODE

static final int STATUS_MODIFIED_CODE
See Also:
Constant Field Values

STATUS_DELETED_CODE

static final int STATUS_DELETED_CODE
See Also:
Constant Field Values

STATUS_ALL_CODE

static final int STATUS_ALL_CODE
See Also:
Constant Field Values

STATUS_MODIFIED

static final java.lang.String STATUS_MODIFIED
See Also:
Constant Field Values

STATUS_DELETED

static final java.lang.String STATUS_DELETED
See Also:
Constant Field Values
Method Detail

getAsset

Asset getAsset()
               throws VersionException
Versions are associated with an asset.

Returns:
Asset associated with this version.
Throws:
VersionException

getVersion

VersionID getVersion()
                     throws VersionException
Returns the version

Returns:
Throws:
VersionException

getRepositoryItem

RepositoryItem getRepositoryItem()
                                 throws VersionException,
                                        RepositoryException
Get the underlying RepositoryItem

Returns:
copy of the resource
Throws:
VersionException
RepositoryException

getVirtualFile

atg.vfs.repository.RepositoryVirtualFile getVirtualFile()
                                                        throws VersionException
Gets the VirtualFile that backs this resource.

Returns:
VirtualFile
Throws:
VersionException

getVirtualFileSystem

VirtualFileSystem getVirtualFileSystem()
                                       throws VersionException
Gets the VirtualFileSystem that this resource is drawn from

Returns:
VirtualFileSystem
Throws:
VersionException

getResourceType

java.lang.Class getResourceType()
                                throws VersionException
Returns the type of the resource that backs up this AssetVersion.

Returns:
Throws:
VersionException

getDevelopmentLine

DevelopmentLine getDevelopmentLine()
                                   throws VersionException
Returns the development line that owns this asset version.

Returns:
Line
Throws:
VersionException

getCreatedInWorkspace

Workspace getCreatedInWorkspace()
                                throws VersionException
Versions have a workspace that created them containing comment, user agent, creation time.

Returns:
change information record for creation or edit
Throws:
VersionException

isDeleted

boolean isDeleted()
                  throws VersionException
Test if this version of the asset has been marked as deleted.

Returns:
true if it has been deleted from the workspace
Throws:
VersionException

isCheckedOut

boolean isCheckedOut()
                     throws VersionException
A version may have been checked-out into one or more workspaces. Tests if there is any working version that has this version as a predecessor.

Returns:
true if the version is currently checked-out in at least one workspace
Throws:
VersionException

getWorkingVersion

WorkingVersion getWorkingVersion()
Returns the existing working version if this asset version is already checked out.

Parameters:
id -
Returns:

getWorkingVersions

java.util.Set getWorkingVersions()
                                 throws VersionException
Get the current checked-out working versions for all development lines. Returns an empty iterator if the version is not checked-out.

Returns:
unmodifiable set of WorkingVersions
Throws:
VersionException

getParentVersion

AssetVersion getParentVersion()
                              throws VersionException
Get the version immediately before this one. Will return null if this is the first version of an asset.

Returns:
the prior version
Throws:
VersionException

getAllParentVersions

java.util.Set getAllParentVersions()
                                   throws VersionException
Gets a set of all prior versions of this asset back to the original.

Returns:
an unmodifiable sorted set of AssetVersions
Throws:
VersionException

hasParentVersion

boolean hasParentVersion(AssetVersion version)
                         throws VersionException
Check to see if the given AssetVersion is an earlier version of this asset.

Parameters:
version - to look for
Returns:
true if the version is an earler version of the associated asset
Throws:
VersionException

getLaterVersions

java.util.Set getLaterVersions()
                               throws VersionException
Get the set of successor versions. There might be more than one because of branching.

Returns:
unmodifiable set of AssetVersions.
Throws:
VersionException

hasLaterVersion

boolean hasLaterVersion(AssetVersion version)
                        throws VersionException
Test if the given version is a newer version of this asset.

Parameters:
version - to look for
Returns:
true if the version is a successor
Throws:
VersionException

isHeadOfLine

boolean isHeadOfLine(DevelopmentLine line)
                     throws VersionException
Returns true if this version of the asset is the current head version on the given development line.

Returns:
Throws:
VersionException

getStatusCode

int getStatusCode()
                  throws VersionException
Gets the status of the asset (one of STATUS_ADDED_CODE, STATUS_DELETED_CODE, STATUS_MODIFIED_CODE)

Returns:
the numeric status code.
Throws:
VersionException

getStatus

java.lang.String getStatus()
                           throws VersionException
Gets the status of the asset (one of STATUS_ADDED, STATUS_DELETED, STATUS_MODIFIED)

Returns:
the string status code.
Throws:
VersionException