Class Category
- All Implemented Interfaces:
DBConstants,EditableData,JcmsConstants,ImportConstants,MashupConstants,Searchable,Storable,JaliosConstants,LangPropertyArgument,TreeNode,Cloneable,Comparable<BasicStorable>
- Author:
- Olivier Dedieu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAuthorizedSelector selects all the categories a member is authorized to read.static classChecks if loggedMember can read/use/manage categorystatic classCategory.DeepOrderComparator<T extends Category>static classstatic classstatic classCategory.NameComparator<T extends Category>static classSelect categories by their name.static classstatic classstatic classstatic classCategory.OrderComparator<T extends Category>static classChecks if category is selectableNested 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.StrongLockSelectorNested 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
FieldsModifier and TypeFieldDescriptionstatic final intprotected intprotected Stringstatic final intstatic final intstatic final Stringstatic final Stringstatic final intprotected Stringstatic final Stringprotected Stringprotected Stringstatic final Characterstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected Stringprotected booleanprotected intprotected Categoryprotected String[]protected Stringprotected intFields inherited from class com.jalios.jcms.Data
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate, WRITE_IN_PROGRESS_EXTRA_INFO, WYSIWYG_INLINE_EDIT_REQUEST_PARAMETERFields inherited from class com.jalios.jstore.BasicStorable
cdate, ddate, id, isStoreCache, mdate, storeFields 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, CLASSIFICATION_LEVEL_FIELD, DBDATA_URID, EXTENDED_READ_RIGHTS, 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_FIELDFields 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_PROPFields 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_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, 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, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, 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_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_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, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_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, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, 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, TYPES_UNKNOWN_CLASS_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_XMLFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthorizedGroup(Group grp) Add an authorized groupvoidAdd an authorized member.addSiblings(String names, Member loggedMember, String userLang) Creates categories based on given names as sibling of current CategoryCreate a Category under the given categorybooleancanBeReadBy(Member member, boolean searchInGroups, boolean checkAncestors) Check if a member can read this category.final booleancanBeReadBy(Member member, boolean searchInGroups, RightInfo rightInfo) Checks if the specified member is authorized to read this Category.booleancanBeUsedBy(Member member) Dual method ofMember.canUseCategory(Category)checkDelete(Member mbr, Map context) Checks if the deletion can be performedChecks whether or not data integrity constraints are respected.checkMember(int op, Member mbr, Map context) Checks if the given member can perform the given operation.booleanReturn true if another category exists with same name (case insensitive) under the given parentcheckUpdate(Member mbr, Map context) Checks if the update can be performedbooleanchildExist(String name) Check if this category contains a child with the given namebooleancontainsDescendant(Category category) Test if a category is a descendant of this category (this method is equivalent to invoke category.hasAncestor(this))booleancontainsUnreadPub(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 memberDelete the given categoryvoidexportXmlField(StringBuffer sb, int indentLevel) Fills the given StringBuffer with Xml export of fields of this data.protected voidexportXmlRelated(StringBuffer sb, String related, int indentLevel) Return a set containing all the contents referenced by this category and all the descendant of this category.getAllContentSet(boolean searchInDB) Return a set containing all the contents referenced by this category and all the descendant of this category.Return a set containing all the publications referenced by this category and all the descendants of this category.getAllPublicationSet(boolean searchInDB) Return a set containing all the publications referenced by this category and all the descendants of this categoryReturns the list of all the ancestors of this category, from the immediate parent to the root (root excluded).getAncestorList(Category ancestor, boolean includeAncestor) Returns the list of all the ancestors of this category, from the immediate parent to the given ancestor.getAncestorString(Category ancestor, 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).getAncestorString(Category ancestor, String sep, boolean includeCat, 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).getAncestorString(String sep, boolean includeCat) Returns a String representation of the ancestor of this category (egFirst Level > Second Level > Category Name).getAncestorString(String sep, boolean includeCat, String lang) Returns a String representation of the ancestor of this category (egFirst Level > Second Level > Category Name).Get the value of authorizedGroupSet.Get the value of authorizedMemberSet.static Category.AuthorizedSelectorgetAuthorizedSelector(Member member) Find the first available color from this category to these ancestors.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.Return the child of this category with the given nameintRetrieves the current ordering type in use for children of this Category.Returns the children categories (ie categories having this category as parent)Returns the children categories ordered according the order of this parent category.getColor()getColor(boolean defaultOnParent) Returns the color of this category.<T extends Category>
Comparator<T> getComparator(String lang) Returns the right comparator (Category.NameComparator, orCategory.OrderComparator) to use depending on children order.Returns the contents which use this categorygetContentSet(boolean searchInDB) Returns the contents which use this categorystatic StringgetCSVHeader(String lang) Returns the CSV header of this objectReturns source information for the icon associated to this Data, either a relative path or sprite classes name.Retrieves the image path of this data in the channel's main language.getDataImage(String lang, boolean useDefault) Retrieves the image path of this data.getDataName(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>
intCount the number of DB publications which belongs to this category (exact mode).<T extends Publication>
intgetDBPublicationCount(Class<T> clazz, boolean exactCat) Count the number of DB publication which belongs to this category.<T extends Publication>
intgetDBPublicationCount(Class<T> clazz, boolean exactCat, boolean searchInTrash) Count the number of DB publication which belongs to this category.static Comparator<Category> Deprecated.static Comparator<Category> getDeepOrderComparator(String lang) Returns all the descendant categories of this one (ie categories having this category as ancestor)Get the value of description.getDescription(String lang) Get the value of description bound to the given language.getDescription(String lang, boolean useDefault) Get the value of description bound to the given language.Get the value of descriptionML.Returns a string representation of this data used by exportXml().Returns the first ancestor of this category with declared managers.getFirstCommonAncestor(Category category) Returns the first common ancestor (FCA) with a given category.static CategorygetFirstCommonAncestor(Collection<Category> collection) Returns the common ancestors of the given categoriesstatic CategorygetFirstNotRelatives(Set<Category> children, Set<Category> roots) Check if one category of the set not relatives to an other category.static Category[]getFirstRelatives(Set<Category> rootSet) Check if one category of the set is relatives to an other category.Get friendly urls Set.getHighestLevelCategorySet(TreeSet<Category> categorySet) Keeps only the categories of highest levelgetIcon()Get the value of icon.Get the value of icon bound to the given language.Get the value of icon bound to the given language.Get the value of iconML.getImage()Get the value of image.Get the value of image bound to the given language.Get the value of image bound to the given language.Get the value of imageML.Retrieve the Date at which this Category was indexed in its search engine.static Category.LeafSelectorgetManagerGroupSet(boolean excludeGroupsWithoutReadAuthorization) getManagerMemberSet(boolean excludeMembersWithoutReadAuthorization) getName()Get the value of name.Get the value of name bound to the given language.Get the value of name bound to the given language.static ComparatorgetNameComparator(String lang) Retrieves a new Categories' NameComparator.Get the value of nameML.booleanstatic Category.NodeSelectorintgetOrder()static Comparator<Category> static Comparator<Category> static ComparatorgetOrderComparator(String lang) Retrieves a new Categories' OrderComparator.Get the value of parent.Returns the publications which use this categorygetPublicationSet(boolean searchInDB) Returns the publications which use this category<T extends Publication>
Set<T> getPublicationSet(Class<T> clazz) Returns a NEW Set of Publication of the given class which use this category.<T extends Publication>
Set<T> getPublicationSet(Class<T> clazz, Member mbr) Returns a NEW Set of Publication of the given class which use this category.getReadableCatSet(Category[] cats, Member mbr) Returns a category subset the given member can read.getReadableCatSet(Set<Category> catSet, Member mbr) Returns a category subset the given member can readgetReadRightsString(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, ...")String[]This method gets called to get all the String to search in (typically the String attribute of the Storable).String[]Get the value of synonyms.Collection<? extends TreeNode> Returns a Collection of TreeNode children of the current nodeReturns parent of the current nodeReturns the root of the current nodeintReturns the number of type referencing this category (through category fields and default categories).getUseGroupSet(boolean excludeGroupsWithoutReadAuthorization) getUseMemberSet(boolean excludeMembersWithoutReadAuthorization) Returns a set of WSTypeEntry referencing this category.booleanhasAncestor(Category ancestor) Test if a category is an ancestor of this category (it returns false if the received category is this category).booleanTests if this category has member or group read rights.booleanReturns true if members or groups are declared as manager on this category.booleanhasDeclaredManagers(boolean checkAncestor) Returns true if members or groups are declared as manager on this category.booleanReturns true if members or groups are declared as user (for use Right) on this category.booleanhasDeclaredUsers(boolean checkAncestor) Returns true if members or groups are declared as user (for use Right) on this category.booleanTests if this category has NO member read rights AND NO group read rights.protected booleaninternalCanBeReadBy(Member member, boolean searchInGroups) Check of this category can be read by the given memberbooleanbooleanbooleanisDeclaredManager(Member mbr) Returns true if the given member is a declared manager on this category (or any parent category).booleanisDeclaredManager(Member mbr, boolean checkAncestor) Returns true if the given member is a declared manager on this category.booleanisDeclaredUser(Member mbr) Returns true if the given member is a declared user (for Use Right) on this category (or any parent category).booleanisDeclaredUser(Member mbr, boolean checkAncestor) Returns true if the given member is a declared user (for use Right) on this category.booleanisLeaf()Returns true if this category is a leaf, that is if it has no child.booleanReturns 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.booleanisNode()Returns true if this category is a node, that is if it has at least one child.booleanReturns 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.booleanisRoot()Returns true if this category is the root category.booleanbooleanReturns true if the given category is a sibling of this category.booleanReturns true if this category is a terminal node, that is if it has only leaf childrenbooleanReturns boolean true if the TreeNode is a leafbooleanReturns boolean true if the TreeNode is a nodeMerges this category with the given the category.static booleanMove the given child at the new order in its parent.Move Category under given parentnameExists(Category parent) Check if another category exists with the same name (case insensitive) under a given parent (skip this category).protected voidperformAfterWrite(int op, Member mbr, Map context) Called to perform some action after the write.protected voidperformBeforeWrite(int op, Member mbr, Map context) Called to perform some action before the write.voidperformDeepCopy(Member mbr, Map context) Performs category deep copyvoidperformDelete(Member mbr, Map context) Performs data deletionperformExport(Member loggedMember, String languages) Returns a String representation of this categories and its descendant in the same format than the import.performImport(Member mbr, File file, String languages, String encoding) Parse and imports categories from the given file under this category.voidRefresh type referrer count.booleanRemove an authorized group.booleanRemove an authorized member.Rename the given categoryvoidSet the value of authorizedGroupSet.voidSet the value of authorizedMemberSet.voidsetChildrenOrder(int childrenOrder) Define the children ordering to be used in this categoryvoidSet the value of color.voidSet the value of description.voidsetDescription(String 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.voidSet the value of descriptionML.voidSet the value of friendlyURLSet.voidSet the value of icon.voidConvenient 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.voidSet the value of iconML.voidSet the value of image.voidConvenient 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.voidSet the value of imageML.voidsetManagerGroupSet(HashSet<Group> managerGroupSet) Set the groups declared as manager of this category (and sub categories).voidsetManagerMemberSet(HashSet<Member> managerMemberSet) Set the members declared as manager of this category (and sub categories).voidSet the value of name.voidConvenient 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.voidSet the value of nameML.voidsetNewTab(boolean v) Set the value of newTab.voidsetOrder(int order) voidSet the value of parent.voidsetSelectable(boolean isSelectable) voidsetSynonyms(String[] v) Set the value of synonyms.voidsetUseGroupSet(HashSet<Group> useGroupSet) Set the groups who are authorized to use this category (and sub categories).voidsetUseMemberSet(HashSet<Member> useMemberSet) Set the members who are authorized to use this category (and sub categories).Returns a CSV view of this objecttoString()protected voidUpdate 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, getAllRelatedData, getAllTypeFieldEntry, getAuthor, getAuthor, getAuthorComparator, getAuthorDBID, getAuthorId, getAuthorSelector, getBooleanFieldValue, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCategoryFieldValue, getCdateSelector, getComparator, getDataIconAlt, getDataIconCSS, getDataIconHtml, getDataIconHtml, getDataIconTitle, getDataImage, getDataNameComparator, getDate, getDate, getDateSelector, getDefaultFieldStatus, getDeletableSelector, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayLinkCss, getDisplayLinkDataAttribute, getDisplayLinkHtmlAttributes, getDisplayUrl, getDoubleFieldValue, getDoubleFieldValue, 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, removeAllRelatedData, removeAllRelatedData, removeExtraData, removeExtraDBData, removeExtraInfo, setAuthor, setAuthorDBID, setAuthorId, setBooleanFieldValue, setCategoryFieldValue, setDoubleFieldValue, setExtraData, setExtraDataMap, setExtraDBData, setExtraDBDataMap, setExtraDBDataMap, setExtraInfo, setFieldValue, setFieldValue, 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, updateIndexTreeSetMethods 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, setId, setStore, toXml
-
Field Details
-
ALPHABETICAL_ORDER
public static final int ALPHABETICAL_ORDER- See Also:
-
CUSTOM_ORDER
public static final int CUSTOM_ORDER- See Also:
-
CTXT_SKIP_WORKSPACE
- See Also:
-
CTXT_SKIP_PUBLICATIONS
- See Also:
-
CTRL_TOPIC_PARENT
public static final int CTRL_TOPIC_PARENT- See Also:
-
CTRL_TOPIC_ADVANCED
public static final int CTRL_TOPIC_ADVANCED- See Also:
-
EXPORT_CAT_SEPARATOR
- See Also:
-
IMPORT_EXPORT_DEPTH_CHAR
-
IMPORT_EXPORT_NAME_SEPARATOR
- See Also:
-
IMPORT_EXPORT_DESCRIPTION_SEPARATOR
- See Also:
-
IMPORT_EXPORT_KEYWORDS_SEPARATOR
- See Also:
-
name
-
nameML
-
parent
-
description
-
descriptionML
-
synonyms
-
isSelectable
protected boolean isSelectable -
order
protected int order -
childrenOrder
protected int childrenOrder -
icon
-
iconML
-
image
-
imageML
-
color
-
newTab
protected boolean newTab -
friendlyURLSet
-
authorizedMemberSet
-
authorizedGroupSet
-
useMemberSet
-
useGroupSet
-
managerMemberSet
-
managerGroupSet
-
authorizedMemberHashSet
-
authorizedGroupHashSet
-
typeReferrerCount
protected transient int typeReferrerCount -
typeReferrer
-
-
Constructor Details
-
Category
public Category()Create a new empty Category (no parent, no name, no description, no children, no synonyms, etc). -
Category
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 Details
-
toString
-
toFullString
- Overrides:
toFullStringin classData
-
toCSV
Returns a CSV view of this object -
getCSVHeader
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
Description copied from class:DataReturns a string representation of this data used by exportXml().- Overrides:
getExportXmlDataValuein classData- Returns:
- a string representation of this data used by exportXml().
-
exportXmlField
Description copied from class:DataFills the given StringBuffer with Xml export of fields of this data.- Overrides:
exportXmlFieldin classData- Parameters:
sb- the StringBufferindentLevel- the indent level
-
getFirstRelatives
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
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
Keeps only the categories of highest level- Parameters:
categorySet- a set of category- Returns:
- a set of category
- Since:
- jcms-4.1
-
containsDescendant
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
Test if a category is an ancestor of this category (it returns false if the received category is this category).- Parameters:
ancestor- the category to test- Returns:
- true if the category is an ancestor of this 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
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
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
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
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
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
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
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
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
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
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
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
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
Returns the publications which use this category- Returns:
- a TreeSet of
Publication
-
getPublicationSet
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
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
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
Returns the contents which use this category- Returns:
- a TreeSet of
Content - Since:
- jcms-4.0
-
getContentSet
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
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
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
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
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(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
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
Move Category under given parent- Parameters:
parent- the Category parentloggedMember- the worker- Returns:
- ControllerStatus for this action
-
addSubs
Create a Category under the given category- Parameters:
names- Category names to create (comma separated)loggedMember- the loggedMemberuserLang- the user language- Returns:
- a ControllerStatus depending on wether the categories can be created or not
- Since:
- jcms-9.0.0
-
addSiblings
Creates categories based on given names as sibling of current Category- Parameters:
names- Category names to create (comma separated)loggedMember- the loggedMemberuserLang- the user language- Returns:
- a ControllerStatus depending on wether the categories can be created or not
- Since:
- jcms-9.0.1
-
rename
Rename the given category- Parameters:
name- the new category nameuserLang- the current languageloggedMember- the worker- Returns:
- ControllerStatus for this action
-
delete
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
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
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
Returns the children categories (ie categories having this category as parent)- Returns:
- a TreeSet of category
-
getChildrenSortedSet
Returns the children categories ordered according the order of this parent category.- Returns:
- the sorted set of the children categories
-
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
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
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
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
Description copied from interface:SearchableThis 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:
getSearchStringsin interfaceSearchable- Returns:
- an array of String corresponding to this object.
-
getDataName
Description copied from class:DataReturn 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:
getDataNamein 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:
-
getDataImage
Description copied from class:DataRetrieves 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:
getDataImagein classData- Returns:
- a path relative to the webapp root.
-
getDataImage
Description copied from class:DataRetrieves 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:
getDataImagein 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
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
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
Get the value of name.- Returns:
- Value of name.
-
setName
Set the value of name.- Parameters:
v- Value to assign to v.
-
getNameML
Get the value of nameML.- Returns:
- Value of nameML.
- Since:
- jcms-4.0
-
setNameML
Set the value of nameML.- Parameters:
v- Value to assign to nameML.- Since:
- jcms-4.0
-
setName
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:
-
getParent
Get the value of parent.- Returns:
- Value of parent.
-
setParent
Set the value of parent.- Parameters:
v- Value to assign to parent.
-
getDescription
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
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
Get the value of description.- Returns:
- Value of description.
-
setDescription
Set the value of description.- Parameters:
v- Value to assign to description.
-
getDescriptionML
Get the value of descriptionML.- Returns:
- Value of descriptionML.
- Since:
- jcms-4.0
-
setDescriptionML
Set the value of descriptionML.- Parameters:
v- Value to assign to descriptionML.- Since:
- jcms-4.0
-
setDescription
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:
-
getSynonyms
Get the value of synonyms.- Returns:
- Value of synonyms.
- Since:
- jcms-4.0
-
setSynonyms
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
Description copied from class:DataReturns 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:
getDataIconin classData- Returns:
- a relative path (eg
images/jalios/icon/abstract.gif) or sprite classes name (egss_sprite ss_date). - See Also:
- Either by specifying a relative image path :
-
getIcon
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
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
Get the value of icon.- Returns:
- Value of icon.
-
setIcon
Set the value of icon.- Parameters:
v- Value to assign to icon.
-
getIconML
Get the value of iconML.- Returns:
- Value of iconML.
- Since:
- jcms-4.0
-
setIconML
Set the value of iconML.- Parameters:
v- Value to assign to iconML.- Since:
- jcms-4.0
-
setIcon
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:
-
getImage
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
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
Get the value of image.- Returns:
- Value of image.
-
setImage
Set the value of image.- Parameters:
v- Value to assign to image.
-
getImageML
Get the value of imageML.- Returns:
- Value of imageML.
- Since:
- jcms-4.0
-
setImageML
Set the value of imageML.- Parameters:
v- Value to assign to imageML.- Since:
- jcms-4.0
-
setImage
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:
-
getColor
- Returns:
- the color of this category.
- Since:
- jcms-5.0.0
-
getColor
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
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
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
Get friendly urls Set.- Returns:
- a TreeSet of friendly url (String).
-
setFriendlyURLSet
Set the value of friendlyURLSet.- Parameters:
v- Value to assign to friendlyURLSet.
-
getComparator
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:
-
getNameComparator
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
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.usegetDeepOrderComparator(String)instead.- Returns:
- a new instance of DeepOrderComparator in the default site language.
-
getDeepOrderComparator
- Parameters:
lang- the user language- Returns:
- a new instance of DeepOrderComparator in the specified language.
- Since:
- jcms-6.0.0
-
getOrderChildrenFirstComparator
-
getOrderChildrenLastComparator
-
getAuthorizedSelector
- Parameters:
member- the member that will used in the authorized selector to perform selection.- Returns:
- a new instance of
Category.AuthorizedSelectorusing the givenMember. - Since:
- jcms-5.7.3
-
getNodeSelector
-
getLeafSelector
-
internalCanBeReadBy
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
-
canBeReadBy
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:
canBeReadByin 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- aRightInfoinstance 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
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
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:
-
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
Get the value of authorizedMemberSet.- Returns:
- Value of authorizedMemberSet.
- Since:
- jcms-4.1
-
setAuthorizedMemberSet
Set the value of authorizedMemberSet.- Parameters:
set- Value to assign to authorizedMemberSet.- Since:
- jcms-4.1
-
addAuthorizedMember
Add an authorized member.- Parameters:
mbr- the member to be added.- Since:
- jcms-5.5.0
-
removeAuthorizedMember
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
Get the value of authorizedGroupSet.- Returns:
- Value of authorizedGroupSet.
- Since:
- jcms-4.1
-
setAuthorizedGroupSet
Set the value of authorizedGroupSet.- Parameters:
set- Value to assign to authorizedGroupSet.- Since:
- jcms-4.1
-
addAuthorizedGroup
Add an authorized group- Parameters:
grp- the group to be added.- Since:
- jcms-5.5.0
-
removeAuthorizedGroup
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
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
- Returns:
- the groups declared as authorized to use this category (and sub categories).
- Since:
- jcms-10.0.6 / JCMS-8769
- See Also:
-
getUseGroupSet
- 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
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
- Returns:
- the members declared as authorized to use this category (and sub categories).
- Since:
- jcms-10.0.6 / JCMS-8769
- See Also:
-
getUseMemberSet
- 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
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
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
- Returns:
- the members declared as manager of this category (and sub categories).
- Since:
- jcms-10.0.5
-
getManagerMemberSet
- 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
Set the members declared as manager of this category (and sub categories).- Parameters:
managerMemberSet- a set of Member- Since:
- jcms-10.0.5
-
getManagerGroupSet
- Returns:
- the groups declared as manager of this category (and sub categories).
- Since:
- jcms-10.0.5
- See Also:
-
getManagerGroupSet
- 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
Set the groups declared as manager of this category (and sub categories).- Parameters:
managerGroupSet- a set of Group- Since:
- jcms-10.0.5
-
isDeclaredManager
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
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
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
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
Description copied from interface:TreeNodeReturns a Collection of TreeNode children of the current node- Specified by:
getTreeChildrenin interfaceTreeNode- Returns:
- Collection of TreeNode
-
getTreeParent
Description copied from interface:TreeNodeReturns parent of the current node- Specified by:
getTreeParentin interfaceTreeNode- Returns:
- TreeNode parent Node
-
isTreeLeaf
public boolean isTreeLeaf()Description copied from interface:TreeNodeReturns boolean true if the TreeNode is a leaf- Specified by:
isTreeLeafin interfaceTreeNode- Returns:
- boolean indicating if node is leaf or node
-
isTreeNode
public boolean isTreeNode()Description copied from interface:TreeNodeReturns boolean true if the TreeNode is a node- Specified by:
isTreeNodein interfaceTreeNode- Returns:
- boolean indicating if node is leaf or node
-
getTreeRoot
Description copied from interface:TreeNodeReturns the root of the current node- Specified by:
getTreeRootin interfaceTreeNode- Returns:
- TreeNode root Node
-
checkIntegrity
Checks whether or not data integrity constraints are respected.- Overrides:
checkIntegrityin classData- Returns:
- a ControllerStatus
- Since:
- jcms-5.0.0
-
checkMember
Checks if the given member can perform the given operation.- Overrides:
checkMemberin 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
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
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
Checks if the update can be performed- Overrides:
checkUpdatein 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
Checks if the deletion can be performed- Overrides:
checkDeletein 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
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
Performs data deletion- Overrides:
performDeletein 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
Description copied from class:DataCalled to perform some action before the write.- Overrides:
performBeforeWritein 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
Description copied from class:DataCalled to perform some action after the write.- Overrides:
performAfterWritein 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
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
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
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
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
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
- Overrides:
exportXmlRelatedin classData
-
moveChild
Move the given child at the new order in its parent. The parent must use the custom order.- Parameters:
child- a child categorynewOrder- the new order for this childopAuthor- the member who perform this operation. This member must have the right to manage the parent category.- Returns:
- true if the move has succeed.
-
getDeepOrderComparator(String)instead.