|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.context.AbstractJcmsAjaxContext com.jalios.jcms.widget.TreeCat
public class TreeCat
This class display a Category Tree using <UL> <LI> tags.
Many options allow customisation of the Tree look&feel and behaviour.
The generated tree works with treecat.css and treecat.js
This class may be called by AJAX RPC Method.
TreeCatTag
,
Serialized FormFields inherited from class com.jalios.jcms.context.AbstractJcmsAjaxContext |
---|
baseUrl, caddy, channel, contextPath, ctxCategories, currentCategory, debug, isAdmin, isIE, isInFrontOffice, isLogged, isWindows, loggedMember, method, parameterMap, portal, portalCategory, pub, resourcePath, url, userLang, userLocale, workspace, zone |
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 |
Constructor Summary | |
---|---|
TreeCat()
|
Method Summary | |
---|---|
String |
addCat(Category parent,
String name)
|
String |
addSiblingCat(String catId,
String name)
Creates a category under the parent of the category id with the given category name |
String |
addSubCat(String catId,
String name)
Creates a new category under the given parent id with the given category name |
protected boolean |
canWorkOn(Category cat)
|
String |
getAjaxSuffix()
|
String |
getBranch(Category cat,
int level)
This method will return a String representing the given Catergory with all requested computed options. |
protected String |
getBranchLI(Category cat,
int level)
This method will return a String representing the given Catergory with all requested computed options. |
protected String |
getBranchLI(Category cat,
String str,
int level)
|
protected String |
getBranchLI(Category cat,
String value,
int level,
boolean hasLevelChanged)
This method will encapsulate the given String representing the given Catergory into <li></li> |
String |
getChildren(Category parent,
int level)
This method return a String of <li></li> displaying children of a given parent Category. |
String |
getChildren(String parentId)
Returns a String of <li></li> displaying children of a given parent Category. |
String |
getChildren(String[] checked,
String[] opened)
Returns a String of <li></li> displaying roots. |
Map |
getChildrenMap(Category parent,
int level)
This method return a Map of Category has key and <li></li> String displaying children has value for a given parent Category. |
protected String |
getDragDrop(Collection roots)
Computes roots rights to enable/disable drag and drop on categories |
protected String |
getEdit(Category cat)
This method will compute the edit icon to display for the given category. |
Set |
getFilteredSet()
|
short |
getFilterMember()
|
protected String |
getHelp(Category cat)
This method will compute the help icon to display for the given category. |
String |
getHiddens()
Returns all input hidden for selected categories that have been filtered (Not removed !) |
protected String |
getInnerRoots(Collection roots,
int level,
boolean rootDisplay)
This method return a String displaying root category of the given set. |
protected String |
getNodeIcon(Category cat,
int level)
This method will compute the node icon to display for the given category. |
protected String |
getNodeLink(Category cat,
int pubCount)
This method will compute the node link to use for the given category. |
protected String |
getNodeName(Category cat,
String classes)
This method will compute the node name to display for the given category. |
int |
getOpenLevel()
|
protected String |
getPortals(Category cat)
This method will compute the portal to display for the given category. |
protected int |
getPubCount(Category cat)
|
protected String |
getPubCount(Category cat,
int pubCount)
This method will compute the node title to display for the given category. |
protected String |
getReadablePub(Category cat)
|
String |
getRedirect()
|
protected String |
getRights(Category cat)
This method will compute the rights to display for the given category. |
String |
getRoots(Collection roots,
int level,
boolean rootDisplay)
Returns a String of <ul></ul> displaying root category of the given set. |
boolean |
getToggleLink()
|
short |
getWidget()
|
protected String |
getWidget(Category cat,
int pubCount)
This method will compute the widget to display for the given category. |
String |
getWidgetName()
|
protected String |
getWorkspaces(Category cat)
This method will compute the workspace to display for the given category. |
protected void |
initRoot(Category cat)
This method initialise data for the given category tree. |
boolean |
isEditDisplay()
|
boolean |
isEditDisplay(Category cat)
|
boolean |
isFilterWorkspace()
|
boolean |
isHelpDisplay(Category cat)
|
boolean |
isMemberFiltered(Category cat)
|
boolean |
isNameHighlighted(Category cat)
|
boolean |
isNameStrong(Category cat)
|
boolean |
isNodeOpen(Category cat,
int level)
|
boolean |
isPortalDisplay(Category cat)
|
boolean |
isRemoved(Category cat)
|
boolean |
isRightsDisplay(Category cat)
|
boolean |
isWidgetDisabled(Category cat,
int pubCount)
|
boolean |
isWidgetExclusive(Category cat)
|
boolean |
isWidgetSelected(Category cat)
|
boolean |
isWorkspaceDisplay(Category cat)
|
boolean |
isWorkspaceFiltered(Category cat)
|
String |
remove(String catId)
Deletes the given category id. |
String |
rename(String catId,
String value)
Renames the given category name in the user current language. |
protected void |
resetRoots()
This method reset all stuff cached by initRoot() |
void |
setCss(String css)
Sets a custom CSS to append to main UL. |
void |
setCtxMenu(boolean ctxmenu)
Specify that generated links will use contextual menu. |
void |
setDragDrop(boolean isDragDrop)
Specify that category branch will be Drag N Dropable |
void |
setEditDisplay(boolean isEditDisplay)
Display edit category icon. |
void |
setEditParam(String editParam)
Sets additional parameters for the edit link. |
void |
setFieldName(String fieldName)
|
void |
setFilterMember(short filterMember)
Sets filters to apply on displayed categories. |
void |
setFilterWorkspace(boolean filterWorkspace)
Filter Categories by workspace categories. |
void |
setFormHandler(EditPublicationHandler formHandler)
|
void |
setHelpDisplay(boolean isHelpDisplay)
Display description for a given category. |
void |
setHighlightCatSet(Set highlightCatSet)
Sets a Set of categories that must be highlighted while generating the category tree. |
void |
setHighlightDescendant(boolean highlightDescendant)
Highlight also children categories. |
void |
setJcmsContext(JcmsJspContext jcmsContext)
Sets the following values from values found in the specified JcmsJspContext. Values are not retrieved from context if they have already been set through their setter. |
void |
setNameLink(String nameLink)
Sets link for name of categories. |
void |
setNameLinkNavigate(boolean nameLinkNavigate)
Specify that generated links will be used for navigation or refinement. |
void |
setNameLinkPubCount(boolean nameLinkPubCount)
Display link only on category having a publication count > 0. |
void |
setNameLinkRegexp(boolean nameLinkRegexp)
Parsed name links by a regular expresion replacing _CATID_ by the category id. |
void |
setNameStrong(boolean nameStrong)
Sets Strong category name when category is descendant of the current workspace. |
void |
setNodeAjaxSuffix(String ajaxSuffix)
Sets an ajax suffix for TreeCat used more than once in a page. |
void |
setNodeFunction(String nodeFunction)
Sets a the JavaScript function to call while clicking on a Node icon onclick. |
void |
setOpenedCatSet(Set openedCatSet)
Sets a Set of categories that must be openend while generating the category tree. |
void |
setOpenHighlighted(boolean openHighlighted)
Open parent category of highlighted categories. |
void |
setOpenLevel(int openLevel)
Sets levels to open while generating tree. |
void |
setOpenParent(boolean openParent)
Open parent category of opened category. |
void |
setOpenWidgetSelected(boolean openWidgetSelected)
Specify if parent category of selected categories must be opened. |
String |
setParent(String catId,
String parentId)
|
void |
setPortalDisplay(boolean isPortalDisplay)
Display attached portal for a given category. |
void |
setPortalLink(String portalLink)
Sets link for portal of categories. |
void |
setPortalLinkRegexp(boolean portalLinkRegexp)
Specify that portal links will be parsed by a regular expression replacing _PORTALID_ by the category id. |
void |
setProxy(TreeCatProxy proxy)
Sets a TreeCatProxy called for each branch of the Tree to filter, modify and customize standard behaviour. |
void |
setPubCountClass(Class pubCountClass)
Sets the class of catezgorized publication to count. |
void |
setPubCountDisplay(boolean isPubCountDisplay)
Display publication count. |
void |
setPubCountDisplayCat(boolean isPubCountDisplayCat)
This method specify to display categories only if their pubCount is greater than 0. |
void |
setPubCountPstatus(boolean pubCountPstatus)
Check publication count must pstatus for visible states. |
void |
setPubCountSet(Set pubCountSet)
Sets a Set of Publication to interSet with current publication's category for publication count. |
void |
setPubReadableDisplay(boolean isPubReadableDisplay)
Display readable publication. |
void |
setRedirect(String redirect)
Sets redirect url for edit icon. |
void |
setRemovedCatSet(Set removedCatSet)
Sets a Set of categories that must be removed while generating the category tree. |
void |
setRightsDisplay(boolean isRightsDisplay)
Display explicit rights member or groups rights for a given category. |
void |
setToggleLink(boolean toggleLink)
Specify that links will be toggle if they are clicked twice. |
void |
setWidget(short widget)
Sisplay the widget after each node icon values may be: TreeCat.WIDGET_NONE TreeCat.WIDGET_RADIO TreeCat.WIDGET_CHECKBOX The default value is TreeCat.WIDGET_NONE. |
void |
setWidgetDisableDescendant(boolean widgetDisableDescendant)
Disabled also descendant category. |
void |
setWidgetDisabledSet(Set widgetDisabledSet)
Sets a Set of categories that must have a widget disabled. |
void |
setWidgetDisableParent(boolean widgetDisableParent)
Disabled also parent category. |
void |
setWidgetDisablePubCount(boolean widgetDisablePubCount)
Specify to disable widget that didn't have categorized publication. |
void |
setWidgetDisableSelectable(boolean widgetDisableSelectable)
Disabled categories not selectable. |
void |
setWidgetExclusive(boolean widgetExclusive)
Uncheck other widget while checking a given widget. |
void |
setWidgetFunction(String widgetFunction)
Sets the onclick function for each widget. |
void |
setWidgetName(String widgetName)
Sets widget name. |
void |
setWidgetSelectDescendant(boolean widgetSelectDescendant)
Select also descendant category. |
void |
setWidgetSelectedSet(Set widgetSelectedSet)
Sets a Set of categories that must have a widget selected. |
void |
setWidgetSelectParent(boolean widgetSelectParent)
Select also parent category. |
void |
setWorkspaceDisplay(boolean isWorkspaceDisplay)
Display attached workspace for a given category. |
void |
setWorkspaceModelDisplay(boolean displayWorkspaceModel)
Display attached workspace model for a given category. |
Methods inherited from class com.jalios.jcms.context.AbstractJcmsAjaxContext |
---|
checkAccess, checkAccess, debug, deflate, getBaseUrl, getCaddy, getContextPath, getCtxCategories, getCurrentCategory, getLoggedMember, getMethod, getParameterMap, getPortal, getPortalCategory, getPublication, getResourcePath, getUrl, getUserLang, getUserLocale, getWorkspace, getZone, glp, inflate, isAdmin, isInFrontOffice, isLogged, readObject, setBaseUrl, setContextPath, setCtxCategories, setCurrentCategory, setLoggedMember, setMethod, setParameterMap, setPortal, setPortalCategory, setPublication, setResourcePath, setUrl, setUserLang, setUserLocale, setWorkspace, writeObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final short WIDGET_NONE
public static final short WIDGET_RADIO
public static final short WIDGET_CHECKBOX
public static final short FILTER_NONE
public static final short FILTER_READ
public static final short FILTER_EDIT
public static final org.apache.oro.text.regex.Pattern CATLINK_PATTERN
public static final org.apache.oro.text.regex.Pattern PORTALLINK_PATTERN
public static final String BLANK
public static final String NAME_LINK_DISPLAY
protected transient EditPublicationHandler formHandler
protected transient String fieldName
protected transient Set removedCatSet
protected transient short filterMember
protected transient boolean filterWorkspace
protected transient boolean isCtxMenu
protected transient Collection memberRootSet
protected transient String nodeFunction
protected transient String ajaxSuffix
protected transient Set openedCatSet
protected transient boolean openParent
protected transient int openLevel
protected transient short widget
protected transient String widgetName
protected transient Set widgetSelectedSet
protected transient boolean widgetSelectDescendant
protected transient boolean widgetSelectParent
protected transient Set widgetDisabledSet
protected transient boolean widgetDisableDescendant
protected transient boolean widgetDisableParent
protected transient boolean widgetDisableSelectable
protected transient boolean widgetDisablePubCount
protected transient String widgetFunction
protected transient boolean widgetExclusive
protected transient boolean openWidgetSelected
protected transient boolean nameStrong
protected transient String nameLink
protected transient boolean nameLinkPubCount
protected transient boolean nameLinkNavigate
protected transient boolean nameLinkRegexp
protected transient boolean toggleLink
protected transient boolean nameLinkIsDisplay
protected transient boolean isPubCountDisplay
protected transient boolean isPubCountDisplayCat
protected transient Class pubCountClass
protected transient boolean pubCountPstatus
protected transient Set pubCountSet
protected transient boolean isPubReadableDisplay
protected transient Set highlightCatSet
protected transient boolean highlightDescendant
protected transient boolean openHighlighted
protected transient boolean isPortalDisplay
protected transient String portalLink
protected transient boolean portalLinkRegexp
protected transient boolean isRightsDisplay
protected transient boolean isHelpDisplay
protected transient boolean isWorkspaceDisplay
protected transient boolean displayWorkspaceModel
protected transient String css
protected transient boolean isDragDrop
protected transient boolean isEditDisplay
protected transient boolean editDisplay
protected transient String editParam
protected transient String redirect
protected transient TreeCatProxy proxy
public transient int countAllField
public transient int countField
public transient int countWidget
public transient Set filteredSet
public transient int computedLevel
public transient Collection computedRoots
public transient Collection roots
public transient int level
public transient boolean rootDisplay
public transient boolean computeAncestor
protected transient boolean isRedirect
Constructor Detail |
---|
public TreeCat()
Method Detail |
---|
public String getChildren(String parentId)
getChildren
in interface TreeCatJSONInterface
parentId
- the Id of the parent Category
getChildren(Category,int)
public String getChildren(String[] checked, String[] opened)
getChildren
in interface TreeCatJSONInterface
getChildren(String[], String[])
public String rename(String catId, String value)
rename
in interface TreeCatJSONInterface
catId
- the working category idvalue
- the new category name
rename(String, String)
public String addSubCat(String catId, String name)
addSubCat
in interface TreeCatJSONInterface
catId
- the working category idname
- the new category name
addSubCat(String, String)
public String addSiblingCat(String catId, String name)
addSiblingCat
in interface TreeCatJSONInterface
catId
- the working category idname
- the new category name
addSiblingCat(String, String)
public String addCat(Category parent, String name)
addCat
in interface TreeCatJSONInterface
addCat(Category, String)
public String remove(String catId)
remove
in interface TreeCatJSONInterface
catId
- the working category id
remove(String)
public String setParent(String catId, String parentId)
setParent
in interface TreeCatJSONInterface
setParent(String, String)
public String getRoots(Collection roots, int level, boolean rootDisplay)
roots
- a Collection of root category to displaylevel
- the level of children to generaterootDisplay
- boolean true if roots must be displayed
protected String getDragDrop(Collection roots)
roots
- a collection of root categories
public String getHiddens()
public String getChildren(Category parent, int level)
parent
- the parent Categorylevel
- the level of child to generate display
getChildrenMap(Category,int)
public Map getChildrenMap(Category parent, int level)
parent
- the parent Categorylevel
- the level of child to generate display
public String getBranch(Category cat, int level)
cat
- the Category to displaylevel
- the level of child to display
protected String getBranchLI(Category cat, int level)
cat
- the Category to displaylevel
- the level of children to generate
getBranchLI(Category, String, int)
protected String getBranchLI(Category cat, String str, int level)
protected String getBranchLI(Category cat, String value, int level, boolean hasLevelChanged)
cat
- the Category to displayvalue
- the display value of the category without <li></li>level
- the level of children to generatehasLevelChanged
- the level has changed
protected String getNodeIcon(Category cat, int level)
cat
- the category to displaylevel
- the level of child to generate display
protected String getWidget(Category cat, int pubCount)
cat
- the category to displaypubCount
- the computed publication count
protected String getNodeLink(Category cat, int pubCount)
cat
- the category to displaypubCount
- the publication count for this category
protected String getNodeName(Category cat, String classes)
cat
- the category to display
protected String getReadablePub(Category cat)
cat
- the category to display
protected String getPubCount(Category cat, int pubCount)
cat
- the category to displaypubCount
- the publication count for this category
protected String getRights(Category cat)
cat
- the category to display
protected String getHelp(Category cat)
cat
- the category to display
protected String getPortals(Category cat)
cat
- the category to display
protected String getWorkspaces(Category cat)
cat
- the category to display
protected String getEdit(Category cat)
cat
- the category to display
protected void initRoot(Category cat)
cat
- the root cateory to initializegetReadablePub(Category)
,
setPubReadableDisplay(boolean)
protected void resetRoots()
protected String getInnerRoots(Collection roots, int level, boolean rootDisplay)
roots
- a Collection of root category to displaylevel
- the level of children to generaterootDisplay
- boolean true if roots must be displayed
protected int getPubCount(Category cat)
public int getOpenLevel()
public boolean isRightsDisplay(Category cat)
public boolean isHelpDisplay(Category cat)
public boolean isPortalDisplay(Category cat)
public boolean isWorkspaceDisplay(Category cat)
public boolean isEditDisplay(Category cat)
public boolean isRemoved(Category cat)
public boolean isNameStrong(Category cat)
public boolean isWorkspaceFiltered(Category cat)
public boolean isMemberFiltered(Category cat)
protected boolean canWorkOn(Category cat)
public boolean isNameHighlighted(Category cat)
public boolean isNodeOpen(Category cat, int level)
public boolean isWidgetSelected(Category cat)
public boolean isWidgetDisabled(Category cat, int pubCount)
public boolean isWidgetExclusive(Category cat)
public String getAjaxSuffix()
public Set getFilteredSet()
public short getFilterMember()
public boolean isFilterWorkspace()
public boolean isEditDisplay()
public String getRedirect()
public short getWidget()
public String getWidgetName()
public boolean getToggleLink()
public void setFormHandler(EditPublicationHandler formHandler)
public void setFieldName(String fieldName)
public void setNodeFunction(String nodeFunction)
nodeFunction
- the JavaScript functionpublic void setNodeAjaxSuffix(String ajaxSuffix)
ajaxSuffix
- String the ajax distinguish suffixpublic void setOpenedCatSet(Set openedCatSet)
openedCatSet
- A Set of categorypublic void setOpenParent(boolean openParent)
openParent
- boolean true to open parent categorypublic void setOpenLevel(int openLevel)
openLevel
- the level to openpublic void setRemovedCatSet(Set removedCatSet)
removedCatSet
- A Set of categorypublic void setHighlightCatSet(Set highlightCatSet)
highlightCatSet
- A Set of categorypublic void setOpenHighlighted(boolean openHighlighted)
openHighlighted
- boolean true to open parent categorypublic void setHighlightDescendant(boolean highlightDescendant)
highlightDescendant
- boolean true to hightlight descendantpublic void setWidget(short widget)
widget
- the widget typepublic void setWidgetName(String widgetName)
widgetName
- the widget namepublic void setWidgetSelectedSet(Set widgetSelectedSet)
widgetSelectedSet
- A Set of categorypublic void setOpenWidgetSelected(boolean openWidgetSelected)
openWidgetSelected
- boolean true to open parent categorypublic void setWidgetSelectDescendant(boolean widgetSelectDescendant)
widgetSelectDescendant
- true if descendant category are selectedpublic void setWidgetSelectParent(boolean widgetSelectParent)
widgetSelectParent
- true if parent category are selectedpublic void setWidgetDisabledSet(Set widgetDisabledSet)
widgetDisabledSet
- A Set of categorypublic void setWidgetDisableDescendant(boolean widgetDisableDescendant)
widgetDisableDescendant
- true if descendant category are selectedpublic void setWidgetDisableParent(boolean widgetDisableParent)
widgetDisableParent
- true if children category are selectedpublic void setWidgetDisableSelectable(boolean widgetDisableSelectable)
widgetDisableSelectable
- true if category not selectable are also disabledpublic void setWidgetFunction(String widgetFunction)
widgetFunction
- the JavaScript function on widgetpublic void setWidgetExclusive(boolean widgetExclusive)
widgetExclusive
- true if widgets are exclusivespublic void setWidgetDisablePubCount(boolean widgetDisablePubCount)
widgetDisablePubCount
- true if widgets are disable when no publication are categorized underpublic void setRightsDisplay(boolean isRightsDisplay)
isRightsDisplay
- boolean true to display rightspublic void setHelpDisplay(boolean isHelpDisplay)
isHelpDisplay
- boolean true to display helppublic void setPortalDisplay(boolean isPortalDisplay)
isPortalDisplay
- boolean true to display portal iconpublic void setWorkspaceDisplay(boolean isWorkspaceDisplay)
isWorkspaceDisplay
- boolean true to display workspace iconpublic void setWorkspaceModelDisplay(boolean displayWorkspaceModel)
displayWorkspaceModel
- boolean true to display workspace iconsetWorkspaceDisplay(boolean)
public void setEditDisplay(boolean isEditDisplay)
isEditDisplay
- boolean true to display edit iconpublic void setPubCountDisplay(boolean isPubCountDisplay)
isPubCountDisplay
- boolean true to display publication countpublic void setPubCountDisplayCat(boolean isPubCountDisplayCat)
isPubCountDisplayCat
- boolean true to display category if there is publicationpublic void setPubReadableDisplay(boolean isPubReadableDisplay)
isPubReadableDisplay
- boolean true to display readable publicationpublic void setFilterMember(short filterMember)
filterMember
- short representing filterpublic void setFilterWorkspace(boolean filterWorkspace)
filterWorkspace
- boolean true if category are filtered by workspacepublic void setPubCountClass(Class pubCountClass)
pubCountClass
- Class the publication classpublic void setPubCountPstatus(boolean pubCountPstatus)
pubCountPstatus
- boolean true if pstatus is checkedpublic void setPubCountSet(Set pubCountSet)
pubCountSet
- Set of publication.public void setEditParam(String editParam)
editParam
- additional edit parameterspublic void setNameStrong(boolean nameStrong)
nameStrong
- boolean true if the name of category may be strongpublic void setNameLink(String nameLink)
nameLink
- String link of the category namesetNameLinkRegexp(boolean)
public void setNameLinkPubCount(boolean nameLinkPubCount)
nameLinkPubCount
- boolean true if publication count is used.public void setNameLinkNavigate(boolean nameLinkNavigate)
nameLinkNavigate
- boolean true if link is used for navigationpublic void setNameLinkRegexp(boolean nameLinkRegexp)
nameLinkRegexp
- boolean true to parse the name linkpublic void setCtxMenu(boolean ctxmenu)
ctxmenu
- true to display ctxmenupublic void setToggleLink(boolean toggleLink)
toggleLink
- boolean true to toggle linkspublic void setRedirect(String redirect)
redirect
- String value of redirect urlsetJcmsContext(JcmsJspContext)
public void setPortalLink(String portalLink)
portalLink
- String link of the category namesetPortalLinkRegexp(boolean)
public void setPortalLinkRegexp(boolean portalLinkRegexp)
portalLinkRegexp
- boolean true to parse the name linkpublic void setCss(String css)
css
- String CSS to append to UL Treecatpublic void setProxy(TreeCatProxy proxy)
proxy
- an implementation of TreeCatProxypublic void setDragDrop(boolean isDragDrop)
isDragDrop
- boolean true to allow drag n drop on categoriespublic void setJcmsContext(JcmsJspContext jcmsContext)
AbstractJcmsAjaxContext
setJcmsContext
in class AbstractJcmsAjaxContext
jcmsContext
- the JcmsJspContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |