public abstract class TableBeanAction extends NewTxAction implements com.technia.tvc.structurebrowser.util.Constants
CLIENT_TASK_ERROR, CLIENT_TASK_ERROR_KEY, CLIENT_TASK_NOTICE_KEY, CLIENT_TASK_WARNING_KEY, GLOBAL_ERROR_KEY, INFORMATION_ERRORCHOOSABLE_FILTERS_REQUEST_KEY, CHOOSABLE_SYSTEM_TABLES_REQUEST_KEY, CHOOSABLE_VIEWS_REQUEST_KEY, CURRENT_FILTERS_REQUEST_KEY, CURRENT_SYSTEM_TABLE_REQUEST_KEY, CURRENT_VIEW_REQUEST_KEY, DISPLAY_MODE_CURRENT_VIEW_REQUEST_KEY, DISPLAYABLE_CHOOSABLE_FILTERS_REQUEST_KEY, DISPLAYABLE_CHOOSABLE_SYSTEM_TABLES_REQUEST_KEY, DISPLAYABLE_CHOOSABLE_VIEWS_REQUEST_KEY, DISPLAYABLE_CURRENT_FILTERS_REQUEST_KEY, DISPLAYABLE_CURRENT_SYSTEM_TABLE_REQUEST_KEY, DISPLAYABLE_CURRENT_VIEW_REQUEST_KEY, KEY_GENERATOR_SESSION_KEY, TABLE_BEAN_REQUEST_KEY, TABLE_NAME_REQUEST_KEY| Constructor and Description |
|---|
TableBeanAction(TxType type)
Public constructor that defines the transaction type that should be used
when performing actions related to a TableBean instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterPerform(TableBean<?> table,
javax.servlet.http.HttpServletRequest request)
Optional method the can be implemented to perform certain logic AFTER the
perform(TableBean, ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
method is invoked. |
protected void |
beforePerform(TableBean<?> table,
javax.servlet.http.HttpServletRequest request)
Optional method the can be implemented to perform certain logic BEFORE
the
perform(TableBean, ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
method is invoked. |
protected void |
copyEnv(javax.servlet.http.HttpServletRequest request,
TableBean<?> oldTable,
TableBean<?> newTable)
Copy the environment from the original table but do not overwrite the
existing variables.
|
Environment |
createEnvironment(javax.servlet.http.HttpServletRequest request) |
abstract TableBean<?> |
createTable(javax.servlet.http.HttpServletRequest request)
This method should be implemented in subclasses to create a new instance
of a class implementing the TableBean interface.
|
void |
discardEnv(TableBean<?> table)
Discard the table's environment.
|
void |
discardTable(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
Remove the table from the current HTTP session.
|
protected void |
ensureContextMenu(javax.servlet.http.HttpServletRequest req,
TableBean<?> table)
Ensures that the context menu is loaded.
|
protected void |
ensureMenuBar(javax.servlet.http.HttpServletRequest req,
TableBean<?> table) |
com.technia.tvc.struts.action.ActionForward |
execute(TxContext txc,
com.technia.tvc.struts.action.ActionMapping mapping,
com.technia.tvc.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method will lookup the TableBean instance in the users
current session and delegate to
perform(TableBean,ActionMapping,ActionForm,HttpServletRequest, HttpServletResponse)
to perform actual business logic on the table. |
protected void |
finishRequest(TableBean<?> table,
javax.servlet.http.HttpServletRequest request) |
static java.lang.String |
generateKey(javax.servlet.http.HttpServletRequest request)
Generate a new table key.
|
protected java.lang.String[] |
getChoosableViewNamesParameter(javax.servlet.http.HttpServletRequest request)
Returns the names of the choosable views that should be available to the
TableBean.
|
Environment |
getEnv(javax.servlet.http.HttpServletRequest request,
TableBean<?> table)
Returns the current environment, if the table doesn't have an environment
a new will be created but not associated with the table.
|
protected java.lang.String |
getGeneratedKey(javax.servlet.http.HttpServletRequest request) |
protected java.lang.Object |
getMonitor(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse resp) |
protected java.lang.String |
getObjectNameFromRequest(javax.servlet.http.HttpServletRequest request)
Returns the name of the
TableBean. |
protected TableBean<?> |
getOriginalTable(javax.servlet.http.HttpServletRequest request,
TableBean<?> table) |
protected PageConfig |
getPageConfig(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Returns the
PageConfig that should be used. |
protected java.lang.String |
getParameter(Environment env,
javax.servlet.http.HttpServletRequest req,
java.lang.String name)
Returns the value of the parameter.
|
TableBean<?> |
getTable(javax.servlet.http.HttpServletRequest request)
Lookup the TableBean in the users current session.
|
TableBean<?> |
getTable(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
Retrieve table, from the given parameter
|
protected java.lang.String |
getViewNameParameter(javax.servlet.http.HttpServletRequest request)
Returns the name of the view that should be used by the
TableBean.
|
static void |
handleErrors(javax.servlet.http.HttpServletRequest request,
com.technia.tvc.struts.action.ActionMessages errors,
boolean showClientTasksAboveTable) |
protected MenuBar |
insertCategoryMenu(MenuBar menuBar,
javax.servlet.http.HttpServletRequest req,
TableBean<?> table,
Environment env) |
protected Menu |
loadContextMenu(java.lang.String contextMenuName,
Environment env)
Load a context menu.
|
protected MenuBar |
loadMenuBar(java.lang.String toolbarName,
Environment env)
Load a MenuBar.
|
abstract com.technia.tvc.struts.action.ActionForward |
perform(TableBean<?> table,
com.technia.tvc.struts.action.ActionMapping mapping,
com.technia.tvc.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method should be overridden to perform business logic on the
TableBean instance.
|
protected javax.servlet.http.HttpServletRequest |
replaceRequest(javax.servlet.http.HttpServletRequest request)
This method allows subclasses to replace the
HttpServletRequest
instance that will be used when processing the request. |
void |
saveEnv(javax.servlet.http.HttpServletRequest request,
TableBean<?> table)
Set the table's environment from the current request.
|
void |
saveTable(javax.servlet.http.HttpServletRequest request,
TableBean<?> table,
java.lang.String key)
Save the table in the current HTTP session using the specified key.
|
protected boolean |
setSystemTableAndFilters(javax.servlet.http.HttpServletRequest request) |
protected boolean |
setView(javax.servlet.http.HttpServletRequest request) |
protected void |
storePageConfig(javax.servlet.http.HttpServletRequest request,
TableBean<?> table,
PageConfig pageConfig)
Stores the page config on the tablebean and initiates the
SelectionsManager.
|
static void |
storeRequestAttributes(javax.servlet.http.HttpServletRequest request,
TableBean<?> tableBean) |
protected void |
update(com.technia.tvc.core.gui.common.Reloadable item) |
TableBean<?> |
updateTable(javax.servlet.http.HttpServletRequest request,
TableBean<?> table)
Updates the table for the current request.
|
executeImpl, getOriginContext, handleClientTasks, handleException, handleLogin, handleTransactionEndFailure, ignoreClientTasksaddError, addError, addErrors, addGlobalError, addGlobalError, addInformationError, asActionError, asActionErrors, copy, debugRequest, execute, findErrorForward, findForwardOrTargetPage, perform, perform, saveError, saveError, saveGlobalError, saveGlobalError, saveInformationError, setLocaleaddErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setServletpublic TableBeanAction(TxType type)
public static java.lang.String generateKey(javax.servlet.http.HttpServletRequest request)
public static void handleErrors(javax.servlet.http.HttpServletRequest request,
com.technia.tvc.struts.action.ActionMessages errors,
boolean showClientTasksAboveTable)
public static void storeRequestAttributes(javax.servlet.http.HttpServletRequest request,
TableBean<?> tableBean)
throws TVCException
TVCExceptionprotected void afterPerform(TableBean<?> table, javax.servlet.http.HttpServletRequest request)
perform(TableBean, ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
method is invoked.protected void beforePerform(TableBean<?> table, javax.servlet.http.HttpServletRequest request)
perform(TableBean, ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
method is invoked.protected void copyEnv(javax.servlet.http.HttpServletRequest request,
TableBean<?> oldTable,
TableBean<?> newTable)
request - The current requestoldTable - The old table to copy the env variables fromnewTable - The new table to copy the env veriables topublic Environment createEnvironment(javax.servlet.http.HttpServletRequest request)
request - The request object.public abstract TableBean<?> createTable(javax.servlet.http.HttpServletRequest request) throws TVCException
TVCExceptionpublic void discardEnv(TableBean<?> table)
public void discardTable(javax.servlet.http.HttpServletRequest request,
java.lang.String key)
protected void ensureContextMenu(javax.servlet.http.HttpServletRequest req,
TableBean<?> table)
req - The current requesttable - The current tableprotected void ensureMenuBar(javax.servlet.http.HttpServletRequest req,
TableBean<?> table)
protected MenuBar insertCategoryMenu(MenuBar menuBar, javax.servlet.http.HttpServletRequest req, TableBean<?> table, Environment env)
public com.technia.tvc.struts.action.ActionForward execute(TxContext txc, com.technia.tvc.struts.action.ActionMapping mapping, com.technia.tvc.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
perform(TableBean,ActionMapping,ActionForm,HttpServletRequest, HttpServletResponse)
to perform actual business logic on the table.execute in class NewTxActiontxc - The transaction context.mapping - The action mappings.form - The action form.request - The HTTP request.response - The HTTP response.java.lang.Exception - If an error occurs.protected void finishRequest(TableBean<?> table, javax.servlet.http.HttpServletRequest request) throws TVCException
table - The current table.request - The current request.TVCException - If unable to finish the request processing, such as
validating the table.protected java.lang.String[] getChoosableViewNamesParameter(javax.servlet.http.HttpServletRequest request)
public Environment getEnv(javax.servlet.http.HttpServletRequest request, TableBean<?> table)
protected java.lang.String getGeneratedKey(javax.servlet.http.HttpServletRequest request)
protected java.lang.Object getMonitor(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse resp)
throws TVCException
getMonitor in class NewTxActionrequest - The current request.resp - The current response.TVCException - Throw this if unable to continue.protected java.lang.String getObjectNameFromRequest(javax.servlet.http.HttpServletRequest request)
TableBean.protected TableBean<?> getOriginalTable(javax.servlet.http.HttpServletRequest request, TableBean<?> table)
protected PageConfig getPageConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws TVCException
PageConfig that should be used.request - The request.response - The response.PageConfig that was loaded.TVCException - If loading the PageConfig failed.protected java.lang.String getParameter(Environment env, javax.servlet.http.HttpServletRequest req, java.lang.String name)
env - The environment.req - The request.name - The name of the parameter.public TableBean<?> getTable(javax.servlet.http.HttpServletRequest request, java.lang.String key) throws TVCException
TVCExceptionpublic TableBean<?> getTable(javax.servlet.http.HttpServletRequest request) throws TVCException
createTable(HttpServletRequest) to create a new instance of the
desired TableBean class.TVCExceptionprotected java.lang.String getViewNameParameter(javax.servlet.http.HttpServletRequest request)
protected Menu loadContextMenu(java.lang.String contextMenuName, Environment env)
contextMenuName - The name of the context menu.env - The environment.protected MenuBar loadMenuBar(java.lang.String toolbarName, Environment env)
toolbarName - The name of the toolbar menu.env - The environment.public abstract com.technia.tvc.struts.action.ActionForward perform(TableBean<?> table, com.technia.tvc.struts.action.ActionMapping mapping, com.technia.tvc.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
java.lang.Exceptionprotected javax.servlet.http.HttpServletRequest replaceRequest(javax.servlet.http.HttpServletRequest request)
HttpServletRequest
instance that will be used when processing the request. Note that this
method will be called after the loading of the PageConfig has
taken place, i.e., you can not rely upon providing essential information
to the getPageConfig(HttpServletRequest, HttpServletResponse)
method with the replaced request instance.request - The current request.public void saveEnv(javax.servlet.http.HttpServletRequest request,
TableBean<?> table)
public void saveTable(javax.servlet.http.HttpServletRequest request,
TableBean<?> table,
java.lang.String key)
protected boolean setSystemTableAndFilters(javax.servlet.http.HttpServletRequest request)
request - The current request.protected boolean setView(javax.servlet.http.HttpServletRequest request)
request - The current request.protected void storePageConfig(javax.servlet.http.HttpServletRequest request,
TableBean<?> table,
PageConfig pageConfig)
request - The current requesttable - The current tablebeanpageConfig - The page config (can be null if a page config isn't
used).protected void update(com.technia.tvc.core.gui.common.Reloadable item)
throws TVCException
item - The component to update if necessary.TVCException - If unable to update the component.public TableBean<?> updateTable(javax.servlet.http.HttpServletRequest request, TableBean<?> table) throws TVCException
This implementation will make sure the current table's view, system table and filters are valid.
TVCExceptionCopyright ? Technia AB. All Rights Reserved.