Class UsersAddHandler

All Implemented Interfaces:
Handler, RouterNanoHTTPD.UriResponder
Direct Known Subclasses:
ExtUsersAddHandler

public class UsersAddHandler extends DefaultAddHandler
Users add handler.
  • Constructor Details

    • UsersAddHandler

      public UsersAddHandler(String entity)
    • UsersAddHandler

      public UsersAddHandler(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 DefaultAddHandler
      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
    • 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 BaseHandler
      Returns:
      redirect index handler
    • getAddMandatoryFields

      public Map<String,Object> getAddMandatoryFields()
      Description copied from class: DefaultAddHandler
      Get additional mandatory fields of the table that are not present and mandatory fields in the GUI. They are usually the DB NOT NULL fields. Return the column/value pair within a map. The value must be an object that is representable as a string!
      Specified by:
      getAddMandatoryFields in class DefaultAddHandler
      Returns:
      column/value pair map
    • getBeanClass

      public Class<?> getBeanClass()
      Description copied from class: DefaultAddHandler
      Get bean entity class that has been generated trough PLANT, self-written or null (then null in extract calls too).
      Overrides:
      getBeanClass in class DefaultAddHandler
      Returns:
      bean entity class
    • hasAccess

      public boolean hasAccess(Session userSession)
      Description copied from class: BaseHandler
      Overwrite this method, to specifically extend handler authorization, e.g. with more app user roles.
      Overrides:
      hasAccess in class BaseHandler
      Parameters:
      userSession - user session
      Returns:
      true if access is allowed, otherwise false
    • getTitle

      public String getTitle(Session userSession)
      Description copied from class: BaseHandler
      Page title show left above the navigation area. If not overwritten, the entity name is shown starting with an upper-case letter!
      Overrides:
      getTitle in class BaseHandler
      Parameters:
      userSession - user session
      Returns:
      page title