Package com.jalios.jcms.ajax
Class AbstractCtxMenu
- java.lang.Object
-
- com.jalios.jcms.context.AbstractJcmsAjaxContext
-
- com.jalios.jcms.ajax.AbstractCtxMenu
-
- All Implemented Interfaces:
CtxMenuConstants
,java.io.Serializable
- Direct Known Subclasses:
CategoryCtxMenu
,MemberCtxMenu
,PublicationCtxMenu
,WidgetCtxMenu
public abstract class AbstractCtxMenu extends AbstractJcmsAjaxContext implements CtxMenuConstants
This abstract class is the used to process AJAX Contextual Menu.- Since:
- jcms-5.7.0
- Version:
- $Revision: 135601 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CTX_MENU_CSS_PREFIX
static java.lang.String
CTX_MENU_DATA_CSS_PREFIX
static java.lang.String
CTX_MENU_GROUP_CSS_PREFIX
static java.lang.String
CTX_MENU_MBR_CSS_PREFIX
static java.lang.String
CTX_MENU_PUB_CSS_PREFIX
static java.lang.String
CTX_MENU_WS_CSS_PREFIX
protected java.lang.String
redirect
protected java.lang.String
redirectJSNoCaddy
-
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, userZoneId, workspace, zone
-
Fields inherited from interface com.jalios.jcms.ajax.CtxMenuConstants
DISABLED, FLAG_CADDY, FLAG_DELETE, FLAG_EDIT, FLAG_EXPORT, FLAG_INSPECT, FLAG_SEPARATOR, INFO_ICON, MENU_DISABLED, MENU_ENABLED, MENU_SKIPPED, NO_ICON
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCtxMenu(JcmsJspContext ctxt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
addCaddyMenu(java.lang.StringBuffer sb, Data data)
protected int
addDeleteMenu(java.lang.StringBuffer sb, Data data, java.lang.String workspaceFilter, boolean isEnabled)
protected int
addEditMenu(java.lang.StringBuffer sb, Data data, boolean isEnabled, boolean popup)
void
addInfo(java.lang.StringBuffer sb, java.lang.String label, java.lang.String value)
Adds an info in an info sectionvoid
addInfoImage(java.lang.StringBuffer sb, java.lang.String path)
Adds an info in an info sectionvoid
addInfoText(java.lang.StringBuffer sb, java.lang.String text)
Adds an info in an info sectionprotected int
addInspectMenu(java.lang.StringBuffer sb, Data data)
void
addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url)
Adds a menu itemvoid
addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, boolean addRedirect)
Adds a menu itemvoid
addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String css)
Adds a menu item wit cssvoid
addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String css, java.lang.String wrapperCss)
Adds a menu item with css on the link wrappervoid
addItemSeparator(java.lang.StringBuffer sb)
Adds a menu item separator.void
addItemWithConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String confirmMsg)
Adds a menu item with a confirm message dialog box.void
addItemWithConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String confirmMsg, java.lang.String specificRedirect)
Adds a menu item with a confirm message dialog box.void
addItemWithJSConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String func, java.lang.String confirmMsg)
Adds a menu item with a confirm message dialog box.void
addItemWithOnclick(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String onclick)
Convenient method which delegates toaddItemWithOnclick(StringBuffer, boolean, String, String, String, String, String)
void
addItemWithOnclick(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String onclick, java.lang.String title)
Adds a menu item with onclick value.void
addItemWithPrompt(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String func, java.lang.String promptMsg, java.lang.String defaultValue)
Adds a menu item with an input dialog box.void
addItemWithPrompt(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String promptMsg, java.lang.String param, java.lang.String defaultValue)
Adds a menu item with an input dialog box.void
closeItem(java.lang.StringBuffer sb, java.lang.String icon, java.lang.String label)
Close a menu item which has got an icon.void
endInfoSection(java.lang.StringBuffer sb)
Ends an info sectionvoid
endSubSection(java.lang.StringBuffer sb)
Ends an sub-sectionvoid
openItem(java.lang.StringBuffer sb, boolean isEnabled)
Open a menu item which has got an icon.void
openItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String css)
Open a menu item which has got an icon.void
setRedirect(java.lang.String redirect)
void
startInfoSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon)
Starts an info sectionvoid
startSubSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon)
Starts an sub-sectionvoid
startSubSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon, java.lang.String ul)
Starts an sub-section-
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, getUserZoneId, getWorkspace, getZone, glp, inflate, isAdmin, isInFrontOffice, isLogged, readObject, setBaseUrl, setContextPath, setCtxCategories, setCurrentCategory, setJcmsContext, setLoggedMember, setMethod, setParameterMap, setPortal, setPortalCategory, setPublication, setResourcePath, setUrl, setUserCountry, setUserLang, setUserLocale, setUserZoneId, setWorkspace, writeObject
-
-
-
-
Field Detail
-
redirect
protected transient java.lang.String redirect
-
redirectJSNoCaddy
protected transient java.lang.String redirectJSNoCaddy
-
CTX_MENU_CSS_PREFIX
public static final java.lang.String CTX_MENU_CSS_PREFIX
- See Also:
- Constant Field Values
-
CTX_MENU_PUB_CSS_PREFIX
public static final java.lang.String CTX_MENU_PUB_CSS_PREFIX
- See Also:
- Constant Field Values
-
CTX_MENU_MBR_CSS_PREFIX
public static final java.lang.String CTX_MENU_MBR_CSS_PREFIX
- See Also:
- Constant Field Values
-
CTX_MENU_GROUP_CSS_PREFIX
public static final java.lang.String CTX_MENU_GROUP_CSS_PREFIX
- See Also:
- Constant Field Values
-
CTX_MENU_WS_CSS_PREFIX
public static final java.lang.String CTX_MENU_WS_CSS_PREFIX
- See Also:
- Constant Field Values
-
CTX_MENU_DATA_CSS_PREFIX
public static final java.lang.String CTX_MENU_DATA_CSS_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractCtxMenu
protected AbstractCtxMenu(JcmsJspContext ctxt)
-
-
Method Detail
-
addEditMenu
protected int addEditMenu(java.lang.StringBuffer sb, Data data, boolean isEnabled, boolean popup)
-
addDeleteMenu
protected int addDeleteMenu(java.lang.StringBuffer sb, Data data, java.lang.String workspaceFilter, boolean isEnabled)
-
addInspectMenu
protected int addInspectMenu(java.lang.StringBuffer sb, Data data)
-
addCaddyMenu
protected int addCaddyMenu(java.lang.StringBuffer sb, Data data)
-
setRedirect
public void setRedirect(java.lang.String redirect)
-
addItemSeparator
public void addItemSeparator(java.lang.StringBuffer sb)
Adds a menu item separator.- Parameters:
sb
- the StringBuffer- Since:
- jcms-5.7.0
-
addItem
public void addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url)
Adds a menu item- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user selects this item- Since:
- jcms-5.7.0
-
addItem
public void addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String css)
Adds a menu item wit css- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user selects this itemcss
- o add to link (for modal)- Since:
- jcms-7.0.0
-
addItem
public void addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String css, java.lang.String wrapperCss)
Adds a menu item with css on the link wrapper- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelcss
- o add to link (for modal)wrapperCss
- added on the link wrapperurl
- the URL to access if the user selects this item- Since:
- jcms-9.0.3
-
addItem
public void addItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, boolean addRedirect)
Adds a menu item- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user selects this itemaddRedirect
- if true add a redirect attribute in the url.- Since:
- jcms-5.7.0
-
addItemWithOnclick
public void addItemWithOnclick(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String onclick)
Convenient method which delegates toaddItemWithOnclick(StringBuffer, boolean, String, String, String, String, String)
- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user selects this itemonclick
- the javascript function to call (Note: current implementation use double quote onclick="")
-
addItemWithOnclick
public void addItemWithOnclick(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String onclick, java.lang.String title)
Adds a menu item with onclick value. The given url may be null and will be replaced by '#'- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user selects this itemonclick
- the javascript function to call (Note: current implementation use double quote onclick="")title
- the title to set (should not contains double quote- Since:
- jcms-5.7.0
-
addItemWithConfirm
public void addItemWithConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String confirmMsg)
Adds a menu item with a confirm message dialog box.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user confirms the dialog boxconfirmMsg
- the confirm message- Since:
- jcms-5.7.0
-
addItemWithConfirm
public void addItemWithConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String confirmMsg, java.lang.String specificRedirect)
Adds a menu item with a confirm message dialog box.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelurl
- the URL to access if the user confirms the dialog boxconfirmMsg
- the confirm messagespecificRedirect
- to force the value of the redirect- Since:
- jcms-5.7.5
-
addItemWithJSConfirm
public void addItemWithJSConfirm(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String func, java.lang.String confirmMsg)
Adds a menu item with a confirm message dialog box.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the icon of this itemlabel
- the property of the labelfunc
- the JavaScript Func to call if the user confirms the dialog box If you need to use string literal in your function, use the simple quote ('), e.g :String func = "function() {Popup.popupWindow('"+url+"', 'Something');}";
confirmMsg
- the confirm message- Since:
- jcms-5.7.0
-
addItemWithPrompt
public void addItemWithPrompt(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String url, java.lang.String promptMsg, java.lang.String param, java.lang.String defaultValue)
Adds a menu item with an input dialog box. Then redirect prompt value to given url.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the iconlabel
- the property of the labelurl
- the URL to access if the user confirm the dialog boxpromptMsg
- the prompt messageparam
- the name of the parameter for the input textdefaultValue
- the default value of the input- Since:
- jcms-5.7.0
-
addItemWithPrompt
public void addItemWithPrompt(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String icon, java.lang.String label, java.lang.String func, java.lang.String promptMsg, java.lang.String defaultValue)
Adds a menu item with an input dialog box. Then call javascript with prompt value.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabledicon
- the iconlabel
- the property of the labelfunc
- the JavaScript function to call with prompt valuepromptMsg
- the prompt messagedefaultValue
- the default value of the input- Since:
- jcms-5.7.0
-
startSubSection
public void startSubSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon)
Starts an sub-section- Parameters:
sb
- the StringBufferlabel
- the label of the sectionicon
- the icon- Since:
- jcms-5.7.0
-
startSubSection
public void startSubSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon, java.lang.String ul)
Starts an sub-section- Parameters:
sb
- the StringBufferlabel
- the label of the sectionicon
- the iconul
- the class on the ul subsection or null- Since:
- jcms-5.7.0
-
endSubSection
public void endSubSection(java.lang.StringBuffer sb)
Ends an sub-section- Parameters:
sb
- the StringBuffer- Since:
- jcms-5.7.0
-
startInfoSection
public void startInfoSection(java.lang.StringBuffer sb, java.lang.String label, java.lang.String icon)
Starts an info section- Parameters:
sb
- the StringBufferlabel
- the label of the sectionicon
- the icon- Since:
- jcms-5.7.0
-
endInfoSection
public void endInfoSection(java.lang.StringBuffer sb)
Ends an info section- Parameters:
sb
- the StringBuffer- Since:
- jcms-5.7.0
-
addInfo
public void addInfo(java.lang.StringBuffer sb, java.lang.String label, java.lang.String value)
Adds an info in an info section- Parameters:
sb
- the StringBufferlabel
- the label of the infovalue
- the value- Since:
- jcms-5.7.0
-
addInfoText
public void addInfoText(java.lang.StringBuffer sb, java.lang.String text)
Adds an info in an info section- Parameters:
sb
- the StringBuffertext
- the text to display- Since:
- jcms-5.7.0
-
addInfoImage
public void addInfoImage(java.lang.StringBuffer sb, java.lang.String path)
Adds an info in an info section- Parameters:
sb
- the StringBufferpath
- the path of the image to display- Since:
- jcms-6.0.0
-
openItem
public void openItem(java.lang.StringBuffer sb, boolean isEnabled)
Open a menu item which has got an icon.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabled.- Since:
- jcms-5.7.0
-
openItem
public void openItem(java.lang.StringBuffer sb, boolean isEnabled, java.lang.String css)
Open a menu item which has got an icon.- Parameters:
sb
- the StringBufferisEnabled
- true if this item is enabled.css
- the css to add in class attribute (Will be added on the LI element)- Since:
- jcms-9.0.3
-
closeItem
public void closeItem(java.lang.StringBuffer sb, java.lang.String icon, java.lang.String label)
Close a menu item which has got an icon.- Parameters:
sb
- the StringBuffericon
- the item iconlabel
- the label of the item- Since:
- jcms-5.7.0
-
-