org.silverpeas.attachment.model
Class HistorisedDocument

java.lang.Object
  extended by org.silverpeas.attachment.model.SimpleDocument
      extended by org.silverpeas.attachment.model.HistorisedDocument
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HistorisedDocumentVersion

public class HistorisedDocument
extends SimpleDocument

This class represents a document that is versioned. It exposes all data of a versioned document from the master version to the first version. To obtain the master version, please use getVersionMaster() method (must return the same instance as the one of "this"). To check if the current instance is indexed on master version, please use SimpleDocument.isVersionMaster() method.

Author:
ehugonnet
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.silverpeas.attachment.model.SimpleDocument
ATTACHMENT_PREFIX, DOCUMENT_PREFIX, FILE_PREFIX, VERSION_PREFIX, WEBDAV_FOLDER
 
Constructor Summary
HistorisedDocument()
           
HistorisedDocument(SimpleDocument doc)
           
HistorisedDocument(SimpleDocumentPK pk, String foreignId, int order, SimpleAttachment file)
           
HistorisedDocument(SimpleDocumentPK pk, String foreignId, int order, String owner, SimpleAttachment file)
           
 
Method Summary
 List<SimpleDocumentVersion> getFunctionalHistory()
          Returns functional history based on versions and indexes.
 List<SimpleDocumentVersion> getHistory()
          Returns technical history (as the JCR)
 SimpleDocument getLastPublicVersion()
          Returns the more recent public version of this document - null if none exists.
 SimpleDocumentVersion getPreviousVersion()
           
 List<SimpleDocument> getPublicVersions()
           
 SimpleDocumentVersion getVersionIdentifiedBy(String id)
          Gets from the history the version identified by the given identifier.
 HistorisedDocument getVersionMaster()
          Returns the master of versioned document.
 boolean isVersioned()
           
 void setHistory(List<SimpleDocumentVersion> history)
           
 
Methods inherited from class org.silverpeas.attachment.model.SimpleDocument
addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsForbidden, addRolesForWhichDownloadIsForbidden, canBeAccessedBy, canBeModifiedBy, computeNodeName, edit, equals, getAlert, getAliasURL, getAttachment, getAttachmentPath, getAttachmentURL, getCloneId, getComment, getContentType, getCreated, getCreatedBy, getDescription, getDirectoryPath, getDisplayIcon, getDocumentType, getEditedBy, getExpiry, getFilename, getFolder, getForbiddenDownloadForRoles, getForeignId, getFullJcrContentPath, getFullJcrPath, getId, getInstanceId, getLanguage, getMajorVersion, getMinorVersion, getNodeName, getOldSilverpeasId, getOnlineURL, getOrder, getPk, getRepositoryPath, getReservation, getSize, getStatus, getTitle, getUniversalURL, getUpdated, getUpdatedBy, getVersion, getVersionIndex, getWebdavContentEditionLanguage, getWebdavContentEditionSize, getWebdavJcrPath, getWebdavUrl, getWebURL, getXmlFormId, hashCode, isContentArchive, isContentImage, isContentMail, isContentPdf, isContentSpinfire, isDownloadAllowedForReaders, isDownloadAllowedForRoles, isDownloadAllowedForRolesFrom, isOpenOfficeCompatible, isPublic, isReadOnly, isSharingAllowedForRolesFrom, isVersionMaster, release, resetWebdavContentEditionContext, setAlert, setAttachment, setCloneId, setComment, setContentType, setCreated, setDescription, setDocumentType, setExpiry, setFilename, setForeignId, setId, setLanguage, setMajorVersion, setMinorVersion, setNodeName, setOldSilverpeasId, setOrder, setPK, setPublicDocument, setRepositoryPath, setReservation, setSize, setStatus, setTitle, setUpdated, setUpdatedBy, setVersionIndex, setVersionMaster, setXmlFormId, toString, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HistorisedDocument

public HistorisedDocument(SimpleDocumentPK pk,
                          String foreignId,
                          int order,
                          SimpleAttachment file)

HistorisedDocument

public HistorisedDocument(SimpleDocumentPK pk,
                          String foreignId,
                          int order,
                          String owner,
                          SimpleAttachment file)

HistorisedDocument

public HistorisedDocument()

HistorisedDocument

public HistorisedDocument(SimpleDocument doc)
Method Detail

getVersionMaster

public HistorisedDocument getVersionMaster()
Description copied from class: SimpleDocument
Returns the master of versioned document. If not versionned, it returns itself. If versioned, it returns the master of versioned document (the last created or updated in other words).

Overrides:
getVersionMaster in class SimpleDocument
Returns:

isVersioned

public boolean isVersioned()
Overrides:
isVersioned in class SimpleDocument

getHistory

public List<SimpleDocumentVersion> getHistory()
Returns technical history (as the JCR)

Returns:

getVersionIdentifiedBy

public SimpleDocumentVersion getVersionIdentifiedBy(String id)
Gets from the history the version identified by the given identifier.

Parameters:
id - the identifier of the searched version.
Returns:
the version of the simple document which the identifier is the one specified, null otherwise.

getFunctionalHistory

public List<SimpleDocumentVersion> getFunctionalHistory()
Returns functional history based on versions and indexes.

Returns:

setHistory

public void setHistory(List<SimpleDocumentVersion> history)

getPublicVersions

public List<SimpleDocument> getPublicVersions()

getLastPublicVersion

public SimpleDocument getLastPublicVersion()
Returns the more recent public version of this document - null if none exists.

Overrides:
getLastPublicVersion in class SimpleDocument
Returns:
the more recent public version of this document - null if none exists.

getPreviousVersion

public SimpleDocumentVersion getPreviousVersion()


Copyright © 2016 Silverpeas. All Rights Reserved.