Class Category
- java.lang.Object
-
- com.jalios.jstore.BasicStorable
-
- com.jalios.jcms.Data
-
- com.jalios.jcms.Category
-
- All Implemented Interfaces:
DBConstants
,EditableData
,JcmsConstants
,ImportConstants
,MashupConstants
,Searchable
,Storable
,JaliosConstants
,LangPropertyArgument
,TreeNode
,java.lang.Cloneable
,java.lang.Comparable<BasicStorable>
public class Category extends Data implements EditableData, TreeNode, Searchable, DBConstants
A Category object is a node of the category tree. It references a set of Publications.- Version:
- $Revision: 135744 $
- Author:
- Olivier Dedieu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Category.AuthorizedSelector
AuthorizedSelector selects all the categories a member is authorized to read.static class
Category.CategoryUsageSelector
Checks if loggedMember can read/use/manage categorystatic class
Category.DeepOrderComparator<T extends Category>
static class
Category.LeafSelector
static class
Category.NameComparator<T extends Category>
static class
Category.NameSelector
Select categories by their name.static class
Category.NodeSelector
static class
Category.OrderChildrenFirstComparator<T extends Category>
static class
Category.OrderChildrenLastComparator<T extends Category>
static class
Category.OrderComparator<T extends Category>
static class
Category.SelectableCategorySelector
Checks if category is selectable-
Nested classes/interfaces inherited from class com.jalios.jcms.Data
Data.AuthorComparator<T extends Data>, Data.AuthorSelector, Data.CdateSelector, Data.DataNameComparator<T extends Data>, Data.DeletableSelector, Data.ImportSelector, Data.MdateSelector, Data.OpAuthorComparator<T extends Data>, Data.RowIdComparator<T extends Data>, Data.StrongLockSelector
-
Nested classes/interfaces inherited from class com.jalios.jstore.BasicStorable
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable>
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALPHABETICAL_ORDER
protected java.util.HashSet<Group>
authorizedGroupHashSet
protected java.util.TreeSet<Group>
authorizedGroupSet
protected java.util.HashSet<Member>
authorizedMemberHashSet
protected java.util.TreeSet<Member>
authorizedMemberSet
protected int
childrenOrder
protected java.lang.String
color
static int
CTRL_TOPIC_ADVANCED
static int
CTRL_TOPIC_PARENT
static java.lang.String
CTXT_SKIP_PUBLICATIONS
static java.lang.String
CTXT_SKIP_WORKSPACE
static int
CUSTOM_ORDER
protected java.lang.String
description
protected java.util.HashMap<java.lang.String,java.lang.String>
descriptionML
static java.lang.String
EXPORT_CAT_SEPARATOR
protected java.util.TreeSet<java.lang.String>
friendlyURLSet
protected java.lang.String
icon
protected java.util.HashMap<java.lang.String,java.lang.String>
iconML
protected java.lang.String
image
protected java.util.HashMap<java.lang.String,java.lang.String>
imageML
static java.lang.Character
IMPORT_EXPORT_DEPTH_CHAR
static java.lang.String
IMPORT_EXPORT_DESCRIPTION_SEPARATOR
static java.lang.String
IMPORT_EXPORT_KEYWORDS_SEPARATOR
static java.lang.String
IMPORT_EXPORT_NAME_SEPARATOR
protected boolean
isSelectable
protected java.util.HashSet<Group>
managerGroupSet
protected java.util.HashSet<Member>
managerMemberSet
protected java.lang.String
name
protected java.util.HashMap<java.lang.String,java.lang.String>
nameML
protected boolean
newTab
protected int
order
protected Category
parent
static java.lang.String
REVISION
protected java.lang.String[]
synonyms
protected java.lang.String
typeReferrer
protected int
typeReferrerCount
protected java.util.HashSet<Group>
useGroupSet
protected java.util.HashSet<Member>
useMemberSet
-
Fields inherited from class com.jalios.jcms.Data
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate, WRITE_IN_PROGRESS_EXTRA_INFO
-
Fields inherited from class com.jalios.jstore.BasicStorable
cdate, ddate, id, isStoreCache, mdate, store
-
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_OPAUTHOR, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READ_ACK, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_RESTRICTIVE_UPDATE_RIGHTS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, OPAUTHOR_ID_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
-
Fields inherited from interface com.jalios.jcms.mashup.ImportConstants
IMPORT_ALARM_MGR, IMPORT_AUTHOR_PROP, IMPORT_CATEGORY_DEFAULT, IMPORT_DC_ATTR, IMPORT_DC_STEP, IMPORT_DIR, IMPORT_ENABLED, IMPORT_JDOM_ELEMENT, IMPORT_LOG_FILE, IMPORT_LOG_MAX, IMPORT_OPTIONS, IMPORT_OPTIONS_DC_CONTEXT, IMPORT_ROOT_PROP, IMPORT_SOURCE_FILE, IMPORT_SOURCE_PREFIX_PROP, IMPORT_SOURCES_DIR, IMPORT_STEP_CLEAN, IMPORT_STEP_IMPORT, IMPORT_STEP_UPDATE_REF, IMPORT_WS_PROP
-
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
-
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
-
Fields inherited from interface com.jalios.jcms.mashup.MashupConstants
DATA_TAG, DATASET_TAG, FIELD_CLASS, FIELD_ENTRY, FIELD_ITEM, FIELD_KEY, FIELD_NAME, FIELD_TAG, FIELD_VALUE, FILE_FIELD, FILE_ID, FILE_MTIME, FILE_SIZE, FILE_TAG, FILE_TICKET, FILESET_TAG, RELATED_TAG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAuthorizedGroup(Group grp)
Add an authorized groupvoid
addAuthorizedMember(Member mbr)
Add an authorized member.ControllerStatus
addSiblings(java.lang.String names, Member loggedMember, java.lang.String userLang)
Creates categories based on given names as sibling of current CategoryControllerStatus
addSubs(java.lang.String names, Member loggedMember, java.lang.String userLang)
Create a Category under the given categoryboolean
canBeReadBy(Group group, boolean checkAncestors)
Deprecated.since JCMS-8579boolean
canBeReadBy(Member member, boolean searchInGroups, boolean checkAncestors)
Check if a member can read this category.boolean
canBeReadBy(Member member, boolean searchInGroups, RightInfo rightInfo)
Checks if the specified member is authorized to read this Category.boolean
canBeUsedBy(Member member)
Dual method ofMember.canUseCategory(Category)
ControllerStatus
checkDelete(Member mbr, java.util.Map context)
Checks if the deletion can be performedControllerStatus
checkIntegrity()
Checks whether or not data integrity constraints are respected.ControllerStatus
checkMember(int op, Member mbr, java.util.Map context)
Checks if the given member can perform the given operation.boolean
checkName(Category parent)
Return true if another category exists with same name (case insensitive) under the given parentControllerStatus
checkUpdate(Member mbr, java.util.Map context)
Checks if the update can be performedboolean
childExist(java.lang.String name)
Check if this category contains a child with the given nameboolean
containsDescendant(Category category)
Test if a category is a descendant of this category (this method is equivalent to invoke category.hasAncestor(this))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 memberControllerStatus
delete(Member loggedMember)
Delete the given categoryvoid
exportXmlField(java.lang.StringBuffer sb, int indentLevel)
Fills the given StringBuffer with Xml export of fields of this data.protected void
exportXmlRelated(java.lang.StringBuffer sb, java.lang.String related, int indentLevel)
java.util.Set<Content>
getAllContentSet()
Return a set containing all the contents referenced by this category and all the descendant of this category.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.java.util.Set<Publication>
getAllPublicationSet()
Return a set containing all the publications referenced by this category and all the descendants of this category.java.util.Set<Publication>
getAllPublicationSet(boolean searchInDB)
Return a set containing all the publications referenced by this category and all the descendants of this categoryjava.util.List<Category>
getAncestorList()
Returns the list of all the ancestors of this category, from the immediate parent to the root (root excluded).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.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 isFirst Level > Second Level > Category Name
, and given ancestor is First Level, it returnsSecond Level > Category Name
).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 isFirst Level > Second Level > Category Name
, and given ancestor is First Level, it returnsSecond Level > Category Name
).java.lang.String
getAncestorString(java.lang.String sep, boolean includeCat)
Returns a String representation of the ancestor of this category (egFirst Level > Second Level > Category Name
).java.lang.String
getAncestorString(java.lang.String sep, boolean includeCat, java.lang.String lang)
Returns a String representation of the ancestor of this category (egFirst Level > Second Level > Category Name
).java.util.Set<Group>
getAuthorizedGroupSet()
Get the value of authorizedGroupSet.java.util.Set<Member>
getAuthorizedMemberSet()
Get the value of authorizedMemberSet.static Category.AuthorizedSelector
getAuthorizedSelector(Member member)
java.lang.String
getAvailableColor()
Find the first available color from this category to these ancestors.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.Category
getChild(java.lang.String name)
Return the child of this category with the given nameint
getChildrenOrder()
Retrieves the current ordering type in use for children of this Category.java.util.Set<Category>
getChildrenSet()
Returns the children categories (ie categories having this category as parent)java.lang.String
getColor()
java.lang.String
getColor(boolean defaultOnParent)
Returns the color of this category.<T extends Category>
java.util.Comparator<T>getComparator(java.lang.String lang)
Returns the right comparator (Category.NameComparator
, orCategory.OrderComparator
) to use depending on children order.java.util.Set<Content>
getContentSet()
Returns the contents which use this categoryjava.util.Set<Content>
getContentSet(boolean searchInDB)
Returns the contents which use this categorystatic java.lang.String
getCSVHeader(java.lang.String lang)
Returns the CSV header of this objectjava.lang.String
getDataIcon()
Returns source information for the icon associated to this Data, either a relative path or sprite classes name.java.lang.String
getDataImage()
Retrieves the image path of this data in the channel's main language.java.lang.String
getDataImage(java.lang.String lang, boolean useDefault)
Retrieves the image path of this data.java.lang.String
getDataName(java.lang.String language)
Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.<T extends Publication>
intgetDBPublicationCount()
Count the number of DB publications which belongs to this category (exact mode).<T extends Publication>
intgetDBPublicationCount(java.lang.Class<T> clazz, boolean exactCat)
Count the number of DB publication which belongs to this category.<T extends Publication>
intgetDBPublicationCount(java.lang.Class<T> clazz, boolean exactCat, boolean searchInTrash)
Count the number of DB publication which belongs to this category.static java.util.Comparator<Category>
getDeepOrderComparator()
Deprecated.usegetDeepOrderComparator(String)
instead.static java.util.Comparator<Category>
getDeepOrderComparator(java.lang.String lang)
java.util.Set<Category>
getDescendantSet()
Returns all the descendant categories of this one (ie categories having this category as ancestor)java.lang.String
getDescription()
Get the value of description.java.lang.String
getDescription(java.lang.String lang)
Get the value of description bound to the given language.java.lang.String
getDescription(java.lang.String lang, boolean useDefault)
Get the value of description bound to the given language.java.util.HashMap<java.lang.String,java.lang.String>
getDescriptionML()
Get the value of descriptionML.java.lang.String
getExportXmlDataValue()
Returns a string representation of this data used by exportXml().Category
getFirstAncestorWithDeclaredManagers()
Returns the first ancestor of this category with declared managers.Category
getFirstCommonAncestor(Category category)
Returns the first common ancestor (FCA) with a given category.static Category
getFirstCommonAncestor(java.util.Collection<Category> collection)
Returns the common ancestors of the given categoriesstatic 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.static Category[]
getFirstRelatives(java.util.Set<Category> rootSet)
Check if one category of the set is relatives to an other category.java.util.TreeSet<java.lang.String>
getFriendlyURLSet()
Get friendly urls Set.static java.util.TreeSet<Category>
getHighestLevelCategorySet(java.util.TreeSet<Category> categorySet)
Keeps only the categories of highest leveljava.lang.String
getIcon()
Get the value of icon.java.lang.String
getIcon(java.lang.String lang)
Get the value of icon bound to the given language.java.lang.String
getIcon(java.lang.String lang, boolean useDefault)
Get the value of icon bound to the given language.java.util.HashMap<java.lang.String,java.lang.String>
getIconML()
Get the value of iconML.java.lang.String
getImage()
Get the value of image.java.lang.String
getImage(java.lang.String lang)
Get the value of image bound to the given language.java.lang.String
getImage(java.lang.String lang, boolean useDefault)
Get the value of image bound to the given language.java.util.HashMap<java.lang.String,java.lang.String>
getImageML()
Get the value of imageML.java.util.Date
getIndexingDate()
Retrieve the Date at which this Category was indexed in its search engine.static Category.LeafSelector
getLeafSelector()
java.util.HashSet<Group>
getManagerGroupSet()
java.util.HashSet<Group>
getManagerGroupSet(boolean excludeGroupsWithoutReadAuthorization)
java.util.HashSet<Member>
getManagerMemberSet()
java.util.HashSet<Member>
getManagerMemberSet(boolean excludeMembersWithoutReadAuthorization)
java.lang.String
getName()
Get the value of name.java.lang.String
getName(java.lang.String lang)
Get the value of name bound to the given language.java.lang.String
getName(java.lang.String lang, boolean useDefault)
Get the value of name bound to the given language.static java.util.Comparator
getNameComparator(java.lang.String lang)
Retrieves a new Categories' NameComparator.java.util.HashMap<java.lang.String,java.lang.String>
getNameML()
Get the value of nameML.boolean
getNewTab()
static Category.NodeSelector
getNodeSelector()
int
getOrder()
static java.util.Comparator<Category>
getOrderChildrenFirstComparator()
static java.util.Comparator<Category>
getOrderChildrenLastComparator()
static java.util.Comparator
getOrderComparator(java.lang.String lang)
Retrieves a new Categories' OrderComparator.Category
getParent()
Get the value of parent.java.util.Set<Publication>
getPublicationSet()
Returns the publications which use this categoryjava.util.Set<Publication>
getPublicationSet(boolean searchInDB)
Returns the publications which use this category<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.<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.static java.util.Set<Category>
getReadableCatSet(Category[] cats, Member mbr)
Returns a category subset the given member can read.static java.util.Set<Category>
getReadableCatSet(java.util.Set<Category> catSet, Member mbr)
Returns a category subset the given member can readjava.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, ...")java.lang.String[]
getSearchStrings()
This method gets called to get all the String to search in (typically the String attribute of the Storable).java.lang.String[]
getSynonyms()
Get the value of synonyms.java.util.Collection<? extends TreeNode>
getTreeChildren()
Returns a Collection of TreeNode children of the current nodeTreeNode
getTreeParent()
Returns parent of the current nodeTreeNode
getTreeRoot()
Returns the root of the current nodeint
getTypeReferrerCount()
Returns the number of type referencing this category (through category fields and default categories).java.util.HashSet<Group>
getUseGroupSet()
java.util.HashSet<Group>
getUseGroupSet(boolean excludeGroupsWithoutReadAuthorization)
java.util.HashSet<Member>
getUseMemberSet()
java.util.HashSet<Member>
getUseMemberSet(boolean excludeMembersWithoutReadAuthorization)
java.util.Set<WSTypeEntry>
getWSTypeEntryReferrerSet()
Returns a set of WSTypeEntry referencing this category.boolean
hasAncestor(Category category)
Test if a category is an ancestor of this category (it returns false if the received category is this category).boolean
hasAnyReadRights()
Tests if this category has member or group read rights.boolean
hasDeclaredManagers()
Returns true if members or groups are declared as manager on this category.boolean
hasDeclaredManagers(boolean checkAncestor)
Returns true if members or groups are declared as manager on this category.boolean
hasDeclaredUsers()
Returns true if members or groups are declared as user (for use Right) on this category.boolean
hasDeclaredUsers(boolean checkAncestor)
Returns true if members or groups are declared as user (for use Right) on this category.boolean
hasNoReadRights()
Tests if this category has NO member read rights AND NO group read rights.protected boolean
internalCanBeReadBy(Group group)
Check of this category can be read by the given groupprotected boolean
internalCanBeReadBy(Member member, boolean searchInGroups)
Check of this category can be read by the given memberboolean
isAlphabeticalOrder()
boolean
isCustomOrder()
boolean
isDeclaredManager(Member mbr)
Returns true if the given member is a declared manager on this category (or any parent category).boolean
isDeclaredManager(Member mbr, boolean checkAncestor)
Returns true if the given member is a declared manager on this category.boolean
isDeclaredUser(Member mbr)
Returns true if the given member is a declared user (for Use Right) on this category (or any parent category).boolean
isDeclaredUser(Member mbr, boolean checkAncestor)
Returns true if the given member is a declared user (for use Right) on this category.boolean
isLeaf()
Returns true if this category is a leaf, that is if it has no child.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.boolean
isNode()
Returns true if this category is a node, that is if it has at least one child.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.boolean
isRoot()
Returns true if this category is the root category.boolean
isSelectable()
boolean
isSibling(Category cat)
Returns true if the given category is a sibling of this category.boolean
isTerminalNode()
Returns true if this category is a terminal node, that is if it has only leaf childrenboolean
isTreeLeaf()
Returns boolean true if the TreeNode is a leafboolean
isTreeNode()
Returns boolean true if the TreeNode is a nodeControllerStatus
mergeWith(Category tgtCat, Member loggedMember)
Merges this category with the given the category.ControllerStatus
moveTo(Category parent, Member loggedMember)
Move Category under given parentjava.lang.String
nameExists(Category parent)
Check if another category exists with the same name (case insensitive) under a given parent (skip this category).protected void
performAfterWrite(int op, Member mbr, java.util.Map context)
Called to perform some action after the write.protected void
performBeforeWrite(int op, Member mbr, java.util.Map context)
Called to perform some action before the write.void
performDeepCopy(Member mbr, java.util.Map context)
Performs category deep copyvoid
performDelete(Member mbr, java.util.Map context)
Performs data deletionjava.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.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.void
refreshTypeReferrerCount()
Refresh type referrer count.boolean
removeAuthorizedGroup(Group grp)
Remove an authorized group.boolean
removeAuthorizedMember(Member mbr)
Remove an authorized member.ControllerStatus
rename(java.lang.String name, java.lang.String userLang, Member loggedMember)
Rename the given categoryvoid
setAuthorizedGroupSet(java.util.TreeSet<Group> set)
Set the value of authorizedGroupSet.void
setAuthorizedMemberSet(java.util.TreeSet<Member> set)
Set the value of authorizedMemberSet.void
setChildrenOrder(int childrenOrder)
Define the children ordering to be used in this categoryvoid
setColor(java.lang.String v)
Set the value of color.void
setDescription(java.lang.String v)
Set the value of description.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)
orsetDescriptionML(HashMap)
) depending on the specified language.void
setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of descriptionML.void
setFriendlyURLSet(java.util.TreeSet<java.lang.String> v)
Set the value of friendlyURLSet.void
setIcon(java.lang.String v)
Set the value of icon.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)
orsetIconML(HashMap)
) depending on the specified language.void
setIconML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of iconML.void
setImage(java.lang.String v)
Set the value of image.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)
orsetImageML(HashMap)
) depending on the specified language.void
setImageML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of imageML.void
setManagerGroupSet(java.util.HashSet<Group> managerGroupSet)
Set the groups declared as manager of this category (and sub categories).void
setManagerMemberSet(java.util.HashSet<Member> managerMemberSet)
Set the members declared as manager of this category (and sub categories).void
setName(java.lang.String v)
Set the value of name.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)
orsetNameML(HashMap)
) depending on the specified language.void
setNameML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of nameML.void
setNewTab(boolean v)
Set the value of newTab.void
setOrder(int order)
void
setParent(Category v)
Set the value of parent.void
setSelectable(boolean isSelectable)
void
setSynonyms(java.lang.String[] v)
Set the value of synonyms.void
setUseGroupSet(java.util.HashSet<Group> useGroupSet)
Set the groups who are authorized to use this category (and sub categories).void
setUseMemberSet(java.util.HashSet<Member> useMemberSet)
Set the members who are authorized to use this category (and sub categories).java.lang.String
toCSV(java.lang.String lang)
Returns a CSV view of this objectjava.lang.String
toFullString()
java.lang.String
toString()
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.-
Methods inherited from class com.jalios.jcms.Data
canBeReadBy, canBeUnlockedBy, canRequestUnlock, checkAndPerformCreate, checkAndPerformCreate, checkAndPerformDelete, checkAndPerformDelete, checkAndPerformUpdate, checkAndPerformUpdate, checkCreate, checkCreate, checkDelete, checkIntegrity, checkLockMember, checkStrongLockMember, checkStrongLockMember, checkUpdate, checkWrite, cleanHybridCollection, cleanHybridCollection, cleanHybridCollection, cleanHybridCollections, clone, computeDBIDArray, computeDBIDList, computeDBIDSet, exportXml, exportXml, exportXml, exportXml, exportXmlRelated, fillExportXmlFieldAttributes, getAllReferrerSet, getAllReferrerSet, getAllTypeFieldEntry, getAuthor, getAuthor, getAuthorComparator, getAuthorDBID, getAuthorId, getAuthorSelector, getBooleanFieldValue, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCategoryFieldValue, getCdateSelector, getComparator, getDataIconAlt, getDataIconCSS, getDataIconHtml, getDataIconHtml, getDataIconTitle, getDataImage, getDataNameComparator, getDate, getDate, getDateSelector, getDeletableSelector, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayLinkCss, getDisplayLinkDataAttribute, getDisplayLinkHtmlAttributes, getDisplayUrl, getDoubleFieldValue, getDoubleFieldValue, getExtension, getExtraData, getExtraDataMap, getExtraDBData, getExtraDBDataMap, getExtraInfo, getExtraInfoMap, getFieldStatusMap, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getGenericThumbnail, getGenericThumbnail, getImportAuthor, getImportBatch, getImportDate, getImportDisplayUrl, getImportId, getImportMap, getImportMdate, getImportSelector, getImportSignature, getImportSource, getImportSourceUrl, getImportUrl, getIntFieldValue, getIntFieldValue, getLangPropertyValue, getLinkCount, getLinkIndexedDataSet, getLinkIndexedDataSet, getLockDate, getLockInfo, getLockMember, getLongFieldValue, getLongFieldValue, getMdateSelector, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getOpAuthor, getOpAuthorComparator, getOpAuthorId, getOpDelegate, getReadAuthorizedSelector, getReferrerSet, getRowId, getRowIdComparator, getStrongLock, getStrongLockContext, getStrongLockContextData, getStrongLockDate, getStrongLockInfo, getStrongLockMember, getStrongLockSelector, getTypeEntry, getTypeFieldsEntries, getUpdateInstance, getVirtualIDSet, importXml, importXmlFieldsWithReferences, importXmlFiles, importXmlReferences, initializeDBDataCollections, isDBData, isImported, isImportUpdated, isInDatabase, isLocked, isPersisted, isStrongLocked, lock, markNewImport, mergeHybridLink, mergeHybridLink, performCreate, performCreate, performDelete, performUpdate, performUpdate, prepareUpdateContext, printDataName, printDisplayLinkEnd, printDisplayLinkStart, printDisplayLinkStart, printDisplayUrl, printDisplayUrl, putStrongLock, putStrongLock, releaseStrongLock, releaseStrongLock, removeExtraData, removeExtraDBData, removeExtraInfo, setAuthor, setAuthorDBID, setAuthorId, setBooleanFieldValue, setCategoryFieldValue, setDoubleFieldValue, setExtension, setExtraData, setExtraDataMap, setExtraDBData, setExtraDBDataMap, setExtraDBDataMap, setExtraInfo, setFieldValue, setFieldValue, setId, setImportAuthor, setImportBatch, setImportDate, setImportDisplayUrl, setImportId, setImportMap, setImportMdate, setImportSignature, setImportSource, setImportSourceUrl, setImportUpdated, setIntFieldValue, setLongFieldValue, setMdate, setOpAuthor, setOpAuthorId, setOpDelegate, setRowId, splitHybridCollections, unlock, unlock, unmarkNewImport, updateDisplayLinkCss, updateDisplayLinkDataAttribute, updateDisplayLinkHtmlAttributes, updateExtraDataMap, updateExtraDBDataMap, updateIndexTreeSet
-
Methods inherited from class com.jalios.jstore.BasicStorable
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, hashCode, isStored, resetInternalCaches, resolveAtt, resolveVal, setAttributes, setAttributes, setCdate, setDdate, setStore, toXml
-
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
ALPHABETICAL_ORDER
public static final int ALPHABETICAL_ORDER
- See Also:
- Constant Field Values
-
CUSTOM_ORDER
public static final int CUSTOM_ORDER
- See Also:
- Constant Field Values
-
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
-
CTRL_TOPIC_PARENT
public static final int CTRL_TOPIC_PARENT
- See Also:
- Constant Field Values
-
CTRL_TOPIC_ADVANCED
public static final int CTRL_TOPIC_ADVANCED
- 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
-
parent
protected Category parent
-
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
-
toFullString
public java.lang.String toFullString()
- Overrides:
toFullString
in classData
-
toCSV
public java.lang.String toCSV(java.lang.String lang)
Returns a CSV view of this object
-
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 classData
- 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 classData
- Parameters:
sb
- the StringBufferindentLevel
- 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 categoryroots
- 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 (egFirst Level > Second Level > Category Name
). Root is excluded.- Parameters:
sep
- the separatorincludeCat
- if true, the category is includedlang
- 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 (egFirst Level > Second Level > Category Name
). Root is excluded.- Parameters:
sep
- the separatorincludeCat
- 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 isFirst Level > Second Level > Category Name
, and given ancestor is First Level, it returnsSecond Level > Category Name
). Root is excluded.- Parameters:
ancestor
- the ancestorsep
- the separatorincludeCat
- if true, the category is includedlang
- 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 isFirst Level > Second Level > Category Name
, and given ancestor is First Level, it returnsSecond Level > Category Name
). Root is excluded.- Parameters:
ancestor
- the ancestorsep
- the separatorincludeCat
- 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 ofChannel.getPublicationSet(Class, Member)
Check rights.- Type Parameters:
T
- a type of Publication- Parameters:
clazz
- the Publication's class to retrievembr
- 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 ofChannel.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 categoryWarning : 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 forexactCat
- 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 forexactCat
- true to search for publication only in this publication, false, to search in descendants categoriessearchInTrash
- 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 withloggedMember
- 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 parentloggedMember
- 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 loggedMember
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 loggedMember
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 nameuserLang
- the current languageloggedMember
- 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 interfaceSearchable
- 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.
Default behaviour is to return toFullString() of Data or empty string if toFullString is null.- Overrides:
getDataName
in classData
- 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 classData
- 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 classData
- 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 nameuseDefault
- 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)
orsetNameML(HashMap)
) depending on the specified language.- Parameters:
lang
- the language (ISO 639 code) in which to set the valuevalue
- 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 descriptionuseDefault
- 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)
orsetDescriptionML(HashMap)
) depending on the specified language.- Parameters:
lang
- the language (ISO 639 code) in which to set the valuevalue
- 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 constantCategory.ALPHABETICAL_ORDER
, for custom ordering (using "order" member), use constantCategory.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 andCategory.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 classData
- Returns:
- a relative path (eg
images/jalios/icon/abstract.gif
) or sprite classes name (egss_sprite ss_date
). - See Also:
Data.getDataIconHtml(String)
- Either by specifying a relative image path :
-
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 iconuseDefault
- 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)
orsetIconML(HashMap)
) depending on the specified language.- Parameters:
lang
- the language (ISO 639 code) in which to set the valuevalue
- 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 imageuseDefault
- 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)
orsetImageML(HashMap)
) depending on the specified language.- Parameters:
lang
- the language (ISO 639 code) in which to set the valuevalue
- 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.
-
getComparator
public <T extends Category> java.util.Comparator<T> getComparator(java.lang.String lang)
Returns the right comparator (Category.NameComparator
, orCategory.OrderComparator
) to use depending on children order.- Type Parameters:
T
- type of Category to compare- Parameters:
lang
- the language in which to compare children categories.- Returns:
- an instance of a comparator
- Since:
- jcms-10.0.4
- See Also:
setChildrenOrder(int)
,isAlphabeticalOrder()
,isCustomOrder()
-
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.usegetDeepOrderComparator(String)
instead.- 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 givenMember
. - Since:
- jcms-5.7.3
-
getNodeSelector
public static Category.NodeSelector getNodeSelector()
-
getLeafSelector
public static Category.LeafSelector getLeafSelector()
-
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 checkedsearchInGroups
- 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 classData
- 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
- aRightInfo
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 checksearchInGroups
- 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
-
canBeUsedBy
public boolean canBeUsedBy(Member member)
Dual method ofMember.canUseCategory(Category)
- Parameters:
member
- the member to check- Returns:
- true if the member is not null and can use this category
- Since:
- jcms-6.0
- See Also:
Member.canUseCategory(Category)
-
canBeReadBy
@Deprecated public boolean canBeReadBy(Group group, boolean checkAncestors)
Deprecated.since JCMS-8579Checks if a group can read this category.- Parameters:
group
- the group to checkcheckAncestors
- 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 methodhasNoReadRights()
.- 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 methodhasAnyReadRights()
.- 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()
- Returns:
- the groups declared as authorized to use this category (and sub categories).
- Since:
- jcms-10.0.6 / JCMS-8769
- See Also:
to filter groups which do not have been declared in read right
-
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()
- Returns:
- the members declared as authorized to use this category (and sub categories).
- Since:
- jcms-10.0.6 / JCMS-8769
- See Also:
to filter member which have not been declared in read right
-
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 membercheckAncestor
- 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()
- Returns:
- the groups declared as manager of this category (and sub categories).
- Since:
- jcms-10.0.5
- See Also:
to filter groups which have not been declared in read right
-
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 membercheckAncestor
- 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 interfaceTreeNode
- Returns:
- Collection of TreeNode
-
getTreeParent
public TreeNode getTreeParent()
Description copied from interface:TreeNode
Returns parent of the current node- Specified by:
getTreeParent
in interfaceTreeNode
- 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 interfaceTreeNode
- 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 interfaceTreeNode
- 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 interfaceTreeNode
- Returns:
- TreeNode root Node
-
checkIntegrity
public ControllerStatus checkIntegrity()
Checks whether or not data integrity constraints are respected.- Overrides:
checkIntegrity
in classData
- 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 classData
- Parameters:
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- 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 classData
- Parameters:
mbr
- the member which requests the write operationcontext
- 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 classData
- Parameters:
mbr
- the member which requests the write operationcontext
- 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 classData
- Parameters:
mbr
- the member which requests the write operationcontext
- 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 classData
- Parameters:
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- 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 classData
- Parameters:
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- 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 operationcontext
- 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 filteredmbr
- 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 filteredmbr
- 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 categoriesfile
- the categories file to parselanguages
- 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 aCharsetDetector
, 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 rightslanguages
- 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 classData
-
-