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:
Extensible,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
EXPORT_LOCKED, EXPORT_UNLOCKED, NATURE_DOCFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcalculateNewVersion(String oldVersionName, boolean major) Calculate the new version name in the format X.Y.intstatic Versioncreate(Document document, User user, String comment, DocumentEvent 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 persistentbooleanlonglonggetDocId()getEvent()longlonginthashCode()voidsetAttributes(Map<String, Attribute> attributes) voidsetCreator(String creator) voidsetCreatorId(long creatorId) voidsetDocId(long docId) voidsetEvent(DocumentEvent event) voidsetFolderId(long folderId) voidsetFolderName(String folderName) voidsetTemplate(Template template) voidsetTemplateId(Long templateId) voidsetTemplateName(String templateName) voidsetUserId(long userId) voidsetUsername(String username) voidsetVersionDate(Date versionDate) toString()Methods inherited from class com.logicaldoc.core.document.AbstractDocument
copyAttributes, getBarcoded, getBarcodeTemplateId, getColor, getComment, getCustomId, getDate, getDecodedPassword, getDeleteUserId, getDigest, getDocAttrs, getExportId, getExportName, getExportStatus, getExportVersion, getExtResId, getFileExtension, getFileName, getFileSize, getFileVersion, getFormId, getIcon, getImmutable, getIndexed, getLanguage, getLastNote, getLinks, getLocale, getLockUser, getLockUserId, getNature, getOcrd, getOcrTemplateId, getPages, getPassword, getPreviewPages, getPublished, getPublisher, getPublisherId, getRevision, getSigned, getStamped, getStartPublishing, getStatus, getStopPublishing, getTgs, getTitle, getTransactionId, getType, getVersion, getWorkflowStatus, getWorkflowStatusDisplay, isGranted, isModified, isPasswordProtected, isPublishing, isToIndex, setBarcoded, setBarcodeTemplateId, setColor, setComment, setCustomId, setDate, setDecodedPassword, setDeleteUserId, setDigest, setDocAttrs, setExportId, setExportName, setExportStatus, setExportVersion, setExtResId, setFileName, setFileSize, setFileVersion, setFormId, setImmutable, setIndexingStatus, setIndexingStatus, setLanguage, setLastNote, setLinks, setLocale, setLockUser, setLockUserId, setModified, setNature, setOcrd, setOcrTemplateId, setPages, setPassword, setPreviewPages, setPublished, setPublisher, setPublisherId, setRevision, setSigned, setStamped, setStartPublishing, setStatus, setStatus, setStopPublishing, setTagsFromWords, setTgs, setTransactionId, setType, setVersion, setWorkflowStatus, setWorkflowStatusDisplayMethods inherited from class com.logicaldoc.core.metadata.ExtensibleObject
getAttribute, getAttributeAtPosition, getAttributeNames, getAttributeNames, getValue, getValueAttributes, getValues, removeAttribute, setAttribute, 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
-
getAttributes
- Specified by:
getAttributesin interfaceExtensible
-
setAttributes
- Specified by:
setAttributesin interfaceExtensible
-
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:
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
toString
- Overrides:
toStringin classAbstractDocument
-
getVersionDate
-
setVersionDate
-
getFolderId
public long getFolderId()- Specified by:
getFolderIdin classAbstractDocument
-
setFolderId
public void setFolderId(long folderId) -
getFolderName
-
setFolderName
-
getTemplateName
- Specified by:
getTemplateNamein interfaceExtensible- Overrides:
getTemplateNamein classAbstractDocument
-
setTemplateName
- Specified by:
setTemplateNamein interfaceExtensible- Overrides:
setTemplateNamein classAbstractDocument
-
create
public static Version create(Document document, User user, String comment, DocumentEvent 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
-
setEvent
-
getEventEnum
-
getEvent
-
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) -
getTemplateId
- Specified by:
getTemplateIdin interfaceExtensible- Overrides:
getTemplateIdin classAbstractDocument
-
setTemplateId
- Specified by:
setTemplateIdin interfaceExtensible- Overrides:
setTemplateIdin classAbstractDocument
-
getTemplate
- Specified by:
getTemplatein interfaceExtensible
-
setTemplate
- Specified by:
setTemplatein interfaceExtensible
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractDocument
-
equals
- Overrides:
equalsin classAbstractDocument
-