Class HistorisedDocument
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.model.SimpleDocument
-
- org.silverpeas.core.contribution.attachment.model.HistorisedDocument
-
- All Implemented Interfaces:
Serializable
,Attachment
,Contribution
,LocalizedAttachment
,LocalizedContribution
,LocalizedResource
,ResourceTranslation
,Translatable
,Translation
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
- 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 usegetVersionMaster()
method (must return the same instance as the one of "this"). To check if the current instance is indexed on master version, please useSimpleDocument.isVersionMaster()
method.- Author:
- ehugonnet
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.contribution.attachment.model.SimpleDocument
ATTACHMENT_PREFIX, DOCUMENT_PREFIX, FILE_PREFIX, VERSION_PREFIX, WEBDAV_FOLDER
-
-
Constructor Summary
Constructors Constructor Description HistorisedDocument()
HistorisedDocument(SimpleDocument doc)
HistorisedDocument(SimpleDocumentPK pk, String foreignId, int order, String owner, SimpleAttachment file)
HistorisedDocument(SimpleDocumentPK pk, String foreignId, int order, SimpleAttachment file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
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.int
hashCode()
boolean
isVersioned()
Is this attachment versioned?void
setHistory(List<SimpleDocumentVersion> history)
-
Methods inherited from class org.silverpeas.core.contribution.attachment.model.SimpleDocument
addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsForbidden, addRolesForWhichDownloadIsForbidden, canBeAccessedBy, canBeModifiedBy, computeNodeName, edit, editableSimultaneously, getAlert, getAttachment, getAttachmentPath, getAttachmentURL, getCloneId, getComment, getContentType, getCreatedBy, getCreationDate, getCreator, getDescription, getDirectoryPath, getDisplayIcon, getDocumentType, getEditedBy, getExpiry, getFilename, getFolder, getForbiddenDownloadForRoles, getForeignId, getFullJcrContentPath, getFullJcrPath, getId, getIdentifier, getInstanceId, getLanguage, getLastUpdateDate, getLastUpdater, getMajorVersion, getMinorVersion, getName, getNodeName, getOldSilverpeasId, getOnlineURL, getOrder, getPk, getRepositoryPath, getReservation, getSize, getStatus, getTitle, getTranslation, getUniversalURL, getUpdatedBy, getVersion, getVersionIndex, getWebdavContentEditionLanguage, getWebdavContentEditionSize, getWebdavJcrPath, getWebdavUrl, getXmlFormId, isASimpleDocument, isContentArchive, isContentImage, isContentMail, isContentPdf, isContentSpinfire, isDisplayableAsContent, isDownloadAllowedForReaders, isDownloadAllowedForRoles, isDownloadAllowedForRolesFrom, isEdited, isEditedBy, isOpenOfficeCompatible, isPublic, isReadOnly, isSharingAllowedForRolesFrom, isVersionMaster, release, resetWebdavContentEditionContext, setAlert, setAttachment, setCloneId, setComment, setContentType, setCreationDate, setDescription, setDisplayableAsContent, setDocumentType, setEditableSimultaneously, setExpiry, setFilename, setForeignId, setId, setLanguage, setLastUpdateDate, setMajorVersion, setMinorVersion, setNodeName, setOldSilverpeasId, setOrder, setPK, setPublicDocument, setRepositoryPath, setReservation, setSize, setStatus, setTitle, setUpdatedBy, setVersionIndex, setVersionMaster, setXmlFormId, toString, unlock
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
getContributionType, getModel, getResourcePath, isIndexable
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy
-
-
-
-
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 classSimpleDocument
- Returns:
- the master version of this document.
-
isVersioned
public boolean isVersioned()
Description copied from interface:Attachment
Is this attachment versioned? A document is versioned if each change is historized and comes to a new minor or major version.- Specified by:
isVersioned
in interfaceAttachment
- Overrides:
isVersioned
in classSimpleDocument
- Returns:
- true if this attachment is versioned, false otherwise.
-
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 classSimpleDocument
- Returns:
- the more recent public version of this document - null if none exists.
-
getPreviousVersion
public SimpleDocumentVersion getPreviousVersion()
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classSimpleDocument
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSimpleDocument
-
-