Class SimpleDocumentVersion
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.model.SimpleDocument
-
- org.silverpeas.core.contribution.attachment.model.SimpleDocumentVersion
-
- All Implemented Interfaces:
Serializable
,Attachment
,Contribution
,LocalizedAttachment
,LocalizedContribution
,LocalizedResource
,ResourceTranslation
,Translatable
,Translation
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
public class SimpleDocumentVersion extends SimpleDocument
This class represents one version in the history of a versioned simple document.The identifier of the component instance provided by this class is the one of the head version. It is the same thing for the provided foreign identifier information. To retrieve the real historized values of the version, please use methods for which the name prefix is getRealVersion...
- Author:
- Yohann Chastagnier
- 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 SimpleDocumentVersion(SimpleDocument documentVersion, HistorisedDocument masterVersion)
The default constructor of a simple document version.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAttachmentURL()
Returns the attachment URL.SimpleDocument
getLastPublicVersion()
Returns the more recent public version of this document - null if none exists.String
getOnlineURL()
SimpleDocumentVersion
getPreviousVersion()
String
getRealVersionForeignId()
Gets the real value of the foreign identifier of the version and not the one of the head version.SimpleDocumentPK
getRealVersionPk()
Gets the real value of the PK of the version and not the one of the head version.String
getUniversalURL()
HistorisedDocument
getVersionMaster()
Returns the master of versioned document.String
getWebdavUrl()
boolean
isVersioned()
Is this attachment versioned?void
setPreviousVersion(SimpleDocumentVersion previousVersion)
void
setVersionMaster(SimpleDocument versionMaster)
-
Methods inherited from class org.silverpeas.core.contribution.attachment.model.SimpleDocument
addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsAllowed, addRolesForWhichDownloadIsForbidden, addRolesForWhichDownloadIsForbidden, canBeAccessedBy, canBeModifiedBy, computeNodeName, edit, editableSimultaneously, equals, getAlert, getAttachment, getAttachmentPath, 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, getOrder, getPk, getRepositoryPath, getReservation, getSize, getStatus, getTitle, getTranslation, getUpdatedBy, getVersion, getVersionIndex, getWebdavContentEditionLanguage, getWebdavContentEditionSize, getWebdavJcrPath, getXmlFormId, hashCode, 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, 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
-
SimpleDocumentVersion
public SimpleDocumentVersion(SimpleDocument documentVersion, HistorisedDocument masterVersion)
The default constructor of a simple document version.- Parameters:
documentVersion
- the original version.masterVersion
- the current version of the document.
-
-
Method Detail
-
getVersionMaster
public HistorisedDocument getVersionMaster()
Description copied from class:SimpleDocument
Returns the master of versioned document. If not versioned, 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.
-
setVersionMaster
public void setVersionMaster(SimpleDocument versionMaster)
- Overrides:
setVersionMaster
in classSimpleDocument
-
getPreviousVersion
public SimpleDocumentVersion getPreviousVersion()
-
setPreviousVersion
public void setPreviousVersion(SimpleDocumentVersion previousVersion)
-
getRealVersionPk
public SimpleDocumentPK getRealVersionPk()
Gets the real value of the PK of the version and not the one of the head version.- Returns:
- the historized PK value of the historized version.
-
getRealVersionForeignId
public String getRealVersionForeignId()
Gets the real value of the foreign identifier of the version and not the one of the head version.- Returns:
- the historized foreign identifier value of the historized version.
-
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.
-
getLastPublicVersion
public SimpleDocument getLastPublicVersion()
Description copied from class:SimpleDocument
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.
-
getWebdavUrl
public String getWebdavUrl()
- Overrides:
getWebdavUrl
in classSimpleDocument
-
getOnlineURL
public String getOnlineURL()
- Overrides:
getOnlineURL
in classSimpleDocument
-
getAttachmentURL
public String getAttachmentURL()
Description copied from class:SimpleDocument
Returns the attachment URL.- Overrides:
getAttachmentURL
in classSimpleDocument
- Returns:
- the attachment URL.
-
getUniversalURL
public String getUniversalURL()
- Overrides:
getUniversalURL
in classSimpleDocument
-
-