public class Category extends Data implements EditableData, TreeNode, Searchable, DBConstants
Modifier and Type | Class and Description |
---|---|
static class |
Category.AuthorizedSelector
AuthorizedSelector selects all the categories a member is
authorized to read.
|
static 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> |
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
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable>
Modifier and Type | Field and Description |
---|---|
static int |
ALPHABETICAL_ORDER |
protected java.util.TreeSet<Group> |
authorizedGroupSet |
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 |
protected boolean |
isExclusive |
protected boolean |
isSelectable |
protected java.lang.String |
name |
protected java.util.HashMap<java.lang.String,java.lang.String> |
nameML |
protected int |
order |
protected Category |
parent |
static java.lang.String |
REVISION |
protected java.lang.String[] |
synonyms |
protected java.lang.String |
typeReferrer |
protected int |
typeReferrerCount |
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_ROLEMAPSTR, 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, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, 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, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_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, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
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
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
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 and Description |
---|
Category()
Create a new empty Category (no parent, no name, no description, no children, no synonyms, etc).
|
Category(Category other)
Category constructor by copy.
|
Modifier and Type | Method and Description |
---|---|
void |
addAuthorizedGroup(Group grp)
Add an authorized group
|
void |
addAuthorizedMember(Member mbr)
Add an authorized member.
|
boolean |
canBeReadBy(Group group,
boolean checkAncestors)
Checks if a group can read this category.
|
boolean |
canBeReadBy(Member member)
This convenient method is the same that canBeReadBy(member, true, true).
|
boolean |
canBeReadBy(Member member,
boolean searchInGroups,
boolean checkAncestors)
Check if a member can read this category.
|
boolean |
canBeUsedBy(Member member)
Dual method of
Member.canUseCategory(Category) |
ControllerStatus |
checkDelete(Member mbr,
java.util.Map context)
Checks if the deletion can be performed
|
ControllerStatus |
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 under the given parent
|
ControllerStatus |
checkUpdate(Member mbr,
java.util.Map context)
Checks if the update can be performed
|
boolean |
childExist(java.lang.String name)
Check if this category contains a child with the given name
|
boolean |
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 member
|
void |
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 category
|
java.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 is
First Level > Second Level > Category Name , and
given ancestor is First Level, it returns
Second 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 is
First Level > Second Level > Category Name , and
given ancestor is First Level, it returns
Second Level > Category Name ). |
java.lang.String |
getAncestorString(java.lang.String sep,
boolean includeCat)
Returns a String representation of the ancestor of this category
(eg
First Level > Second Level > Category Name ). |
java.lang.String |
getAncestorString(java.lang.String sep,
boolean includeCat,
java.lang.String lang)
Returns a String representation of the ancestor of this category
(eg
First Level > Second Level > Category Name ). |
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 name
|
int |
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()
Get the value of color.
|
java.util.Set<Content> |
getContentSet()
Returns the contents which use this category
|
java.util.Set<Content> |
getContentSet(boolean searchInDB)
Returns the contents which use this category
|
static java.lang.String |
getCSVHeader(java.lang.String lang)
Returns the CSV header of this object
|
java.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> |
getDBPublicationCount()
Count the number of DB publications which belongs to this category (exact mode).
|
<T extends Publication> |
getDBPublicationCount(java.lang.Class<T> clazz,
boolean exactCat)
Count the number of DB publication which belongs to this category.
|
static java.util.Comparator<Category> |
getDeepOrderComparator()
Deprecated.
use
getDeepOrderComparator(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 |
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 categories
|
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.
|
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 level
|
java.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.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.
|
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 category
|
java.util.Set<Publication> |
getPublicationSet(boolean searchInDB)
Returns the publications which use this category
|
<T extends Publication> |
getPublicationSet(java.lang.Class<T> clazz)
Returns a NEW Set of Publication of the given class which use this category.
|
<T extends Publication> |
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(java.util.Set<Category> catSet,
Member mbr)
Returns a category subset the given member can read
|
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, ...")
|
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 node
|
TreeNode |
getTreeParent()
Returns parent of the current node
|
TreeNode |
getTreeRoot()
Returns the root of the current node
|
int |
getTypeReferrerCount()
Returns the number of type referencing this category (through category fields and default categories).
|
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 |
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 group
|
protected boolean |
internalCanBeReadBy(Member member,
boolean searchInGroups)
Check of this category can be read by the given member
|
boolean |
isAlphabeticalOrder() |
boolean |
isCustomOrder() |
boolean |
isExclusive() |
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 children
|
boolean |
isTreeLeaf()
Returns boolean true if the TreeNode is a leaf
|
boolean |
isTreeNode()
Returns boolean true if the TreeNode is a node
|
ControllerStatus |
mergeWith(Category tgtCat,
Member loggedMember)
Merges this category with the given the category.
|
java.lang.String |
nameExists(Category parent)
Check if another category exists with the same name 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 copy
|
void |
performDelete(Member mbr,
java.util.Map context)
Performs data deletion
|
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.
|
void |
setAuthorizedGroupSet(java.util.TreeSet<Group> v)
Set the value of authorizedGroupSet.
|
void |
setAuthorizedMemberSet(java.util.TreeSet<Member> v)
Set the value of authorizedMemberSet.
|
void |
setChildrenOrder(int childrenOrder)
Define the children ordering to be used in this category
|
void |
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).
|
void |
setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of descriptionML.
|
void |
setExclusive(boolean isExclusive) |
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).
|
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).
|
void |
setImageML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of imageML.
|
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).
|
void |
setNameML(java.util.HashMap<java.lang.String,java.lang.String> v)
Set the value of nameML.
|
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.
|
java.lang.String |
toCSV(java.lang.String lang)
Returns a CSV view of this object
|
java.lang.String |
toFullString() |
java.lang.String |
toString() |
void |
updateAllPublicationSet()
Recompute the allPublicationSet/allContentSet and all the
descendant's allPublicationSet/allContentSet .
|
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.
|
canRequestUnlock, checkCreate, checkCreate, checkDelete, checkIntegrity, checkLockMember, checkStrongLockMember, checkUpdate, checkWrite, clone, computeDBIDArray, exportXml, exportXml, exportXml, exportXml, exportXmlRelated, fillExportXmlFieldAttributes, getAllReferrerSet, getAllReferrerSet, getAllTypeFieldEntry, getAuthor, getAuthor, getAuthorComparator, getAuthorDBID, getAuthorId, getAuthorSelector, getBooleanFieldValue, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCategoryFieldValue, getCdateSelector, getComparator, getDataIconAlt, getDataIconHtml, getDataIconHtml, getDataIconTitle, getDataImage, getDataNameComparator, getDate, getDate, getDateSelector, getDeletableSelector, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayUrl, getDoubleFieldValue, getDoubleFieldValue, getExtension, getExtraData, getExtraDataMap, getExtraDBData, getExtraDBDataMap, getExtraInfo, getExtraInfoMap, getFieldStatusMap, getFieldValue, getFieldValue, getFieldValue, getFieldValue, 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, getOpDelegate, getRowId, getRowIdComparator, getStrongLock, getStrongLockDate, getStrongLockInfo, getStrongLockMember, getStrongLockSelector, getTypeEntry, getTypeFieldsEntries, getUpdateInstance, getVirtualIDSet, hashCode, importXml, importXmlFieldsWithReferences, importXmlFiles, importXmlReferences, initializeDBDataCollections, isDBData, isImported, isImportUpdated, isInDatabase, isLocked, isPersisted, isStrongLocked, lock, markNewImport, mergeHybridLink, performCreate, performCreate, performDelete, performUpdate, performUpdate, prepareUpdateContext, printDataName, printDisplayLinkEnd, printDisplayLinkStart, printDisplayUrl, printDisplayUrl, 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, setOpDelegate, setRowId, unlock, unlock, unmarkNewImport, updateExtraDataMap, updateExtraDBDataMap, updateIndexTreeSet
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, isStored, resolveAtt, resolveVal, setAttributes, setAttributes, setCdate, setDdate, setStore, toXml
public static final java.lang.String REVISION
public static final int ALPHABETICAL_ORDER
public static final int CUSTOM_ORDER
public static final java.lang.String CTXT_SKIP_WORKSPACE
public static final java.lang.String CTXT_SKIP_PUBLICATIONS
public static final int CTRL_TOPIC_PARENT
public static final int CTRL_TOPIC_ADVANCED
public static final java.lang.String EXPORT_CAT_SEPARATOR
protected java.lang.String name
protected java.util.HashMap<java.lang.String,java.lang.String> nameML
protected Category parent
protected java.lang.String description
protected java.util.HashMap<java.lang.String,java.lang.String> descriptionML
protected java.lang.String[] synonyms
protected boolean isExclusive
protected boolean isSelectable
protected int order
protected int childrenOrder
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
protected java.lang.String color
protected java.util.TreeSet<java.lang.String> friendlyURLSet
protected java.util.TreeSet<Member> authorizedMemberSet
protected java.util.TreeSet<Group> authorizedGroupSet
protected transient int typeReferrerCount
protected transient java.lang.String typeReferrer
public Category()
public Category(Category other)
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).
other
- the category to copypublic java.lang.String toFullString()
toFullString
in class Data
public java.lang.String toCSV(java.lang.String lang)
public static java.lang.String getCSVHeader(java.lang.String lang)
lang
- the output languagepublic java.lang.String getExportXmlDataValue()
Data
getExportXmlDataValue
in class Data
public void exportXmlField(java.lang.StringBuffer sb, int indentLevel)
Data
exportXmlField
in class Data
sb
- the StringBufferindentLevel
- the indent levelpublic static Category[] getFirstRelatives(java.util.Set<Category> rootSet)
rootSet
- a set of root categorypublic static Category getFirstNotRelatives(java.util.Set<Category> children, java.util.Set<Category> roots)
children
- a set of categoryroots
- a set of root categorypublic static java.util.TreeSet<Category> getHighestLevelCategorySet(java.util.TreeSet<Category> categorySet)
categorySet
- a set of categorypublic boolean containsDescendant(Category category)
category
- the category to testpublic boolean hasAncestor(Category category)
category
- the category to testpublic java.util.List<Category> getAncestorList()
public java.util.List<Category> getAncestorList(Category ancestor, boolean includeAncestor)
ancestor
- the ancestor (null means root)includeAncestor
- if true add the ancestor to the listpublic java.lang.String getAncestorString(java.lang.String sep, boolean includeCat, java.lang.String lang)
First Level > Second Level > Category Name
).
Root is excluded.sep
- the separatorincludeCat
- if true, the category is includedlang
- the language to use to build the Stringpublic java.lang.String getAncestorString(java.lang.String sep, boolean includeCat)
First Level > Second Level > Category Name
).
Root is excluded.sep
- the separatorincludeCat
- if true, the category is includedpublic java.lang.String getAncestorString(Category ancestor, java.lang.String sep, boolean includeCat, java.lang.String lang)
First Level > Second Level > Category Name
, and
given ancestor is First Level, it returns
Second Level > Category Name
). Root is excluded.ancestor
- the ancestorsep
- the separatorincludeCat
- if true, the category is includedlang
- the language to use to build the Stringpublic java.lang.String getAncestorString(Category ancestor, java.lang.String sep, boolean includeCat)
First Level > Second Level > Category Name
, and
given ancestor is First Level, it returns
Second Level > Category Name
). Root is excluded.ancestor
- the ancestorsep
- the separatorincludeCat
- if true, the category is includedpublic boolean isSibling(Category cat)
cat
- the categorypublic java.lang.String getAvailableColor()
getAvailableColor(int)
public java.lang.String getAvailableColor(int levelOffset)
levelOffset
- the offset to apply for each levelpublic Category getFirstCommonAncestor(Category category)
category
- the category to used when searching the first
common ancestor with this category. if null, return value
will be null.public static Category getFirstCommonAncestor(java.util.Collection<Category> collection)
collection
- Collection of Categorypublic void updateAllPublicationSet()
public <T extends Publication> java.util.Set<T> getPublicationSet(java.lang.Class<T> clazz, Member mbr)
Channel.getPublicationSet(Class, Member)
Check rights.T
- a type of Publicationclazz
- the Publication's class to retrievembr
- the Member requesting publicationspublic <T extends Publication> java.util.Set<T> getPublicationSet(java.lang.Class<T> clazz)
Channel.getDataSet(Class)
.
DO NOT check rights.T
- a type of Publicationclazz
- the Publication's class to retrievepublic java.util.Set<Publication> getPublicationSet()
Publication
public java.util.Set<Publication> getPublicationSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DBPublication
public java.util.Set<Publication> getAllPublicationSet()
public java.util.Set<Publication> getAllPublicationSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DBpublic java.util.Set<Content> getContentSet()
Content
public java.util.Set<Content> getContentSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DBContent
public java.util.Set<Content> getAllContentSet()
public java.util.Set<Content> getAllContentSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DBpublic <T extends Publication> int getDBPublicationCount()
Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.
T
- a type of Publicationpublic <T extends Publication> int getDBPublicationCount(java.lang.Class<T> clazz, boolean exactCat)
Warning : as of current implementation, this method will query the database and may not be optimized for frequent use and large volumetry, use wisely.
T
- a type of Publicationclazz
- the class to search forexactCat
- true to search for publication only in this publication, false, to search in descendants categoriesprotected void updateDBPublicationIndexes()
public ControllerStatus mergeWith(Category tgtCat, Member loggedMember)
tgtCat
- the category to merge withloggedMember
- the member.public boolean isRoot()
public boolean isLeaf()
public boolean isNode()
public boolean isLeaf(Member mbr)
mbr
- the member to check the read rightpublic boolean isNode(Member mbr)
mbr
- the member to check the read rightpublic boolean isTerminalNode()
public boolean isAlphabeticalOrder()
public boolean isCustomOrder()
public java.util.Set<Category> getChildrenSet()
public java.util.Set<Category> getDescendantSet()
public boolean childExist(java.lang.String name)
name
- the category name to searchpublic Category getChild(java.lang.String name)
name
- the category name to searchpublic boolean containsUnreadPub(Member member)
member
- the readerpublic java.lang.String[] getSearchStrings()
Searchable
getSearchStrings
in interface Searchable
public java.lang.String getDataName(java.lang.String language)
Data
getDataName
in class Data
language
- the language in which to return the name if multilang available for the data.getName(String)
,
Data.getDataName(String)
public java.lang.String getDataImage()
Data
This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.
getDataImage
in class Data
public java.lang.String getDataImage(java.lang.String lang, boolean useDefault)
Data
This method can (should) be implemented by subclasses to provide an image/illustration of this Data.
Default behaviour is to return empty string.
getDataImage
in class Data
lang
- the user language (ISO-639 language code)useDefault
- should the default language be used if no value is found for the specified languagepublic java.lang.String getName(java.lang.String lang)
lang
- the language to get the namepublic java.lang.String getName(java.lang.String lang, boolean useDefault)
lang
- the language to get the nameuseDefault
- should main language used as default language
if name does not exist in the given languagepublic java.lang.String getName()
public void setName(java.lang.String v)
v
- Value to assign to v.public java.util.HashMap<java.lang.String,java.lang.String> getNameML()
public void setNameML(java.util.HashMap<java.lang.String,java.lang.String> v)
v
- Value to assign to nameML.public void setName(java.lang.String lang, java.lang.String value)
setName(String)
or setNameML(HashMap)
)
depending on the specified language.lang
- the language (ISO 639 code) in which to set the valuevalue
- the value to set.setName(String)
,
setNameML(HashMap)
public Category getParent()
public void setParent(Category v)
v
- Value to assign to parent.public java.lang.String getDescription(java.lang.String lang)
lang
- the language to get the descriptionpublic java.lang.String getDescription(java.lang.String lang, boolean useDefault)
lang
- the language to get the descriptionuseDefault
- should main language used as default language
if description does not exist in the given languagepublic java.lang.String getDescription()
public void setDescription(java.lang.String v)
v
- Value to assign to description.public java.util.HashMap<java.lang.String,java.lang.String> getDescriptionML()
public void setDescriptionML(java.util.HashMap<java.lang.String,java.lang.String> v)
v
- Value to assign to descriptionML.public void setDescription(java.lang.String lang, java.lang.String value)
setDescription(String)
or setDescriptionML(HashMap)
)
depending on the specified language.lang
- the language (ISO 639 code) in which to set the valuevalue
- the value to set.setDescription(String)
,
setDescriptionML(HashMap)
public java.lang.String[] getSynonyms()
public void setSynonyms(java.lang.String[] v)
v
- Value to assign to synonyms.public void setExclusive(boolean isExclusive)
public boolean isExclusive()
public void setSelectable(boolean isSelectable)
public boolean isSelectable()
public void setOrder(int order)
public int getOrder()
public void setChildrenOrder(int childrenOrder)
childrenOrder
- an integer indicating the ordering type to be used.
For alphabetical ordering, use constant Category.ALPHABETICAL_ORDER
,
for custom ordering (using "order" member), use constant Category.CUSTOM_ORDER
public int getChildrenOrder()
Category.ALPHABETICAL_ORDER
(0) for alphabetical
ordering and Category.CUSTOM_ORDER
(1) for custom ordering using
order memberpublic java.lang.String getDataIcon()
Data
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.
types.Article.icon: images/jalios/icon/abstract.gif
types.Article.icon: ss_sprite ss_date
getDataIcon
in class Data
images/jalios/icon/abstract.gif
) or sprite classes name (eg ss_sprite ss_date
).Data.getDataIconHtml(String)
public java.lang.String getIcon(java.lang.String lang)
lang
- the language to get the iconpublic java.lang.String getIcon(java.lang.String lang, boolean useDefault)
lang
- the language to get the iconuseDefault
- should main language used as default language
if icon does not exist in the given languagepublic java.lang.String getIcon()
public void setIcon(java.lang.String v)
v
- Value to assign to icon.public java.util.HashMap<java.lang.String,java.lang.String> getIconML()
public void setIconML(java.util.HashMap<java.lang.String,java.lang.String> v)
v
- Value to assign to iconML.public void setIcon(java.lang.String lang, java.lang.String value)
setIcon(String)
or setIconML(HashMap)
)
depending on the specified language.lang
- the language (ISO 639 code) in which to set the valuevalue
- the value to set.setIcon(String)
,
setIconML(HashMap)
public java.lang.String getImage(java.lang.String lang)
lang
- the language to get the imagepublic java.lang.String getImage(java.lang.String lang, boolean useDefault)
lang
- the language to get the imageuseDefault
- should main language used as default language
if image does not exist in the given languagepublic java.lang.String getImage()
public void setImage(java.lang.String v)
v
- Value to assign to image.public java.util.HashMap<java.lang.String,java.lang.String> getImageML()
public void setImageML(java.util.HashMap<java.lang.String,java.lang.String> v)
v
- Value to assign to imageML.public void setImage(java.lang.String lang, java.lang.String value)
setImage(String)
or setImageML(HashMap)
)
depending on the specified language.lang
- the language (ISO 639 code) in which to set the valuevalue
- the value to set.setImage(String)
,
setImageML(HashMap)
public java.lang.String getColor()
public void setColor(java.lang.String v)
v
- Value to assign to color.public java.util.Date getIndexingDate()
public java.util.TreeSet<java.lang.String> getFriendlyURLSet()
public void setFriendlyURLSet(java.util.TreeSet<java.lang.String> v)
v
- Value to assign to friendlyURLSet.public static java.util.Comparator getNameComparator(java.lang.String lang)
lang
- the language in which to compare categorie's namepublic static java.util.Comparator getOrderComparator(java.lang.String lang)
lang
- the language in which the alphabetical ordering will
will performed if the category are ordered alphabetically.@Deprecated public static java.util.Comparator<Category> getDeepOrderComparator()
getDeepOrderComparator(String)
instead.public static java.util.Comparator<Category> getDeepOrderComparator(java.lang.String lang)
lang
- the user languagepublic static java.util.Comparator<Category> getOrderChildrenFirstComparator()
public static java.util.Comparator<Category> getOrderChildrenLastComparator()
public static Category.AuthorizedSelector getAuthorizedSelector(Member member)
member
- the member that will used in the authorized selector
to perform selection.Category.AuthorizedSelector
using
the given Member
.public static Category.NodeSelector getNodeSelector()
public static Category.LeafSelector getLeafSelector()
protected boolean internalCanBeReadBy(Member member, boolean searchInGroups)
member
- the member to be checkedsearchInGroups
- if true check if one of the group this
member belongs to is authorized to read this category.protected boolean internalCanBeReadBy(Group group)
group
- the group to be checked
member belongs to is authorized to read this category.public boolean canBeReadBy(Member member, boolean searchInGroups, boolean checkAncestors)
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.public boolean canBeReadBy(Member member)
member
- the member to checkcanBeReadBy(com.jalios.jcms.Member,boolean,boolean)
public boolean canBeUsedBy(Member member)
Member.canUseCategory(Category)
member
- the member to checkMember.canUseCategory(Category)
public boolean canBeReadBy(Group group, boolean checkAncestors)
group
- the group to checkcheckAncestors
- if true checks the read rights of the ancestors of this category.public boolean hasAnyReadRights()
!hasSomeReadRights()
to test
if this category has no read rights, in this case, use the method
hasNoReadRights()
.public boolean hasNoReadRights()
!hasNoReadRights()
to test
if this category has some read rights, in this case, use the method
hasAnyReadRights()
.public java.util.Set<Member> getAuthorizedMemberSet()
public void setAuthorizedMemberSet(java.util.TreeSet<Member> v)
v
- Value to assign to authorizedMemberSet.public void addAuthorizedMember(Member mbr)
mbr
- the member to be added.public boolean removeAuthorizedMember(Member mbr)
mbr
- the member to be removed.public java.util.Set<Group> getAuthorizedGroupSet()
public void setAuthorizedGroupSet(java.util.TreeSet<Group> v)
v
- Value to assign to authorizedGroupSet.public void addAuthorizedGroup(Group grp)
grp
- the group to be added.public boolean removeAuthorizedGroup(Group grp)
grp
- the group to be removed.public java.lang.String getReadRightsString(int max)
max
- how many group/member to displaypublic java.util.Collection<? extends TreeNode> getTreeChildren()
TreeNode
getTreeChildren
in interface TreeNode
public TreeNode getTreeParent()
TreeNode
getTreeParent
in interface TreeNode
public boolean isTreeLeaf()
TreeNode
isTreeLeaf
in interface TreeNode
public boolean isTreeNode()
TreeNode
isTreeNode
in interface TreeNode
public TreeNode getTreeRoot()
TreeNode
getTreeRoot
in interface TreeNode
public ControllerStatus checkIntegrity()
checkIntegrity
in class Data
public ControllerStatus checkMember(int op, Member mbr, java.util.Map context)
checkMember
in class Data
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public java.lang.String nameExists(Category parent)
parent
- the parent category to be testspublic boolean checkName(Category parent)
parent
- the parent category to be testspublic ControllerStatus checkUpdate(Member mbr, java.util.Map context)
checkUpdate
in class Data
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public ControllerStatus checkDelete(Member mbr, java.util.Map context)
checkDelete
in class Data
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public int getTypeReferrerCount()
public java.util.Set<WSTypeEntry> getWSTypeEntryReferrerSet()
public void refreshTypeReferrerCount()
public void performDelete(Member mbr, java.util.Map context)
performDelete
in class Data
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)protected void performBeforeWrite(int op, Member mbr, java.util.Map context)
Data
performBeforeWrite
in class Data
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)protected void performAfterWrite(int op, Member mbr, java.util.Map context)
Data
performAfterWrite
in class Data
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public void performDeepCopy(Member mbr, java.util.Map context)
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public static java.util.Set<Category> getReadableCatSet(java.util.Set<Category> catSet, Member mbr)
catSet
- the category set to be filteredmbr
- the readerpublic ControllerStatus performImport(Member mbr, java.io.File file, java.lang.String languages, java.lang.String encoding)
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.Channel.getLanguageList()
.encoding
- the encoding of the file to import, if null, the encoding will be guessed
using a CharsetDetector
, and if the encoding cannot be guessed, ISO-8859-1 is
used as a last resort. Therefore, you should always precise one when possible.protected void exportXmlRelated(java.lang.StringBuffer sb, java.lang.String related, int indentLevel)
exportXmlRelated
in class Data
Copyright © 2001-2010 Jalios SA. All Rights Reserved.