com.jalios.jcms.ajax
Class AbstractCtxMenu

java.lang.Object
  extended by com.jalios.jcms.context.AbstractJcmsAjaxContext
      extended by com.jalios.jcms.ajax.AbstractCtxMenu
All Implemented Interfaces:
CtxMenuConstants, 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: 40154 $
See Also:
Serialized Form

Field Summary
protected  String redirect
           
protected  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, workspace, zone
 
Fields inherited from interface com.jalios.jcms.ajax.CtxMenuConstants
DISABLED, FLAG_CADDY, FLAG_DELETE, FLAG_EDIT, FLAG_EXPORT, FLAG_SEPARATOR, INFO_ICON, MENU_DISABLED, MENU_ENABLED, MENU_SKIPPED, NO_ICON
 
Constructor Summary
protected AbstractCtxMenu(JcmsJspContext ctxt)
           
 
Method Summary
protected  int addCaddyMenu(StringBuffer sb, Data data)
           
protected  int addDeleteMenu(StringBuffer sb, Data data, String workspaceFilter, boolean isEnabled)
           
protected  int addEditMenu(StringBuffer sb, Data data, boolean isEnabled, boolean popup)
           
 void addInfo(StringBuffer sb, String label, String value)
          Adds an info in an info section
 void addInfoImage(StringBuffer sb, String path)
          Adds an info in an info section
 void addInfoText(StringBuffer sb, String text)
          Adds an info in an info section
 void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url)
          Adds a menu item
 void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, boolean addRedirect)
          Adds a menu item
 void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String css)
          Adds a menu item wit css
 void addItemSeparator(StringBuffer sb)
          Adds a menu item separator.
 void addItemWithConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String confirmMsg)
          Adds a menu item with a confirm message dialog box.
 void addItemWithConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String confirmMsg, String specificRedirect)
          Adds a menu item with a confirm message dialog box.
 void addItemWithJSConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String func, String confirmMsg)
          Adds a menu item with a confirm message dialog box.
 void addItemWithOnclick(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String onclick)
          Convenient method which delegates to addItemWithOnclick(StringBuffer, boolean, String, String, String, String, String)
 void addItemWithOnclick(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String onclick, String title)
          Adds a menu item with onclick value.
 void addItemWithPrompt(StringBuffer sb, boolean isEnabled, String icon, String label, String func, String promptMsg, String defaultValue)
          Adds a menu item with an input dialog box.
 void addItemWithPrompt(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String promptMsg, String param, String defaultValue)
          Adds a menu item with an input dialog box.
 void closeItem(StringBuffer sb, String icon, String label)
          Close a menu item which has got an icon.
 void endInfoSection(StringBuffer sb)
          Ends an info section
 void endSubSection(StringBuffer sb)
          Ends an sub-section
 void openItem(StringBuffer sb, boolean isEnabled)
          Open a menu item which has got an icon.
 void setRedirect(String redirect)
           
 void startInfoSection(StringBuffer sb, String label, String icon)
          Starts an info section
 void startSubSection(StringBuffer sb, String label, String icon)
          Starts an sub-section
 void startSubSection(StringBuffer sb, String label, String icon, 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, getWorkspace, getZone, glp, inflate, isAdmin, isInFrontOffice, isLogged, readObject, setBaseUrl, setContextPath, setCtxCategories, setCurrentCategory, setJcmsContext, 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

redirect

protected transient String redirect

redirectJSNoCaddy

protected transient String redirectJSNoCaddy
Constructor Detail

AbstractCtxMenu

protected AbstractCtxMenu(JcmsJspContext ctxt)
Method Detail

addEditMenu

protected int addEditMenu(StringBuffer sb,
                          Data data,
                          boolean isEnabled,
                          boolean popup)

addDeleteMenu

protected int addDeleteMenu(StringBuffer sb,
                            Data data,
                            String workspaceFilter,
                            boolean isEnabled)

addCaddyMenu

protected int addCaddyMenu(StringBuffer sb,
                           Data data)

setRedirect

public void setRedirect(String redirect)

addItemSeparator

public void addItemSeparator(StringBuffer sb)
Adds a menu item separator.

Parameters:
sb - the StringBuffer
Since:
jcms-5.7.0

addItem

public void addItem(StringBuffer sb,
                    boolean isEnabled,
                    String icon,
                    String label,
                    String url)
Adds a menu item

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user selects this item
Since:
jcms-5.7.0

addItem

public void addItem(StringBuffer sb,
                    boolean isEnabled,
                    String icon,
                    String label,
                    String url,
                    String css)
Adds a menu item wit css

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user selects this item
css - o add to link (for modal)
Since:
jcms-7.0.0

addItem

public void addItem(StringBuffer sb,
                    boolean isEnabled,
                    String icon,
                    String label,
                    String url,
                    boolean addRedirect)
Adds a menu item

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user selects this item
addRedirect - if true add a redirect attribute in the url.
Since:
jcms-5.7.0

addItemWithOnclick

public void addItemWithOnclick(StringBuffer sb,
                               boolean isEnabled,
                               String icon,
                               String label,
                               String url,
                               String onclick)
Convenient method which delegates to addItemWithOnclick(StringBuffer, boolean, String, String, String, String, String)

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user selects this item
onclick - the javascript function to call (Note: current implementation use double quote onclick="")

addItemWithOnclick

public void addItemWithOnclick(StringBuffer sb,
                               boolean isEnabled,
                               String icon,
                               String label,
                               String url,
                               String onclick,
                               String title)
Adds a menu item with onclick value. The given url may be null and will be replaced by '#'

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user selects this item
onclick - 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(StringBuffer sb,
                               boolean isEnabled,
                               String icon,
                               String label,
                               String url,
                               String confirmMsg)
Adds a menu item with a confirm message dialog box.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user confirms the dialog box
confirmMsg - the confirm message
Since:
jcms-5.7.0

addItemWithConfirm

public void addItemWithConfirm(StringBuffer sb,
                               boolean isEnabled,
                               String icon,
                               String label,
                               String url,
                               String confirmMsg,
                               String specificRedirect)
Adds a menu item with a confirm message dialog box.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
url - the URL to access if the user confirms the dialog box
confirmMsg - the confirm message
specificRedirect - to force the value of the redirect
Since:
jcms-5.7.5

addItemWithJSConfirm

public void addItemWithJSConfirm(StringBuffer sb,
                                 boolean isEnabled,
                                 String icon,
                                 String label,
                                 String func,
                                 String confirmMsg)
Adds a menu item with a confirm message dialog box.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon of this item
label - the property of the label
func - 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(StringBuffer sb,
                              boolean isEnabled,
                              String icon,
                              String label,
                              String url,
                              String promptMsg,
                              String param,
                              String defaultValue)
Adds a menu item with an input dialog box. Then redirect prompt value to given url.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon
label - the property of the label
url - the URL to access if the user confirm the dialog box
promptMsg - the prompt message
param - the name of the parameter for the input text
defaultValue - the default value of the input
Since:
jcms-5.7.0

addItemWithPrompt

public void addItemWithPrompt(StringBuffer sb,
                              boolean isEnabled,
                              String icon,
                              String label,
                              String func,
                              String promptMsg,
                              String defaultValue)
Adds a menu item with an input dialog box. Then call javascript with prompt value.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled
icon - the icon
label - the property of the label
func - the JavaScript function to call with prompt value
promptMsg - the prompt message
defaultValue - the default value of the input
Since:
jcms-5.7.0

startSubSection

public void startSubSection(StringBuffer sb,
                            String label,
                            String icon)
Starts an sub-section

Parameters:
sb - the StringBuffer
label - the label of the section
icon - the icon
Since:
jcms-5.7.0

startSubSection

public void startSubSection(StringBuffer sb,
                            String label,
                            String icon,
                            String ul)
Starts an sub-section

Parameters:
sb - the StringBuffer
label - the label of the section
icon - the icon
ul - the class on the ul subsection or null
Since:
jcms-5.7.0

endSubSection

public void endSubSection(StringBuffer sb)
Ends an sub-section

Parameters:
sb - the StringBuffer
Since:
jcms-5.7.0

startInfoSection

public void startInfoSection(StringBuffer sb,
                             String label,
                             String icon)
Starts an info section

Parameters:
sb - the StringBuffer
label - the label of the section
icon - the icon
Since:
jcms-5.7.0

endInfoSection

public void endInfoSection(StringBuffer sb)
Ends an info section

Parameters:
sb - the StringBuffer
Since:
jcms-5.7.0

addInfo

public void addInfo(StringBuffer sb,
                    String label,
                    String value)
Adds an info in an info section

Parameters:
sb - the StringBuffer
label - the label of the info
value - the value
Since:
jcms-5.7.0

addInfoText

public void addInfoText(StringBuffer sb,
                        String text)
Adds an info in an info section

Parameters:
sb - the StringBuffer
text - the text to display
Since:
jcms-5.7.0

addInfoImage

public void addInfoImage(StringBuffer sb,
                         String path)
Adds an info in an info section

Parameters:
sb - the StringBuffer
path - the path of the image to display
Since:
jcms-6.0.0

openItem

public void openItem(StringBuffer sb,
                     boolean isEnabled)
Open a menu item which has got an icon.

Parameters:
sb - the StringBuffer
isEnabled - true if this item is enabled.
Since:
jcms-5.7.0

closeItem

public void closeItem(StringBuffer sb,
                      String icon,
                      String label)
Close a menu item which has got an icon.

Parameters:
sb - the StringBuffer
icon - the item icon
label - the label of the item
Since:
jcms-5.7.0


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