Class HtmlMenuWrapper
java.lang.Object
org.apache.ofbiz.widget.renderer.html.HtmlMenuWrapper
- Direct Known Subclasses:
HtmlMenuWrapperImage
Widget Library - HTML Menu Wrapper class - makes it easy to do the setup and render of a menu
-
Constructor Summary
ModifierConstructorDescriptionprotected
HtmlMenuWrapper
(String resourceName, String menuName, HttpServletRequest request, HttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptiongetFromContext
(String name) Gets from context.getFromContext
(String menuItemName, String valueName) Gets from context.boolean
Gets is error.Gets menu renderer.static HtmlMenuWrapper
getMenuWrapper
(HttpServletRequest request, HttpServletResponse response, HttpSession session, String menuDefFile, String menuName, String menuWrapperClassName) Gets model menu.Gets renderer.Gets request.Gets response.void
init
(String resourceName, String menuName, HttpServletRequest request, HttpServletResponse response) Init.void
putInContext
(String name, Object value) Put in context.void
putInContext
(String menuItemName, String valueName, Object value) Put in context.Render menu string string.void
setIsError
(boolean isError) Tells the menu library whether this is a response to an error or not.void
setMenuOverrideName
(String menuName) Sets menu override name.void
setParameters
(Map<String, Object> paramMap) Sets parameters.void
setRenderer
(MenuStringRenderer renderer) Sets renderer.void
setRequest
(HttpServletRequest request) Sets request.void
setResponse
(HttpServletResponse response) Sets response.
-
Constructor Details
-
HtmlMenuWrapper
protected HtmlMenuWrapper() -
HtmlMenuWrapper
public HtmlMenuWrapper(String resourceName, String menuName, HttpServletRequest request, HttpServletResponse response) throws IOException, SAXException, ParserConfigurationException
-
-
Method Details
-
init
public void init(String resourceName, String menuName, HttpServletRequest request, HttpServletResponse response) throws IOException, SAXException, ParserConfigurationException Init.- Parameters:
resourceName
- the resource namemenuName
- the menu namerequest
- the requestresponse
- the response- Throws:
IOException
- the io exceptionSAXException
- the sax exceptionParserConfigurationException
- the parser configuration exception
-
getMenuRenderer
Gets menu renderer.- Returns:
- the menu renderer
-
renderMenuString
Render menu string string.- Returns:
- the string
- Throws:
IOException
- the io exception
-
setIsError
public void setIsError(boolean isError) Tells the menu library whether this is a response to an error or not. Defaults on initialization according to the presense of an errorMessage in the request or if an isError parameter was passed to the page with the value "true". If true then the prefilled values will come from the parameters Map instead of the value Map. -
getIsError
public boolean getIsError()Gets is error.- Returns:
- the is error
-
setMenuOverrideName
Sets menu override name.- Parameters:
menuName
- the menu name
-
putInContext
Put in context.- Parameters:
name
- the namevalue
- the value
-
putInContext
Put in context.- Parameters:
menuItemName
- the menu item namevalueName
- the value namevalue
- the value
-
getFromContext
Gets from context.- Parameters:
name
- the name- Returns:
- the from context
-
getFromContext
Gets from context.- Parameters:
menuItemName
- the menu item namevalueName
- the value name- Returns:
- the from context
-
getModelMenu
Gets model menu.- Returns:
- the model menu
-
getRenderer
Gets renderer.- Returns:
- the renderer
-
setRenderer
Sets renderer.- Parameters:
renderer
- the renderer
-
setRequest
Sets request.- Parameters:
request
- the request
-
setResponse
Sets response.- Parameters:
response
- the response
-
getRequest
Gets request.- Returns:
- the request
-
getResponse
Gets response.- Returns:
- the response
-
getMenuWrapper
public static HtmlMenuWrapper getMenuWrapper(HttpServletRequest request, HttpServletResponse response, HttpSession session, String menuDefFile, String menuName, String menuWrapperClassName) -
setParameters
Sets parameters.- Parameters:
paramMap
- the param map
-