Class Version

    • Constructor Detail

      • Version

        public Version()
      • Version

        public Version​(Version source)
    • Method Detail

      • 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)
      • 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)
      • 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)
      • getDocId

        public long getDocId()
      • setDocId

        public void setDocId​(long docId)