com.ibm.workplace.wcm.api
Interface Version


public interface Version

A reference to a specific Version of an Item stored within the repository.

Since:
8.0

Method Summary
 java.util.Date date()
          The Date that this Version was created.
 java.lang.String[] labels()
          Returns the labels set on this Version.
 java.lang.String modifier()
          The String distinguished name of the last modifier that created this Version.
 void setLabels(java.lang.String... labels)
          Set the labels for this Version.
 Document versionedDocument()
          The Item representation of this Version.
 DocumentId<?> versionedDocumentId()
          A DocumentId representation of this Version.
 java.lang.String versionName()
          The name for this Version
 

Method Detail

labels

java.lang.String[] labels()
Returns the labels set on this Version.

Returns:
List of all labels set on this Version. This list can be empty, but will never be null.
Since:
8.0

setLabels

void setLabels(java.lang.String... labels)
               throws com.ibm.workplace.wcm.api.exceptions.VersioningException,
                      com.ibm.workplace.wcm.api.exceptions.AuthorizationException
Set the labels for this Version. This will replace all existing labels that are currently defined. Note: An single empty string is treated as a value and is not the same as passing in null or an empty String[].

Parameters:
labels - The labels to set on this Version
Throws:
com.ibm.workplace.wcm.api.exceptions.VersioningException - if an error occurred updating the labels on the Version
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the current user does not have sufficient access rights to set new labels on the Version
Since:
8.0

versionName

java.lang.String versionName()
The name for this Version

Returns:
The name for this Version
Since:
8.0

date

java.util.Date date()
The Date that this Version was created.

Returns:
The Date that this Version was created.
Since:
8.0

modifier

java.lang.String modifier()
                          throws com.ibm.workplace.wcm.api.exceptions.DocumentNotFoundException
The String distinguished name of the last modifier that created this Version.

Returns:
The String last modifier that created this Version.
Throws:
com.ibm.workplace.wcm.api.exceptions.DocumentNotFoundException - if the version could be found in the repository
Since:
8.0

versionedDocument

Document versionedDocument()
                           throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                  com.ibm.workplace.wcm.api.exceptions.OperationFailedException,
                                  com.ibm.workplace.wcm.api.exceptions.DocumentNotFoundException,
                                  com.ibm.workplace.wcm.api.exceptions.DocumentCreationException
The Item representation of this Version. All properties of the Item can be accessed and retrieved in the same way as on a regular active Document.

Note: The Document returned from this method cannot be used to perform actions on the currently active Document that it represents. A DocumentSaveException will be thrown if an attempt is made to save this Item back into the repository using Workspace.save(). A IllegalDocumentTypeException will be thrown if an attempt is made to move this Document using Workspace.move(). The DocumentId returned from calling Document.getId() on the Object returned will not be usable for any operation that accepts a DocumentId.

Returns:
The Document representation of this Version
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the current user does not have sufficient access rights access the version
com.ibm.workplace.wcm.api.exceptions.DocumentCreationException - if an error occurred while trying to construct the Item from the stored version
com.ibm.workplace.wcm.api.exceptions.DocumentNotFoundException - if the version could be found in the repository
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if an error occurred trying to retrieve the version from the repository
Since:
8.0

versionedDocumentId

DocumentId<?> versionedDocumentId()
                                  throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                         com.ibm.workplace.wcm.api.exceptions.OperationFailedException,
                                         com.ibm.workplace.wcm.api.exceptions.DocumentCreationException,
                                         com.ibm.workplace.wcm.api.exceptions.DocumentIdCreationException
A DocumentId representation of this Version. In cases where the underlying Document has been deleted the DocumentId is the only was to determine basic information about the Version. This DocumentId will not be usable for any operation that accepts a DocumentId.

Returns:
The DocumentId representation of this Version
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the current user does not have sufficient access rights access the version
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if an error occurred trying to retrieve the version from the repository
com.ibm.workplace.wcm.api.exceptions.DocumentCreationException
com.ibm.workplace.wcm.api.exceptions.DocumentIdCreationException
Since:
8.5