Class HtmlMenuWrapper
- java.lang.Object
-
- org.apache.ofbiz.widget.renderer.html.HtmlMenuWrapper
-
- Direct Known Subclasses:
HtmlMenuWrapperImage
public class HtmlMenuWrapper extends java.lang.Object
Widget Library - HTML Menu Wrapper class - makes it easy to do the setup and render of a menu
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
context
protected java.lang.String
menuName
protected ModelMenu
modelMenu
static java.lang.String
module
protected MenuStringRenderer
renderer
protected javax.servlet.http.HttpServletRequest
request
protected java.lang.String
resourceName
protected javax.servlet.http.HttpServletResponse
response
-
Constructor Summary
Constructors Modifier Constructor Description protected
HtmlMenuWrapper()
HtmlMenuWrapper(java.lang.String resourceName, java.lang.String menuName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getFromContext(java.lang.String name)
java.lang.Object
getFromContext(java.lang.String menuItemName, java.lang.String valueName)
boolean
getIsError()
MenuStringRenderer
getMenuRenderer()
static HtmlMenuWrapper
getMenuWrapper(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, java.lang.String menuDefFile, java.lang.String menuName, java.lang.String menuWrapperClassName)
ModelMenu
getModelMenu()
MenuStringRenderer
getRenderer()
javax.servlet.http.HttpServletRequest
getRequest()
javax.servlet.http.HttpServletResponse
getResponse()
void
init(java.lang.String resourceName, java.lang.String menuName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
putInContext(java.lang.String name, java.lang.Object value)
void
putInContext(java.lang.String menuItemName, java.lang.String valueName, java.lang.Object value)
java.lang.String
renderMenuString()
void
setIsError(boolean isError)
Tells the menu library whether this is a response to an error or not.void
setMenuOverrideName(java.lang.String menuName)
void
setParameters(java.util.Map<java.lang.String,java.lang.Object> paramMap)
void
setRenderer(MenuStringRenderer renderer)
void
setRequest(javax.servlet.http.HttpServletRequest request)
void
setResponse(javax.servlet.http.HttpServletResponse response)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resourceName
protected java.lang.String resourceName
-
menuName
protected java.lang.String menuName
-
request
protected javax.servlet.http.HttpServletRequest request
-
response
protected javax.servlet.http.HttpServletResponse response
-
modelMenu
protected ModelMenu modelMenu
-
renderer
protected MenuStringRenderer renderer
-
context
protected java.util.Map<java.lang.String,java.lang.Object> context
-
-
Constructor Detail
-
HtmlMenuWrapper
protected HtmlMenuWrapper()
-
HtmlMenuWrapper
public HtmlMenuWrapper(java.lang.String resourceName, java.lang.String menuName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
-
-
Method Detail
-
init
public void init(java.lang.String resourceName, java.lang.String menuName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
- Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
-
getMenuRenderer
public MenuStringRenderer getMenuRenderer()
-
renderMenuString
public java.lang.String renderMenuString() throws java.io.IOException
- Throws:
java.io.IOException
-
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()
-
setMenuOverrideName
public void setMenuOverrideName(java.lang.String menuName)
-
putInContext
public void putInContext(java.lang.String name, java.lang.Object value)
-
putInContext
public void putInContext(java.lang.String menuItemName, java.lang.String valueName, java.lang.Object value)
-
getFromContext
public java.lang.Object getFromContext(java.lang.String name)
-
getFromContext
public java.lang.Object getFromContext(java.lang.String menuItemName, java.lang.String valueName)
-
getModelMenu
public ModelMenu getModelMenu()
-
getRenderer
public MenuStringRenderer getRenderer()
-
setRenderer
public void setRenderer(MenuStringRenderer renderer)
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request)
-
setResponse
public void setResponse(javax.servlet.http.HttpServletResponse response)
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
-
getMenuWrapper
public static HtmlMenuWrapper getMenuWrapper(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, java.lang.String menuDefFile, java.lang.String menuName, java.lang.String menuWrapperClassName)
-
setParameters
public void setParameters(java.util.Map<java.lang.String,java.lang.Object> paramMap)
-
-