Package com.logicaldoc.core.document
Class Version
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.metadata.ExtensibleObject
com.logicaldoc.core.document.AbstractDocument
com.logicaldoc.core.document.Version
- All Implemented Interfaces:
TransactionalObject
,Serializable
,Comparable<Version>
This class represents versions.
- Version:
- 1.0
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Field Summary
Fields inherited from class com.logicaldoc.core.document.AbstractDocument
DOC_ARCHIVED, DOC_CHECKED_OUT, DOC_LOCKED, DOC_UNLOCKED, EXPORT_LOCKED, EXPORT_UNLOCKED, INDEX_INDEXED, INDEX_SKIP, INDEX_TO_INDEX, INDEX_TO_INDEX_METADATA, NATURE_DOC
Fields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
calculateNewVersion
(String oldVersionName, boolean major) Calculate the new version name in the format X.Y.int
static Version
Factory method that creates a Version and replicate all given document's properties.
The new version and fileVersion will be set in both Document and Version
Important: The created Version is not persistentlong
long
getDocId()
getEvent()
long
long
void
setCreator
(String creator) void
setCreatorId
(long creatorId) void
setDocId
(long docId) void
void
setFolderId
(long folderId) void
setFolderName
(String folderName) void
setTemplateId
(Long templateId) void
setUserId
(long userId) void
setUsername
(String username) void
setVersionDate
(Date versionDate) toString()
Methods inherited from class com.logicaldoc.core.document.AbstractDocument
addTag, clearTags, copyAttributes, getBarcoded, getBarcodeTemplateId, getColor, getComment, getCreation, getCustomId, getDate, getDecodedPassword, getDeleteUser, getDeleteUserId, getDigest, getDocRef, getDocRefType, getExportId, getExportName, getExportStatus, getExportVersion, getExtResId, getFileExtension, getFileName, getFileSize, getFileVersion, getFolder, getFormId, getIcon, getImmutable, getIndexed, getLanguage, getLinks, getLocale, getLockUser, getLockUserId, getNature, getOcrd, getOcrTemplateId, getPages, getPassword, getPreviewPages, getPublished, getPublisher, getPublisherId, getRating, getSigned, getStamped, getStartPublishing, getStatus, getStopPublishing, getTags, getTagsAsWords, getTagsString, getTgs, getTitle, getTransactionId, getType, getVersion, getWorkflowStatus, getWorkflowStatusDisplay, isGranted, isModified, isPasswordProtected, isPublishing, isToIndex, setBarcoded, setBarcodeTemplateId, setColor, setComment, setCreation, setCustomId, setDate, setDecodedPassword, setDeleteUser, setDeleteUserId, setDigest, setDocRef, setDocRefType, setExportId, setExportName, setExportStatus, setExportVersion, setExtResId, setFileName, setFileSize, setFileVersion, setFolder, setFormId, setImmutable, setIndexed, setLanguage, setLinks, setLocale, setLockUser, setLockUserId, setModified, setNature, setOcrd, setOcrTemplateId, setPages, setPassword, setPreviewPages, setPublished, setPublisher, setPublisherId, setRating, setSigned, setStamped, setStartPublishing, setStatus, setStopPublishing, setTags, setTagsFromWords, setTgs, setTransactionId, setType, setVersion, setWorkflowStatus, setWorkflowStatusDisplay
Methods inherited from class com.logicaldoc.core.metadata.ExtensibleObject
getAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getAttributes, getTemplate, getTemplateName, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, setAttributes, setTemplate, setTemplateName, setValue, setValues, setValues
Methods inherited from class com.logicaldoc.core.PersistentObject
equals, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, hashCode, setDeleted, setId, setLastModified, setRecordVersion, setTenantId
-
Constructor Details
-
Version
public Version() -
Version
-
-
Method Details
-
getUserId
public long getUserId() -
setUserId
public void setUserId(long userId) -
getUsername
-
setUsername
-
calculateNewVersion
Calculate the new version name in the format X.Y.- Parameters:
oldVersionName
- the old version in the format X.Ymajor
- if the new version is a major release or not- Returns:
- the new version name in the format X.Y
- See Also:
-
getNewVersionName(String, boolean)
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
toString
- Overrides:
toString
in classAbstractDocument
-
getVersionDate
-
setVersionDate
-
getFolderId
public long getFolderId() -
setFolderId
public void setFolderId(long folderId) -
getFolderName
-
setFolderName
-
getTemplateId
- Overrides:
getTemplateId
in classExtensibleObject
-
setTemplateId
- Overrides:
setTemplateId
in classExtensibleObject
-
create
public static Version create(Document document, User user, String comment, String event, boolean release) Factory method that creates a Version and replicate all given document's properties.
The new version and fileVersion will be set in both Document and Version
Important: The created Version is not persistent- Parameters:
document
- The document to be versioneduser
- The user who made the changescomment
- The version commentevent
- The event that caused the new releaserelease
- True if this is a new release(eg: 2.0) rather than a subversion(eg: 1.1)- Returns:
- The newly created version
-
getEvent
-
setEvent
-
getCreator
- Overrides:
getCreator
in classAbstractDocument
-
setCreator
- Overrides:
setCreator
in classAbstractDocument
-
getCreatorId
public long getCreatorId()- Overrides:
getCreatorId
in classAbstractDocument
-
setCreatorId
public void setCreatorId(long creatorId) - Overrides:
setCreatorId
in classAbstractDocument
-
getDocId
public long getDocId() -
setDocId
public void setDocId(long docId)
-