Class HtmlMenuWrapper

java.lang.Object
org.apache.ofbiz.widget.renderer.html.HtmlMenuWrapper
Direct Known Subclasses:
HtmlMenuWrapperImage

public class HtmlMenuWrapper extends Object
Widget Library - HTML Menu Wrapper class - makes it easy to do the setup and render of a menu
  • Constructor Details

  • Method Details

    • init

      public void init(String resourceName, String menuName, HttpServletRequest request, HttpServletResponse response) throws IOException, SAXException, ParserConfigurationException
      Init.
      Parameters:
      resourceName - the resource name
      menuName - the menu name
      request - the request
      response - the response
      Throws:
      IOException - the io exception
      SAXException - the sax exception
      ParserConfigurationException - the parser configuration exception
    • getMenuRenderer

      public MenuStringRenderer getMenuRenderer()
      Gets menu renderer.
      Returns:
      the menu renderer
    • renderMenuString

      public String renderMenuString() throws IOException
      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

      public void setMenuOverrideName(String menuName)
      Sets menu override name.
      Parameters:
      menuName - the menu name
    • putInContext

      public void putInContext(String name, Object value)
      Put in context.
      Parameters:
      name - the name
      value - the value
    • putInContext

      public void putInContext(String menuItemName, String valueName, Object value)
      Put in context.
      Parameters:
      menuItemName - the menu item name
      valueName - the value name
      value - the value
    • getFromContext

      public Object getFromContext(String name)
      Gets from context.
      Parameters:
      name - the name
      Returns:
      the from context
    • getFromContext

      public Object getFromContext(String menuItemName, String valueName)
      Gets from context.
      Parameters:
      menuItemName - the menu item name
      valueName - the value name
      Returns:
      the from context
    • getModelMenu

      public ModelMenu getModelMenu()
      Gets model menu.
      Returns:
      the model menu
    • getRenderer

      public MenuStringRenderer getRenderer()
      Gets renderer.
      Returns:
      the renderer
    • setRenderer

      public void setRenderer(MenuStringRenderer renderer)
      Sets renderer.
      Parameters:
      renderer - the renderer
    • setRequest

      public void setRequest(HttpServletRequest request)
      Sets request.
      Parameters:
      request - the request
    • setResponse

      public void setResponse(HttpServletResponse response)
      Sets response.
      Parameters:
      response - the response
    • getRequest

      public HttpServletRequest getRequest()
      Gets request.
      Returns:
      the request
    • getResponse

      public HttpServletResponse getResponse()
      Gets response.
      Returns:
      the response
    • getMenuWrapper

      public static HtmlMenuWrapper getMenuWrapper(HttpServletRequest request, HttpServletResponse response, HttpSession session, String menuDefFile, String menuName, String menuWrapperClassName)
    • setParameters

      public void setParameters(Map<String,Object> paramMap)
      Sets parameters.
      Parameters:
      paramMap - the param map