|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jstore.BasicStorable com.jalios.jcms.Data com.jalios.jcms.Category
public class Category
A Category object is a node of the category tree. It references a set of Publications.
Nested Class Summary | |
---|---|
static class |
Category.AuthorizedSelector
AuthorizedSelector selects all the categories a member is authorized to read. |
static class |
Category.DeepOrderComparator
|
static class |
Category.LeafSelector
|
static class |
Category.NameComparator
|
static class |
Category.NameSelector
Select categories by their name. |
static class |
Category.NodeSelector
|
static class |
Category.OrderChildrenFirstComparator
|
static class |
Category.OrderChildrenLastComparator
|
static class |
Category.OrderComparator
|
Nested classes/interfaces inherited from class com.jalios.jcms.Data |
---|
Data.AuthorComparator<T extends Data>, Data.AuthorSelector, Data.CdateSelector, Data.DataNameComparator<T extends Data>, Data.DeletableSelector, Data.ImportSelector, Data.MdateSelector, Data.OpAuthorComparator<T extends Data>, Data.RowIdComparator<T extends Data>, Data.StrongLockSelector |
Nested classes/interfaces inherited from class com.jalios.jstore.BasicStorable |
---|
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable> |
Field Summary | |
---|---|
static int |
ALPHABETICAL_ORDER
|
protected TreeSet<Group> |
authorizedGroupSet
|
protected TreeSet<Member> |
authorizedMemberSet
|
protected int |
childrenOrder
|
protected String |
color
|
static int |
CTRL_TOPIC_ADVANCED
|
static int |
CTRL_TOPIC_PARENT
|
static String |
CTXT_SKIP_PUBLICATIONS
|
static String |
CTXT_SKIP_WORKSPACE
|
static int |
CUSTOM_ORDER
|
protected String |
description
|
protected HashMap<String,String> |
descriptionML
|
static String |
EXPORT_CAT_SEPARATOR
|
protected TreeSet<String> |
friendlyURLSet
|
protected String |
icon
|
protected HashMap<String,String> |
iconML
|
protected String |
image
|
protected HashMap<String,String> |
imageML
|
protected boolean |
isExclusive
|
protected boolean |
isSelectable
|
protected String |
name
|
protected HashMap<String,String> |
nameML
|
protected int |
order
|
protected Category |
parent
|
static String |
REVISION
|
protected String[] |
synonyms
|
protected String |
typeReferrer
|
protected int |
typeReferrerCount
|
Fields inherited from class com.jalios.jcms.Data |
---|
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate |
Fields inherited from class com.jalios.jstore.BasicStorable |
---|
cdate, ddate, id, mdate, store |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Fields inherited from interface com.jalios.jcms.mashup.ImportConstants |
---|
IMPORT_ALARM_MGR, IMPORT_AUTHOR_PROP, IMPORT_CATEGORY_DEFAULT, IMPORT_DC_ATTR, IMPORT_DC_STEP, IMPORT_DIR, IMPORT_ENABLED, IMPORT_JDOM_ELEMENT, IMPORT_LOG_FILE, IMPORT_LOG_MAX, IMPORT_OPTIONS, IMPORT_OPTIONS_DC_CONTEXT, IMPORT_ROOT_PROP, IMPORT_SOURCE_FILE, IMPORT_SOURCE_PREFIX_PROP, IMPORT_SOURCES_DIR, IMPORT_STEP_CLEAN, IMPORT_STEP_IMPORT, IMPORT_STEP_UPDATE_REF, IMPORT_WS_PROP |
Fields inherited from interface com.jalios.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 | |
---|---|
Category()
Create a new empty Category (no parent, no name, no description, no children, no synonyms, etc). |
|
Category(Category other)
Category constructor by copy. |
Method Summary | ||
---|---|---|
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,
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,
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,
Map context)
Checks if the update can be performed |
|
boolean |
childExist(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(StringBuffer sb,
int indentLevel)
Fills the given StringBuffer with Xml export of fields of this data. |
|
protected void |
exportXmlRelated(StringBuffer sb,
String related,
int indentLevel)
|
|
Set<Content> |
getAllContentSet()
Return a set containing all the contents referenced by this category and all the descendant of this category |
|
Set<Content> |
getAllContentSet(boolean searchInDB)
Return a set containing all the contents referenced by this category and all the descendant of this category |
|
Set<Publication> |
getAllPublicationSet()
Return a set containing all the publications referenced by this category and all the descendants of this category |
|
Set<Publication> |
getAllPublicationSet(boolean searchInDB)
Return a set containing all the publications referenced by this category and all the descendants of this category |
|
List<Category> |
getAncestorList()
Returns the list of all the ancestors of this category, from the immediate parent to the root (root excluded). |
|
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. |
|
String |
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 is First Level > Second Level > Category Name , and
given ancestor is First Level, it returns
Second Level > Category Name ). |
|
String |
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 is First Level > Second Level > Category Name , and
given ancestor is First Level, it returns
Second Level > Category Name ). |
|
String |
getAncestorString(String sep,
boolean includeCat)
Returns a String representation of the ancestor of this category (eg First Level > Second Level > Category Name ). |
|
String |
getAncestorString(String sep,
boolean includeCat,
String lang)
Returns a String representation of the ancestor of this category (eg First Level > Second Level > Category Name ). |
|
Set<Group> |
getAuthorizedGroupSet()
Get the value of authorizedGroupSet. |
|
Set<Member> |
getAuthorizedMemberSet()
Get the value of authorizedMemberSet. |
|
static Category.AuthorizedSelector |
getAuthorizedSelector(Member member)
|
|
String |
getAvailableColor()
Find the first available color from this category to these ancestors. |
|
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(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. |
|
Set<Category> |
getChildrenSet()
Returns the children categories (ie categories having this category as parent) |
|
String |
getColor()
Get the value of color. |
|
Set<Content> |
getContentSet()
Returns the contents which use this category |
|
Set<Content> |
getContentSet(boolean searchInDB)
Returns the contents which use this category |
|
static String |
getCSVHeader(String lang)
Returns the CSV header of this object |
|
String |
getDataImage()
Retrieves the image path of this data in the channel's main language. |
|
String |
getDataImage(String lang,
boolean useDefault)
Retrieves the image path of this data. |
|
String |
getDataName(String language)
Return the name of this Data, every sub class Data which will be displayed to user should implements this method already. |
|
|
getDBPublicationCount()
Count the number of DB publications which belongs to this category (exact mode). |
|
|
getDBPublicationCount(Class<T> clazz,
boolean exactCat)
Count the number of DB publication which belongs to this category. |
|
static Comparator<Category> |
getDeepOrderComparator()
Deprecated. use getDeepOrderComparator(String) instead. |
|
static Comparator<Category> |
getDeepOrderComparator(String lang)
|
|
Set<Category> |
getDescendantSet()
Returns all the descendant categories of this one (ie categories having this category as ancestor) |
|
String |
getDescription()
Get the value of description. |
|
String |
getDescription(String lang)
Get the value of description bound to the given language. |
|
String |
getDescription(String lang,
boolean useDefault)
Get the value of description bound to the given language. |
|
HashMap<String,String> |
getDescriptionML()
Get the value of descriptionML. |
|
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(Collection<Category> collection)
Returns the common ancestors of the given categories |
|
static Category |
getFirstNotRelatives(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. |
|
TreeSet<String> |
getFriendlyURLSet()
Get friendly urls Set. |
|
static TreeSet<Category> |
getHighestLevelCategorySet(TreeSet<Category> categorySet)
Keeps only the categories of highest level |
|
String |
getIcon()
Get the value of icon. |
|
String |
getIcon(String lang)
Get the value of icon bound to the given language. |
|
String |
getIcon(String lang,
boolean useDefault)
Get the value of icon bound to the given language. |
|
HashMap<String,String> |
getIconML()
Get the value of iconML. |
|
String |
getImage()
Get the value of image. |
|
String |
getImage(String lang)
Get the value of image bound to the given language. |
|
String |
getImage(String lang,
boolean useDefault)
Get the value of image bound to the given language. |
|
HashMap<String,String> |
getImageML()
Get the value of imageML. |
|
Date |
getIndexingDate()
Retrieve the Date at which this Category was indexed in its search engine. |
|
static Category.LeafSelector |
getLeafSelector()
|
|
String |
getName()
Get the value of name. |
|
String |
getName(String lang)
Get the value of name bound to the given language. |
|
String |
getName(String lang,
boolean useDefault)
Get the value of name bound to the given language. |
|
static Comparator |
getNameComparator(String lang)
Retrieves a new Categories' NameComparator. |
|
HashMap<String,String> |
getNameML()
Get the value of nameML. |
|
static Category.NodeSelector |
getNodeSelector()
|
|
int |
getOrder()
|
|
static Comparator<Category> |
getOrderChildrenFirstComparator()
|
|
static Comparator<Category> |
getOrderChildrenLastComparator()
|
|
static Comparator |
getOrderComparator(String lang)
Retrieves a new Categories' OrderComparator. |
|
Category |
getParent()
Get the value of parent. |
|
Set<Publication> |
getPublicationSet()
Returns the publications which use this category |
|
Set<Publication> |
getPublicationSet(boolean searchInDB)
Returns the publications which use this category |
|
|
getPublicationSet(Class<T> clazz)
Returns a NEW Set of Publication of the given class which use this category. |
|
|
getPublicationSet(Class<T> clazz,
Member mbr)
Returns a NEW Set of Publication of the given class which use this category. |
|
static Set<Category> |
getReadableCatSet(Set<Category> catSet,
Member mbr)
Returns a category subset the given member can read |
|
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, ...") |
|
String[] |
getSearchStrings()
This method gets called to get all the String to search in (typically the String attribute of the Storable). |
|
String[] |
getSynonyms()
Get the value of synonyms. |
|
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). |
|
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. |
|
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,
Map context)
Called to perform some action after the write. |
|
protected void |
performBeforeWrite(int op,
Member mbr,
Map context)
Called to perform some action before the write. |
|
void |
performDeepCopy(Member mbr,
Map context)
Performs category deep copy |
|
void |
performDelete(Member mbr,
Map context)
Performs data deletion |
|
ControllerStatus |
performImport(Member mbr,
File file,
String languages,
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(TreeSet<Group> v)
Set the value of authorizedGroupSet. |
|
void |
setAuthorizedMemberSet(TreeSet<Member> v)
Set the value of authorizedMemberSet. |
|
void |
setChildrenOrder(int childrenOrder)
Define the children ordering to be used in this category |
|
void |
setColor(String v)
Set the value of color. |
|
void |
setDescription(String v)
Set the value of description. |
|
void |
setDescription(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) or setDescriptionML(HashMap) )
depending on the specified language. |
|
void |
setDescriptionML(HashMap<String,String> v)
Set the value of descriptionML. |
|
void |
setExclusive(boolean isExclusive)
|
|
void |
setFriendlyURLSet(TreeSet<String> v)
Set the value of friendlyURLSet. |
|
void |
setIcon(String v)
Set the value of icon. |
|
void |
setIcon(String lang,
String value)
Convenient method to set the value of the Icon field in any language (default site language or any other). This method will set the proper field value ( setIcon(String) or setIconML(HashMap) )
depending on the specified language. |
|
void |
setIconML(HashMap<String,String> v)
Set the value of iconML. |
|
void |
setImage(String v)
Set the value of image. |
|
void |
setImage(String lang,
String value)
Convenient method to set the value of the Image field in any language (default site language or any other). This method will set the proper field value ( setImage(String) or setImageML(HashMap) )
depending on the specified language. |
|
void |
setImageML(HashMap<String,String> v)
Set the value of imageML. |
|
void |
setName(String v)
Set the value of name. |
|
void |
setName(String lang,
String value)
Convenient method to set the value of the Name field in any language (default site language or any other). This method will set the proper field value ( setName(String) or setNameML(HashMap) )
depending on the specified language. |
|
void |
setNameML(HashMap<String,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(String[] v)
Set the value of synonyms. |
|
String |
toCSV(String lang)
Returns a CSV view of this object |
|
String |
toFullString()
|
|
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. |
Methods inherited from class com.jalios.jstore.BasicStorable |
---|
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, isStored, resolveAtt, resolveVal, setAttributes, setCdate, setDdate, setId, setStore, toXml |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final int ALPHABETICAL_ORDER
public static final int CUSTOM_ORDER
public static final String CTXT_SKIP_WORKSPACE
public static final String CTXT_SKIP_PUBLICATIONS
public static final int CTRL_TOPIC_PARENT
public static final int CTRL_TOPIC_ADVANCED
public static final String EXPORT_CAT_SEPARATOR
protected String name
protected HashMap<String,String> nameML
protected Category parent
protected String description
protected HashMap<String,String> descriptionML
protected String[] synonyms
protected boolean isExclusive
protected boolean isSelectable
protected int order
protected int childrenOrder
protected String icon
protected HashMap<String,String> iconML
protected String image
protected HashMap<String,String> imageML
protected String color
protected TreeSet<String> friendlyURLSet
protected TreeSet<Member> authorizedMemberSet
protected TreeSet<Group> authorizedGroupSet
protected transient int typeReferrerCount
protected transient String typeReferrer
Constructor Detail |
---|
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
- Method Detail |
---|
public String toString()
toString
in class Data
public String toFullString()
toFullString
in class Data
public String toCSV(String lang)
toCSV
in class Data
lang
- the output language
public static String getCSVHeader(String lang)
lang
- the output language
public String getExportXmlDataValue()
Data
getExportXmlDataValue
in class Data
public void exportXmlField(StringBuffer sb, int indentLevel)
Data
exportXmlField
in class Data
sb
- the StringBufferindentLevel
- the indent levelpublic static Category[] getFirstRelatives(Set<Category> rootSet)
rootSet
-
public static Category getFirstNotRelatives(Set<Category> children, Set<Category> roots)
children
- roots
-
public static TreeSet<Category> getHighestLevelCategorySet(TreeSet<Category> categorySet)
categorySet
-
public boolean containsDescendant(Category category)
category
- the category to test
public boolean hasAncestor(Category category)
category
- the category to test
public List<Category> getAncestorList()
public List<Category> getAncestorList(Category ancestor, boolean includeAncestor)
ancestor
- the ancestor (null means root)includeAncestor
- if true add the ancestor to the list
public String getAncestorString(String sep, boolean includeCat, 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 String
public String getAncestorString(String sep, boolean includeCat)
First Level > Second Level > Category Name
).
Root is excluded.
sep
- the separatorincludeCat
- if true, the category is included
public String getAncestorString(Category ancestor, String sep, boolean includeCat, 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 String
public String getAncestorString(Category ancestor, 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 included
public boolean isSibling(Category cat)
cat
- the category
public String getAvailableColor()
getAvailableColor(int)
public String getAvailableColor(int levelOffset)
levelOffset
- the offset to apply for each level
public 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(Collection<Category> collection)
collection
- Collection of Category
public void updateAllPublicationSet()
public <T extends Publication> Set<T> getPublicationSet(Class<T> clazz, Member mbr)
Channel.getPublicationSet(Class, Member)
Check rights.
clazz
- the Publication's class to retrievembr
- the Member requesting publications
public <T extends Publication> Set<T> getPublicationSet(Class<T> clazz)
Channel.getDataSet(Class)
.
DO NOT check rights.
clazz
- the Publication's class to retrieve
public Set<Publication> getPublicationSet()
Publication
public Set<Publication> getPublicationSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DB
Publication
public Set<Publication> getAllPublicationSet()
public Set<Publication> getAllPublicationSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DB
public Set<Content> getContentSet()
Content
public Set<Content> getContentSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DB
Content
public Set<Content> getAllContentSet()
public Set<Content> getAllContentSet(boolean searchInDB)
searchInDB
- if true the search is extended to the DB
public <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.
public <T extends Publication> int getDBPublicationCount(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.
clazz
- the class to search forexactCat
- true to search for publication only in this publication, false, to search in descendants categories
protected 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 right
public boolean isNode(Member mbr)
mbr
- the member to check the read right
public boolean isTerminalNode()
public boolean isAlphabeticalOrder()
public boolean isCustomOrder()
public Set<Category> getChildrenSet()
public Set<Category> getDescendantSet()
public boolean childExist(String name)
name
- the category name to search
public Category getChild(String name)
name
- the category name to search
public boolean containsUnreadPub(Member member)
member
- the reader
public String[] getSearchStrings()
Searchable
getSearchStrings
in interface Searchable
public String getDataName(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 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 String getDataImage(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 language
public String getName(String lang)
lang
- the language to get the name
public String getName(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 language
public String getName()
public void setName(String v)
v
- Value to assign to v.public HashMap<String,String> getNameML()
public void setNameML(HashMap<String,String> v)
v
- Value to assign to nameML.public void setName(String 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 String getDescription(String lang)
lang
- the language to get the description
public String getDescription(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 language
public String getDescription()
public void setDescription(String v)
v
- Value to assign to description.public HashMap<String,String> getDescriptionML()
public void setDescriptionML(HashMap<String,String> v)
v
- Value to assign to descriptionML.public void setDescription(String 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 String[] getSynonyms()
public void setSynonyms(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 String getIcon(String lang)
lang
- the language to get the icon
public String getIcon(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 language
public String getIcon()
public void setIcon(String v)
v
- Value to assign to icon.public HashMap<String,String> getIconML()
public void setIconML(HashMap<String,String> v)
v
- Value to assign to iconML.public void setIcon(String 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 String getImage(String lang)
lang
- the language to get the image
public String getImage(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 language
public String getImage()
public void setImage(String v)
v
- Value to assign to image.public HashMap<String,String> getImageML()
public void setImageML(HashMap<String,String> v)
v
- Value to assign to imageML.public void setImage(String 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 String getColor()
public void setColor(String v)
v
- Value to assign to color.public Date getIndexingDate()
public TreeSet<String> getFriendlyURLSet()
public void setFriendlyURLSet(TreeSet<String> v)
v
- Value to assign to friendlyURLSet.public static Comparator getNameComparator(String lang)
lang
- the language in which to compare categorie's name
public static Comparator getOrderComparator(String lang)
lang
- the language in which the alphabetical ordering will
will performed if the category are ordered alphabetically.
@Deprecated public static Comparator<Category> getDeepOrderComparator()
getDeepOrderComparator(String)
instead.
public static Comparator<Category> getDeepOrderComparator(String lang)
public static Comparator<Category> getOrderChildrenFirstComparator()
public static 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 check
canBeReadBy(com.jalios.jcms.Member,boolean,boolean)
public boolean canBeUsedBy(Member member)
Member.canUseCategory(Category)
member
- the member to check
Member.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 Set<Member> getAuthorizedMemberSet()
public void setAuthorizedMemberSet(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 Set<Group> getAuthorizedGroupSet()
public void setAuthorizedGroupSet(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 String getReadRightsString(int max)
max
- how many group/member to display
public 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, 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 String nameExists(Category parent)
parent
- the parent category to be tests
public boolean checkName(Category parent)
parent
- the parent category to be tests
public ControllerStatus checkUpdate(Member mbr, 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, 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 Set<WSTypeEntry> getWSTypeEntryReferrerSet()
public void refreshTypeReferrerCount()
public void performDelete(Member mbr, 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, 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, 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, Map context)
mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public static Set<Category> getReadableCatSet(Set<Category> catSet, Member mbr)
catSet
- the category set to be filteredmbr
- the reader
public ControllerStatus performImport(Member mbr, File file, String languages, 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(StringBuffer sb, String related, int indentLevel)
exportXmlRelated
in class Data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |