Class Version

All Implemented Interfaces:
TransactionalObject, Serializable, Comparable<Version>

public class Version extends AbstractDocument implements Comparable<Version>
This class represents versions.
Version:
1.0
Author:
Marco Meschieri - LogicalDOC
See Also:
  • Constructor Details

    • Version

      public Version()
    • Version

      public Version(Version source)
  • Method Details

    • getUserId

      public long getUserId()
    • setUserId

      public void setUserId(long userId)
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
    • calculateNewVersion

      public static String calculateNewVersion(String oldVersionName, boolean major)
      Calculate the new version name in the format X.Y.
      Parameters:
      oldVersionName - the old version in the format X.Y
      major - 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

      public int compareTo(Version other)
      Specified by:
      compareTo in interface Comparable<Version>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractDocument
    • getVersionDate

      public Date getVersionDate()
    • setVersionDate

      public void setVersionDate(Date versionDate)
    • getFolderId

      public long getFolderId()
    • setFolderId

      public void setFolderId(long folderId)
    • getFolderName

      public String getFolderName()
    • setFolderName

      public void setFolderName(String folderName)
    • getTemplateId

      public Long getTemplateId()
      Overrides:
      getTemplateId in class ExtensibleObject
    • setTemplateId

      public void setTemplateId(Long templateId)
      Overrides:
      setTemplateId in class ExtensibleObject
    • 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 versioned
      user - The user who made the changes
      comment - The version comment
      event - The event that caused the new release
      release - True if this is a new release(eg: 2.0) rather than a subversion(eg: 1.1)
      Returns:
      The newly created version
    • getEvent

      public String getEvent()
    • setEvent

      public void setEvent(String event)
    • getCreator

      public String getCreator()
      Overrides:
      getCreator in class AbstractDocument
    • setCreator

      public void setCreator(String creator)
      Overrides:
      setCreator in class AbstractDocument
    • getCreatorId

      public long getCreatorId()
      Overrides:
      getCreatorId in class AbstractDocument
    • setCreatorId

      public void setCreatorId(long creatorId)
      Overrides:
      setCreatorId in class AbstractDocument
    • getDocId

      public long getDocId()
    • setDocId

      public void setDocId(long docId)