Class Publication

    • Field Detail

      • PUBLICATION_WFNOTE

        public static final java.lang.String PUBLICATION_WFNOTE
        See Also:
        Constant Field Values
      • CTX_PSTATUS_UPDATE

        public static final java.lang.String CTX_PSTATUS_UPDATE
        See Also:
        Constant Field Values
      • ACL_CAN_ATTACH_WS

        public static final java.lang.String ACL_CAN_ATTACH_WS
        See Also:
        Constant Field Values
      • ATTACHWS_CHECK_PUB_RIGHTS_PROP

        protected static final java.lang.String ATTACHWS_CHECK_PUB_RIGHTS_PROP
        See Also:
        Constant Field Values
      • mainLanguage

        protected java.lang.String mainLanguage
      • title

        protected java.lang.String title
      • titleML

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

        protected java.util.Date pdate
      • edate

        protected java.util.Date edate
      • sdate

        protected java.util.Date sdate
      • adate

        protected java.util.Date adate
      • udate

        protected java.util.Date udate
      • majorVersion

        protected int majorVersion
      • minorVersion

        protected transient int minorVersion
      • pstatus

        protected int pstatus
      • mergeDate

        protected java.util.Date mergeDate
      • mergeId

        protected java.lang.String mergeId
      • templates

        protected java.lang.String[] templates
      • categories

        protected Category[] categories
      • categorySet

        protected transient java.util.TreeSet<Category> categorySet
      • authorizedMemberSet

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

        protected java.util.HashSet<java.lang.String> authorizedMemberSetDBID
      • authorizedGroupSet

        protected java.util.TreeSet<Group> authorizedGroupSet
      • updateMemberSet

        protected java.util.TreeSet<Member> updateMemberSet
      • updateGroupSet

        protected java.util.TreeSet<Group> updateGroupSet
      • restrictUpdateRights

        protected boolean restrictUpdateRights
      • classificationLevel

        protected int classificationLevel
      • isTracked

        protected boolean isTracked
      • readAck

        protected boolean readAck
      • friendlyURLSet

        protected java.util.TreeSet<java.lang.String> friendlyURLSet
      • roleMap

        protected java.util.HashMap<java.lang.String,​java.util.TreeSet<Member>> roleMap
      • workflowId

        protected java.lang.String workflowId
      • attachWorkspaceSet

        protected java.util.Set<Workspace> attachWorkspaceSet
      • wfExpressAlarmEntry

        protected transient AlarmEntry wfExpressAlarmEntry
      • wfReminderAlarmEntry

        protected transient AlarmEntry wfReminderAlarmEntry
      • weakDataImage

        protected transient java.lang.String weakDataImage
      • mainInstanceId

        protected transient java.lang.String mainInstanceId
      • workspaceId

        protected transient java.lang.String workspaceId
      • hasNoReadRightsDBData

        protected transient boolean hasNoReadRightsDBData
      • hasNoReadRightsDBDataInitialized

        protected transient boolean hasNoReadRightsDBDataInitialized
      • readerCount

        protected transient int readerCount
      • voteScore

        protected transient int voteScore
      • voteCount

        protected transient int voteCount
      • hasAttachWS

        protected transient boolean hasAttachWS
      • dbFriendlyURLSet

        protected transient java.util.Set<java.lang.String> dbFriendlyURLSet
      • dbFriendlyURLSetInit

        protected transient boolean dbFriendlyURLSetInit
      • extendedReadRightsDBData

        protected transient boolean extendedReadRightsDBData
      • SYNC_ATTACH_WORKSPACE_MEDIA_ENABLED_PROP

        protected static final java.lang.String SYNC_ATTACH_WORKSPACE_MEDIA_ENABLED_PROP
        See Also:
        Constant Field Values
    • Constructor Detail

      • Publication

        public Publication()
      • Publication

        public Publication​(Publication other)
    • Method Detail

      • init

        public void init​(Member author,
                         Workspace ws)
        This method initialise the object with default values for the given workspace:
        • Default categories
        • Default Authorized groups
        • Default Pstatus
        • Given Workspace
        • Given Author and opAuthor

        It should be called after constructor and before setting parameters. Handlers already set theses parameters. This is a convenient method for external developpements.

        Parameters:
        author - the Author of the publication
        ws - the workspace of the publication
        Since:
        jcms-5.6.0
      • getAllWikiText

        public java.lang.String getAllWikiText()
        Returns a String which contains the concatenation of all the wiki fields.
        Returns:
        a String which contains the concatenation of all the wiki fields.
        Since:
        jcms-5.5.0
      • getAllWysiwygText

        public java.lang.String getAllWysiwygText()
        Returns a String which contains the concatenation of all the wysiwyg fields.
        Returns:
        a String which contains the concatenation of all the wysiwyg fields.
        Since:
        jcms-5.5.0
      • getSearchStrings

        public java.lang.String[] getSearchStrings()
        Searchable implementation
        Specified by:
        getSearchStrings in interface Searchable
        Returns:
        an array of Strings which contains only one string which is the concatenation of all the searchable string of this publication.
        See Also:
        Searchable.getSearchStrings()
      • hasCategory

        public boolean hasCategory​(Category cat)
        Test if a publication references a given category.
        Parameters:
        cat - the category to be tested
        Returns:
        true if this publication has this category.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Data
        Returns:
        the title of the publication
      • importXml

        public void importXml​(org.jdom.Element elt,
                              ImportOptions options)
        Description copied from class: Data
        Fill this data with the values contains in the JDOM element.
        Overrides:
        importXml in class Data
        Parameters:
        elt - the JDOM element
        options - the ImportOptions
      • getImportConflictCopy

        public Publication getImportConflictCopy()
        Returns the conflict copy bound to this imported publication (or null if there is no conflict copy).
        Returns:
        the conflict copy bound to this imported publication (or null if there is no conflict copy).
        Since:
        jcms-5.7.2
      • hasImportConflict

        public boolean hasImportConflict()
        Returns true if this imported publication has a conflict copy.
        Returns:
        true if this imported publication has a conflict copy.
        Since:
        jcms-5.7.2
      • isImportConflictCopy

        public boolean isImportConflictCopy()
        Returns true if this publication is an import conflict copy.
        Returns:
        true if this publication is an import conflict copy.
        Since:
        jcms-5.7.2
      • setImportConflictCopy

        public void setImportConflictCopy​(boolean v)
        Set the value of isImportConflictCopy.
        Parameters:
        v - Value to assign to isImportConflictCopy.
        Since:
        jcms-5.7.2
      • importMarkAsMerged

        public void importMarkAsMerged​(Member opAuthor)
        Merges all the import extra data (import date, import version, ....) of the most recent conflict copy with the original. Then, removes all the conflit copies.
        Parameters:
        opAuthor - the author of the operation
        Since:
        jcms-5.7.2
      • importOverrideAndUpdate

        public void importOverrideAndUpdate​(Member opAuthor)
        Ignores all the local changes and replaces the local imported data with the conflict copy.
        Parameters:
        opAuthor - the author of the operation.
        Since:
        jcms-5.7.2
      • importConvertToLocal

        public void importConvertToLocal​(Member opAuthor)
        Converts this imported publication to a local data
        Parameters:
        opAuthor - the author of the operation
        Since:
        jcms-5.7.2
      • removeImportMetadata

        public void removeImportMetadata()
        Remove all the import metadata on this publication
        Since:
        jcms-5.7.3
      • computeSignature

        @Deprecated
        public java.lang.String computeSignature()
        Deprecated.
        use #computeSignature(boolean, boolean)
        Compute the signature (MD5) of this publication. Common fields are ignored.
        Returns:
        the signature of this publication.
        Since:
        jcms-5.7.2
        See Also:
        computeSignature(boolean, boolean)
      • computeSignature

        public java.lang.String computeSignature​(boolean includePublicationFields,
                                                 boolean hash)
        Compute the signature of this publication.
        Parameters:
        includePublicationFields - if true add the common publication fields (author, pdate, categories, ...). Computed fields (cdate, mdate, udate, minorVersion) are skipped.
        hash - if true hash (MD5) the signature otherwise return the complete string of the signature.
        Returns:
        the signature of this publication.
        Since:
        jcms-6.2.0
      • exportXmlField

        public void exportXmlField​(java.lang.StringBuffer sb,
                                   int indentLevel)
        Description copied from class: Data
        Fills the given StringBuffer with Xml export of fields of this data.
        Overrides:
        exportXmlField in class Data
        Parameters:
        sb - the StringBuffer
        indentLevel - the indent level
      • exportXmlRelated

        protected void exportXmlRelated​(java.lang.StringBuffer sb,
                                        java.lang.String related,
                                        int indentLevel)
        Overrides:
        exportXmlRelated in class Data
      • getCurrentWorkerSet

        public java.util.Set<Member> getCurrentWorkerSet()
        Returns the Set of member which will be current workers on this state of workflow (empty set if no specific worker are available)
        Returns:
        the Set of member which will be current workers on this state of workflow (empty set if no specific worker are available)
      • getDocumentLinkSet

        public java.util.Set<FileDocument> getDocumentLinkSet()
        Returns all the FileDocument instance (and subclass) targeted by this Publication through its link fields and through wiki and wysiwyg field.

        Included in results:

        • both JStore and DBData referenced by this Publication are supported,
        • all values referenced in FileDocument fields (or subclass) declared in the Type Editor for this object's type,
        • all FileDocument instance (and subclass) referenced in wiki and wysiwyg field of this publication

        This method is supported on DBData, it can be invoked on both JStore or DBData objects.

        See online documentation on data links and referrers : https://community.jalios.com/doc/referrer

        Returns:
        the set of documents attached to this publication.
        Since:
        jcms-6.0.1
        See Also:
        getLinkDataSet(Class)
      • getAllFilePath

        public java.util.Set<java.lang.String> getAllFilePath()
        Gives the set of all relatives path to all kind (image, media) of files linked from the given publication.
        Returns:
        a not null set of all relative path to linked files.
        Since:
        JCMS-6.1
      • getTypeLabel

        public java.lang.String getTypeLabel​(java.lang.String lang)
        Returns the label of the type of this publication.
        Parameters:
        lang - the language
        Returns:
        the label of the type of this publication.
        Since:
        jcms-5.5.0
      • getTypeFieldLabel

        public java.lang.String getTypeFieldLabel​(java.lang.String fieldName,
                                                  java.lang.String lang)
        Returns the localized label of the given field of the given publication.
        Parameters:
        fieldName - the name of the field
        lang - the language
        Returns:
        the localized label of the given field of the given publication.
        Since:
        jcms-9.0.3
        See Also:
        Channel.getTypeFieldLabel(Class, String, String)
      • getVersionString

        public java.lang.String getVersionString()
        Returns the current version (major.minor) of this publication.
        Returns:
        the current version (major.minor) of this publication.
        Since:
        jcms-5.7.0
      • majorUpdate

        public void majorUpdate()
        Increments the major version
        Since:
        jcms-5.7.0
      • toFullString

        public java.lang.String toFullString()
        Overrides:
        toFullString in class Data
        Returns:
        a debug string
      • toCSV

        public java.lang.String toCSV​(java.lang.String lang)
        Returns a CSV view of this object
        Overrides:
        toCSV in class Data
        Parameters:
        lang - the output language
        Returns:
        a CSV view of this object
        Since:
        jcms-5.0.0
      • getCSVHeader

        public static java.lang.String getCSVHeader​(java.lang.String lang)
        Returns the CSV header of this object
        Parameters:
        lang - the output language
        Returns:
        the CSV header of this object
        Since:
        jcms-5.0.0
      • getAbstract

        public java.lang.String getAbstract()
        Returns the abstract of this publication in the channel's main language.
        Returns:
        the abstract of this publication in the channel's main language.
      • getAbstract

        public java.lang.String getAbstract​(java.lang.String lang,
                                            boolean useDefault)
        Returns the abstract of this publication.
        Parameters:
        lang - the user language (ISO-639 language code)
        useDefault - should the default language be used
        Returns:
        the abstract of this publication.
      • getAbstract

        public java.lang.String getAbstract​(java.lang.String lang)
        Returns the abstract of this publication.
        Parameters:
        lang - the user language
        Returns:
        the abstract of this publication.
      • getAbstractML

        public java.util.HashMap<java.lang.String,​java.lang.String> getAbstractML()
        Returns the map containing abstracts of this publication in all language but the channel's main language.
        Returns:
        the map with ISO-639 language code as the key and abstract as the value, never return null.
        Since:
        jcms-6.0.0
      • setAbstract

        public void setAbstract​(java.lang.String lang,
                                java.lang.String value)
        Convenient method to set the value of the Abstract field in any language (default site language or any other).
        depending on the specified language.
        Parameters:
        lang - the language (ISO 639 code) in which to set the value
        value - the value to set.
        Since:
        jcms-7.0.0
      • setAbstract

        public void setAbstract​(java.lang.String value)
        Set the value of the Abstract field in the main language (default site language or any other).
        Parameters:
        value - the value to set.
        Since:
        jcms-7.0.0
      • getAbstractAsText

        public java.lang.String getAbstractAsText​(java.util.Locale locale)
        Returns the abstract as raw text (no html or wiki).
        Parameters:
        locale - Locale used :
        • to retrieve the abstract field value in the corresponding language
        • to use for rendering (wiki or JHTML) before HTML,
        Default site locale/language is used if null is specified.

        Security warning: the returned value is raw text in which special HTML characters are not entity encoded. You MUST encode the returned value using the encoding appropriate to your ouput (HTML, JSON, XML, etc)

        Returns:
        the abstract as raw text (No html or wiki)
        Since:
        jcms 10.0.1 / JCMS-6464
      • clearTransientIndex

        public void clearTransientIndex()
        Clear all the transient fields that contains indexes. This method is typically called after cloning a publication.
      • setWorkflow

        public void setWorkflow​(Workflow workflow)
      • initCopy

        public void initCopy​(Member newAuthor)
        Initialize this publication once it has been cloned for a copy (eg by duplicate.jsp)
        Parameters:
        newAuthor - the author of this publication
        Since:
        jcms-4.0.2
      • discardCopy

        public void discardCopy​(Publication copy)
        This method is called when the creation of copy or a work copy of this publication has failed. It is intended to perform cleaning operations.
        Parameters:
        copy - the copy which has been discarded.
        Since:
        jcms-8.0.0
      • createCopy

        public Publication createCopy​(Member mbr)
        Creates a copy from this publication
        Parameters:
        mbr - the author of the copy
        Returns:
        a (stored) copy of this publication.
        Since:
        jcms-5.5.0
        See Also:
        createCopy(Member, Map)
      • createCopy

        public Publication createCopy​(Member mbr,
                                      java.util.Map context)
        Creates a copy from this publication
        Parameters:
        mbr - the author of the copy
        context - the context
        Returns:
        a (stored) copy of this publication.
        Since:
        jcms-10.0.6
      • createWorkCopy

        public Publication createWorkCopy​(Member mbr)
        Creates a work copy for this publication
        Parameters:
        mbr - the author of the work copy
        Returns:
        a (stored) work copy of this publication. Returns null if the member cannot create a work copy.
        Since:
        jcms-5.5.0
        See Also:
        createWorkCopy(Member, Map)
      • createWorkCopy

        public Publication createWorkCopy​(Member mbr,
                                          java.util.Map context)
        Creates a work copy for this publication
        Parameters:
        mbr - the author of the work copy
        context - the context
        Returns:
        a (stored) work copy of this publication. Returns null if the member cannot create a work copy.
        Since:
        jcms-10.0.6
      • getDescendantCategorySet

        public java.util.TreeSet<Category> getDescendantCategorySet​(Category parent)
        Return the set of category of this publication which are the descendant category of a given parent category. The set is ordered according the Category.OrderComparator. This methods only returns public categories (ie without read rights).
        Parameters:
        parent - the parent category
        Returns:
        a set of category.
      • getDescendantCategorySet

        public java.util.TreeSet<Category> getDescendantCategorySet​(Category parent,
                                                                    boolean includingParent)
        Return the set of category of this publication which are the descendant category of a given parent category, including the given parent category in case the parameter includingParent is true. The set is ordered according the Category.OrderComparator. This methods only returns public categories (ie without read rights).
        Parameters:
        parent - the parent category
        includingParent - true if the parent has to be included in the set of tested categories
        Returns:
        a set of category.
      • getDescendantCategorySet

        public java.util.TreeSet<Category> getDescendantCategorySet​(Category parent,
                                                                    boolean includingParent,
                                                                    Member member)
        Return the set of category of this publication which are descendant of given parent category, including the given parent category in case the parameter includingParent is true.

        Check category read rights for the given member.

        The set is ordered according the Category.OrderComparator using current userLang (see Channel.getCurrentUserLang().

        Parameters:
        parent - the parent category
        includingParent - true if the parent has to be included in the set of tested categories
        member - if not null, checks category read rights for this member
        Returns:
        a set of category.
        Since:
        jcms-4.1
      • getFirstDescendantCategory

        public Category getFirstDescendantCategory​(Category parent)
        This convenient method returns the first category of the set returned by getDescendantCategorySet. This methods only returns a public category (ie without read rights).
        Parameters:
        parent - the parent category
        Returns:
        the first category (or null if none)
      • getFirstDescendantCategory

        public Category getFirstDescendantCategory​(Category parent,
                                                   boolean includingParent)
        This convenient method returns the first category of the set returned by getDescendantCategorySet, including the parent in case parameter includingParent is true and the current publication has parent as category. This methods returns a public category (ie without read rights).
        Parameters:
        parent - the parent category
        includingParent - true if the category membership test must be made on parent too
        Returns:
        the first category (or null if none)
      • getFirstDescendantCategory

        public Category getFirstDescendantCategory​(Category parent,
                                                   boolean includingParent,
                                                   Member member)
        This convenient method returns the first category of the set returned by getDescendantCategorySet, including the parent in case parameter includingParent is true and the current publication has parent as category. Check category read rights for the given member.
        Parameters:
        parent - the parent category
        includingParent - true if the category membership test must be made on parent too
        member - if not null, checks if the category read rights for this member
        Returns:
        the first category (or null if none)
        Since:
        jcms-4.1
      • containsCategory

        public boolean containsCategory​(Category category)
        This convenient method returns true if the publication contains a given category.
        Parameters:
        category - the category
        Returns:
        true if the publication contains the given category, false otherwise.
      • hasWeakReferrers

        public boolean hasWeakReferrers()
        Returns true if this publication has weak referrers.
        Returns:
        true if this publication has weak referrers.
        Since:
        jcms-5.5.0
      • getWeakReferrerSet

        public java.util.Set<Publication> getWeakReferrerSet()
        Returns the set of weak referrers.

        Included in results:

        • JStore Publication instance that references this Publication through a weak a wiki or wysiwyg field.

        Excluded from results (non exhaustive list):

        • DBData.

        This method is NOT supported on DBData, it will only return results when invoked on JStore objects.

        DO NOT alter the returned set, clone prior modification.

        See online documentation on data links and referrers : https://community.jalios.com/doc/referrer

        Returns:
        the set of weak referrers.
        Since:
        jcms-5.5.0
        See Also:
        getDocumentLinkSet(), getLinkDataSet(Class)
      • addWeakReferrer

        public void addWeakReferrer​(Publication referrer)
        Add a weak referrer.
        Parameters:
        referrer - the weak referrer to be added.
        Since:
        jcms-5.5.0
      • removeWeakReferrer

        public void removeWeakReferrer​(Publication referrer)
        Remove a weak referrer.
        Parameters:
        referrer - the weak referrer to be removed.
        Since:
        jcms-5.5.0
      • getExternalLinkSet

        public java.util.Set<java.lang.String> getExternalLinkSet()
        Returns all the external link contains in this publication. An external link is an absolute URL contained in an URL field, a wiki field or a wysiwyg field. URLs of the site are exclude. This method is overridden by type having URL fields.
        Returns:
        all the external link contains in this publication.
        Since:
        jcms-5.5.0
      • canBeReadBy

        public final boolean canBeReadBy​(Member member,
                                         boolean searchInGroups)
        Check if a member can read this publication.
        Parameters:
        member - the member to check
        searchInGroups - if true check if one of the group this member belongs to is authorized to read this publication.
        Returns:
        true if the member can read this publication
        Since:
        jcms-2.1
      • canBeReadBy

        public final boolean canBeReadBy​(Member member,
                                         boolean searchInGroups,
                                         RightInfo rightInfo)
        Checks if the specified member is authorized to read this Publication.

        This method is the implementation of Data read right control for Publication.

        Overrides:
        canBeReadBy in class Data
        Parameters:
        member - the member to check (may be null for anonymous user)
        searchInGroups - set to true to check for read right authorization using Member's group(s).
        rightInfo - a RightInfo instance in which explanation of read right authorization acceptance or refusal will be indicated. Value is required and cannot be null.
        Returns:
        true if the member can read this Publication, false otherwise
        Since:
        jcms-10.0.0
      • internalCanBeReadBy

        protected final boolean internalCanBeReadBy​(Member member,
                                                    boolean searchInGroups,
                                                    RightInfo rightInfo)
      • isUserContent

        public boolean isUserContent()
        Returns true if this data is User Content.
        Returns:
        true if this data is an instance of UserContent.
        Since:
        jcms-6.0.0
      • isUserContentType

        public static boolean isUserContentType​(java.lang.Class<?> clazz)
        Checks if the given class is a "User Content" That means a Publication not manage by JCMS workers.
        Parameters:
        clazz - the working class
        Returns:
        boolean true if it is a UGC Publication
        Since:
        jcms-6.0.0
      • canBeReadBy

        @Deprecated
        public final boolean canBeReadBy​(Group group)
        Deprecated.
        since JCMS-8577
        Checks if a group can read this publication.
        Parameters:
        group - the group to check
        Returns:
        true if the group can read this publication
        Since:
        jcms-2.1
      • canBeReadBy

        @Deprecated
        public final boolean canBeReadBy​(Group group,
                                         RightInfo rightInfo)
        Deprecated.
        since JCMS-8577
        Checks if a group can read this publication.
        Parameters:
        group - the group to check
        rightInfo - The RightInfo
        Returns:
        true if the group can read this publication
      • isAudienced

        public boolean isAudienced()
        Check if this publication is Audienced.
        This methods directly calls RightPolicy.isAudienced(Publication).
        Returns:
        true if this publication is Audienced.
        Since:
        jcms-5.5.0
        See Also:
        RightPolicy.isAudienced(Publication)
      • getAudiencedRightsString

        public java.lang.String getAudiencedRightsString​(java.lang.String userLang,
                                                         int max)
        This convenient method returns a String displaying categories used by audience right (eg if this publication is restricted to member, g2, m1, m2 and m3, getReadRightsString(3) will return "g1, g2, m1, ...")
        Parameters:
        userLang - the user language
        max - how many group/member to display
        Returns:
        a String
        Since:
        jcms-5.5.0
      • hasAnyReadRights

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

        public boolean hasNoReadRights()
        Tests if this publication has NO member read rights AND NO group read rights.
        Returns:
        true if there are NO member read rights AND NO group read rights.
        Since:
        jcms-5.0.4
      • getHasNoReadRights

        public boolean getHasNoReadRights()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the value of hasNoReadRights()
        Since:
        jcms-6.2.0
      • setHasNoReadRights

        public void setHasNoReadRights​(java.lang.Boolean b)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        b - the value
        Since:
        jcms-9.0.2
      • getExtendedReadRights

        public boolean getExtendedReadRights()
        Checks if this DB publication has been marked as having its read right potentially extended custom right policy.
        Returns:
        true if publication read rights are potentially extended, false otherwise (false is the default value)
        Since:
        10.0.8 / JCMS-10038
        See Also:
        setExtendedReadRights(Boolean)
      • setExtendedReadRights

        public void setExtendedReadRights​(java.lang.Boolean extendedRights)
        Indicate that this DB publication has its read rights potentially extended by a custom right policy.

        Set to true, in a custom DataController, when your custom RightPolicyFilter wants to grant read right beyond the explicit read rights specified through getAuthorizedGroupSet() and getAuthorizedMemberSet().
        For performance reason, you should set to true only when getAuthorizedGroupSet() or getAuthorizedMemberSet() have been set.

        Parameters:
        extendedRights - true to extend, false or null otherwise (false is the default value)
        Since:
        10.0.8 / JCMS-10038
      • 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, ...")

        The returned string is properly encoded for use in HTML attribute.

        Parameters:
        max - how many group/member to display
        Returns:
        a String
        Since:
        jcms-4.0
      • isPublic

        public boolean isPublic()
        Returns true is this publication can be read by any one.

        On a public site, a publication is considered public if it can be read by an anonymous user.
        On a private site, a publication is considered public if it the only reason it would be refused to an anonymous user is because the site is private.

        Returns:
        true is this publication is public, false otherwise
        Since:
        jcms-6.0.1
      • getMainInstance

        public Publication getMainInstance()
        If this publication is a work copy then return the main instance
        Returns:
        the main instance
        Since:
        jcms-4.0
        See Also:
        isWorkCopy()
      • setMainInstance

        public void setMainInstance​(Publication mainInstance)
        If this publication is a work copy then set it's main instance
        Parameters:
        mainInstance - the main instance
        Since:
        jcms-4.0
      • getMainInstanceId

        public java.lang.String getMainInstanceId()
      • setMainInstanceId

        public void setMainInstanceId​(java.lang.String v)
      • isWorkCopy

        public boolean isWorkCopy()
        Checks if this publication is a working copy.

        A publication is a working copy when a non-null publication is referenced in the mainInstance field, indicating the original publication that was used to create the working copy.

        Returns:
        true if this publication is a working copy (it has a main instance), false if it not a working copy (it does not has a main instance)
        Since:
        jcms-4.0
        See Also:
        getMainInstance()
      • isInVisibleState

        public boolean isInVisibleState()
        Returns true if this publication is in a visible state
        Returns:
        true if this publication is in a visible state
        Since:
        jcms-4.0.2
        See Also:
        WFState.isVisible()
      • canBeArchived

        public ControllerStatus canBeArchived​(Member mbr,
                                              java.util.Map context)
        Returns a ControllerStatus indicating if this publication can be archived or not
        Parameters:
        mbr - the member to check
        context - the context
        Returns:
        a ControllerStatus indicating if this publication can be archived or not
        See Also:
        CustomArchiveManager.canBeArchived(com.jalios.jcms.Publication, com.jalios.jcms.Member, Map)
      • canBeArchived

        public boolean canBeArchived​(Member mbr)
        Check if the publication can be archived by the given member.
        Parameters:
        mbr - the member
        Returns:
        true if this publication can be archived
        Since:
        jcms-4.1.1
        See Also:
        canBeArchived(Member, Map)
      • canCreateCopy

        public boolean canCreateCopy​(Member mbr)
        Returns true if the given member can create a copy of this publication
        Parameters:
        mbr - the member to be checked
        Returns:
        true if a given member can create a copy of this publication
        Since:
        jcms-5.5.0
      • canCreateCopy

        public boolean canCreateCopy​(Member mbr,
                                     boolean isWorkCopy)
        Returns true if the given member can create a copy of this publication
        Parameters:
        mbr - the member to be checked
        isWorkCopy - true if this is a workCopy
        Returns:
        true if a given member can create a copy of this publication
        Since:
        jcms-5.6.0
      • canCreateCopy

        public boolean canCreateCopy​(Member mbr,
                                     Workspace targetWorkspace)
        Returns true if the given member can create a copy of this publication
        Parameters:
        mbr - the member to be checked
        targetWorkspace - the workspace where the copy will be created
        Returns:
        true if a given member can create a copy of this publication
        Since:
        jcms-10.0.8
      • canCreateWorkCopy

        public boolean canCreateWorkCopy​(Member mbr)
        Returns true if the given member can create a work copy of this publication
        Parameters:
        mbr - the member to be checked
        Returns:
        true if a given member can create a work copy of this publication
        Since:
        jcms-4.0
      • canMergeWorkCopy

        public boolean canMergeWorkCopy​(Member mbr)
        Returns true if the given member can merge this work copy with it's main instance
        Parameters:
        mbr - the member to be checked
        Returns:
        true if the given member can merge this work copy with it's main instance
        Since:
        jcms-4.0
      • canBeEditedFieldByField

        public boolean canBeEditedFieldByField​(Member mbr)
        Returns true if this publication can be edited field by field on the front-office by the given member.
        Parameters:
        mbr - the member to check
        Returns:
        true if this publication can be edited field by field on the front-office by the given member.
        Since:
        jcms-5.5.0
      • canRequestUnlock

        public boolean canRequestUnlock​(Member mbr)
        Description copied from class: Data
        Returns true if the given member can request to unlock this data.
        Overrides:
        canRequestUnlock in class Data
        Parameters:
        mbr - the member who request the lock
        Returns:
        true if the given member can request to unlock this data.
      • getInternalWorkflow

        public Workflow getInternalWorkflow()
        Returns the Workflow bound internaly to this publication
        Returns:
        the Workflow bound internaly to this publication, if none null is return
        Since:
        jcms-7.1.0
      • getWorkflowId

        public java.lang.String getWorkflowId()
        Returns the internal workflow id if set (only worklow instance, not workflow associated with the publication class)
        Returns:
        the internal workflow id if set (only worklow instance, not workflow associated with the publication class)
      • setWorkflowId

        public void setWorkflowId​(java.lang.String wfId)
        Set the internal workflow id (if the id is null, workflow will be workflow associated with publication class)
        Parameters:
        wfId - the workflow id
      • getWorkflow

        public Workflow getWorkflow()
        Returns the Workflow bound to this publication
        Returns:
        the Workflow bound to this publication
        Since:
        jcms-4.0.1
      • getWFState

        public WFState getWFState()
        Returns the WFState bound to the current pstatus or null if none
        Returns:
        the WFState bound to the current pstatus or null if none
        Since:
        jcms-3.0
      • getWFStateLabel

        public java.lang.String getWFStateLabel​(java.lang.String lang)
        This convenient method returns the Workflow's state label this publication is in. The label is localized according the given language.
        Parameters:
        lang - the language used for localisation.
        Returns:
        the String of the label of the WFState bound to the current pstatus or "???" if unknown state.
        Since:
        jcms-5.7
        See Also:
        getWFState()
      • getWFStateLabelHtml

        public java.lang.String getWFStateLabelHtml​(java.lang.String lang)
        This convenient method returns the HTML Workflow's state label this publication is in. The label is localized according the given language.
        Parameters:
        lang - the language
        Returns:
        the HTML code of the label of the WFState bound to the current pstatus or "???" if unknown state.
        Since:
        jcms-7.0.0
      • getNextWFStateSet

        public java.util.Set<WFState> getNextWFStateSet​(Member member)
        Returns the set of WFState the given member can put this publication in, according the rights of the member, the workflow and the current state of the publication.
        Parameters:
        member - the member.
        Returns:
        the set of WFState the given member can put this publication in.
        Since:
        jcms-5.7.0
      • getPstatusAlarmEntry

        public AlarmEntry getPstatusAlarmEntry​(int pstatus)
        Get the alarmEntry bound to a given pstatus
        Parameters:
        pstatus - the pstatus
        Returns:
        an AlarmEntry
        Since:
        jcms-2.1
      • putPstatusAlarmEntry

        public void putPstatusAlarmEntry​(int pstatus,
                                         AlarmEntry alarmEntry)
        Bind an AlarmEntry to a given pstatus
        Parameters:
        pstatus - the pstatus
        alarmEntry - the AlarmEntry
        Since:
        jcms-2.1
      • removePstatusAlarmEntry

        public AlarmEntry removePstatusAlarmEntry​(int pstatus)
        Remove an AlarmEntry to a given pstatus
        Parameters:
        pstatus - the pstatus
        Returns:
        the removed AlarmEntry
        Since:
        jcms-2.1
      • checkLang

        public boolean checkLang​(java.lang.String lang)
        Check if the publication is available for the given language. Returns true if the title or the abstract of the publication is available in the given language.
        Parameters:
        lang - the language to check (lower-case two-letter codes as defined by ISO-639 (eg: en, fr, de, es, ...)
        Returns:
        true if the title or the abstract of the publication is available in the given language
        Since:
        jcms-4.0
      • getCategories

        public Category[] getCategories​(Member member)
        Returns the categories of the publication the member can read
        Parameters:
        member - the member to be checked
        Returns:
        the categories of the publication the member can read
        Since:
        jcms-4.1
      • getCategorySet

        public java.util.TreeSet<Category> getCategorySet()
        Returns the categories of this publication as a Set.

        Do not modify the returned value !! This method returns an internal index which is not stored. If you need to modify the categories of this publication, see methods setCategories(Category[]), addCategory(Category) or removeCategory(Category).
        This methods always returns a set with the exact same categories available through getCategories().

        Returns:
        a TreeSet of categories (never return null). DO NOT modify this set.
        Since:
        jcms-5.0.0
      • setCategorySet

        public void setCategorySet​(java.util.Set<Category> catSet)
        Replaces the current categories with this set of categories.
        Parameters:
        catSet - the new category set
        Since:
        jcms-5.7.2
      • addCategory

        public void addCategory​(Category cat)
        Add the given category to the categories of this publication
        Parameters:
        cat - the category to be added
        Since:
        jcms-5.0.0
      • removeCategory

        public void removeCategory​(Category cat)
        Remove the specified category from this publication's categories
        Parameters:
        cat - the category to be removed
        Since:
        jcms-5.6.2 jcms-5.7.1
      • updatePstatus

        public void updatePstatus​(Member author,
                                  int newPstatus,
                                  java.lang.String note)
        Change the pstatus of this publication, store it and generate a WFNote
        Parameters:
        author - the author of this update (ie the author of the WFNote)
        newPstatus - new value of pstatus
        note - the WFNote's comment
        Since:
        jcms-5.0.0
      • getWSTypeEntry

        public WSTypeEntry getWSTypeEntry​(Workspace wrkspc)
        This method return a WSTypeEntry for the given workspace in the current class. If workspace is null then the workspace of the publication will be used.
        Parameters:
        wrkspc - The working Workspace
        Returns:
        WSTypeEntry the TypeEntry
        Since:
        jcms-5.5.0
        See Also:
        Workspace.getWSTypeEntry(Class)
      • getWSTypeEntry

        public WSTypeEntry getWSTypeEntry()
        This method return a WSTypeEntry for the current workspace in the current class.
        Returns:
        WSTypeEntry the TypeEntry
        Since:
        jcms-6.0.0
        See Also:
        getWSTypeEntry(Workspace)
      • getDisplayTemplateFile

        @Deprecated
        public java.lang.String getDisplayTemplateFile()
        Deprecated.
        Must call instead getTemplatePath()
        Returns:
        see getTemplatePath()
      • getQueryTemplateFile

        @Deprecated
        public java.lang.String getQueryTemplateFile()
        Deprecated.
        Must call instead getTemplatePath()
        Returns:
        see getTemplatePath()
      • getDefaultTemplateUsage

        public java.lang.String getDefaultTemplateUsage()
        Returns the default template usage used to display the publication. This default template may change between Content and Portlets
        Returns:
        String the default usage
      • isDefaultTemplate

        public boolean isDefaultTemplate​(java.lang.String usage)
        Checks if the publication use a default template for the given usage
        Parameters:
        usage - the template usage
        Returns:
        boolean true if the publication use a default template for the given usage
      • getTemplate

        public java.lang.String getTemplate​(java.lang.String usage)
        Returns the template name for the given usage
        Parameters:
        usage - the template usage
        Returns:
        String the name of the template used
      • getTemplatePath

        public java.lang.String getTemplatePath​(JcmsJspContext ctxt)
        Returns the template path for the current context
        Parameters:
        ctxt - the JcmsJspContext
        Returns:
        String the path of the template used
      • getTemplatePath

        public java.lang.String getTemplatePath​(java.lang.String usage,
                                                boolean devModeChecks)
        Returns the template path for the given usage
        Parameters:
        usage - the template usage
        devModeChecks - perform developpement checks on template
        Returns:
        String the path of the template used
      • getTemplateEntry

        public TypeTemplateEntry getTemplateEntry​(java.lang.String usage,
                                                  boolean devModeChecks)
        Returns the TypeTemplateEntry matching the given parameters. It returns a default template if the given one does work.
        Parameters:
        usage - the template usage
        devModeChecks - perform developpement checks on template
        Returns:
        TypeTemplateEntry the matching templates
      • getTemplateEntry

        public static TypeTemplateEntry getTemplateEntry​(java.lang.String usage,
                                                         boolean devModeChecks,
                                                         java.lang.Class<? extends Data> clazz,
                                                         Workspace ws)
        Returns the TypeTemplateEntry matching the given parameters. It returns a default template if the given one does work.
        Parameters:
        usage - the template usage
        devModeChecks - perform developpement checks on template
        clazz - the template publication class
        ws - the workspace where to create the publication
        Returns:
        TypeTemplateEntry the matching templates
      • resolveTypeTemplateEntry

        protected static TypeTemplateEntry resolveTypeTemplateEntry​(WSTypeEntry wste,
                                                                    java.lang.String usage,
                                                                    java.lang.String[] templates)
        Returns TypeTemplateEntry matching given parameters.

        Internal mechanism:

        • may default usage on a more generic usage
        • will use default template if the template list is null
        Parameters:
        wste - the Type Description
        usage - the template usage
        templates - null or available templates
        Returns:
        TypeTemplateEntry
        See Also:
        TypeEntry.getFirstTemplateEntry(String, String[])
      • checkTemplateEntry

        protected static boolean checkTemplateEntry​(TypeTemplateEntry tte,
                                                    java.lang.String usage,
                                                    boolean devModeChecks,
                                                    java.lang.String label)
        Checks if the given TypeTemplateEntry is matching dev modes In developpement mode it throws exception if template is null or jsp is missing In production mode it returns default template if template is null but do not check if JSP template exists to improve performances.
        Parameters:
        tte - the TypeTemplateEntry to check
        usage - the usage
        devModeChecks - perform developpement checks on template
        label - String use for error message
        Returns:
        true if the TypeTemplateEntry match requirement
      • getTemplateEntrySet

        public java.util.Set<TypeTemplateEntry> getTemplateEntrySet()
        Returns a Set of TypeTemplateEntry matching current publication templates
        Returns:
        Set of TypeTemplateEntry
      • getTemplates

        public java.lang.String[] getTemplates()
        Get the value of templates.
        Returns:
        Value of templates.
      • setTemplates

        public void setTemplates​(java.lang.String[] v)
        Set the value of templates.
        Parameters:
        v - Value to assign to templates.
      • setTemplate

        public void setTemplate​(java.lang.String name)
      • updateTemplate

        protected java.lang.String[] updateTemplate​(java.lang.String name,
                                                    java.lang.String[] templates)
      • getFieldInMainLanguage

        public <T> T getFieldInMainLanguage​(T field,
                                            java.util.HashMap<java.lang.String,​T> fieldML)
        Retrieve the value of the specified multilingual field in the main language of the publication.

        This method MUST only be used for multilingual fields.

        Parameters:
        field - the field value in the site default language.
        fieldML - the multilingual map of the fields values in other languages.
        Returns:
        a field value or null if it could not be found in the publication's main language
        See Also:
        setMainLanguage(String)
      • 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.
      • getDataImage

        public java.lang.String getDataImage()
        Returns a data image of this publication based on the image contains in its wiki or wysiwyg fields.
        Overrides:
        getDataImage in class Data
        Returns:
        a data image of this publication based on the image contains in its wiki or wysiwyg fields.
        Since:
        JCMS-9.0.0
        See Also:
        Data.getDataImage()
      • invalidateWeakDataImage

        public void invalidateWeakDataImage()
      • getDataIcon

        public java.lang.String getDataIcon()
        Description copied from class: Data
        Returns source information for the icon associated to this Data, either a relative path or sprite classes name.

        If this method behavior has not been overriden by subclass, the default icon can be declared using property types.{Type}.icon, where {Type} is the short class name of the type concerned.

        • Either by specifying a relative image path :
          types.Article.icon: images/jalios/icon/abstract.gif 
        • or else by using a sprite icon :
          types.Article.icon: ss_sprite ss_date
        Overrides:
        getDataIcon in class Data
        Returns:
        a relative path (eg images/jalios/icon/abstract.gif) or sprite classes name (eg ss_sprite ss_date).
        See Also:
        Data.getDataIconHtml(String)
      • getDataIconTitle

        public java.lang.String getDataIconTitle​(java.lang.String lang)
        Description copied from class: Data
        Returns the icon's tooltip.

        If this method behavior has not been overriden by subclass, the default alternative text can be declared using language property types.{Type}.title, where {Type} is the short class name of the type concerned.

        Overrides:
        getDataIconTitle in class Data
        Parameters:
        lang - the user language.
        Returns:
        the title Html attribute for the IMG Html tag
        See Also:
        Data.getDataIconHtml(String)
      • getGenericThumbnail

        public java.lang.String getGenericThumbnail()
        Description copied from class: Data
        Returns a generic thumbnail for this Data. As defined by properties types.{short-class-name}.thumb.

        If no property was defined for the class of this Data, the thumbnail specified in property types.unknown.thumb is used.

        FileDocument uses its own implementation, see FileDocument.getGenericThumbnail().

        Overrides:
        getGenericThumbnail in class Data
        Returns:
        a thumbnail path relative to the webapp root, eg images/jalios/icons/data/article.gif
      • getDataName

        public java.lang.String getDataName​(java.lang.String language)
        Description copied from class: Data
        Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.
        • The Title (multi-language) for a Publication.
        • The Name (multi-language) for a Category.
        • The Name for a Group, a Member.
        • The Title (multi-language) for a Workspace.
        Can be seen as a smart multi-language toString(), but never returning null.
        Default behaviour is to return toFullString() of Data or empty string if toFullString is null.
        Overrides:
        getDataName in class Data
        Parameters:
        language - the language in which to return the name if multilang available for the data.
        Returns:
        title of Publication in given language or empty String if not specified.
        Since:
        jcms-5.1
        See Also:
        getTitle(String), Data.getDataName(String)
      • 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-4.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-4.0
      • getTitle

        public java.lang.String getTitle()
        Retrieve the title of this publication in the main site language.
        Returns:
        Value of title.
      • 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.
      • 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-4.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-4.0
      • setTitle

        public void setTitle​(java.lang.String lang,
                             java.lang.String value)
        Convenient method to set the value of the Title field in any language (default site language or any other).
        This method will set the proper field value (setTitle(String) or setTitleML(HashMap)) depending on the specified language.
        Parameters:
        lang - the language (ISO 639 code) in which to set the value
        value - the value to set.
        Since:
        jcms-5.7
      • getTitleMLE

        public java.lang.String getTitleMLE()
        Returns the encoded titleML.
        Returns:
        the encoded titleML.
        Since:
        jcms-10.0.0
      • setTitleMLE

        public void setTitleMLE​(java.lang.String v)
        Set the value for the encoded titleML
        Parameters:
        v - the encoded titleML
        Since:
        jcms-10.0.0
      • getPdate

        public java.util.Date getPdate()
        Retrieve the publication date of this publication.
        Returns:
        the publication Date or null if not available.
      • setPdate

        public void setPdate​(java.util.Date v)
        Set the publication date of this publication.
        Parameters:
        v - the Date to assign, can be null.
      • getEdate

        public java.util.Date getEdate()
        Retrieve the expiration date of this publication.
        Returns:
        the expiration Date or null if not available.
      • setEdate

        public void setEdate​(java.util.Date v)
        Set the expiration date of this publication.
        Parameters:
        v - the Date to assign, can be null.
      • getSdate

        public java.util.Date getSdate()
        Retrieve the sort date of this publication.
        Returns:
        the sort Date or null if not available.
        Since:
        jcms-4.0
      • setSdate

        public void setSdate​(java.util.Date v)
        Set the sort date of this publication.
        Parameters:
        v - the Date to assign, can be null.
        Since:
        jcms-4.0
      • getAdate

        public java.util.Date getAdate()
        Retrieve the archiving date of this publication.
        Returns:
        the archiving Date or null if not available.
        Since:
        jcms-4.1.1
      • setAdate

        public void setAdate​(java.util.Date v)
        Set the archiving date of this publication.
        Parameters:
        v - the Date to assign, can be null.
        Since:
        jcms-5.0.0
      • setUdate

        public void setUdate​(java.util.Date udate)
        Set the date of last major update.
        Parameters:
        udate - the date
        Since:
        jcms-5.7.0
      • getUdate

        public java.util.Date getUdate()
        Returns the date of last major update.
        Returns:
        the date of last major update.
        Since:
        jcms-5.7.0
      • getPstatus

        public int getPstatus()
        Get the value of pstatus.
        Returns:
        Value of pstatus.
      • setPstatus

        public void setPstatus​(int v)
        Set the value of pstatus.
        Parameters:
        v - Value to assign to pstatus.
      • isVersioned

        public boolean isVersioned()
        Returns true if the current Publication is versioned (is stored or is instance of HistorizedDBData)
        Returns:
        true if the current Publication is versioned (is stored or is instance of HistorizedDBData)
        Since:
        jcms-7.0.3
      • getMajorVersion

        public int getMajorVersion()
        Returns the major version.
        Returns:
        the major version.
        Since:
        jcms-5.7.0
      • setMajorVersion

        public void setMajorVersion​(int majorVersion)
        Set the major version.
        Parameters:
        majorVersion - the major version
        Since:
        jcms-5.7.0
      • getMinorVersion

        public int getMinorVersion()
        Returns the minor version. This field is not persistent. It is incremented each time the object is saved. It is reset when the major version is incremented (e.g. 1.0, 1.1, 1.2, 2.0, 2.1, ...)
        Returns:
        the minor version.
        Since:
        jcms-5.7.0
      • setMinorVersion

        public void setMinorVersion​(int minorVersion)
        Set the minor version.
        Parameters:
        minorVersion - the minor version.
        Since:
        jcms-5.7.0
      • setMergeDate

        public void setMergeDate​(java.util.Date mergeDate)
        Set the date of the last merge with a work copy
        Parameters:
        mergeDate - the merge date.
        Since:
        jcms-5.7.0
      • getMergeDate

        public java.util.Date getMergeDate()
        Returns the date of the last merge with a work copy.
        Returns:
        the date of the last merge with a work copy.
        Since:
        jcms-5.7.0
      • setMergeId

        public void setMergeId​(java.lang.String mergeId)
        Set the id of the work copy used for the last merge.
        Parameters:
        mergeId - the id of the work copy used for the last merge.
        Since:
        jcms-5.7.0
      • getMergeId

        public java.lang.String getMergeId()
        Returns the id of the work copy used for the last merge.
        Returns:
        the id of the work copy used for the last merge.
        Since:
        jcms-5.7.0
      • getCategories

        public Category[] getCategories()
        Retrieve the categories of this publication.
        Returns:
        an array of Category (can be null or empty).
      • setCategories

        public void setCategories​(Category[] cats)
        Set categories of this publication.
        Parameters:
        cats - an array of Category (can be null or empty).
      • getCatIdSet

        public java.util.Set<java.lang.String> getCatIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the category id set
        Since:
        jcms-6.2.0
      • setCatIdSet

        public void setCatIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the category id set
        Since:
        jcms-6.2.0
      • getAllCatIdSet

        public java.util.Set<java.lang.String> getAllCatIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the "all category" id set
        Since:
        jcms-6.2.0
      • setAllCatIdSet

        public void setAllCatIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the "all category" id set
        Since:
        jcms-6.2.0
      • getVoteScore

        public int getVoteScore()
      • setVoteScore

        public void setVoteScore​(java.lang.Integer voteScore)
      • getVoteCount

        public int getVoteCount()
      • setVoteCount

        public void setVoteCount​(java.lang.Integer voteCount)
      • getPopularity

        public int getPopularity()
        Returns:
        the popularity of current Publication
        Since:
        jcms-8.0.0
      • getVoteValue

        public int getVoteValue()
        Returns:
        the vote value based on property defined in jcms.prop ("vote.default-value") or the default value
        Since:
        jcms-8.0.0
      • recomputeScore

        public void recomputeScore()
        Recompute the score of the publication
        Since:
        jcms-8.0.0
      • canBeVotedBy

        public boolean canBeVotedBy​(Member mbr)
        Parameters:
        mbr - the Member
        Returns:
        true if given Member can vote on current Publication
        Since:
        jcms-8.0.0
      • isVotable

        public boolean isVotable()
        Returns:
        true if this Publication is votable
      • getWorkCopySet

        public java.util.Set<Publication> getWorkCopySet()
        Get the value of workCopySet.
        Returns:
        Value of workCopySet.
        Since:
        jcms-5.5.0
      • getAuthorizedMemberSet

        public java.util.Set<Member> getAuthorizedMemberSet()
        Get the set of Member and DBMember authorized to read this Publication.
        Returns:
        a set of Member.
        Since:
        jcms-2.1
      • getAuthorizedMemberSet

        public java.util.Set<Member> getAuthorizedMemberSet​(boolean queryDB)
        Get the set of Member authorized to read this Publication.

        DBMembers are also queried if queryDB parameter is true.

        Parameters:
        queryDB - weither to also query DBMember or not
        Returns:
        a set of Member.
        Since:
        jcms-10.0.1
      • setAuthorizedMemberSet

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

        protected void splitHybridCollections​(Data previousData)
        Description copied from class: Data
        This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
        Overrides:
        splitHybridCollections in class Data
        Parameters:
        previousData - the previous data (provided for update only)
      • cleanHybridCollections

        protected void cleanHybridCollections()
        Description copied from class: Data
        This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
        Overrides:
        cleanHybridCollections in class Data
      • getAuthorizedMemberSetDBID

        public java.util.HashSet<java.lang.String> getAuthorizedMemberSetDBID()
      • setAuthorizedMemberSetDBID

        public void setAuthorizedMemberSetDBID​(java.util.HashSet<java.lang.String> v)
      • addAuthorizedMember

        public void addAuthorizedMember​(Member mbr)
        Add an authorized member.
        Parameters:
        mbr - the member to be added.
        Since:
        jcms-5.5.0
      • removeAuthorizedMember

        public boolean removeAuthorizedMember​(Member mbr)
        Remove an authorized member.
        Parameters:
        mbr - the member to be removed.
        Returns:
        true if the set contained the specified member.
        Since:
        jcms-5.5.0
      • getAuthMbrIdSet

        public java.util.Set<java.lang.String> getAuthMbrIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        he authMbrIdSet
        Since:
        jcms-6.2.0
      • setAuthMbrIdSet

        public void setAuthMbrIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the set of authorized Member's id
        Since:
        jcms-6.2.0
      • getAuthorizedGroupSet

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

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

        public void addAuthorizedGroup​(Group grp)
        Add an authorized group
        Parameters:
        grp - the group to be added.
        Since:
        jcms-5.5.0
      • removeAuthorizedGroup

        public boolean removeAuthorizedGroup​(Group grp)
        Remove an authorized group.
        Parameters:
        grp - the group to be removed.
        Returns:
        true if the set contained the specified group.
        Since:
        jcms-5.5.0
      • getAuthGrpIdSet

        public java.util.Set<java.lang.String> getAuthGrpIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the authGrpIdSet
        Since:
        jcms-6.2.0
      • setAuthGrpIdSet

        public void setAuthGrpIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the set of authorized Group's id
        Since:
        jcms-6.2.0
      • getRestrictUpdateRights

        public boolean getRestrictUpdateRights()
        Returns true if the update rights of this publication are restricted.
        Returns:
        true if the update rights of this publication are restricted.
        Since:
        jcms-10.0.5
      • setRestrictUpdateRights

        public void setRestrictUpdateRights​(java.lang.Boolean v)
        If true, restrict the update rights to the members declared in updateMemberSet and updateGroupSet.
        Parameters:
        v - the value
        Since:
        jcms-10.0.5
      • getUpdateMemberSet

        public java.util.Set<Member> getUpdateMemberSet()
        Get the set of Member authorized to update this Publication.
        Returns:
        a set of Member.
        Since:
        jcms-2.1
      • setUpdateMemberSet

        public void setUpdateMemberSet​(java.util.TreeSet<Member> memberSet)
        Set the Members explicitely authorized to update this instance.
        Parameters:
        memberSet - a set of Member.
        Since:
        jcms-2.1
      • getUpdateMbrIdSet

        public java.util.Set<java.lang.String> getUpdateMbrIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        he authMbrIdSet
        Since:
        jcms-9.0.2
      • setUpdateMbrIdSet

        public void setUpdateMbrIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the set of authorized Member's id
        Since:
        jcms-9.0.2
      • getUpdateGroupSet

        public java.util.Set<Group> getUpdateGroupSet()
        Get the set of Group authorized to update this Publication.
        Returns:
        a set of Group.
        Since:
        jcms-2.1
      • setUpdateGroupSet

        public void setUpdateGroupSet​(java.util.TreeSet<Group> groupSet)
        Set the Groups whose members are explicitely authorized to update this instance.
        Parameters:
        groupSet - a set of Group.
        Since:
        jcms-2.1
      • getUpdateGrpIdSet

        public java.util.Set<java.lang.String> getUpdateGrpIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the updateGrpIdSet
        Since:
        jcms-9.0.2
      • setUpdateGrpIdSet

        public void setUpdateGrpIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the set of authorized Group's id
        Since:
        jcms-9.0.2
      • getClassificationLevel

        public int getClassificationLevel()
        Retrieve the classification level of this publication.

        When creating new publication, if classification level was not explicitely specified, the classification level of the publication's workspace is automatically used.

        Returns:
        a value from 0 for unclassified publication to ClassificationManager.getMaximumLevel() (included) for highly classified publication
        Since:
        10.0.8 / JCMS-10746
        See Also:
        ClassificationManager
      • setClassificationLevel

        public void setClassificationLevel​(java.lang.Integer level)
        Set the classification level of this publication.
        Parameters:
        level - a value from 0 for unclassified publication to ClassificationManager.getMaximumLevel() (included) for highly classified publication. 0 if used if null is specified.
        Since:
        10.0.8 / JCMS-10746
        See Also:
        ClassificationManager
      • isClassified

        public boolean isClassified()
        Check if this publication is classified.
        Returns:
        true if this publication has a its effective classification level higher than 1 (and classification is enabled), false otherwise
        Since:
        10.0.8 / JCMS-10746
        See Also:
        getEffectiveClassificationLevel()
      • supportsClassification

        public final boolean supportsClassification()
        Check if this publication supports being classified.
        Returns:
        false if this publication is a PortalElement, true for all other publication
        Since:
        10.0.8 / JCMS-10746
      • isTracked

        public boolean isTracked()
        Check if a the publication's readers are tracked
        Returns:
        true if the publication's readers are tracked
        Since:
        jcms-4.0.2
      • setTracked

        public void setTracked​(boolean bool)
        Set the track flag
        Parameters:
        bool - a boolean
        Since:
        jcms-4.0.2
      • getReadAck

        public boolean getReadAck()
        Returns true if read acknowledge is mandatory on this publication.
        Returns:
        true if read acknowledge is mandatory on this publication.
        Since:
        jcms-10.0.5
      • setReadAck

        public void setReadAck​(java.lang.Boolean v)
        If true, read acknowledge is mandatory on this publication.
        Parameters:
        v - the value
        Since:
        jcms-10.0.5
      • canBeFollowedBy

        public boolean canBeFollowedBy​(Member mbr)
        Returns true if the given member can follow this publication
        Parameters:
        mbr - the member
        Returns:
        true if the given member can follow this publication
        Since:
        jcms-7.0.0
      • addFollower

        public void addFollower​(Member mbr)
        Adds a follower for this publication.
        Parameters:
        mbr - the follower
        Since:
        jcms-7.0.0
      • removeFollower

        public void removeFollower​(Member mbr)
        Removes the given follower for this publication.
        Parameters:
        mbr - the follower
        Since:
        jcms-7.0.0
      • removeAllFollowers

        public void removeAllFollowers()
        Removes all the follower for this publication.
        Since:
        jcms-7.0.0
      • isFollowedBy

        public boolean isFollowedBy​(Member mbr)
        Returns true if the given member follows this publication.
        Parameters:
        mbr - the member to test
        Returns:
        true if the given member follows this publication.
        Since:
        jcms-7.0.0
      • getFollowerList

        public java.util.List<Member> getFollowerList​(boolean searchParents)
        Returns all the followers of this publication.
        Parameters:
        searchParents - if true search followers of the (TreeNode) parent of this publication
        Returns:
        all the followers of this publication.
        Since:
        jcms-7.0.0
      • notifyFollowers

        public void notifyFollowers​(Member opAuthor,
                                    java.util.Map context)
        Notify all the follower of this publication.
        Parameters:
        opAuthor - the member who sets off this notification. This member won't be notified.
        context - the context
        Since:
        jcms-7.0.0
      • getWorkspace

        public Workspace getWorkspace()
        Returns:
        Returns the workspace.
      • setWorkspace

        public void setWorkspace​(Workspace workspace)
        Parameters:
        workspace - The workspace to set.
      • getAttachWorkspaceSet

        public java.util.Set<Workspace> getAttachWorkspaceSet()
        Returns the attachWorkspaceSet
        Returns:
        the attachWorkspaceSet
        Since:
        jcms-10.0.0
      • setAttachWorkspaceSet

        public void setAttachWorkspaceSet​(java.util.Set<Workspace> attachWorkspaceSet)
        Set the attachWorkspaceSet
        Parameters:
        attachWorkspaceSet - the attachWorkspaceSet
        Since:
        jcms-10.0.0
      • getAttachWSIdSet

        public java.util.Set<java.lang.String> getAttachWSIdSet()
        Do not call this method. It is reserved for DBData mapping.
        Returns:
        the attachWSIdSet
        Since:
        jcms-10.0.0
      • setAttachWSIdSet

        public void setAttachWSIdSet​(java.util.Set<java.lang.String> idSet)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        idSet - the Set of Workspace id to use for attachWSIdSet
        Since:
        jcms-10.0.0
      • getHasAttachWS

        public boolean getHasAttachWS()
        Returns true if this publication is attached to other workspaces.
        Returns:
        true if this publication is attached to other workspaces.
        Since:
        jcms-10.0.0
      • setHasAttachWS

        public void setHasAttachWS​(java.lang.Boolean v)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        v - the hasAttachWS
        Since:
        jcms-10.0.0
      • getRoleMap

        public java.util.HashMap<java.lang.String,​java.util.TreeSet<Member>> getRoleMap()
        Returns:
        Returns the roleMap.
        Since:
        jcms-5.5.0
      • setRoleMap

        public void setRoleMap​(java.util.HashMap<java.lang.String,​java.lang.Object> roleMap)
        Parameters:
        roleMap - The roleMap to set
        Since:
        jcms-5.5.0
      • setRoleMemberSetMap

        public void setRoleMemberSetMap​(java.util.HashMap<java.lang.String,​java.util.TreeSet<Member>> roleMap)
      • setRoleMapStr

        public void setRoleMapStr​(java.lang.String str)
        Assigns the roleMap from the given encoded String (only used for DBData property mapping)
        Parameters:
        str - the encoded string.
        Since:
        jcms-7.0.1
      • getRoleMapStr

        public java.lang.String getRoleMapStr()
        Returns the encoded String from the current roleMap (only used for DBData property mapping)
        Returns:
        the encoded String from the current roleMap.
        Since:
        jcms-7.0.1
      • assignRole

        public void assignRole​(java.lang.String roleId,
                               Member mbr)
        Assigns a member to a role
        Parameters:
        roleId - the identifier of the WF role (e.g. "basic-validators")
        mbr - the member to be assigned to the role
        Since:
        jcms-5.5.0
      • assignRole

        public void assignRole​(java.lang.String roleId,
                               java.util.TreeSet<Member> mbrSet)
      • unassignRole

        public void unassignRole​(java.lang.String roleId)
        Unassigns a member to a role
        Parameters:
        roleId - the identifier of the WF role (e.g. "basic-validators")
        Since:
        jcms-5.5.0
      • unassignMember

        public void unassignMember​(Member mbr)
        Unassign a member from all the role he has been assigned to.
        Parameters:
        mbr - the member to be unassigned.
        Since:
        jcms-5.5.0
      • isRoleAssigned

        public boolean isRoleAssigned​(java.lang.String roleId)
        Determines whether there exists at least one member assigned to the given role
        Parameters:
        roleId - the WFRole ID to be checked
        Returns:
        true if there exists at least one member assigned to the given role
        Since:
        jcms-5.5.0
      • getMemberSetAssignedToRole

        public java.util.TreeSet<Member> getMemberSetAssignedToRole​(java.lang.String roleId)
        Returns the member bound to the given role.
        Parameters:
        roleId - the WFRole ID to be checked
        Returns:
        the member bound to the given role.
        Since:
        jcms-5.5.0
      • isInRole

        public boolean isInRole​(java.lang.String roleId,
                                Member mbr)
        Determines whether the given member can use the given role for this publication
        Parameters:
        roleId - the WFRole ID
        mbr - the member to be checked
        Returns:
        true if the member can use the given role
        Since:
        jcms-5.5.0
      • getFriendlyURLSet

        public java.util.TreeSet<java.lang.String> getFriendlyURLSet()
        Get friendly urls Set.
        Returns:
        a TreeSet of friendly url (String).
      • setFriendlyURLSet

        public void setFriendlyURLSet​(java.util.TreeSet<java.lang.String> v)
      • getDbFriendlyURLSet

        public java.util.Set<java.lang.String> getDbFriendlyURLSet()
      • setDbFriendlyURLSet

        public void setDbFriendlyURLSet​(java.util.Set<java.lang.String> v)
      • hasBeenReadBy

        public boolean hasBeenReadBy​(Member mbr)
        Check if the given member has read this publication
        Parameters:
        mbr - The member you want to test
        Returns:
        true if the member has read false instead
        Since:
        jcms-4.0.2
      • getReaderTracker

        public ReaderTracker getReaderTracker​(Member mbr)
        Returns the ReaderTracker for this publication and the given member.
        Parameters:
        mbr - the member
        Returns:
        the ReaderTracker for this publication and the given member.
        Since:
        jcms-10.0.5
      • getReaderTrackerList

        public java.util.List<ReaderTracker> getReaderTrackerList()
        Returns the reader list for the given publication.
        Returns:
        the reader list for the given publication.
        Since:
        jcms-6.0.0
      • getReaderCount

        public int getReaderCount()
        Returns:
        the number of reader for this publication
        Since:
        jcms-4.0.2
      • hasBeenReadAckBy

        public boolean hasBeenReadAckBy​(Member mbr)
        Returns true if the given member has confirmed the reading of this publication.
        Parameters:
        mbr - the member
        Returns:
        if the given member has confirmed the reading of the given publication.
        Since:
        jcms-10.0.5
      • getReadAckCount

        public int getReadAckCount()
        Returns the count of member who confirm the reading of this publication.
        Returns:
        the count of member who confirm the reading of this publication.
        Since:
        jcms-10.0.5
      • ackRead

        public void ackRead​(Member mbr)
        Confirm the read of this publication by the given member.
        Parameters:
        mbr - the member
        Since:
        jcms-10.0.5
      • setReaderCount

        public void setReaderCount​(int v)
        Do not call this method. It is reserved for DBData mapping.
        Parameters:
        v - the value
        Since:
        jcms-6.2.0
      • getAccessCount

        public int getAccessCount()
        Returns:
        the number of access for this publication
        Since:
        jcms-6.0.0
      • trackReader

        public void trackReader​(Member mbr)
        Track the given reader.
        Parameters:
        mbr - the user to be tracked (may be null).
        Since:
        jcms-6.0.0
      • trackReader

        public void trackReader​(Member mbr,
                                int accessType)
        Track the given reader for given access type.
        Parameters:
        mbr - the user to be tracked (may be null).
        accessType - the type of access
        Since:
        jcms-8.0.0
      • removeAllReaderTracker

        public void removeAllReaderTracker​(Member opAuthor)
        Remove all the readers notes
        Parameters:
        opAuthor - the member who performs this operation
        Since:
        jcms-6.0.0
      • removeDataSet

        protected void removeDataSet​(Member opAuthor,
                                     java.util.Set<? extends Data> dataSet)
        Remove all the data of the given data set
        Parameters:
        opAuthor - the member who performs this operation
        dataSet - the data set to be removed
        Since:
        jcms-5.5.0
      • removeAllDescendants

        public void removeAllDescendants​(Member opAuthor,
                                         java.util.Map context)
        Remove all descendant TreeNode that can be deleted
        Parameters:
        opAuthor - the member who performs this operation
        context - the DataController's context
        Since:
        jcms-5.0.0
      • hasAlreadyVoted

        public boolean hasAlreadyVoted​(Member member)
        Check if the given member has already voted for this publication
        Parameters:
        member - the member to check
        Returns:
        true if the given member has already voted (ie add a WFNote) in the workflow for this publication.
        Since:
        jcms-4.0.2
      • addWFExpressAlarm

        public void addWFExpressAlarm()
        Adds a WFExpress alarm for this publication (only for main leader replica).
        Since:
        jcms-5.5.0
      • removeWFExpressAlarm

        public void removeWFExpressAlarm()
        Removes the WFExpress alarm for this publication.
        Since:
        jcms-5.5.0
      • addWFReminderAlarm

        public void addWFReminderAlarm()
        Adds a WFReminder alarm for this publication (only for main leader replica).
        Since:
        jcms-5.5.0
      • removeWFReminderAlarm

        public void removeWFReminderAlarm()
        Removes the WFExpress alarm for this publication.
        Since:
        jcms-5.5.0
      • getEstimatedReminderCount

        public int getEstimatedReminderCount()
        Returns an estimation of how many reminders have been sent since this publication is in this state. If the publication is in a state without reminder, it returns -1.
        Returns:
        the reminder count or -1 if this publication is in a state without reminder.
        Since:
        jcms-5.5.0
      • checkStateChange

        public java.lang.Object[] checkStateChange​(Member mbr,
                                                   int newPstatus)
        Checks if the state change can be performed (it checks if the transition's rule can be perfomed)
        Parameters:
        mbr - the member who submit the state change
        newPstatus - the new pstatus
        Returns:
        an Objec[] which contains 1) a Boolean which determines if the transition must be performed 2) the WFNote of the member if it has already voted.
        Since:
        jcms-5.5.0
      • checkStateChange

        public java.lang.Object[] checkStateChange​(Member mbr,
                                                   int newPstatus,
                                                   int oldPstatus)
        Checks if the state change can be performed (it checks if the transition's rule can be perfomed)
        Parameters:
        mbr - the member who submit the state change
        newPstatus - the new pstatus
        oldPstatus - the old pstatus
        Returns:
        an Objec[] which contains 1) a Boolean which determines if the transition must be performed 2) the WFNote of the member if it has already voted.
        Since:
        jcms-6.1.3
      • createWFNote

        public boolean createWFNote​(Member mbr,
                                    int newPstatus,
                                    java.lang.String note)
        Create/Update a WFNote and check if the transition can be performed.
        Parameters:
        mbr - the member which performe this operation
        newPstatus - new pstatus
        note - member's comment
        Returns:
        true if state transition must be performed
        Since:
        jcms-5.5.0
      • createWFNote

        public boolean createWFNote​(Member mbr,
                                    int newPstatus,
                                    int oldPstatus,
                                    java.lang.String note)
        Create/Update a WFNote and check if the transition can be performed.
        Parameters:
        mbr - the member which performe this operation
        newPstatus - new pstatus
        oldPstatus - old pstatus
        note - member's comment
        Returns:
        true if state transition must be performed
        Since:
        jcms-6.1.3
      • getTitleComparator

        public static <T extends Publication> java.util.Comparator<T> getTitleComparator​(java.lang.String lang)
        Parameters:
        lang - the user language
        Returns:
        a new instance of Publication.TitleComparator using the given language.
        Since:
        jcms-4.0
      • getWorkspaceComparator

        public static <T extends Publication> java.util.Comparator<T> getWorkspaceComparator​(java.lang.String lang)
        Parameters:
        lang - the user language
        Returns:
        a new instance of Publication.WorkspaceComparator.
        Since:
        jcms-5.6.1
      • getComparator

        @Deprecated
        public static <T extends Publication> java.util.Comparator<T> getComparator​(java.lang.Class<T> clazz,
                                                                                    java.lang.String str,
                                                                                    boolean reverse)
        Deprecated.
        Parameters:
        clazz - the clazz
        str - the name of the comparator
        reverse - true to reverse the comparator order
        Returns:
        the comparator
      • getDate

        public java.util.Date getDate​(java.lang.String dateType)
        Return the date corresponding to the given parameter : date/cdate, mdate, edate, pdate, sdate, adate, udate or null if nothing match or the matching date is null.
        Overrides:
        getDate in class Data
        Parameters:
        dateType - the date type
        Returns:
        the date
        Since:
        jcms-4.0
      • getDate

        public java.util.Date getDate​(java.lang.String dateType,
                                      java.util.Date defaultDate)
        Return the date corresponding to the given parameter : date/cdate, mdate, edate, pdate, sdate, adate, udate, or null if nothing match or the matching date is null.
        Overrides:
        getDate in class Data
        Parameters:
        dateType - the date type
        defaultDate - the default date
        Returns:
        the date
        Since:
        jcms-4.0
      • getIndexingDate

        public java.util.Date getIndexingDate()
        Retrieve the Date at which this Publication was indexed in its search engine.
        Returns:
        a Date or null if was not indexed.
        Since:
        jcms-6.0.1
      • getPstatusSelector

        public static Publication.PstatusSelector getPstatusSelector​(int pstatus,
                                                                     int greater)
        Parameters:
        pstatus - the reference pstatus to be used during comparison
        greater - an integer indicating the comparison to be performed :
        • -1 : to select publications with a pstatus lower than or equals to the reference pstatus
        • 1 : to select publications with a pstatus greater than or equals to the reference pstatus
        • any other value : to select publications with a pstatus equals to the reference pstatus
        Returns:
        a new instance of Publication.PstatusSelector.
        Since:
        jcms-2.1
        See Also:
        Publication.PstatusSelector
      • getPdateSelector

        public static Publication.PdateSelector getPdateSelector​(java.util.Date begin,
                                                                 java.util.Date end)
        Parameters:
        begin - the begin date
        end - the end date
        Returns:
        a new instance of Publication.PdateSelector using the given begin and end Date.
        Since:
        jcms-2.1
      • getSdateSelector

        public static Publication.SdateSelector getSdateSelector​(java.util.Date begin,
                                                                 java.util.Date end)
        Parameters:
        begin - the begin date
        end - the end date
        Returns:
        a new instance of Publication.SdateSelector using the given begin and end Date.
        Since:
        jcms-4.1
      • getEdateSelector

        public static Publication.EdateSelector getEdateSelector​(java.util.Date begin,
                                                                 java.util.Date end)
        Parameters:
        begin - the begin date
        end - the end date
        Returns:
        a new instance of Publication.EdateSelector using the given begin and end Date.
        Since:
        jcms-2.1
      • getAdateSelector

        public static Publication.AdateSelector getAdateSelector​(java.util.Date begin,
                                                                 java.util.Date end)
        Parameters:
        begin - the begin date
        end - the end date
        Returns:
        a new instance of Publication.AdateSelector using the given begin and end Date.
        Since:
        jcms-4.1.1
      • getUdateSelector

        public static Publication.UdateSelector getUdateSelector​(java.util.Date begin,
                                                                 java.util.Date end)
        Parameters:
        begin - the begin date
        end - the end date
        Returns:
        a new instance of Publication.UdateSelector using the given begin and end Date.
        Since:
        jcms-4.1.1
      • isTreeLeaf

        public boolean isTreeLeaf()
        Description copied from interface: TreeNode
        Returns boolean true if the TreeNode is a leaf
        Specified by:
        isTreeLeaf in interface TreeNode
        Returns:
        boolean indicating if node is leaf or node
        See Also:
        TreeNode.isTreeLeaf()
      • isTreeNode

        public boolean isTreeNode()
        Description copied from interface: TreeNode
        Returns boolean true if the TreeNode is a node
        Specified by:
        isTreeNode in interface TreeNode
        Returns:
        boolean indicating if node is leaf or node
        See Also:
        TreeNode.isTreeNode()
      • getTreeRoot

        public TreeNode getTreeRoot()
        Description copied from interface: TreeNode
        Returns the root of the current node
        Specified by:
        getTreeRoot in interface TreeNode
        Returns:
        TreeNode root Node
      • checkIntegrity

        public ControllerStatus checkIntegrity()
        Checks whether or not data integrity constraints are respected.
        Overrides:
        checkIntegrity in class Data
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkWrite

        public ControllerStatus checkWrite​(int op,
                                           Member mbr,
                                           boolean checkIntegrity,
                                           java.util.Map context)
        Checks if the given write operation can be performed
        Overrides:
        checkWrite in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        checkIntegrity - if true, requires the constraints integrity to be checked
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkMember

        public ControllerStatus checkMember​(int op,
                                            Member mbr,
                                            java.util.Map context)
        Checks if the given member can perform the given operation.
        Overrides:
        checkMember in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkCreate

        public ControllerStatus checkCreate​(Member mbr,
                                            java.util.Map context)
        Checks if the creation can be performed
        Overrides:
        checkCreate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkUpdate

        public ControllerStatus checkUpdate​(Member mbr,
                                            java.util.Map context)
        Checks if the update can be performed
        Overrides:
        checkUpdate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkDelete

        public ControllerStatus checkDelete​(Member mbr,
                                            java.util.Map context)
        Checks if the deletion can be performed
        Overrides:
        checkDelete in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkMerge

        public ControllerStatus checkMerge​(Member mbr,
                                           java.util.Map context)
        Checks if the merge can be performed
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • performCreate

        public void performCreate​(Member mbr,
                                  java.util.Map context)
        Performs data creation
        Overrides:
        performCreate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • performUpdate

        public void performUpdate​(Member mbr,
                                  java.util.Map context)
        Performs data update
        Overrides:
        performUpdate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • performDelete

        public void performDelete​(Member mbr,
                                  java.util.Map context)
        Performs data deletion
        Overrides:
        performDelete in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • prepareMergeCopy

        protected void prepareMergeCopy​(Publication mergeCopy)
      • performMerge

        public void performMerge​(Member mbr)
        Performs publication merge
        Parameters:
        mbr - the member which requests the write operation
        Since:
        jcms-5.0.0
      • performMerge

        public void performMerge​(Member mbr,
                                 java.util.Map context)
        Performs publication merge
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • performBeforeWrite

        protected void performBeforeWrite​(int op,
                                          Member mbr,
                                          java.util.Map context)
        Description copied from class: Data
        Called to perform some action before the write.
        Overrides:
        performBeforeWrite in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
      • performAfterWrite

        protected void performAfterWrite​(int op,
                                         Member mbr,
                                         java.util.Map context)
        Description copied from class: Data
        Called to perform some action after the write.
        Overrides:
        performAfterWrite in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
      • getFieldValue

        public java.lang.Object getFieldValue​(java.lang.String fieldName,
                                              java.lang.String lang,
                                              boolean useDefault)
                                       throws java.lang.NoSuchFieldException
        Gets the value of the given Object field name for the current Data.
        If the field is multilingual, the given language will be used.
        Do not retrieve Category fields, see #getCategoryFieldValue(String, Member).
        Overrides:
        getFieldValue in class Data
        Parameters:
        fieldName - the field name from which to retrieve the field value.
        lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
        useDefault - whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).
        Returns:
        the Object field value
        Throws:
        java.lang.NoSuchFieldException - if the field was not found in the given Data.
      • setFieldValue

        public void setFieldValue​(java.lang.String fieldName,
                                  java.lang.Object value,
                                  java.lang.String lang)
                           throws java.lang.NoSuchFieldException
        Sets the value of the given Object field name for the current Data.
        If the field is multilingual, the given language will be used.
        Do not retrieve Category fields, see #getCategoryFieldValue(String, Member).
        Overrides:
        setFieldValue in class Data
        Parameters:
        fieldName - the field name from which to retrieve the field value.
        value - whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).
        lang - the language (ISO-639 code) in which to retrieve the field value (used only for multilingual fields).
        Throws:
        java.lang.NoSuchFieldException - if the field was not found in the given Data.
        Since:
        jcms-7.0.0
      • assignCommonPublicationFields

        public void assignCommonPublicationFields​(Publication pub)
        Assign all the common fields (author, workspace, pstatus, pdate, ...) of this publication from the given one.

        As of current implementation, the following fields are copied :

        • author
        • workspace
        • main language
        • major version
        • pdate
        • adate
        • udate
        • sdate
        • edate
        • pstatus
        • tracked
        • merge date
        • merge id
        • categories
        • display template
        • query template
        • authorized member set
        • authorized group set
        • update member set
        • update group set
        • friendly URLs set
        • role map
        Parameters:
        pub - the publication to copy from.
        Since:
        jcms-5.7.2
      • getImportVersion

        public java.lang.String getImportVersion()
        Get the value of importVersion.
        Returns:
        Value of importVersion.
        Since:
        jcms-5.7.2
      • setImportVersion

        public void setImportVersion​(java.lang.String v)
        Set the value of importVersion.
        Parameters:
        v - Value to assign to importVersion.
        Since:
        jcms-5.7.2
      • getWFNoteList

        public java.util.List<WFNote> getWFNoteList()
        Returns the list of WFNote bound to this publication.
        Returns:
        the list of WFNote bound to this publication.
        Since:
        jcms-6.0.0
      • getWorkspaceId

        public java.lang.String getWorkspaceId()
        Returns the JStore ID of the workspace (only for DBData)
        Returns:
        the JStore ID of the workspace (only for DBData)
        Since:
        jcms-6.0.0
      • setWorkspaceId

        public void setWorkspaceId​(java.lang.String v)
        Sets the JStore ID of the workspace (only for DBData)
        Parameters:
        v - the JStore workspace id
        Since:
        jcms-6.0.0
      • initializeDBDataCollections

        public void initializeDBDataCollections()
        Description copied from class: Data
        This methods force the collections of the DBData to be initialized()
        Overrides:
        initializeDBDataCollections in class Data
      • cloneDBDataCollections

        public void cloneDBDataCollections()
      • attachPublication

        public boolean attachPublication​(java.lang.String fieldName,
                                         Publication attachment)
        Attaches the given publication to the given field of this publication. The publication is not saved.
        Parameters:
        fieldName - the name of the field
        attachment - the publication to attach to.
        Returns:
        true if this publication has been attached to the given field.
        Since:
        jcms-9.0.0
      • canBeAttachedBy

        public boolean canBeAttachedBy​(Member mbr)
        Returns true if the given member can attach this publication to another workspace.
        Parameters:
        mbr - the member
        Returns:
        true if the given member can attach this publication to another workspace.
        Since:
        jcms-10.0.0
      • canBeAttachedTo

        public boolean canBeAttachedTo​(Workspace attachWorkspace,
                                       Member mbr)
        Returns true if the given member can attach this publication to the given workspace.
        Parameters:
        attachWorkspace - the workspace to attach this publication
        mbr - the member
        Returns:
        if the given member can attach this publication to the given workspace.
        Since:
        jcms-10.0.0
      • canBeDetachedFrom

        public boolean canBeDetachedFrom​(Workspace attachWorkspace,
                                         Member mbr)
        Returns true if the given member can detach this publication from the given workspace.
        Parameters:
        attachWorkspace - the workspace this publication is attached to.
        mbr - the member
        Returns:
        true if the given member can detach this publication from the given workspace.
        Since:
        jcms-10.0.0
      • attachTo

        public ControllerStatus attachTo​(Workspace attachWorkspace,
                                         java.util.Set<Category> catSet,
                                         Member mbr)
        Attaches this publication to the given workspace with the given categories.
        Parameters:
        attachWorkspace - the attach workspace
        catSet - the set of categories for this attachment
        mbr - the member who performs the attachment.
        Returns:
        the ControllerStatus of the publication update.
        Since:
        jcms-10.0.0
      • detachFrom

        public ControllerStatus detachFrom​(Workspace attachWorkspace,
                                           Member mbr)
        Detaches this publication for the given attachWorkspace. This operation is performed by the given member.
        Parameters:
        attachWorkspace - the attach workspace
        mbr - the member who performs the detachment.
        Returns:
        the ControllerStatus of the publication update.
        Since:
        jcms-10.0.0
      • isTrashed

        public boolean isTrashed()
        Returns:
        true if this publication is in the trash
        Since:
        jcms-10.0.6
      • checkAndPerformTrash

        public ControllerStatus checkAndPerformTrash​(Member opAuthor,
                                                     java.util.Map context)
        Check if publication can be put in trash, and do it if possible and authorized.

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the trash operation.
        context - a map which contains context parameters (may be null)
        Returns:
        the ControllerStatus of the publication trash operation.
        Since:
        jcms-10.0.5 / JCMS-8353
      • checkTrash

        public ControllerStatus checkTrash​(Member opAuthor,
                                           java.util.Map context)
        Check this publication can be trashed given its current state and authorization of specified member.

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the trash operation.
        context - a map which contains context parameters (may be null)
        Returns:
        the ControllerStatus of the publication trash verification.
        Since:
        jcms-10.0.5 / JCMS-8353
      • performTrash

        public void performTrash​(Member opAuthor,
                                 java.util.Map context)
        Put this put publication in the trash.

        Putting publication in trash means changing its pstatus to 30 (while tracking its current pstatus in case it is untrashed later).

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the trash operation.
        context - a map which contains context parameters (may be null)
        Since:
        jcms-10.0.5 / JCMS-8353
        See Also:
        checkAndPerformTrash(Member, Map)
      • checkAndPerformUntrash

        public ControllerStatus checkAndPerformUntrash​(Member opAuthor,
                                                       java.util.Map context)
        Check if publication can be removed from trash, and do it if possible and authorized.

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the untrash operation.
        context - a map which contains context parameters (may be null)
        Returns:
        the ControllerStatus of the publication untrash operation.
        Since:
        jcms-10.0.5 / JCMS-8353
      • checkUntrash

        public ControllerStatus checkUntrash​(Member opAuthor,
                                             java.util.Map context)
        Check this publication can be remove from trashed given its current state and authorization of specified member.

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the untrash operation.
        context - a map which contains context parameters (may be null)
        Returns:
        the ControllerStatus of the publication untrash verification.
        Since:
        jcms-10.0.5 / JCMS-8353
        See Also:
        checkAndPerformUntrash(Member, Map)
      • performUntrash

        public void performUntrash​(Member opAuthor,
                                   java.util.Map context)
        Remove this publication from the trash.

        Removing publication from trash means changing its pstatus back to the pstatus it had before being trashed.

        Requirement : this MUST be an update instance, as returned by Data.getUpdateInstance()

        Parameters:
        opAuthor - the member who performs the untrash operation.
        context - a map which contains context parameters (may be null)
        Since:
        jcms-10.0.5 / JCMS-8353
        See Also:
        checkAndPerformUntrash(Member, Map)
      • getReferrerSet

        public java.util.Set getReferrerSet​(boolean searchInDB)
        Returns the referrer set of this data.
        Parameters:
        searchInDB - if true search for DB publication referring this publication.
        Returns:
        the referrer set of this data.
        Since:
        jcms-10.0.2
      • updateDisplayLinkCss

        public java.lang.StringBuilder updateDisplayLinkCss​(java.lang.StringBuilder builder)
        Description copied from class: Data
        Returns a StringBuilder which contains css, whom you can modify or replace in your subclasses
        Overrides:
        updateDisplayLinkCss in class Data
        Parameters:
        builder - the StringBuilder
        Returns:
        a StringBuilder which contains css of display link