|
Daisy Open Source CMS | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Version
A version of a Document.
This object provides access to the all versioned information of a document,
for a specific version of the document. Versions cannot be modified (except
their state, see below),
they are read-only. See Document.save() for when a version is created.
A version can have a state of either 'publish' or 'draft'. This state can be changed at any time.
| Method Summary | |
|---|---|
String |
getChangeComment()
Returns the change comment for this version (can be null). |
ChangeType |
getChangeType()
Returns the change type for this version (never null). |
Date |
getCreated()
Returns the date when this version was created. |
long |
getCreator()
Returns the id of the user that created this version. |
long |
getId()
The id of the version, which is a sequence number, the first version being 1, then 2, and so on. |
Date |
getLastModified()
Get the time at which the state of this version was last changed. |
long |
getLastModifier()
Get the id of the user that last changed the state of this version. |
org.outerx.daisy.x10.VersionDocument |
getShallowXml()
Get an XML document containing information about this version, but without the actual versioned content, thus no fields, parts, links etc. |
VersionState |
getState()
Returns the current state of this version. |
VersionKey |
getSyncedWith()
Returns a VersionKey that identifies the version that this version was synced to. |
long |
getTotalSizeOfParts()
Get the sum of the size of the parts in this version. |
org.outerx.daisy.x10.VersionDocument |
getXml()
Get an XML document describing the version. |
void |
save()
Saves changes made to the metadata of this version (versionState, syncedWith, changeType and changeComment). |
void |
setChangeComment(String changeComment)
Changes the change comment for this version. |
void |
setChangeType(ChangeType changeType)
Changes the change type for this version. |
void |
setState(VersionState state)
Changes the state of this version. |
void |
setSyncedWith(long languageId,
long versionId)
Changes the 'synced with' field for this version. |
void |
setSyncedWith(VersionKey syncedWith)
Sets the 'synced with' pointer by specifying a VersionKey object. |
| Methods inherited from interface org.outerj.daisy.repository.VersionedData |
|---|
getDocumentName, getField, getField, getFields, getFieldsInOrder, getLinks, getPart, getPart, getParts, getPartsInOrder, hasField, hasField, hasPart, hasPart |
| Method Detail |
|---|
long getId()
Date getCreated()
long getCreator()
UserManager.
org.outerx.daisy.x10.VersionDocument getShallowXml()
org.outerx.daisy.x10.VersionDocument getXml()
throws RepositoryException
RepositoryExceptionvoid setState(VersionState state)
Sinced daisy 2.2, this method no longer has immediate effect, you need to call version.save() to make the change permanent.
VersionState getState()
void setSyncedWith(long languageId,
long versionId)
throws RepositoryException
This method does not have immediate effect. You need to call version.save() to make the change permanent.
To clear the 'synced with' field, specify -1 for languageId and versionId.
IllegalArgumentException - if exactly one of languageId and versionId is -1 or versionId < 0
RepositoryException - if the languageId!=-1 and the language does not exist
void setSyncedWith(VersionKey syncedWith)
throws RepositoryException
RepositoryExceptionVersionKey getSyncedWith()
void setChangeType(ChangeType changeType)
throws RepositoryException
This method does not have immediate effect. You need to call version.save() to make the change permanent.
The change type indicates if the version contains major or minor changes.
When using translation management, the change type is used to indicate that a version contains changes which render translations invalid. So if a user makes changes to a version, even though these might seem minor, but which should be replicated in translations, than the change type should be set to major (when using translation management, otherwise you can assign your own meaning to this field).
RepositoryExceptionChangeType getChangeType()
void setChangeComment(String changeComment)
throws RepositoryException
This method does not have immediate effect. You need to call version.save() to make the change permanent.
changeComment - the comment text, can be null to clear the change comment
RepositoryExceptionString getChangeComment()
void save()
throws RepositoryException
RepositoryExceptionlong getLastModifier()
Date getLastModified()
long getTotalSizeOfParts()
|
Daisy Open Source CMS | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||