Package org.bgerp.action.base

# Class BaseAction

java.lang.Object
org.apache.struts.action.Action
org.apache.struts.actions.BaseAction
org.apache.struts.actions.DispatchAction
org.bgerp.action.base.BaseAction

Direct Known Subclasses:
  `ActionLogAction`, `AppAction`, `BackupAction`, `BaseAction`, `BaseAction`, `BaseAction`, `BoardAction`, `BoardAction`, `BoardAction`, `CalendarAction`, `CleanupAction`, `ConfigAction`, `CredentialAction`, `CustomAction`, `CustomAction`, `CustomerAction`, `CustomerAction`, `DatabaseAction`, `DemoAction`, `DirectoryAction`, `DirectoryAddressAction`, `DispatchAction`, `DispatchAction`, `DocumentAction`, `DynamicAction`, `EMailAction`, `EmptyAction`, `FileAction`, `HelpDeskAction`, `InvoiceAction`, `LicenseAction`, `LinkAction`, `LockAction`, `LogAction`, `LoginAction`, `MessageAction`, `MessageAction`, `MessageCallAction`, `NewsAction`, `ParameterAction`, `PartyAction`, `PoolAction`, `ProcessAction`, `ProcessAction`, `ProcessAction`, `ProcessAction`, `ProcessAction`, `ProcessQueueAction`, `ProfileAction`, `ProfileAction`, `QueryAction`, `QueryHistoryAction`, `ReportAction`, `ReportActionBase`, `RunAction`, `SearchAction`, `SearchAction`, `SubscriptionAction`, `TaskAction`, `UserAction`, `UserAction`, `UserAction`, `WorkAction`

public abstract class BaseAction extends org.apache.struts.actions.DispatchAction

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Localizer`
  `l`
  `protected final Log`
  `log`
  `static final com.fasterxml.jackson.databind.ObjectMapper`
  `MAPPER`
  `protected static final String`
  `PATH_JSP`
  `static final String`
  `PATH_JSP_ADMIN`
  `static final String`
  `PATH_JSP_OPEN`
  `static final String`
  `PATH_JSP_USER`
  `static final String`
  `PATH_JSP_USERMOB`
  `protected final Setup`
  `setup`

  ### Fields inherited from class org.apache.struts.actions.DispatchAction

  `clazz, methods, types`

  ### Fields inherited from class org.apache.struts.actions.BaseAction

  `messages`

  ### Fields inherited from class org.apache.struts.action.Action

  `servlet`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `BaseAction()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `checkModified(LastModify lastModify, DynActionForm form)`
  Checks concurrent modifications by different users.
  `protected org.apache.struts.action.ActionForward`
  `dispatchMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm actionForm, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String name)`
  `protected String`
  `getParameter(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
  `protected org.apache.struts.action.ActionForward`
  `html(Connection con, DynActionForm form, String path)`
  JSP forward.
  `protected org.apache.struts.action.ActionForward`
  `html(ConnectionSet conSet, DynActionForm form, String path)`
  JSP forward.
  `protected org.apache.struts.action.ActionForward`
  `json(Connection con, DynActionForm form)`
  Sends response result in JSON format.
  `protected org.apache.struts.action.ActionForward`
  `json(ConnectionSet conSet, DynActionForm form)`
  Sends response result in JSON format.
  `protected PermissionNode`
  `permissionCheck(DynActionForm form, String action)`
  Checks action permission.
  `protected void`
  `restoreRequestParams(Connection con, DynActionForm form, boolean get, boolean set, String... params)`
  Saves and restores HTTP request parameters.
  `org.apache.struts.action.ActionForward`
  `unspecified(DynActionForm form, Connection con)`
  Default action method if no parameter 'action' passed.
  `org.apache.struts.action.ActionForward`
  `unspecified(DynActionForm form, ConnectionSet conSet)`
  Default action method if no parameter 'action' passed.
  `protected void`
  `updatePersonalization(DynActionForm form, Connection con, Consumer<Preferences> setFunction)`
  Stores new values in personalization map and update it if changed.

  ### Methods inherited from class org.apache.struts.actions.DispatchAction

  `cancelled, execute, getMethod, getMethodName, unspecified`

  ### Methods inherited from class org.apache.struts.action.Action

  `addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MAPPER

    public static final com.fasterxml.jackson.databind.ObjectMapper MAPPER

  - ### PATH_JSP

    protected static final String PATH_JSP
    See Also:
      - Constant Field Values

  - ### PATH_JSP_ADMIN

    public static final String PATH_JSP_ADMIN
    See Also:
      - Constant Field Values

  - ### PATH_JSP_USER

    public static final String PATH_JSP_USER
    See Also:
      - Constant Field Values

  - ### PATH_JSP_USERMOB

    public static final String PATH_JSP_USERMOB
    See Also:
      - Constant Field Values

  - ### PATH_JSP_OPEN

    public static final String PATH_JSP_OPEN
    See Also:
      - Constant Field Values

  - ### log

    protected final Log log

  - ### setup

    protected final Setup setup

  - ### l

    protected Localizer l

- ## Constructor Details

  - ### BaseAction

    protected BaseAction()

- ## Method Details

  - ### unspecified

    public org.apache.struts.action.ActionForward unspecified(DynActionForm form, ConnectionSet conSet) throws Exception
    Default action method if no parameter 'action' passed. Overwrite and implement.
    Parameters:
      `form` -
      `conSet` -
    Returns:
    Throws:
      `Exception`

  - ### unspecified

    public org.apache.struts.action.ActionForward unspecified(DynActionForm form, Connection con) throws Exception
    Default action method if no parameter 'action' passed. Overwrite and implement.
    Parameters:
      `form` -
      `con` -
    Returns:
    Throws:
      `Exception`

  - ### getParameter

    protected String getParameter(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
    Overrides:
      `getParameter` in class `org.apache.struts.actions.DispatchAction`
    Throws:
      `Exception`

  - ### dispatchMethod

    protected org.apache.struts.action.ActionForward dispatchMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm actionForm, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String name) throws Exception
    Overrides:
      `dispatchMethod` in class `org.apache.struts.actions.DispatchAction`
    Throws:
      `Exception`

  - ### permissionCheck

    protected PermissionNode permissionCheck(DynActionForm form, String action) throws javassist.NotFoundException, BGMessageException
    Checks action permission.
    Parameters:
      `form` - form with user.
      `action` - semicolon separated action class and method.
    Returns:
      permission node.
    Throws:
      `javassist.NotFoundException` - permission node for `action` not found.
      `BGMessageException` - permission is denied.

  - ### html

    protected org.apache.struts.action.ActionForward html(Connection con, DynActionForm form, String path)
    JSP forward.
    Parameters:
      `con` - SQL connection.
      `form` - form object.
      `path` - JSP path.
    Returns:

  - ### html

    protected org.apache.struts.action.ActionForward html(ConnectionSet conSet, DynActionForm form, String path)
    JSP forward.
    Parameters:
      `conSet` - set of SQL connections.
      `form` - form object.
      `path` - JSP path.
    Returns:

  - ### json

    protected org.apache.struts.action.ActionForward json(Connection con, DynActionForm form)
    Sends response result in JSON format.
    Parameters:
      `con` -
      `form` -
    Returns:

  - ### json

    protected org.apache.struts.action.ActionForward json(ConnectionSet conSet, DynActionForm form)
    Sends response result in JSON format.
    Parameters:
      `conSet` -
      `form` -
    Returns:

  - ### checkModified

    protected void checkModified(LastModify lastModify, DynActionForm form) throws BGMessageException
    Checks concurrent modifications by different users.
    Parameters:
      `lastModify` - initial state of modified item.
      `form` - request with parameters `lastModifyUserId` and `lastModifyTime` for comparing to `lastModify`.
    Throws:
      `BGMessageException` - entity was stored by another user in between.

  - ### restoreRequestParams

    protected void restoreRequestParams(Connection con, DynActionForm form, boolean get, boolean set, String... params) throws SQLException
    Saves and restores HTTP request parameters. As storage used `User.getPers()`, key is 'param.' + `DynActionForm.getAreaId()`.
    Parameters:
      `con` - DB connection.
      `form` - there params are taken and restored, also contains 'areaId' param.
      `get` - restore values.
      `set` - save values.
      `params` - parameter names.
    Throws:
      `SQLException`

  - ### updatePersonalization

    protected void updatePersonalization(DynActionForm form, Connection con, Consumer<Preferences> setFunction) throws Exception
    Stores new values in personalization map and update it if changed.
    Parameters:
      `form` - the form for obtaining the user.
      `con` - DB connection.
      `setFunction` - function for setting map parameters.
    Throws:
      `Exception`