atg.versionmanager
Class VersionManagerURI

java.lang.Object
  extended by atg.versionmanager.VersionManagerURI
All Implemented Interfaces:
java.io.Serializable

public class VersionManagerURI
extends java.lang.Object
implements java.io.Serializable

URIs used by the version manager are of the form DEV_LINE = atgvm://versionmanager/development-line-name REPOSITORY_ITEM = atgvm://versionmanager/versioned-repository-name/item-descriptor-name/item-id#version-id VIRTUAL_FILE = atgvm://versionmanager/versioned-virtual-filesystem-name/virtual-file-path#version NOTE: A version manager URI is not thread-safe. Use a new one in each thread.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
static int DEV_LINE
           
static int DEV_LINE_NAME
           
static int DEV_LINE_UID
           
static java.lang.String METHOD
           
static int REPOSITORY_ITEM
           
static int REPOSITORY_ITEM_DESCRIPTOR
           
static int REPOSITORY_ITEM_ID
           
static int REPOSITORY_NAME
           
static int REPOSITORY_VERSION
           
static int REPOSITORY_VIRTUAL_FILE
           
static int VERMAN_NAME
           
static int VERSION_MANAGER
           
static int VIRTUAL_FILE
           
static int VIRTUAL_FILE_PATH
           
static int VIRTUAL_FILE_VERSION
           
static int VVFS_NAME
           
 
Constructor Summary
VersionManagerURI()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getAssetVersion()
          Get the asset version of this URI.
 java.lang.String getNameURIPart()
           
static java.lang.String getPartSeparator()
           
 Repository getRepository(VersionManager pVersionManager)
          Return the repository component configured with the given version manager and which was used to create this uri.
 java.lang.String getRepositoryID()
          Return the repository ID of the asset that this URI points to.
 RepositoryItemDescriptor getRepositoryItemDescriptor(VersionManager pVersionManager)
          Return the item descriptor type that this URI points to.
 java.lang.String getRepositoryItemDescriptorName(VersionManager pVersionManager)
          Return the item descriptor type name that this URI points to.
static VersionManagerURI getRVFSURI(java.lang.String versionManagerName, java.lang.String repositoryName, java.lang.String itemName, java.lang.String itemId, java.lang.Integer version)
          This is the preferend method of creating a file asset URI.
 int getType()
          Gets the type of this URI.
static VersionManagerURI getURI(int uriType, java.lang.String stringFormOfURI)
          Creates a VersionManagerAPI from a string, passing one of DEV_LINE, REPOSITORY_ITEM or VIRTUAL_FILE to indicate what the URI type is.
static VersionManagerURI getURI(int uriType, VersionManagerURI uriRoot, java.lang.String version)
          Creates a VersionManagerAPI from a string, passing one of DEV_LINE, REPOSITORY_ITEM or VIRTUAL_FILE to indicate what the URI type is.
static VersionManagerURI getURI(java.lang.String versionManagerName, java.lang.String repositoryName, java.lang.String itemName, java.lang.String itemId)
           
static VersionManagerURI getURI(java.lang.String versionManagerName, java.lang.String repositoryName, java.lang.String itemName, java.lang.String itemId, java.lang.Integer version)
           
static VersionManagerURI getURI(java.lang.String stringFormOfURI, VersionManager pVersionManager)
          Creates a VersionManagerAPI from a string.
 java.lang.String getURIPart(int part)
          Returns the part of the URI at the given index, parsing using the rules for the given type of URI.
 java.lang.String getURIString()
          Returns the URI as a String.
 VersionID getVersionID()
           
 VersionManagerURI getVersionlessURI()
           
static java.lang.String getVersionSeparator()
           
static VersionManagerURI getVFSURI(java.lang.String versionManagerName, java.lang.String vfsServiceName, java.lang.String vfsPath, java.lang.Integer version)
          Deprecated. use getRVFSURI() instead.
 atg.vfs.repository.RepositoryVirtualFileSystem getVirtualFileSystem(VersionManager pVersionManager)
          Return the virtual file system component configured with the given version manager and which was used to create this uri if this is a repository for a VirtualFile asset.
 int hashCode()
           
 boolean isFileFolder(VersionManager pVersionManager)
          Does this URI represent a file folder.
 boolean isParentOfURI(VersionManagerURI otherURI)
          Returns true if the given URI belongs to the same namespace as this URI.
 boolean isValid()
          Checks to see that the URI is not missing any parts.
 boolean setFullURI(int uriType, java.lang.String stringFormOfURI)
          Fills in a VersionManagerURI by taking a complete URI including the method.
 java.lang.String toString()
          Returns the URI as a String
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

VERSION_MANAGER

public static final int VERSION_MANAGER
See Also:
Constant Field Values

DEV_LINE

public static final int DEV_LINE
See Also:
Constant Field Values

REPOSITORY_ITEM

public static final int REPOSITORY_ITEM
See Also:
Constant Field Values

VIRTUAL_FILE

public static final int VIRTUAL_FILE
See Also:
Constant Field Values

REPOSITORY_VIRTUAL_FILE

public static final int REPOSITORY_VIRTUAL_FILE
See Also:
Constant Field Values

METHOD

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

VERMAN_NAME

public static final int VERMAN_NAME
See Also:
Constant Field Values

REPOSITORY_NAME

public static final int REPOSITORY_NAME
See Also:
Constant Field Values

REPOSITORY_ITEM_DESCRIPTOR

public static final int REPOSITORY_ITEM_DESCRIPTOR
See Also:
Constant Field Values

REPOSITORY_ITEM_ID

public static final int REPOSITORY_ITEM_ID
See Also:
Constant Field Values

REPOSITORY_VERSION

public static final int REPOSITORY_VERSION
See Also:
Constant Field Values

VVFS_NAME

public static final int VVFS_NAME
See Also:
Constant Field Values

VIRTUAL_FILE_PATH

public static final int VIRTUAL_FILE_PATH
See Also:
Constant Field Values

VIRTUAL_FILE_VERSION

public static final int VIRTUAL_FILE_VERSION
See Also:
Constant Field Values

DEV_LINE_NAME

public static final int DEV_LINE_NAME
See Also:
Constant Field Values

DEV_LINE_UID

public static final int DEV_LINE_UID
See Also:
Constant Field Values
Constructor Detail

VersionManagerURI

public VersionManagerURI()
Method Detail

getURI

public static VersionManagerURI getURI(java.lang.String stringFormOfURI,
                                       VersionManager pVersionManager)
Creates a VersionManagerAPI from a string. This method tries to determine if it is for a repository item, virtual file, or development line by trying to resolve the 3rd part of the URI string.

Parameters:
stringFormOfURI - the URI string
Returns:
A VersionManagerURI object

getURI

public static VersionManagerURI getURI(int uriType,
                                       java.lang.String stringFormOfURI)
Creates a VersionManagerAPI from a string, passing one of DEV_LINE, REPOSITORY_ITEM or VIRTUAL_FILE to indicate what the URI type is.

Parameters:
stringFormOfURI -
Returns:

getURI

public static VersionManagerURI getURI(int uriType,
                                       VersionManagerURI uriRoot,
                                       java.lang.String version)
Creates a VersionManagerAPI from a string, passing one of DEV_LINE, REPOSITORY_ITEM or VIRTUAL_FILE to indicate what the URI type is.

Parameters:
stringFormOfURI -
Returns:

getVFSURI

public static VersionManagerURI getVFSURI(java.lang.String versionManagerName,
                                          java.lang.String vfsServiceName,
                                          java.lang.String vfsPath,
                                          java.lang.Integer version)
Deprecated. use getRVFSURI() instead.

Parameters:
versionManagerName -
vfsServiceName -
vfsPath -
version -
Returns:

getRVFSURI

public static VersionManagerURI getRVFSURI(java.lang.String versionManagerName,
                                           java.lang.String repositoryName,
                                           java.lang.String itemName,
                                           java.lang.String itemId,
                                           java.lang.Integer version)
This is the preferend method of creating a file asset URI. getVFSURI method is deprecated and is not guaranteed to be supported in future. Some operations cannot be reliable performed by the version manager if the old form of the URI is used. e.g. file rename.

Parameters:
versionManagerName -
repositoryName - the name of the ContentRepository underneath the RepositoryFileSystem
itemName - ContentRepositoryItem or ContentRepositoryFolder's item descriptor name.
itemId - the repository ID of the item.
version -
Returns:
VersionMangerURI

getURI

public static VersionManagerURI getURI(java.lang.String versionManagerName,
                                       java.lang.String repositoryName,
                                       java.lang.String itemName,
                                       java.lang.String itemId,
                                       java.lang.Integer version)

getURI

public static VersionManagerURI getURI(java.lang.String versionManagerName,
                                       java.lang.String repositoryName,
                                       java.lang.String itemName,
                                       java.lang.String itemId)

setFullURI

public boolean setFullURI(int uriType,
                          java.lang.String stringFormOfURI)
Fills in a VersionManagerURI by taking a complete URI including the method.

Parameters:
stringFormOfURI -

isFileFolder

public boolean isFileFolder(VersionManager pVersionManager)
                     throws VersionException
Does this URI represent a file folder.

Throws:
VersionException

isParentOfURI

public boolean isParentOfURI(VersionManagerURI otherURI)
Returns true if the given URI belongs to the same namespace as this URI. Namely, if the given URI starts with this URI, then this method will return true (atgvm://a/b/c is a child of atgvm://a/b).

Parameters:
otherURI -
Returns:

isValid

public boolean isValid()
Checks to see that the URI is not missing any parts.

Returns:
true if nothing is missing from the URI

getType

public int getType()
Gets the type of this URI. Can be used when creating a new, longer URI based on this one.

Returns:
the URI's type code

getURIPart

public java.lang.String getURIPart(int part)
Returns the part of the URI at the given index, parsing using the rules for the given type of URI. Use the public constants for convenience.

Returns:
String

getNameURIPart

public java.lang.String getNameURIPart()

getVersionlessURI

public VersionManagerURI getVersionlessURI()

getVersionID

public VersionID getVersionID()

getURIString

public java.lang.String getURIString()
Returns the URI as a String. This method exists so that the string value can be accessed from as a bean property.


toString

public java.lang.String toString()
Returns the URI as a String

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

getPartSeparator

public static java.lang.String getPartSeparator()
Returns:

getVersionSeparator

public static java.lang.String getVersionSeparator()
Returns:

getRepository

public Repository getRepository(VersionManager pVersionManager)
Return the repository component configured with the given version manager and which was used to create this uri.

Parameters:
pVersionManager -
Returns:
The repository that this asset URI was created for.

getRepositoryItemDescriptor

public RepositoryItemDescriptor getRepositoryItemDescriptor(VersionManager pVersionManager)
                                                     throws RepositoryException
Return the item descriptor type that this URI points to.

Parameters:
pVersionManager -
Returns:
the RepositoryItemDescriptor
Throws:
RepositoryException

getRepositoryItemDescriptorName

public java.lang.String getRepositoryItemDescriptorName(VersionManager pVersionManager)
                                                 throws RepositoryException
Return the item descriptor type name that this URI points to.

Parameters:
pVersionManager -
Returns:
the RepositoryItemDescriptor
Throws:
RepositoryException, - VersionRuntimeException
RepositoryException

getRepositoryID

public java.lang.String getRepositoryID()
Return the repository ID of the asset that this URI points to.

Returns:
String representation of the repository ID

getVirtualFileSystem

public atg.vfs.repository.RepositoryVirtualFileSystem getVirtualFileSystem(VersionManager pVersionManager)
Return the virtual file system component configured with the given version manager and which was used to create this uri if this is a repository for a VirtualFile asset.

Parameters:
pVersionManager -
Returns:
The VVFS that this asset URI was created for.

getAssetVersion

public java.lang.Integer getAssetVersion()
Get the asset version of this URI. Is this is a versionless URI null is returned

Returns: