Class ArchivedPublication

    • Field Detail

      • rowId

        protected java.lang.Long rowId
      • cdate

        protected java.util.Date cdate
      • author

        protected Member author
      • mainLanguage

        protected java.lang.String mainLanguage
      • title

        protected java.lang.String title
      • titleML

        protected java.util.HashMap<java.lang.String,​java.lang.String> titleML
      • description

        protected java.lang.String description
      • descriptionML

        protected java.util.HashMap<java.lang.String,​java.lang.String> descriptionML
      • originalId

        protected java.lang.String originalId
      • originalType

        protected short originalType
      • originalTypeLabel

        protected java.lang.String originalTypeLabel
      • authorizedMemberSet

        protected java.util.TreeSet<Member> authorizedMemberSet
      • authorizedGroupSet

        protected java.util.TreeSet<Group> authorizedGroupSet
    • Constructor Detail

      • ArchivedPublication

        public ArchivedPublication()
      • ArchivedPublication

        public ArchivedPublication​(Publication pub)
        Create a new ArchivedPublication from a publication.

        Should only be called by the ArchiveManager which performs the whole archiving process.

        Parameters:
        pub - the Publication from which we create this Archive
        Since:
        jcms-4.1.1
    • Method Detail

      • save

        public void save()
        Creates or updates this archive in the DB.
      • delete

        public void delete()
        Delete this archive (from the DB and all associated files on disk).
      • canBeReadBy

        public boolean canBeReadBy​(Member member)
        Check if this archive can be ready by specified member.
        Parameters:
        member - the member to check (can be null)
        Returns:
        true is Member can read archive, false otherwise
      • canBeUpdatedBy

        public boolean canBeUpdatedBy​(Member member)
        Check if this archive can be updated by specified member.
        Parameters:
        member - the member to check (can be null)
        Returns:
        true is Member can delete archive, false otherwise
      • canBeDeletedBy

        public boolean canBeDeletedBy​(Member member)
        Check if this archive can be deleted by specified member.
        Parameters:
        member - the member to check (can be null)
        Returns:
        true is Member can delete archive, false otherwise
      • getSavedHtmlPath

        public java.lang.String getSavedHtmlPath​(java.lang.String userLang)
        Return the path (webapp relative, for jsp inclusion) of the file in which the original publication was saved
        Parameters:
        userLang - the lang in which the Publication is wanted, if available
        Returns:
        the path of the html file were the Publication was saved, or null if no file was found
        Since:
        jcms-4.1.1
      • getSavedXmlPath

        public java.lang.String getSavedXmlPath()
        Return the path (webapp relative) of the XML file in which the original publication's data was saved
        Returns:
        the path of the XML file were the Publication was saved
        Since:
        jcms-4.1.1
      • getAssociatedFilesMap

        public java.util.HashMap<java.lang.String,​java.lang.String> getAssociatedFilesMap()
        Retrieve files associated with the given archive.
        Returns:
        an hashmap, filename ==> filepath (webapp relative)
      • setRowId

        public void setRowId​(java.lang.Long rowId)
        Specified by:
        setRowId in interface DBData
      • getRowId

        public java.lang.Long getRowId()
        Specified by:
        getRowId in interface DBData
      • getCdate

        public java.util.Date getCdate()
        Get the archive creation date.
        Returns:
        a date.
      • setCdate

        public void setCdate​(java.util.Date cdate)
        Set the creation date of this ArchivedPublication.
        Parameters:
        cdate - Value to assign to cdate.
      • getWorkspace

        public Workspace getWorkspace()
      • setWorkspace

        public void setWorkspace​(Workspace workspace)
      • getWorkspaceId

        public java.lang.String getWorkspaceId()
      • setWorkspaceId

        public void setWorkspaceId​(java.lang.String workspaceId)
      • getAuthor

        public Member getAuthor()
        Get the author of this Archive.
        Returns:
        the Member author of this archive.
        Since:
        jcms-6.0
      • setAuthor

        public void setAuthor​(Member mbr)
        Set the author of this Archive.
        Parameters:
        mbr - Value to assign to author.
        Since:
        jcms-6.0
      • getAuthorId

        public java.lang.String getAuthorId()
        Returns the JStore ID of the author
        Returns:
        the JStore ID of the author
        Since:
        jcms-6.0
      • setAuthorId

        public void setAuthorId​(java.lang.String authordId)
        Sets the JStore ID of the author
        Parameters:
        authordId - the JStore author id
        Since:
        jcms-6.0
      • getMainLanguage

        public java.lang.String getMainLanguage()
        Get the value of main language.
        Returns:
        Value of main language.
      • setMainLanguage

        public void setMainLanguage​(java.lang.String v)
        Set the value of main language.
        Parameters:
        v - Value to assign to main language.
      • getTitle

        public java.lang.String getTitle​(java.lang.String lang)
        Get the value of title bound to the given language.
        Parameters:
        lang - the language to get the title
        Returns:
        title in the given language.
        Since:
        jcms-6.0
      • getTitle

        public java.lang.String getTitle​(java.lang.String lang,
                                         boolean useDefault)
        Get the value of title bound to the given language.
        Parameters:
        lang - the language to get the title
        useDefault - should main language used as default language if title does not exist in the given language
        Returns:
        title in the given language.
        Since:
        jcms-6.0
      • getTitle

        public java.lang.String getTitle()
        Retrieve the title of this publication in the main site language.
        Returns:
        Value of title.
        Since:
        jcms-6.0
      • setTitle

        public void setTitle​(java.lang.String v)
        Set the title of this publication in the main site language.
        Parameters:
        v - value to assign to title.
        Since:
        jcms-6.0
      • getTitleML

        public java.util.HashMap<java.lang.String,​java.lang.String> getTitleML()
        Retrieve the HashMap containing the titles of this publication in language other than the main site language.
        Returns:
        an HashMap of String.
        Since:
        jcms-6.0
      • setTitleML

        public void setTitleML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the HashMap containing the titles of this publication in language other than the main site language.
        Parameters:
        v - an HashMap of String.
        Since:
        jcms-6.0
      • setTitleXml

        public void setTitleXml​(java.lang.String xml)
        Set the titles of this Publication in all the languages using the specified XML string.
        Parameters:
        xml - an xml string as returned by getTitleXml()
        Since:
        jcms-6.0
      • getDescription

        public java.lang.String getDescription()
      • setDescription

        public void setDescription​(java.lang.String value)
      • getDescription

        public java.lang.String getDescription​(java.lang.String lang)
      • getDescription

        public java.lang.String getDescription​(java.lang.String lang,
                                               boolean useDefault)
      • getDescriptionML

        public java.util.HashMap<java.lang.String,​java.lang.String> getDescriptionML()
      • setDescriptionML

        public void setDescriptionML​(java.util.HashMap<java.lang.String,​java.lang.String> map)
      • getDescriptionXml

        public java.lang.String getDescriptionXml()
        Retrieves an xml serialization of the descriptions of this Publication in all the languages.
        Returns:
        a valid XML document, as returned by JcmsUtil.convertMultilingualFieldToXml(String, Map)
        Since:
        jcms-6.0
      • setDescriptionXml

        public void setDescriptionXml​(java.lang.String xml)
        Set the descriptions of this Publication in all the languages using the specified XML string.
        Parameters:
        xml - an xml string as returned by getDescriptionXml()
        Since:
        jcms-6.0
      • getAuthorizedMemberSet

        public java.util.Set<Member> getAuthorizedMemberSet()
        Get the set of Member authorized to read this archive.
        Returns:
        a set of Member.
        Since:
        jcms-6.0
      • setAuthorizedMemberSet

        public void setAuthorizedMemberSet​(java.util.TreeSet<Member> memberSet)
        Set the set of Member authorized to read this archive.
        Parameters:
        memberSet - a set of Member.
        Since:
        jcms-6.0
      • getAuthorizedMemberIds

        public java.lang.String getAuthorizedMemberIds()
      • setAuthorizedMemberIds

        public void setAuthorizedMemberIds​(java.lang.String authorizedMemberIds)
      • getAuthorizedGroupSet

        public java.util.Set<Group> getAuthorizedGroupSet()
        Get the set of Group authorized to read this archive.
        Returns:
        a set of Group.
        Since:
        jcms-6.0
      • setAuthorizedGroupSet

        public void setAuthorizedGroupSet​(java.util.TreeSet<Group> groupSet)
        Set the set of Group authorized to read this archive.
        Parameters:
        groupSet - a set of Group.
        Since:
        jcms-6.0
      • getAuthorizedGroupIds

        public java.lang.String getAuthorizedGroupIds()
      • setAuthorizedGroupIds

        public void setAuthorizedGroupIds​(java.lang.String authorizedGroupIds)
      • hasAnyReadRights

        public boolean hasAnyReadRights()
        Tests if this archive has member or group read rights.
        Returns:
        true if there are member or group read rights.
        Since:
        jcms-6.0
      • getReadRightsString

        public java.lang.String getReadRightsString​(int max)
        This convenient method returns a String displaying group/member read rights (eg if this publication is restricted to g1, g2, m1, m2 and m3, getReadRightsString(3) will return "g1, g2, m1, ...")
        Parameters:
        max - how many group/member to display
        Returns:
        a String
        Since:
        jcms-6.0
      • getOriginalId

        public java.lang.String getOriginalId()
      • setOriginalId

        public void setOriginalId​(java.lang.String originalId)
      • getOriginalType

        public short getOriginalType()
      • setOriginalType

        public void setOriginalType​(short originalType)
      • getOriginalTypeLabel

        public java.lang.String getOriginalTypeLabel()
      • setOriginalTypeLabel

        public void setOriginalTypeLabel​(java.lang.String originalTypeLabel)