Package ch.autumo.beetroot.handler
Class ExampleUploadHandler
java.lang.Object
org.nanohttpd.router.RouterNanoHTTPD.DefaultStreamHandler
org.nanohttpd.router.RouterNanoHTTPD.DefaultHandler
ch.autumo.beetroot.handler.BaseHandler
ch.autumo.beetroot.handler.ExampleUploadHandler
- All Implemented Interfaces:
Handler,RouterNanoHTTPD.UriResponder
Default file upload handler for 'web/html/files/add.html' templates.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.autumo.beetroot.handler.BaseHandler
BaseHandler.IfSectionHandler -
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionExampleUploadHandler(String entity) ExampleUploadHandler(String entity, String errMsg) -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Overwrite to get the right re-route/redirect index handler after modifying data.Get web resource file as it lies on the file system relatively to the started server process.voidrender(BeetRootHTTPSession session) Overwrite to set your template variables.saveData(BeetRootHTTPSession session) Save data to DB.Methods inherited from class ch.autumo.beetroot.handler.BaseHandler
addCheckBox, addErrorMessage, addHtmlDataLine, addHtmlHeadLine, addSuccessMessage, addWarningMessage, columns, columnsSize, deleteData, formatSingleValueForDB, get, getBeanClass, 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, getTitle, getTransientFields, getUpdateSetClause, getUpdateSetClause, hasAccess, hasExternalLinks, hasNoColumnsConfig, initialize, initialValue, initValuesSize, isCurrentUserUpdate, isCustomResponse, isNoContentResponse, isNoContentResponseButRoute, isPrecisionInputType, isRetryCall, loginMarker, parseAssociatedEntities, parseUnassociatedEntities, patchInputValue, readData, 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
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
ExampleUploadHandler
-
ExampleUploadHandler
-
-
Method Details
-
saveData
Description copied from class:BaseHandlerSave data to DB. Override for add handlers.- Overrides:
saveDatain classBaseHandler- 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
-
getResource
Description copied from class:BaseHandlerGet web resource file as it lies on the file system relatively to the started server process.- Specified by:
getResourcein interfaceHandler- Specified by:
getResourcein classBaseHandler- Returns:
- web resource
-
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 classBaseHandler- Returns:
- redirect index handler
-
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
-