Class Category

    • Field Detail

      • CTXT_SKIP_WORKSPACE

        public static final java.lang.String CTXT_SKIP_WORKSPACE
        See Also:
        Constant Field Values
      • CTXT_SKIP_PUBLICATIONS

        public static final java.lang.String CTXT_SKIP_PUBLICATIONS
        See Also:
        Constant Field Values
      • EXPORT_CAT_SEPARATOR

        public static final java.lang.String EXPORT_CAT_SEPARATOR
        See Also:
        Constant Field Values
      • IMPORT_EXPORT_DEPTH_CHAR

        public static final java.lang.Character IMPORT_EXPORT_DEPTH_CHAR
      • IMPORT_EXPORT_NAME_SEPARATOR

        public static final java.lang.String IMPORT_EXPORT_NAME_SEPARATOR
        See Also:
        Constant Field Values
      • IMPORT_EXPORT_DESCRIPTION_SEPARATOR

        public static final java.lang.String IMPORT_EXPORT_DESCRIPTION_SEPARATOR
        See Also:
        Constant Field Values
      • IMPORT_EXPORT_KEYWORDS_SEPARATOR

        public static final java.lang.String IMPORT_EXPORT_KEYWORDS_SEPARATOR
        See Also:
        Constant Field Values
      • name

        protected java.lang.String name
      • nameML

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

        protected java.lang.String description
      • descriptionML

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

        protected java.lang.String[] synonyms
      • isSelectable

        protected boolean isSelectable
      • order

        protected int order
      • childrenOrder

        protected int childrenOrder
      • icon

        protected java.lang.String icon
      • iconML

        protected java.util.HashMap<java.lang.String,​java.lang.String> iconML
      • image

        protected java.lang.String image
      • imageML

        protected java.util.HashMap<java.lang.String,​java.lang.String> imageML
      • color

        protected java.lang.String color
      • newTab

        protected boolean newTab
      • friendlyURLSet

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

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

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

        protected java.util.HashSet<Member> useMemberSet
      • useGroupSet

        protected java.util.HashSet<Group> useGroupSet
      • managerMemberSet

        protected java.util.HashSet<Member> managerMemberSet
      • managerGroupSet

        protected java.util.HashSet<Group> managerGroupSet
      • authorizedMemberHashSet

        protected transient java.util.HashSet<Member> authorizedMemberHashSet
      • authorizedGroupHashSet

        protected transient java.util.HashSet<Group> authorizedGroupHashSet
      • typeReferrerCount

        protected transient int typeReferrerCount
      • typeReferrer

        protected transient java.lang.String typeReferrer
    • Constructor Detail

      • Category

        public Category()
        Create a new empty Category (no parent, no name, no description, no children, no synonyms, etc).
      • Category

        public Category​(Category other)
        Category constructor by copy.

        Use this constructor to create a new Category or copy an existing one.
        The newly created Category will have the same value for most of (but not all!) fields of the specified Category.

        Important : DO NOT use this constructor to UPDATE Category !, instead use the getUpdateInstance() method. (This constructor by copy does not copy all fields, for example the friendly URLs of the specified category will not be copied into the new Category).

        Parameters:
        other - the category to copy
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Data
      • toFullString

        public java.lang.String toFullString()
        Overrides:
        toFullString in class Data
      • 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
      • getExportXmlDataValue

        public java.lang.String getExportXmlDataValue()
        Description copied from class: Data
        Returns a string representation of this data used by exportXml().
        Overrides:
        getExportXmlDataValue in class Data
        Returns:
        a string representation of this data used by exportXml().
      • 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
      • getFirstRelatives

        public static Category[] getFirstRelatives​(java.util.Set<Category> rootSet)
        Check if one category of the set is relatives to an other category.
        Parameters:
        rootSet - a set of root category
        Returns:
        a Category[2] with the 2 first relatives.
      • getFirstNotRelatives

        public static Category getFirstNotRelatives​(java.util.Set<Category> children,
                                                    java.util.Set<Category> roots)
        Check if one category of the set not relatives to an other category.
        Parameters:
        children - a set of category
        roots - a set of root category
        Returns:
        a Category[2] with the 2 first relatives.
      • getHighestLevelCategorySet

        public static java.util.TreeSet<Category> getHighestLevelCategorySet​(java.util.TreeSet<Category> categorySet)
        Keeps only the categories of highest level
        Parameters:
        categorySet - a set of category
        Returns:
        a set of category
        Since:
        jcms-4.1
      • containsDescendant

        public boolean containsDescendant​(Category category)
        Test if a category is a descendant of this category (this method is equivalent to invoke category.hasAncestor(this))
        Parameters:
        category - the category to test
        Returns:
        true if the category is a descendant of this category
      • hasAncestor

        public boolean hasAncestor​(Category category)
        Test if a category is an ancestor of this category (it returns false if the received category is this category).
        Parameters:
        category - the category to test
        Returns:
        true if the category is an ancestor of this category
      • getAncestorList

        public java.util.List<Category> getAncestorList()
        Returns the list of all the ancestors of this category, from the immediate parent to the root (root excluded).
        Returns:
        the list of ancestors
      • getAncestorList

        public java.util.List<Category> getAncestorList​(Category ancestor,
                                                        boolean includeAncestor)
        Returns the list of all the ancestors of this category, from the immediate parent to the given ancestor.
        Parameters:
        ancestor - the ancestor (null means root)
        includeAncestor - if true add the ancestor to the list
        Returns:
        the list of ancestors
        Since:
        jcms-5.0.0
      • getAncestorString

        public java.lang.String getAncestorString​(java.lang.String sep,
                                                  boolean includeCat,
                                                  java.lang.String lang)
        Returns a String representation of the ancestor of this category (eg First Level > Second Level > Category Name). Root is excluded.
        Parameters:
        sep - the separator
        includeCat - if true, the category is included
        lang - the language to use to build the String
        Returns:
        a String containing the ancestors concatenation.
        Since:
        jcms-4.0
      • getAncestorString

        public java.lang.String getAncestorString​(java.lang.String sep,
                                                  boolean includeCat)
        Returns a String representation of the ancestor of this category (eg First Level > Second Level > Category Name). Root is excluded.
        Parameters:
        sep - the separator
        includeCat - if true, the category is included
        Returns:
        a String containing the ancestors concatenation.
        Since:
        jcms-3.0
      • getAncestorString

        public java.lang.String getAncestorString​(Category ancestor,
                                                  java.lang.String sep,
                                                  boolean includeCat,
                                                  java.lang.String lang)
        Returns a String representation of the ancestor of this category, truncated according the given ancestor (eg if ancestor String is First Level > Second Level > Category Name, and given ancestor is First Level, it returns Second Level > Category Name). Root is excluded.
        Parameters:
        ancestor - the ancestor
        sep - the separator
        includeCat - if true, the category is included
        lang - the language to use to build the String
        Returns:
        a String containing the ancestors concatenation.
        Since:
        jcms-4.0
      • getAncestorString

        public java.lang.String getAncestorString​(Category ancestor,
                                                  java.lang.String sep,
                                                  boolean includeCat)
        Returns a String representation of the ancestor of this category, truncated according the given ancestor (eg if ancestor String is First Level > Second Level > Category Name, and given ancestor is First Level, it returns Second Level > Category Name). Root is excluded.
        Parameters:
        ancestor - the ancestor
        sep - the separator
        includeCat - if true, the category is included
        Returns:
        a String containing the ancestors concatenation.
        Since:
        jcms-3.0
      • isSibling

        public boolean isSibling​(Category cat)
        Returns true if the given category is a sibling of this category. Returns true if the given category is this category.
        Parameters:
        cat - the category
        Returns:
        true if the given category is a sibling of this category. Returns true if the given category is this category.
        Since:
        jcms-6.1.0
      • getAvailableColor

        public java.lang.String getAvailableColor()
        Find the first available color from this category to these ancestors.
        Returns:
        the first available color from this category to these ancestors (in all the case, return a non null value).
        Since:
        jcms-5.0.0
        See Also:
        getAvailableColor(int)
      • getAvailableColor

        public java.lang.String getAvailableColor​(int levelOffset)
        Find the first available color from this category to these ancestors and apply a color offset corresponding to the sub-level of this cateogy.
        Parameters:
        levelOffset - the offset to apply for each level
        Returns:
        the first available color from this category to these ancestors with the offset applied (in all the case, return a non null value).
        Since:
        jcms-5.5.0
      • getFirstCommonAncestor

        public Category getFirstCommonAncestor​(Category category)
        Returns the first common ancestor (FCA) with a given category. The FCA of c1 and c2 is the first category which is an ancestor of c1 and c2.
        If (c1 == c2) FCA = c1.parent.
        If (c1 ancestor of c2) FCA = c1
        Parameters:
        category - the category to used when searching the first common ancestor with this category. if null, return value will be null.
        Returns:
        the first common ancestor Category between this and the specified category, may return null if specified category is null
      • getFirstCommonAncestor

        public static Category getFirstCommonAncestor​(java.util.Collection<Category> collection)
        Returns the common ancestors of the given categories
        Parameters:
        collection - Collection of Category
        Returns:
        Category the first common ancestor
        Since:
        jcms-5.7.3
      • getPublicationSet

        public <T extends Publication> java.util.Set<T> getPublicationSet​(java.lang.Class<T> clazz,
                                                                          Member mbr)
        Returns a NEW Set of Publication of the given class which use this category. Behavior of clazz and mbr relies to underlaying behavior of Channel.getPublicationSet(Class, Member) Check rights.
        Type Parameters:
        T - a type of Publication
        Parameters:
        clazz - the Publication's class to retrieve
        mbr - the Member requesting publications
        Returns:
        Set of Publication
      • getPublicationSet

        public <T extends Publication> java.util.Set<T> getPublicationSet​(java.lang.Class<T> clazz)
        Returns a NEW Set of Publication of the given class which use this category. Behavior of clazz relies to underlaying behavior of Channel.getDataSet(Class). DO NOT check rights.
        Type Parameters:
        T - a type of Publication
        Parameters:
        clazz - the Publication's class to retrieve
        Returns:
        Set of Publication
      • getPublicationSet

        public java.util.Set<Publication> getPublicationSet()
        Returns the publications which use this category
        Returns:
        a TreeSet of Publication
      • getPublicationSet

        public java.util.Set<Publication> getPublicationSet​(boolean searchInDB)
        Returns the publications which use this category
        Parameters:
        searchInDB - if true the search is extended to the DB
        Returns:
        a TreeSet of Publication
        Since:
        jcms-6.2
      • getAllPublicationSet

        public java.util.Set<Publication> getAllPublicationSet()
        Return a set containing all the publications referenced by this category and all the descendants of this category.

        Warning : Returns an empty collection during store load (since JCMS-5833).

        Returns:
        the publication set
      • getAllPublicationSet

        public java.util.Set<Publication> getAllPublicationSet​(boolean searchInDB)
        Return a set containing all the publications referenced by this category and all the descendants of this category

        Warning : Returns an empty collection during store load (since JCMS-5833).

        Parameters:
        searchInDB - if true the search is extended to the DB
        Returns:
        the publication set
        Since:
        jcms-6.2
      • getContentSet

        public java.util.Set<Content> getContentSet()
        Returns the contents which use this category
        Returns:
        a TreeSet of Content
        Since:
        jcms-4.0
      • getContentSet

        public java.util.Set<Content> getContentSet​(boolean searchInDB)
        Returns the contents which use this category
        Parameters:
        searchInDB - if true the search is extended to the DB
        Returns:
        a TreeSet of Content
        Since:
        jcms-6.2
      • getAllContentSet

        public java.util.Set<Content> getAllContentSet()
        Return a set containing all the contents referenced by this category and all the descendant of this category.

        Warning : Returns an empty collection during store load (since JCMS-5833).

        Returns:
        the content set
        Since:
        jcms-4.0
      • getAllContentSet

        public java.util.Set<Content> getAllContentSet​(boolean searchInDB)
        Return a set containing all the contents referenced by this category and all the descendant of this category.

        Warning : Returns an empty collection during store load (since JCMS-5833).

        Parameters:
        searchInDB - if true the search is extended to the DB
        Returns:
        the content set
        Since:
        jcms-6.2
      • getDBPublicationCount

        public <T extends Publication> int getDBPublicationCount()
        Count the number of DB publications which belongs to this category (exact mode).

        Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.

        Type Parameters:
        T - a type of Publication
        Returns:
        the count of DB Publications which belongs to this Category (exactMode)
        Since:
        7.0.2
      • getDBPublicationCount

        public <T extends Publication> int getDBPublicationCount​(java.lang.Class<T> clazz,
                                                                 boolean exactCat)
        Count the number of DB publication which belongs to this category.

        Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.

        Type Parameters:
        T - a type of Publication
        Parameters:
        clazz - the class to search for
        exactCat - true to search for publication only in this publication, false, to search in descendants categories
        Returns:
        the count of DB Publications which belongs to this Category
        Since:
        7.0.2
      • getDBPublicationCount

        public <T extends Publication> int getDBPublicationCount​(java.lang.Class<T> clazz,
                                                                 boolean exactCat,
                                                                 boolean searchInTrash)
        Count the number of DB publication which belongs to this category.

        Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.

        Type Parameters:
        T - a type of Publication
        Parameters:
        clazz - the class to search for
        exactCat - true to search for publication only in this publication, false, to search in descendants categories
        searchInTrash - true to searched trashed publication, false to exclude them
        Returns:
        the count of DB Publications which belongs to this Category
        Since:
        jcms-10.0.6 / JCMS-8934
      • updateDBPublicationIndexes

        protected void updateDBPublicationIndexes()
        Update publication allCatIdSet in this Category and its childrens when the Category parent is changed Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.
        Since:
        jcms-7.0.2
      • mergeWith

        public ControllerStatus mergeWith​(Category tgtCat,
                                          Member loggedMember)
        Merges this category with the given the category. All the children of this category are moved to the given category. All the publications assigned tho this category are moved to the given category. The loggedMember must have the right to manage the 2 categories.
        Parameters:
        tgtCat - the category to merge with
        loggedMember - the member.
        Returns:
        true if the merge has been done.
        Since:
        jcms-7.1
      • moveTo

        public ControllerStatus moveTo​(Category parent,
                                       Member loggedMember)
        Move Category under given parent
        Parameters:
        parent - the Category parent
        loggedMember - the worker
        Returns:
        ControllerStatus for this action
      • addSubs

        public ControllerStatus addSubs​(java.lang.String names,
                                        Member loggedMember,
                                        java.lang.String userLang)
        Create a Category under the given category
        Parameters:
        names - Category names to create (comma separated)
        loggedMember - the logged Member
        userLang - the user language
        Returns:
        a ControllerStatus depending on wether the categories can be created or not
        Since:
        jcms-9.0.0
      • addSiblings

        public ControllerStatus addSiblings​(java.lang.String names,
                                            Member loggedMember,
                                            java.lang.String userLang)
        Creates categories based on given names as sibling of current Category
        Parameters:
        names - Category names to create (comma separated)
        loggedMember - the logged Member
        userLang - the user language
        Returns:
        a ControllerStatus depending on wether the categories can be created or not
        Since:
        jcms-9.0.1
      • rename

        public ControllerStatus rename​(java.lang.String name,
                                       java.lang.String userLang,
                                       Member loggedMember)
        Rename the given category
        Parameters:
        name - the new category name
        userLang - the current language
        loggedMember - the worker
        Returns:
        ControllerStatus for this action
      • delete

        public ControllerStatus delete​(Member loggedMember)
        Delete the given category
        Parameters:
        loggedMember - the worker
        Returns:
        ControllerStatus for this action
      • isRoot

        public boolean isRoot()
        Returns true if this category is the root category.
        Returns:
        true if the category has no child
        Since:
        jcms-5.0.0
      • isLeaf

        public boolean isLeaf()
        Returns true if this category is a leaf, that is if it has no child.
        Returns:
        true if the category has no child
      • isNode

        public boolean isNode()
        Returns true if this category is a node, that is if it has at least one child.
        Returns:
        true if the category has at least a child.
      • isLeaf

        public boolean isLeaf​(Member mbr)
        Returns true if this category is a leaf according the given member and the category read right, that is if this category has no child readable for the given member.
        Parameters:
        mbr - the member to check the read right
        Returns:
        true if the category has no child
        Since:
        jcms-4.1
      • isNode

        public boolean isNode​(Member mbr)
        Returns true if this category is a node according the given member and the category read right, that is if this category has at least one child readable for the given member.
        Parameters:
        mbr - the member to check the read right
        Returns:
        true if the category has at least a child.
        Since:
        jcms-4.1
      • isTerminalNode

        public boolean isTerminalNode()
        Returns true if this category is a terminal node, that is if it has only leaf children
        Returns:
        true if the category has only lead children
        Since:
        jcms-3.0
      • isAlphabeticalOrder

        public boolean isAlphabeticalOrder()
        Returns:
        true if children of this category are alphabically ordered
        Since:
        jcms-3.0
      • isCustomOrder

        public boolean isCustomOrder()
        Returns:
        true if children of this category are custom ordered
        Since:
        jcms-3.0
      • getChildrenSet

        public java.util.Set<Category> getChildrenSet()
        Returns the children categories (ie categories having this category as parent)
        Returns:
        a TreeSet of category
      • getDescendantSet

        public java.util.Set<Category> getDescendantSet()
        Returns all the descendant categories of this one (ie categories having this category as ancestor)
        Returns:
        a Set of category
        Since:
        jcms-3.0
      • childExist

        public boolean childExist​(java.lang.String name)
        Check if this category contains a child with the given name
        Parameters:
        name - the category name to search
        Returns:
        true if there exists at least one child with the given name
        Since:
        jcms-4.0
      • getChild

        public Category getChild​(java.lang.String name)
        Return the child of this category with the given name
        Parameters:
        name - the category name to search
        Returns:
        the child or null if not found
        Since:
        jcms-4.0
      • containsUnreadPub

        public boolean containsUnreadPub​(Member member)
        Check if this category (and all its sub-categories) contains at least one tracked publication which has not been read by the given member
        Parameters:
        member - the reader
        Returns:
        true if there exists at least one unread publication
        Since:
        jcms-4.1
      • getSearchStrings

        public java.lang.String[] getSearchStrings()
        Description copied from interface: Searchable
        This method gets called to get all the String to search in (typically the String attribute of the Storable). If one of those String match the query, this Storable is added in the result set.
        Specified by:
        getSearchStrings in interface Searchable
        Returns:
        an array of String corresponding to this object.
      • 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:
        name of Category in given language or empty String if not specified.
        Since:
        jcms-5.1
        See Also:
        getName(String), Data.getDataName(String)
      • getDataImage

        public java.lang.String getDataImage()
        Description copied from class: Data
        Retrieves the image path of this data in the channel's main language.

        This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
        Default behaviour is to return empty string.

        Overrides:
        getDataImage in class Data
        Returns:
        a path relative to the webapp root.
      • getDataImage

        public java.lang.String getDataImage​(java.lang.String lang,
                                             boolean useDefault)
        Description copied from class: Data
        Retrieves the image path of this data.

        This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
        Default behaviour is to return empty string.

        Overrides:
        getDataImage in class Data
        Parameters:
        lang - the user language (ISO-639 language code)
        useDefault - should the default language be used if no value is found for the specified language
        Returns:
        a path relative to the webapp root.
      • getName

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

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

        public java.lang.String getName()
        Get the value of name.
        Returns:
        Value of name.
      • setName

        public void setName​(java.lang.String v)
        Set the value of name.
        Parameters:
        v - Value to assign to v.
      • getNameML

        public java.util.HashMap<java.lang.String,​java.lang.String> getNameML()
        Get the value of nameML.
        Returns:
        Value of nameML.
        Since:
        jcms-4.0
      • setNameML

        public void setNameML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the value of nameML.
        Parameters:
        v - Value to assign to nameML.
        Since:
        jcms-4.0
      • setName

        public void setName​(java.lang.String lang,
                            java.lang.String value)
        Convenient method to set the value of the Name field in any language (default site language or any other).
        This method will set the proper field value (setName(String) or setNameML(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
        See Also:
        setName(String), setNameML(HashMap)
      • getParent

        public Category getParent()
        Get the value of parent.
        Returns:
        Value of parent.
      • setParent

        public void setParent​(Category v)
        Set the value of parent.
        Parameters:
        v - Value to assign to parent.
      • getDescription

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

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

        public java.lang.String getDescription()
        Get the value of description.
        Returns:
        Value of description.
      • setDescription

        public void setDescription​(java.lang.String v)
        Set the value of description.
        Parameters:
        v - Value to assign to description.
      • getDescriptionML

        public java.util.HashMap<java.lang.String,​java.lang.String> getDescriptionML()
        Get the value of descriptionML.
        Returns:
        Value of descriptionML.
        Since:
        jcms-4.0
      • setDescriptionML

        public void setDescriptionML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the value of descriptionML.
        Parameters:
        v - Value to assign to descriptionML.
        Since:
        jcms-4.0
      • setDescription

        public void setDescription​(java.lang.String lang,
                                   java.lang.String value)
        Convenient method to set the value of the Description field in any language (default site language or any other).
        This method will set the proper field value (setDescription(String) or setDescriptionML(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
        See Also:
        setDescription(String), setDescriptionML(HashMap)
      • getSynonyms

        public java.lang.String[] getSynonyms()
        Get the value of synonyms.
        Returns:
        Value of synonyms.
        Since:
        jcms-4.0
      • setSynonyms

        public void setSynonyms​(java.lang.String[] v)
        Set the value of synonyms.
        Parameters:
        v - Value to assign to synonyms.
        Since:
        jcms-4.0
      • setSelectable

        public void setSelectable​(boolean isSelectable)
      • isSelectable

        public boolean isSelectable()
      • setOrder

        public void setOrder​(int order)
      • getOrder

        public int getOrder()
      • setChildrenOrder

        public void setChildrenOrder​(int childrenOrder)
        Define the children ordering to be used in this category
        Parameters:
        childrenOrder - an integer indicating the ordering type to be used. For alphabetical ordering, use constant Category.ALPHABETICAL_ORDER, for custom ordering (using "order" member), use constant Category.CUSTOM_ORDER
        Since:
        jcms-3.0
      • getChildrenOrder

        public int getChildrenOrder()
        Retrieves the current ordering type in use for children of this Category.
        Returns:
        the ordering type in use, Category.ALPHABETICAL_ORDER (0) for alphabetical ordering and Category.CUSTOM_ORDER (1) for custom ordering using order member
        Since:
        jcms-3.0
      • 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)
      • getIcon

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

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

        public java.lang.String getIcon()
        Get the value of icon.
        Returns:
        Value of icon.
      • setIcon

        public void setIcon​(java.lang.String v)
        Set the value of icon.
        Parameters:
        v - Value to assign to icon.
      • getIconML

        public java.util.HashMap<java.lang.String,​java.lang.String> getIconML()
        Get the value of iconML.
        Returns:
        Value of iconML.
        Since:
        jcms-4.0
      • setIconML

        public void setIconML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the value of iconML.
        Parameters:
        v - Value to assign to iconML.
        Since:
        jcms-4.0
      • setIcon

        public void setIcon​(java.lang.String lang,
                            java.lang.String value)
        Convenient method to set the value of the Icon field in any language (default site language or any other).
        This method will set the proper field value (setIcon(String) or setIconML(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
        See Also:
        setIcon(String), setIconML(HashMap)
      • getImage

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

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

        public java.lang.String getImage()
        Get the value of image.
        Returns:
        Value of image.
      • setImage

        public void setImage​(java.lang.String v)
        Set the value of image.
        Parameters:
        v - Value to assign to image.
      • getImageML

        public java.util.HashMap<java.lang.String,​java.lang.String> getImageML()
        Get the value of imageML.
        Returns:
        Value of imageML.
        Since:
        jcms-4.0
      • setImageML

        public void setImageML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the value of imageML.
        Parameters:
        v - Value to assign to imageML.
        Since:
        jcms-4.0
      • setImage

        public void setImage​(java.lang.String lang,
                             java.lang.String value)
        Convenient method to set the value of the Image field in any language (default site language or any other).
        This method will set the proper field value (setImage(String) or setImageML(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
        See Also:
        setImage(String), setImageML(HashMap)
      • getColor

        public java.lang.String getColor()
        Returns:
        the color of this category.
        Since:
        jcms-5.0.0
      • getColor

        public java.lang.String getColor​(boolean defaultOnParent)
        Returns the color of this category. If defaultOnParent is true, returns the parent category (recursively)
        Parameters:
        defaultOnParent - if true and this category has no color, returns the color of the parent category.
        Returns:
        the color of this category.
        Since:
        jcms-10.0.6
      • setColor

        public void setColor​(java.lang.String v)
        Set the value of color.
        Parameters:
        v - Value to assign to color.
        Since:
        jcms-5.0.0
      • getNewTab

        public boolean getNewTab()
        Returns:
        true if this category must be open in a new tab.
        Since:
        jcms-10.0.7
      • setNewTab

        public void setNewTab​(boolean v)
        Set the value of newTab.
        Parameters:
        v - Value to assign to newTab.
        Since:
        jcms-10.0.7
      • getIndexingDate

        public java.util.Date getIndexingDate()
        Retrieve the Date at which this Category was indexed in its search engine.
        Returns:
        a Date or null if was not indexed.
        Since:
        jcms-6.0.1
      • 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)
        Set the value of friendlyURLSet.
        Parameters:
        v - Value to assign to friendlyURLSet.
      • getNameComparator

        public static java.util.Comparator getNameComparator​(java.lang.String lang)
        Retrieves a new Categories' NameComparator.
        Parameters:
        lang - the language in which to compare categorie's name
        Returns:
        a new instance of NameComparator in the specified language.
      • getOrderComparator

        public static java.util.Comparator getOrderComparator​(java.lang.String lang)
        Retrieves a new Categories' OrderComparator.
        Parameters:
        lang - the language in which the alphabetical ordering will will performed if the category are ordered alphabetically.
        Returns:
        a new instance of OrderComparator using the default site language if using alphabetical ordering.
        Since:
        jcms-5.6.1
      • getDeepOrderComparator

        @Deprecated
        public static java.util.Comparator<Category> getDeepOrderComparator()
        Deprecated.
        Returns:
        a new instance of DeepOrderComparator in the default site language.
      • getDeepOrderComparator

        public static java.util.Comparator<Category> getDeepOrderComparator​(java.lang.String lang)
        Parameters:
        lang - the user language
        Returns:
        a new instance of DeepOrderComparator in the specified language.
        Since:
        jcms-6.0.0
      • getOrderChildrenFirstComparator

        public static java.util.Comparator<Category> getOrderChildrenFirstComparator()
      • getOrderChildrenLastComparator

        public static java.util.Comparator<Category> getOrderChildrenLastComparator()
      • getAuthorizedSelector

        public static Category.AuthorizedSelector getAuthorizedSelector​(Member member)
        Parameters:
        member - the member that will used in the authorized selector to perform selection.
        Returns:
        a new instance of Category.AuthorizedSelector using the given Member.
        Since:
        jcms-5.7.3
      • internalCanBeReadBy

        protected boolean internalCanBeReadBy​(Member member,
                                              boolean searchInGroups)
        Check of this category can be read by the given member
        Parameters:
        member - the member to be checked
        searchInGroups - if true check if one of the group this member belongs to is authorized to read this category.
        Returns:
        true this category can be read by the given member
        Since:
        jcms-4.1
      • internalCanBeReadBy

        protected boolean internalCanBeReadBy​(Group group)
        Check of this category can be read by the given group
        Parameters:
        group - the group to be checked member belongs to is authorized to read this category.
        Returns:
        true this category can be read by the given group
        Since:
        jcms-4.1
      • canBeReadBy

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

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

        Current implementation delegates to canBeReadBy(member, true, true).

        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 Category, false otherwise
        Since:
        jcms-10.0.0
        See Also:
        canBeReadBy(com.jalios.jcms.Member,boolean,boolean)
      • canBeReadBy

        public boolean canBeReadBy​(Member member,
                                   boolean searchInGroups,
                                   boolean checkAncestors)
        Check if a member can read this category.
        Parameters:
        member - the member to check
        searchInGroups - if true check if one of the group this member belongs to is authorized to read this category.
        checkAncestors - if true checks the read rights of the ancestors of this category.
        Returns:
        true if the member can read this category
        Since:
        jcms-4.1
      • canBeReadBy

        @Deprecated
        public boolean canBeReadBy​(Group group,
                                   boolean checkAncestors)
        Deprecated.
        since JCMS-8579
        Checks if a group can read this category.
        Parameters:
        group - the group to check
        checkAncestors - if true checks the read rights of the ancestors of this category.
        Returns:
        true if the group can read this category
        Since:
        jcms-4.1
      • hasAnyReadRights

        public boolean hasAnyReadRights()
        Tests if this category has member or group read rights.
        Warning: You cannot use !hasSomeReadRights() to test if this category has no read rights, in this case, use the method hasNoReadRights().
        Returns:
        true if there are member or group read rights.
        Since:
        jcms-5.0.4
      • hasNoReadRights

        public boolean hasNoReadRights()
        Tests if this category has NO member read rights AND NO group read rights.
        Warning: you cannot use !hasNoReadRights() to test if this category has some read rights, in this case, use the method hasAnyReadRights().
        Returns:
        true if there are NO member read rights AND NO group read rights.
        Since:
        jcms-5.0.4
      • getAuthorizedMemberSet

        public java.util.Set<Member> getAuthorizedMemberSet()
        Get the value of authorizedMemberSet.
        Returns:
        Value of authorizedMemberSet.
        Since:
        jcms-4.1
      • setAuthorizedMemberSet

        public void setAuthorizedMemberSet​(java.util.TreeSet<Member> set)
        Set the value of authorizedMemberSet.
        Parameters:
        set - Value to assign to authorizedMemberSet.
        Since:
        jcms-4.1
      • 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
      • getAuthorizedGroupSet

        public java.util.Set<Group> getAuthorizedGroupSet()
        Get the value of authorizedGroupSet.
        Returns:
        Value of authorizedGroupSet.
        Since:
        jcms-4.1
      • setAuthorizedGroupSet

        public void setAuthorizedGroupSet​(java.util.TreeSet<Group> set)
        Set the value of authorizedGroupSet.
        Parameters:
        set - Value to assign to authorizedGroupSet.
        Since:
        jcms-4.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
      • setUseGroupSet

        public void setUseGroupSet​(java.util.HashSet<Group> useGroupSet)
        Set the groups who are authorized to use this category (and sub categories).
        Parameters:
        useGroupSet - a Set of Group
        Since:
        jcms-10.0.6 / JCMS-8769
      • getUseGroupSet

        public java.util.HashSet<Group> getUseGroupSet​(boolean excludeGroupsWithoutReadAuthorization)
        Parameters:
        excludeGroupsWithoutReadAuthorization - true to filter groups which do not have read right on this category, false to return declared groups without any filter
        Returns:
        the groups declared as authorized to use this category (and sub categories), never return null
        Since:
        jcms-10.0.6 / JCMS-9281
      • setUseMemberSet

        public void setUseMemberSet​(java.util.HashSet<Member> useMemberSet)
        Set the members who are authorized to use this category (and sub categories).
        Parameters:
        useMemberSet - a Set of Member
        Since:
        jcms-10.0.6 / JCMS-8769
      • getUseMemberSet

        public java.util.HashSet<Member> getUseMemberSet​(boolean excludeMembersWithoutReadAuthorization)
        Parameters:
        excludeMembersWithoutReadAuthorization - true to filter members which do not have explicit read right on this category (or its parent), false to return declared member without any filter
        Returns:
        the members declared as authorized to use this category (and sub categories).
        Since:
        jcms-10.0.6 / JCMS-9281
      • isDeclaredUser

        public boolean isDeclaredUser​(Member mbr)
        Returns true if the given member is a declared user (for Use Right) on this category (or any parent category).
        Parameters:
        mbr - the member
        Returns:
        true if the given member is a declared user (for use Right) on this category (or any parent category).
        Since:
        jcms-10.0.6 / JCMS-8769
      • isDeclaredUser

        public boolean isDeclaredUser​(Member mbr,
                                      boolean checkAncestor)
        Returns true if the given member is a declared user (for use Right) on this category.
        Parameters:
        mbr - the member
        checkAncestor - if true check with ancestors of this category
        Returns:
        true if the given member is a declared user (for use Right) on this category.
        Since:
        jcms-10.0.6 / JCMS-8769
      • hasDeclaredUsers

        public boolean hasDeclaredUsers()
        Returns true if members or groups are declared as user (for use Right) on this category.
        Returns:
        true if members or groups are declared as user (for use Right) on this category.
        Since:
        jcms-10.0.6 / JCMS-8769
      • hasDeclaredUsers

        public boolean hasDeclaredUsers​(boolean checkAncestor)
        Returns true if members or groups are declared as user (for use Right) on this category.
        Parameters:
        checkAncestor - if true check the parents of this category
        Returns:
        true if members or groups are declared as user (for use Right) on this category.
        Since:
        jcms-10.0.6 / JCMS-8769
      • getManagerMemberSet

        public java.util.HashSet<Member> getManagerMemberSet()
        Returns:
        the members declared as manager of this category (and sub categories).
        Since:
        jcms-10.0.5
      • getManagerMemberSet

        public java.util.HashSet<Member> getManagerMemberSet​(boolean excludeMembersWithoutReadAuthorization)
        Parameters:
        excludeMembersWithoutReadAuthorization - true to filter members which do not have explicit read right on this category (or its parent), false to return declared member without any filter
        Returns:
        the members declared as manager of this category (and sub categories).
        Since:
        jcms-10.0.6 / JCMS-9281
      • setManagerMemberSet

        public void setManagerMemberSet​(java.util.HashSet<Member> managerMemberSet)
        Set the members declared as manager of this category (and sub categories).
        Parameters:
        managerMemberSet - a set of Member
        Since:
        jcms-10.0.5
      • getManagerGroupSet

        public java.util.HashSet<Group> getManagerGroupSet​(boolean excludeGroupsWithoutReadAuthorization)
        Parameters:
        excludeGroupsWithoutReadAuthorization - true to filter groups which do not have read right on this category, false to return declared groups without any filter
        Returns:
        the groups declared as authorized to use this category (and sub categories), never return null
        Since:
        jcms-10.0.6 / JCMS-9281
      • setManagerGroupSet

        public void setManagerGroupSet​(java.util.HashSet<Group> managerGroupSet)
        Set the groups declared as manager of this category (and sub categories).
        Parameters:
        managerGroupSet - a set of Group
        Since:
        jcms-10.0.5
      • isDeclaredManager

        public boolean isDeclaredManager​(Member mbr)
        Returns true if the given member is a declared manager on this category (or any parent category).
        Parameters:
        mbr - the member
        Returns:
        true if the given member is a declared manager on this category (or any parent category).
        Since:
        jcms-10.0.5
      • isDeclaredManager

        public boolean isDeclaredManager​(Member mbr,
                                         boolean checkAncestor)
        Returns true if the given member is a declared manager on this category.
        Parameters:
        mbr - the member
        checkAncestor - if true check with ancestors of this category
        Returns:
        true if the given member is a declared manager on this category.
        Since:
        jcms-10.0.5
      • hasDeclaredManagers

        public boolean hasDeclaredManagers()
        Returns true if members or groups are declared as manager on this category.
        Returns:
        true if members or groups are declared as manager on this category.
        Since:
        jcms-10.0.5
      • hasDeclaredManagers

        public boolean hasDeclaredManagers​(boolean checkAncestor)
        Returns true if members or groups are declared as manager on this category.
        Parameters:
        checkAncestor - if true check the parents of this category
        Returns:
        true if members or groups are declared as manager on this category.
        Since:
        jcms-10.0.5
      • getFirstAncestorWithDeclaredManagers

        public Category getFirstAncestorWithDeclaredManagers()
        Returns the first ancestor of this category with declared managers.
        Returns:
        the first ancestor of this category with declared managers.
        Since:
        jcms-10.0.5
      • getReadRightsString

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

        public java.util.Collection<? extends TreeNode> getTreeChildren()
        Description copied from interface: TreeNode
        Returns a Collection of TreeNode children of the current node
        Specified by:
        getTreeChildren in interface TreeNode
        Returns:
        Collection of TreeNode
      • getTreeParent

        public TreeNode getTreeParent()
        Description copied from interface: TreeNode
        Returns parent of the current node
        Specified by:
        getTreeParent in interface TreeNode
        Returns:
        TreeNode parent Node
      • 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
      • 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
      • 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
      • 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
      • nameExists

        public java.lang.String nameExists​(Category parent)
        Check if another category exists with the same name (case insensitive) under a given parent (skip this category). If such a category exists return the language code (en, fr, ...) of the conflicting name. Otherwise returns null.
        Parameters:
        parent - the parent category to be tests
        Returns:
        null if no category use the same name (case insensitive) or the language code of the conflicting name.
        Since:
        jcms-5.6.1
      • checkName

        public boolean checkName​(Category parent)
        Return true if another category exists with same name (case insensitive) under the given parent
        Parameters:
        parent - the parent category to test
        Returns:
        true if a category exists
        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
      • getTypeReferrerCount

        public int getTypeReferrerCount()
        Returns the number of type referencing this category (through category fields and default categories).
        Returns:
        the number of type referencing this category.
        Since:
        jcms-5.5.0
      • getWSTypeEntryReferrerSet

        public java.util.Set<WSTypeEntry> getWSTypeEntryReferrerSet()
        Returns a set of WSTypeEntry referencing this category.
        Returns:
        a set of WSTypeEntry referencing this category.
        Since:
        jcms-5.5.0
      • refreshTypeReferrerCount

        public void refreshTypeReferrerCount()
        Refresh type referrer count.
        Since:
        jcms-5.5.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
      • 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)
      • performDeepCopy

        public void performDeepCopy​(Member mbr,
                                    java.util.Map context)
        Performs category deep copy
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • getReadableCatSet

        public static java.util.Set<Category> getReadableCatSet​(java.util.Set<Category> catSet,
                                                                Member mbr)
        Returns a category subset the given member can read
        Parameters:
        catSet - the category set to be filtered
        mbr - the reader
        Returns:
        a clone of catSet without categories the member cannot read
        Since:
        jcms-5.0.1
      • getReadableCatSet

        public static java.util.Set<Category> getReadableCatSet​(Category[] cats,
                                                                Member mbr)
        Returns a category subset the given member can read.
        Parameters:
        cats - the category set to be filtered
        mbr - the reader
        Returns:
        a set of categories without categories the member cannot read
        Since:
        jcms-9.0.2
      • performImport

        public ControllerStatus performImport​(Member mbr,
                                              java.io.File file,
                                              java.lang.String languages,
                                              java.lang.String encoding)
        Parse and imports categories from the given file under this category.
        Parameters:
        mbr - the member used for creation and update of categories
        file - the categories file to parse
        languages - is the comma separated list of the languages in which the translation will appear in the specified file.
        For example, {"en", "fr"} if the file contains a line such as "My Category | Ma catégorie".
        Or {"fr", "en"} if the file contains a line such as "Ma catégorie | My Category".
        If null, the current site language will be used (Channel.getLanguageList().
        encoding - the encoding of the file to import, if null, the encoding will be guessed using a CharsetDetector, and if the encoding cannot be guessed, ISO-8859-1 is used as a last resort. Therefore, you should always precise one when possible.
        Returns:
        a ControllerStatus indicating the operation success/failure (never return null)
      • performExport

        public java.lang.String performExport​(Member loggedMember,
                                              java.lang.String languages)
        Returns a String representation of this categories and its descendant in the same format than the import.
        Parameters:
        loggedMember - the member processing export operation, used for read rights
        languages - is the comma separated list of the languages in which the translation will appear in the specified file.
        If null, the current site language will be used (Channel.getLanguageList().
        Returns:
        a String representation of current cat and descendants
        Since:
        jcms-10.0.4 JCMS-7822
      • exportXmlRelated

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