Package com.logicaldoc.core.document
Class Version
- All Implemented Interfaces:
Securable,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_DOCFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcalculateNewVersion(String oldVersionName, boolean major) Calculate the new version name in the format X.Y.intstatic VersionFactory 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 persistentbooleanlonglonggetDocId()getEvent()longlongvoidsetCreator(String creator) voidsetCreatorId(long creatorId) voidsetDocId(long docId) voidvoidsetFolderId(long folderId) voidsetFolderName(String folderName) voidsetTemplateId(Long templateId) voidsetUserId(long userId) voidsetUsername(String username) voidsetVersionDate(Date versionDate) toString()Methods inherited from class com.logicaldoc.core.document.AbstractDocument
addTag, clearTags, copyAttributes, getBarcoded, getBarcodeTemplateId, getColor, getComment, getCustomId, getDate, getDecodedPassword, getDeleteUser, getDeleteUserId, getDigest, getDocAttrs, 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, setCustomId, setDate, setDecodedPassword, setDeleteUser, setDeleteUserId, setDigest, setDocAttrs, 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, setWorkflowStatusDisplayMethods inherited from class com.logicaldoc.core.security.SecurableExtensibleObject
addAccessControlEntry, getAccessControlEntry, getAccessControlList, hashCode, setAccessControlListMethods inherited from class com.logicaldoc.core.metadata.ExtensibleObject
getAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getAttributes, getTemplate, getTemplateName, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, setAttributes, setTemplate, setTemplateName, setValue, setValuesMethods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, 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:
compareToin interfaceComparable<Version>
-
equals
- Overrides:
equalsin classSecurableExtensibleObject
-
toString
- Overrides:
toStringin classAbstractDocument
-
getVersionDate
-
setVersionDate
-
getFolderId
public long getFolderId() -
setFolderId
public void setFolderId(long folderId) -
getFolderName
-
setFolderName
-
getTemplateId
- Overrides:
getTemplateIdin classExtensibleObject
-
setTemplateId
- Overrides:
setTemplateIdin 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:
getCreatorin classAbstractDocument
-
setCreator
- Overrides:
setCreatorin classAbstractDocument
-
getCreatorId
public long getCreatorId()- Overrides:
getCreatorIdin classAbstractDocument
-
setCreatorId
public void setCreatorId(long creatorId) - Overrides:
setCreatorIdin classAbstractDocument
-
getDocId
public long getDocId() -
setDocId
public void setDocId(long docId)
-