Class ExtUsersAddHandler

All Implemented Interfaces:
Handler, RouterNanoHTTPD.UriResponder

public class ExtUsersAddHandler extends UsersAddHandler
Users add handler for extended roles.
  • Constructor Details

    • ExtUsersAddHandler

      public ExtUsersAddHandler(String entity)
    • ExtUsersAddHandler

      public ExtUsersAddHandler(String entity, String errMsg)
  • Method Details

    • saveData

      public HandlerResponse saveData(BeetRootHTTPSession session) throws Exception
      Description copied from class: BaseHandler
      Save data to DB. Override for add handlers.
      Overrides:
      saveData in class UsersAddHandler
      Parameters:
      session - HTTP session
      Returns:
      response or null, null means success, response's status must be checked and must hold the id of the saved record!
      Throws:
      Exception - exception
    • extractCustomSingleInputDiv

      public String extractCustomSingleInputDiv(BeetRootHTTPSession session, String val, ResultSetMetaData rsmd, String columnName, String guiColName, int idx) throws Exception
      Description copied from class: DefaultAddHandler
      Overwrite this method, if you need to add a custom field (HTML 'div'); e.g. when multiple user roles are used; in this case the 'div' is more likely consisting of 2 role assignment boxes instead of a simple input-'div' or use it for any custom 'div'. The 'div' is guaranteed to be inserted in the column-order as defined in the 'columns.cfg'.

      The return value of this method is essential:
      • Returns the data (including an empty character string): The HTML data is inserted into the template and further parsing of the columns for the HTML input elements is completed.
      • If 'null' is returned, the search for matching input elements for the current columns is continued, even if it is a transient column! Transient columns should be parsed in this method!
      Overrides:
      extractCustomSingleInputDiv in class DefaultAddHandler
      Parameters:
      session - HTTP session
      val - repost data (only available in retry case)
      rsmd - result set meta data
      columnName - column name as configured in 'web/<entity>/columns.cfg'
      guiColName - GUI column name as configured in 'web/<entity>/columns.cfg'
      idx - SQL result set column index
      Returns:
      html data extract <div>...</div>
      Throws:
      Exception - exception
    • render

      public void render(BeetRootHTTPSession session)
      Description copied from class: BaseHandler
      Overwrite to set your template variables. Only use the pure names without bracket-limiters and $-sign; e.g., In template '{$name}' -> 'name' as variable. Example: setVar("name", "Gandalf").
      Overrides:
      render in class BaseHandler
      Parameters:
      session - HTTP session
    • getRedirectHandler

      public Class<?> getRedirectHandler()
      Description copied from class: BaseHandler
      Overwrite to get the right re-route/redirect index handler after modifying data. It must be of the same entity as the last executing handler!
      Overrides:
      getRedirectHandler in class UsersAddHandler
      Returns:
      redirect index handler