Package ch.autumo.beetroot.handler.users
Class ExtUsersAddHandler
- All Implemented Interfaces:
Handler,RouterNanoHTTPD.UriResponder
Users add handler for extended roles.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.autumo.beetroot.handler.BaseHandler
BaseHandler.IfSectionHandler -
Field Summary
Fields inherited from class ch.autumo.beetroot.handler.BaseHandler
action, columns, emptyBean, entity, htmlData, htmlHead, initialValues, insertServletNameInTemplateRefs, MSG_TYPE_ERR, MSG_TYPE_INFO, MSG_TYPE_WARN, PRECISION_INPUT_TYPES, servletName, TAG_PREFIX_LANG, transientFields, uniqueFields -
Constructor Summary
ConstructorsConstructorDescriptionExtUsersAddHandler(String entity) ExtUsersAddHandler(String entity, String errMsg) -
Method Summary
Modifier and TypeMethodDescriptionextractCustomSingleInputDiv(BeetRootHTTPSession session, String val, ResultSetMetaData rsmd, String columnName, String guiColName, int idx) 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'.Class<?>Overwrite to get the right re-route/redirect index handler after modifying data.voidrender(BeetRootHTTPSession session) Overwrite to set your template variables.saveData(BeetRootHTTPSession session) Save data to DB.Methods inherited from class ch.autumo.beetroot.handler.users.UsersAddHandler
getAddMandatoryFields, getBeanClass, getTitle, hasAccessMethods inherited from class ch.autumo.beetroot.handler.DefaultAddHandler
extractSingleInputDiv, extractSingleInputDiv, formatSingleValueForDB, getResource, getSelectValues, isSelect, readDataMethods inherited from class ch.autumo.beetroot.handler.BaseHandler
addCheckBox, addErrorMessage, addHtmlDataLine, addHtmlHeadLine, addSuccessMessage, addWarningMessage, columns, columnsSize, deleteData, get, getColumn, getColumnsForSql, getColumnsForSql, getCurrentEntityDbId, getCurrentSession, getCustomizedExceptionInformation, getData, getEmptyBean, getEntity, getHandlerClass, getHtmlData, getHtmlHead, getInsertValues, getLayout, getMessageType, getMimeType, getNewScanner, getNewScanner, getPaginator, getSimpleManagementUserRoles, getStatus, getTableExport, getTemplateEngineErrorMessage, getTemplateEngineErrorTitle, getText, getText, getTransientFields, getUpdateSetClause, getUpdateSetClause, hasExternalLinks, hasNoColumnsConfig, initialize, initialValue, initValuesSize, isCurrentUserUpdate, isCustomResponse, isNoContentResponse, isNoContentResponseButRoute, isPrecisionInputType, isRetryCall, loginMarker, parseAssociatedEntities, parseUnassociatedEntities, patchInputValue, readSnippetResource, redirectedMarker, refreshUserRoles, registerDisplayField, registerRoutes, renderAll, setCurrentEntityDbId, setMessageType, setVar, setVarAll, showLangMenu, showMenu, uniqueFields, uniqueTest, updateDataMethods inherited from class org.nanohttpd.router.RouterNanoHTTPD.DefaultStreamHandler
delete, other, post, put
-
Constructor Details
-
ExtUsersAddHandler
-
ExtUsersAddHandler
-
-
Method Details
-
saveData
Description copied from class:BaseHandlerSave data to DB. Override for add handlers.- Overrides:
saveDatain classUsersAddHandler- 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:DefaultAddHandlerOverwrite 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:
extractCustomSingleInputDivin classDefaultAddHandler- Parameters:
session- HTTP sessionval- repost data (only available in retry case)rsmd- result set meta datacolumnName- 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
Description copied from class:BaseHandlerOverwrite 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:
renderin classBaseHandler- Parameters:
session- HTTP session
-
getRedirectHandler
Description copied from class:BaseHandlerOverwrite 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:
getRedirectHandlerin classUsersAddHandler- Returns:
- redirect index handler
-