Class WebUtils

java.lang.Object
com.groiss.gui.WebUtils

public class WebUtils extends Object
Miscellanea data retrieval methods used in a Web tier.
  • Constructor Details

    • WebUtils

      public WebUtils()
  • Method Details

    • jsonObjectSelect

      public static Page jsonObjectSelect(HttpServletRequest req) throws Exception
      Performs the search using the criteria, specified as request parameters, and returns the JSON-encoded page with the content of found entries.
      Parameters:
      req - current request
      Throws:
      Exception - in case of an error
    • jsonHolidays

      public Page jsonHolidays(HttpServletRequest req) throws Exception
      Returns holidays for the date picker in JSON format.
      Parameters:
      req - current request
      Throws:
      Exception
    • agentSelect

      public static JSONPage agentSelect(HttpServletRequest req) throws Exception
      can be used by ObjectSelect-widgets to query for agents (either roles or users)
      possible parameters are: role,application,orgunit,noEmptyEntry,includeRoleToo
      currently it's only possible to search for users and optionally include the given role too
      Parameters:
      req - the request
      Throws:
      Exception
    • genJSONPage

      public static JSONPage genJSONPage(Collection<? extends KeyValuePair<String,String>> p)
      Parameters:
      p - a list of elements. The key of the com.groiss.ds.Pair is the value of the option. The value of the Pair is the label of the option
      Returns:
      a JSONPage filling the Dojo Select
      Throws:
      JSONException
    • genJSONPage

      public static JSONPage genJSONPage(Collection<? extends KeyValuePair<String,String>> p, String id, String label, Boolean showNull)
    • getJSONObjectSelect

      public static JSONPage getJSONObjectSelect(Map<String,String> params) throws Exception
      Parameters:
      params - a map containing all configuration parameters for the dojo select
      Returns:
      a JSONPage filling the dojo options
      Throws:
      Exception