com.jalios.jcms.widget
Class TreeCat

java.lang.Object
  extended by com.jalios.jcms.context.AbstractJcmsAjaxContext
      extended by com.jalios.jcms.widget.TreeCat
All Implemented Interfaces:
JcmsConstants, TreeCatJSONInterface, JaliosConstants, Serializable

public class TreeCat
extends AbstractJcmsAjaxContext
implements TreeCatJSONInterface, JcmsConstants, Serializable

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.

Since:
jcms-5.5.0
Version:
$Revision: 66770 $
Author:
Jean-Philippe Encausse
See Also:
TreeCatTag, Serialized Form

Field Summary
protected  String ajaxSuffix
           
static String BLANK
           
static org.apache.oro.text.regex.Pattern CATLINK_PATTERN
           
 boolean computeAncestor
           
 int computedLevel
           
 Collection computedRoots
           
 int countAllField
           
 int countField
           
 int countWidget
           
protected  String css
           
protected  boolean displayWorkspaceModel
           
protected  boolean editDisplay
           
protected  String editParam
           
protected  String fieldName
           
static short FILTER_EDIT
           
static short FILTER_NONE
           
static short FILTER_READ
           
 Set filteredSet
           
protected  short filterMember
           
protected  boolean filterWorkspace
           
protected  EditPublicationHandler formHandler
           
protected  Set highlightCatSet
           
protected  boolean highlightDescendant
           
protected  boolean isCtxMenu
           
protected  boolean isDragDrop
           
protected  boolean isEditDisplay
           
protected  boolean isEmpty
           
protected  boolean isHelpDisplay
           
protected  boolean isPortalDisplay
           
protected  boolean isPubCountDisplay
           
protected  boolean isPubCountDisplayCat
           
protected  boolean isPubReadableDisplay
           
protected  boolean isRedirect
           
protected  boolean isRightsDisplay
           
protected  boolean isWorkspaceDisplay
           
 int level
           
protected  Collection memberRootSet
           
static String NAME_LINK_DISPLAY
           
protected  String nameLink
           
protected  boolean nameLinkIsDisplay
           
protected  boolean nameLinkNavigate
           
protected  boolean nameLinkPubCount
           
protected  boolean nameLinkRegexp
           
protected  boolean nameStrong
           
protected  String nodeFunction
           
protected  Set openedCatSet
           
protected  boolean openHighlighted
           
protected  int openLevel
           
protected  boolean openParent
           
protected  boolean openWidgetSelected
           
protected  String portalLink
           
static org.apache.oro.text.regex.Pattern PORTALLINK_PATTERN
           
protected  boolean portalLinkRegexp
           
protected  TreeCatProxy proxy
           
protected  Class pubCountClass
           
protected  boolean pubCountPstatus
           
protected  Set pubCountSet
           
protected  String redirect
           
protected  Set removedCatSet
           
protected  Set retainedCatSet
           
static String REVISION
           
 boolean rootDisplay
           
 Collection roots
           
protected  boolean toggleLink
           
protected  short widget
           
static short WIDGET_CHECKBOX
           
static short WIDGET_NONE
           
static short WIDGET_RADIO
           
protected  boolean widgetDisableDescendant
           
protected  Set widgetDisabledSet
           
protected  boolean widgetDisableParent
           
protected  boolean widgetDisablePubCount
           
protected  boolean widgetDisableSelectable
           
protected  boolean widgetExclusive
           
protected  String widgetFunction
           
protected  String widgetName
           
protected  boolean widgetSelectDescendant
           
protected  Set widgetSelectedSet
           
protected  boolean widgetSelectParent
           
 
Fields 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, userCountry, userLang, userLocale, workspace, zone
 
Fields inherited from interface com.jalios.jcms.JcmsConstants
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_DEEP_COPY, OP_DEEP_DELETE, OP_DELETE, OP_MERGE, OP_UPDATE, 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, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
 
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 isEmpty()
          Must be called after getRoots() returns rue if there is no inner roots to display.
 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 isRetained(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 setRetainedCatSet(Set retainedCatSet)
          Sets a Set of categories that must be retains 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, getUserCountry, getUserLang, getUserLocale, getWorkspace, getZone, glp, inflate, isAdmin, isInFrontOffice, isLogged, readObject, setBaseUrl, setContextPath, setCtxCategories, setCurrentCategory, setLoggedMember, setMethod, setParameterMap, setPortal, setPortalCategory, setPublication, setResourcePath, setUrl, setUserCountry, setUserLang, setUserLocale, setWorkspace, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

WIDGET_NONE

public static final short WIDGET_NONE
See Also:
Constant Field Values

WIDGET_RADIO

public static final short WIDGET_RADIO
See Also:
Constant Field Values

WIDGET_CHECKBOX

public static final short WIDGET_CHECKBOX
See Also:
Constant Field Values

FILTER_NONE

public static final short FILTER_NONE
See Also:
Constant Field Values

FILTER_READ

public static final short FILTER_READ
See Also:
Constant Field Values

FILTER_EDIT

public static final short FILTER_EDIT
See Also:
Constant Field Values

CATLINK_PATTERN

public static final org.apache.oro.text.regex.Pattern CATLINK_PATTERN

PORTALLINK_PATTERN

public static final org.apache.oro.text.regex.Pattern PORTALLINK_PATTERN

BLANK

public static final String BLANK
See Also:
Constant Field Values

NAME_LINK_DISPLAY

public static final String NAME_LINK_DISPLAY
See Also:
Constant Field Values

formHandler

protected transient EditPublicationHandler formHandler

fieldName

protected transient String fieldName

removedCatSet

protected transient Set removedCatSet

retainedCatSet

protected transient Set retainedCatSet

filterMember

protected transient short filterMember

filterWorkspace

protected transient boolean filterWorkspace

isCtxMenu

protected transient boolean isCtxMenu

memberRootSet

protected transient Collection memberRootSet

nodeFunction

protected transient String nodeFunction

ajaxSuffix

protected transient String ajaxSuffix

openedCatSet

protected transient Set openedCatSet

openParent

protected transient boolean openParent

openLevel

protected transient int openLevel

widget

protected transient short widget

widgetName

protected transient String widgetName

widgetSelectedSet

protected transient Set widgetSelectedSet

widgetSelectDescendant

protected transient boolean widgetSelectDescendant

widgetSelectParent

protected transient boolean widgetSelectParent

widgetDisabledSet

protected transient Set widgetDisabledSet

widgetDisableDescendant

protected transient boolean widgetDisableDescendant

widgetDisableParent

protected transient boolean widgetDisableParent

widgetDisableSelectable

protected transient boolean widgetDisableSelectable

widgetDisablePubCount

protected transient boolean widgetDisablePubCount

widgetFunction

protected transient String widgetFunction

widgetExclusive

protected transient boolean widgetExclusive

openWidgetSelected

protected transient boolean openWidgetSelected

nameStrong

protected transient boolean nameStrong

nameLink

protected transient String nameLink

nameLinkPubCount

protected transient boolean nameLinkPubCount

nameLinkNavigate

protected transient boolean nameLinkNavigate

nameLinkRegexp

protected transient boolean nameLinkRegexp

toggleLink

protected transient boolean toggleLink

nameLinkIsDisplay

protected transient boolean nameLinkIsDisplay

isPubCountDisplay

protected transient boolean isPubCountDisplay

isPubCountDisplayCat

protected transient boolean isPubCountDisplayCat

pubCountClass

protected transient Class pubCountClass

pubCountPstatus

protected transient boolean pubCountPstatus

pubCountSet

protected transient Set pubCountSet

isPubReadableDisplay

protected transient boolean isPubReadableDisplay

highlightCatSet

protected transient Set highlightCatSet

highlightDescendant

protected transient boolean highlightDescendant

openHighlighted

protected transient boolean openHighlighted

isPortalDisplay

protected transient boolean isPortalDisplay

portalLink

protected transient String portalLink

portalLinkRegexp

protected transient boolean portalLinkRegexp

isRightsDisplay

protected transient boolean isRightsDisplay

isHelpDisplay

protected transient boolean isHelpDisplay

isWorkspaceDisplay

protected transient boolean isWorkspaceDisplay

displayWorkspaceModel

protected transient boolean displayWorkspaceModel

css

protected transient String css

isDragDrop

protected transient boolean isDragDrop

isEditDisplay

protected transient boolean isEditDisplay

editDisplay

protected transient boolean editDisplay

editParam

protected transient String editParam

redirect

protected transient String redirect

proxy

protected transient TreeCatProxy proxy

countAllField

public transient int countAllField

countField

public transient int countField

countWidget

public transient int countWidget

filteredSet

public transient Set filteredSet

computedLevel

public transient int computedLevel

computedRoots

public transient Collection computedRoots

roots

public transient Collection roots

level

public transient int level

rootDisplay

public transient boolean rootDisplay

computeAncestor

public transient boolean computeAncestor

isRedirect

protected transient boolean isRedirect

isEmpty

protected transient boolean isEmpty
Constructor Detail

TreeCat

public TreeCat()
Method Detail

getChildren

public String getChildren(String parentId)
Returns a String of <li></li> displaying children of a given parent Category. Convenient method called by ajax request.

Specified by:
getChildren in interface TreeCatJSONInterface
Parameters:
parentId - the Id of the parent Category
Returns:
String containing a list of <li></li> category children
See Also:
getChildren(Category,int)

getChildren

public String getChildren(String[] checked,
                          String[] opened)
Returns a String of <li></li> displaying roots. Convenient method called by ajax request.

Specified by:
getChildren in interface TreeCatJSONInterface
Returns:
String containing a list of <li></li> category root
See Also:
getChildren(String[], String[])

rename

public String rename(String catId,
                     String value)
Renames the given category name in the user current language.

Specified by:
rename in interface TreeCatJSONInterface
Parameters:
catId - the working category id
value - the new category name
Returns:
String ControllerStatus error message
See Also:
rename(String, String)

addSubCat

public String addSubCat(String catId,
                        String name)
Creates a new category under the given parent id with the given category name

Specified by:
addSubCat in interface TreeCatJSONInterface
Parameters:
catId - the working category id
name - the new category name
Returns:
String ControllerStatus error message
See Also:
addSubCat(String, String)

addSiblingCat

public String addSiblingCat(String catId,
                            String name)
Creates a category under the parent of the category id with the given category name

Specified by:
addSiblingCat in interface TreeCatJSONInterface
Parameters:
catId - the working category id
name - the new category name
Returns:
String ControllerStatus error message
See Also:
addSiblingCat(String, String)

addCat

public String addCat(Category parent,
                     String name)
Specified by:
addCat in interface TreeCatJSONInterface
See Also:
addCat(Category, String)

remove

public String remove(String catId)
Deletes the given category id.

Specified by:
remove in interface TreeCatJSONInterface
Parameters:
catId - the working category id
Returns:
String ControllerStatus error message
See Also:
remove(String)

setParent

public String setParent(String catId,
                        String parentId)
Specified by:
setParent in interface TreeCatJSONInterface
See Also:
setParent(String, String)

getRoots

public String getRoots(Collection roots,
                       int level,
                       boolean rootDisplay)
Returns a String of <ul></ul> displaying root category of the given set.

Parameters:
roots - a Collection of root category to display
level - the level of children to generate
rootDisplay - boolean true if roots must be displayed
Returns:
String containing <ul></ul> of category

getDragDrop

protected String getDragDrop(Collection roots)
Computes roots rights to enable/disable drag and drop on categories

Parameters:
roots - a collection of root categories
Returns:
String the css to apply

getHiddens

public String getHiddens()
Returns all input hidden for selected categories that have been filtered (Not removed !)

Returns:
String representing <input> hidden

getChildren

public String getChildren(Category parent,
                          int level)
This method return a String of <li></li> displaying children of a given parent Category.

Parameters:
parent - the parent Category
level - the level of child to generate display
Returns:
String containing a list of <li></li> category children
See Also:
getChildrenMap(Category,int)

getChildrenMap

public 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.

Parameters:
parent - the parent Category
level - the level of child to generate display
Returns:
Map of Category/String

getBranch

public String getBranch(Category cat,
                        int level)
This method will return a String representing the given Catergory with all requested computed options.

Parameters:
cat - the Category to display
level - the level of child to display
Returns:
String displaying the category without <li></li>

getBranchLI

protected String getBranchLI(Category cat,
                             int level)
This method will return a String representing the given Catergory with all requested computed options.

Parameters:
cat - the Category to display
level - the level of children to generate
Returns:
String displaying the category with <li></li>
See Also:
getBranchLI(Category, String, int)

getBranchLI

protected String getBranchLI(Category cat,
                             String str,
                             int level)

getBranchLI

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>

Parameters:
cat - the Category to display
value - the display value of the category without <li></li>
level - the level of children to generate
hasLevelChanged - the level has changed
Returns:
String displaying the category with <li></li>

getNodeIcon

protected String getNodeIcon(Category cat,
                             int level)
This method will compute the node icon to display for the given category.

Parameters:
cat - the category to display
level - the level of child to generate display
Returns:
String the computed String

getWidget

protected String getWidget(Category cat,
                           int pubCount)
This method will compute the widget to display for the given category.

Parameters:
cat - the category to display
pubCount - the computed publication count
Returns:
String the computed String

getNodeLink

protected String getNodeLink(Category cat,
                             int pubCount)
This method will compute the node link to use for the given category. The methode getNodeName() will be called to compute the node name.

Parameters:
cat - the category to display
pubCount - the publication count for this category
Returns:
String the computed String

getNodeName

protected String getNodeName(Category cat,
                             String classes)
This method will compute the node name to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

getReadablePub

protected String getReadablePub(Category cat)
Parameters:
cat - the category to display
Returns:
String an information representing readable publication

getPubCount

protected String getPubCount(Category cat,
                             int pubCount)
This method will compute the node title to display for the given category.

Parameters:
cat - the category to display
pubCount - the publication count for this category
Returns:
String the computed String

getRights

protected String getRights(Category cat)
This method will compute the rights to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

getHelp

protected String getHelp(Category cat)
This method will compute the help icon to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

getPortals

protected String getPortals(Category cat)
This method will compute the portal to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

getWorkspaces

protected String getWorkspaces(Category cat)
This method will compute the workspace to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

getEdit

protected String getEdit(Category cat)
This method will compute the edit icon to display for the given category.

Parameters:
cat - the category to display
Returns:
String the computed String

initRoot

protected void initRoot(Category cat)
This method initialise data for the given category tree. - It initialise a Set of Category handling Unread and Tracked Publication.

Parameters:
cat - the root cateory to initialize
See Also:
getReadablePub(Category), setPubReadableDisplay(boolean)

resetRoots

protected void resetRoots()
This method reset all stuff cached by initRoot()


getInnerRoots

protected String getInnerRoots(Collection roots,
                               int level,
                               boolean rootDisplay)
This method return a String displaying root category of the given set. WARNING ! This method init data for each roots and init the computedRoots / computedLevel var

Parameters:
roots - a Collection of root category to display
level - the level of children to generate
rootDisplay - boolean true if roots must be displayed
Returns:
String containing <ul></ul> of category

getPubCount

protected int getPubCount(Category cat)

getOpenLevel

public int getOpenLevel()

isRightsDisplay

public boolean isRightsDisplay(Category cat)

isHelpDisplay

public boolean isHelpDisplay(Category cat)

isPortalDisplay

public boolean isPortalDisplay(Category cat)

isWorkspaceDisplay

public boolean isWorkspaceDisplay(Category cat)

isEditDisplay

public boolean isEditDisplay(Category cat)

isRemoved

public boolean isRemoved(Category cat)

isRetained

public boolean isRetained(Category cat)

isNameStrong

public boolean isNameStrong(Category cat)

isWorkspaceFiltered

public boolean isWorkspaceFiltered(Category cat)

isMemberFiltered

public boolean isMemberFiltered(Category cat)

canWorkOn

protected boolean canWorkOn(Category cat)

isNameHighlighted

public boolean isNameHighlighted(Category cat)

isNodeOpen

public boolean isNodeOpen(Category cat,
                          int level)

isWidgetSelected

public boolean isWidgetSelected(Category cat)

isWidgetDisabled

public boolean isWidgetDisabled(Category cat,
                                int pubCount)

isWidgetExclusive

public boolean isWidgetExclusive(Category cat)

getAjaxSuffix

public String getAjaxSuffix()

getFilteredSet

public Set getFilteredSet()

getFilterMember

public short getFilterMember()

isFilterWorkspace

public boolean isFilterWorkspace()

isEditDisplay

public boolean isEditDisplay()

getRedirect

public String getRedirect()

getWidget

public short getWidget()

getWidgetName

public String getWidgetName()

getToggleLink

public boolean getToggleLink()

setFormHandler

public void setFormHandler(EditPublicationHandler formHandler)

setFieldName

public void setFieldName(String fieldName)

setNodeFunction

public void setNodeFunction(String nodeFunction)
Sets a the JavaScript function to call while clicking on a Node icon onclick. Default value is: "Ajax.Tree.toggleOpenClose(this);"

Parameters:
nodeFunction - the JavaScript function

setNodeAjaxSuffix

public void setNodeAjaxSuffix(String ajaxSuffix)
Sets an ajax suffix for TreeCat used more than once in a page.

Parameters:
ajaxSuffix - String the ajax distinguish suffix

setOpenedCatSet

public void setOpenedCatSet(Set openedCatSet)
Sets a Set of categories that must be openend while generating the category tree.

Parameters:
openedCatSet - A Set of category

setOpenParent

public void setOpenParent(boolean openParent)
Open parent category of opened category. Default value is true.

Parameters:
openParent - boolean true to open parent category

setOpenLevel

public void setOpenLevel(int openLevel)
Sets levels to open while generating tree. level for roots must be > 0;

Parameters:
openLevel - the level to open

setRemovedCatSet

public void setRemovedCatSet(Set removedCatSet)
Sets a Set of categories that must be removed while generating the category tree.

Parameters:
removedCatSet - A Set of category

setRetainedCatSet

public void setRetainedCatSet(Set retainedCatSet)
Sets a Set of categories that must be retains while generating the category tree.

Parameters:
retainedCatSet - A Set of category

setHighlightCatSet

public void setHighlightCatSet(Set highlightCatSet)
Sets a Set of categories that must be highlighted while generating the category tree.

Parameters:
highlightCatSet - A Set of category

setOpenHighlighted

public void setOpenHighlighted(boolean openHighlighted)
Open parent category of highlighted categories. Default value is true.

Parameters:
openHighlighted - boolean true to open parent category

setHighlightDescendant

public void setHighlightDescendant(boolean highlightDescendant)
Highlight also children categories. Default value is false.

Parameters:
highlightDescendant - boolean true to hightlight descendant

setWidget

public void setWidget(short widget)
Sisplay the widget after each node icon values may be: The default value is TreeCat.WIDGET_NONE.

Parameters:
widget - the widget type

setWidgetName

public void setWidgetName(String widgetName)
Sets widget name. this parameter is required if a widget is specified.

Parameters:
widgetName - the widget name

setWidgetSelectedSet

public void setWidgetSelectedSet(Set widgetSelectedSet)
Sets a Set of categories that must have a widget selected. while generating the category tree.

Parameters:
widgetSelectedSet - A Set of category

setOpenWidgetSelected

public void setOpenWidgetSelected(boolean openWidgetSelected)
Specify if parent category of selected categories must be opened. Default value is true.

Parameters:
openWidgetSelected - boolean true to open parent category

setWidgetSelectDescendant

public void setWidgetSelectDescendant(boolean widgetSelectDescendant)
Select also descendant category. Default value is false. NB: If check is done by JavaScript and some descendant have not been alread downloaded then they will not be checked.

Parameters:
widgetSelectDescendant - true if descendant category are selected

setWidgetSelectParent

public void setWidgetSelectParent(boolean widgetSelectParent)
Select also parent category. Default value is false.

Parameters:
widgetSelectParent - true if parent category are selected

setWidgetDisabledSet

public void setWidgetDisabledSet(Set widgetDisabledSet)
Sets a Set of categories that must have a widget disabled. while generating the category tree.

Parameters:
widgetDisabledSet - A Set of category

setWidgetDisableDescendant

public void setWidgetDisableDescendant(boolean widgetDisableDescendant)
Disabled also descendant category. Default value is false.

Parameters:
widgetDisableDescendant - true if descendant category are selected

setWidgetDisableParent

public void setWidgetDisableParent(boolean widgetDisableParent)
Disabled also parent category. Default value is false.

Parameters:
widgetDisableParent - true if children category are selected

setWidgetDisableSelectable

public void setWidgetDisableSelectable(boolean widgetDisableSelectable)
Disabled categories not selectable. Default value is true.

Parameters:
widgetDisableSelectable - true if category not selectable are also disabled

setWidgetFunction

public void setWidgetFunction(String widgetFunction)
Sets the onclick function for each widget. Function will be called after internal treecat widget function.

Parameters:
widgetFunction - the JavaScript function on widget

setWidgetExclusive

public void setWidgetExclusive(boolean widgetExclusive)
Uncheck other widget while checking a given widget. At a same time two widget can't be checked.

Parameters:
widgetExclusive - true if widgets are exclusives

setWidgetDisablePubCount

public void setWidgetDisablePubCount(boolean widgetDisablePubCount)
Specify to disable widget that didn't have categorized publication.

Parameters:
widgetDisablePubCount - true if widgets are disable when no publication are categorized under

setRightsDisplay

public void setRightsDisplay(boolean isRightsDisplay)
Display explicit rights member or groups rights for a given category. Defaut icon is a key. Default value is true.

Parameters:
isRightsDisplay - boolean true to display rights

setHelpDisplay

public void setHelpDisplay(boolean isHelpDisplay)
Display description for a given category. Default value is true.

Parameters:
isHelpDisplay - boolean true to display help

setPortalDisplay

public void setPortalDisplay(boolean isPortalDisplay)
Display attached portal for a given category. It display, Portal, Redirect, and Multiple Portals. Default value is true.

Parameters:
isPortalDisplay - boolean true to display portal icon

setWorkspaceDisplay

public void setWorkspaceDisplay(boolean isWorkspaceDisplay)
Display attached workspace for a given category. It display Workspace or multiple workspace Default value is true.

Parameters:
isWorkspaceDisplay - boolean true to display workspace icon

setWorkspaceModelDisplay

public void setWorkspaceModelDisplay(boolean displayWorkspaceModel)
Display attached workspace model for a given category.

Parameters:
displayWorkspaceModel - boolean true to display workspace icon
See Also:
setWorkspaceDisplay(boolean)

setEditDisplay

public void setEditDisplay(boolean isEditDisplay)
Display edit category icon. Default value is false.

Parameters:
isEditDisplay - boolean true to display edit icon

setPubCountDisplay

public void setPubCountDisplay(boolean isPubCountDisplay)
Display publication count. Default value is false.

Parameters:
isPubCountDisplay - boolean true to display publication count

setPubCountDisplayCat

public void setPubCountDisplayCat(boolean isPubCountDisplayCat)
This method specify to display categories only if their pubCount is greater than 0. Default value is false.

Parameters:
isPubCountDisplayCat - boolean true to display category if there is publication

setPubReadableDisplay

public void setPubReadableDisplay(boolean isPubReadableDisplay)
Display readable publication. Default value is false.

Parameters:
isPubReadableDisplay - boolean true to display readable publication

setFilterMember

public void setFilterMember(short filterMember)
Sets filters to apply on displayed categories. It depends on logged Member rights. Values may be: The default value is TreeCat.FILTER_NONE.

Parameters:
filterMember - short representing filter

setFilterWorkspace

public void setFilterWorkspace(boolean filterWorkspace)
Filter Categories by workspace categories. Default value is false.

Parameters:
filterWorkspace - boolean true if category are filtered by workspace

setPubCountClass

public void setPubCountClass(Class pubCountClass)
Sets the class of catezgorized publication to count. Default value is Content.class. This field must not be set to null.

Parameters:
pubCountClass - Class the publication class

setPubCountPstatus

public void setPubCountPstatus(boolean pubCountPstatus)
Check publication count must pstatus for visible states. Default value is true.

Parameters:
pubCountPstatus - boolean true if pstatus is checked

setPubCountSet

public void setPubCountSet(Set pubCountSet)
Sets a Set of Publication to interSet with current publication's category for publication count.

Parameters:
pubCountSet - Set of publication.

setEditParam

public void setEditParam(String editParam)
Sets additional parameters for the edit link. Parameter redirect and id are internally set.

Parameters:
editParam - additional edit parameters

setNameStrong

public void setNameStrong(boolean nameStrong)
Sets Strong category name when category is descendant of the current workspace. Default value is false.

Parameters:
nameStrong - boolean true if the name of category may be strong

setNameLink

public void setNameLink(String nameLink)
Sets link for name of categories. The link may be parsed by a Regular Expression matching something_CATID_something otherwise the category if will be append at the end of the link.

Parameters:
nameLink - String link of the category name
See Also:
setNameLinkRegexp(boolean)

setNameLinkPubCount

public void setNameLinkPubCount(boolean nameLinkPubCount)
Display link only on category having a publication count > 0. Default value is false.

Parameters:
nameLinkPubCount - boolean true if publication count is used.

setNameLinkNavigate

public void setNameLinkNavigate(boolean nameLinkNavigate)
Specify that generated links will be used for navigation or refinement. Regexp will be only apply on Navigate. Default value is true

Parameters:
nameLinkNavigate - boolean true if link is used for navigation

setNameLinkRegexp

public void setNameLinkRegexp(boolean nameLinkRegexp)
Parsed name links by a regular expresion replacing _CATID_ by the category id. Default value is false

Parameters:
nameLinkRegexp - boolean true to parse the name link

setCtxMenu

public void setCtxMenu(boolean ctxmenu)
Specify that generated links will use contextual menu. Default value is true

Parameters:
ctxmenu - true to display ctxmenu

setToggleLink

public void setToggleLink(boolean toggleLink)
Specify that links will be toggle if they are clicked twice. On second click the value of the category will be "". The default value of toggleLink is true.

Parameters:
toggleLink - boolean true to toggle links

setRedirect

public void setRedirect(String redirect)
Sets redirect url for edit icon.

Parameters:
redirect - String value of redirect url
See Also:
setJcmsContext(JcmsJspContext)

setPortalLink

public void setPortalLink(String portalLink)
Sets link for portal of categories. The link may be parsed by a Regular Expression matching something_PORTALID_something.

Parameters:
portalLink - String link of the category name
See Also:
setPortalLinkRegexp(boolean)

setPortalLinkRegexp

public void setPortalLinkRegexp(boolean portalLinkRegexp)
Specify that portal links will be parsed by a regular expression replacing _PORTALID_ by the category id. Default value is false.

Parameters:
portalLinkRegexp - boolean true to parse the name link

setCss

public void setCss(String css)
Sets a custom CSS to append to main UL.

Parameters:
css - String CSS to append to UL Treecat

setProxy

public void setProxy(TreeCatProxy proxy)
Sets a TreeCatProxy called for each branch of the Tree to filter, modify and customize standard behaviour.

Parameters:
proxy - an implementation of TreeCatProxy

setDragDrop

public void setDragDrop(boolean isDragDrop)
Specify that category branch will be Drag N Dropable

Parameters:
isDragDrop - boolean true to allow drag n drop on categories

setJcmsContext

public void setJcmsContext(JcmsJspContext jcmsContext)
Description copied from class: AbstractJcmsAjaxContext
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. This method MUST be called when this object is created during the inital request (as opposed to other AJAX request occuring after).

Overrides:
setJcmsContext in class AbstractJcmsAjaxContext
Parameters:
jcmsContext - the JcmsJspContext

isEmpty

public boolean isEmpty()
Must be called after getRoots() returns rue if there is no inner roots to display.

Returns:
boolean true if TreeCat is empty


Copyright © 2001-2010 Jalios SA. All Rights Reserved.