Class BaseAction

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String FORWARD_DEFAULT  
      protected Localizer l  
      protected Log log  
      static com.fasterxml.jackson.databind.ObjectMapper mapper  
      protected static java.lang.String PATH_JSP  
      static java.lang.String PATH_JSP_ADMIN  
      static java.lang.String PATH_JSP_OPEN  
      static java.lang.String PATH_JSP_USER  
      protected 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

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void checkModified​(LastModify lastModify, DynActionForm form)  
      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, java.lang.String name)  
      protected boolean getAccess​(java.lang.String accessList, java.lang.String accessItemKey, int value)  
      protected org.apache.struts.action.ActionForward html​(java.sql.Connection con, org.apache.struts.action.ActionMapping mapping, DynActionForm form)
      Deprecated.
      protected org.apache.struts.action.ActionForward html​(java.sql.Connection con, org.apache.struts.action.ActionMapping mapping, DynActionForm form, java.lang.String name)
      Deprecated.
      protected org.apache.struts.action.ActionForward html​(java.sql.Connection con, DynActionForm form, java.lang.String path)
      JSP forward file path.
      protected org.apache.struts.action.ActionForward html​(java.sql.Connection con, DynActionForm form, java.util.Map<java.lang.String,​java.lang.String> mapping)
      JSP forward file path calculated using getForwardJspPath(DynActionForm, Map) function.
      protected org.apache.struts.action.ActionForward html​(ConnectionSet conSet, org.apache.struts.action.ActionMapping mapping, DynActionForm form)
      Deprecated.
      protected org.apache.struts.action.ActionForward html​(ConnectionSet conSet, org.apache.struts.action.ActionMapping mapping, DynActionForm form, java.lang.String name)
      Deprecated.
      protected org.apache.struts.action.ActionForward html​(ConnectionSet conSet, DynActionForm form, java.lang.String path)
      JSP forward file path.
      protected org.apache.struts.action.ActionForward json​(java.sql.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 org.apache.struts.action.ActionForward processJsonForward​(java.sql.Connection con, DynActionForm form)
      Deprecated.
      protected org.apache.struts.action.ActionForward processJsonForward​(java.sql.Connection con, DynActionForm form, javax.servlet.http.HttpServletResponse response)
      Deprecated.
      protected org.apache.struts.action.ActionForward processJsonForward​(ConnectionSet conSet, DynActionForm form)
      Deprecated.
      protected org.apache.struts.action.ActionForward processJsonForward​(ConnectionSet conSet, DynActionForm form, javax.servlet.http.HttpServletResponse response)
      Deprecated.
      protected org.apache.struts.action.ActionForward processUserTypedForward​(java.sql.Connection con, org.apache.struts.action.ActionMapping mapping, DynActionForm form, java.lang.String htmlForwardName)
      Deprecated.
      protected org.apache.struts.action.ActionForward processUserTypedForward​(java.sql.Connection con, org.apache.struts.action.ActionMapping mapping, DynActionForm form, javax.servlet.http.HttpServletResponse response, java.lang.String htmlForwardName)
      Deprecated.
      protected org.apache.struts.action.ActionForward processUserTypedForward​(ConnectionSet conSet, org.apache.struts.action.ActionMapping mapping, DynActionForm form, java.lang.String htmlForwardName)
      Deprecated.
      protected org.apache.struts.action.ActionForward processUserTypedForward​(ConnectionSet conSet, org.apache.struts.action.ActionMapping mapping, DynActionForm form, javax.servlet.http.HttpServletResponse response, java.lang.String htmlForwardName)
      Deprecated.
      protected void restoreRequestParams​(java.sql.Connection con, DynActionForm form, boolean get, boolean set, java.lang.String... params)
      Saves and restores HTTP request parameters.
      protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Standard Struts method, shouldn't be used.
      protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping, DynActionForm form, java.sql.Connection con)
      Deprecated.
      protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping, DynActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.sql.Connection con)
      Deprecated.
      protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping, DynActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ConnectionSet conSet)
      Deprecated.
      protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping, DynActionForm form, ConnectionSet conSet)
      Deprecated.
      org.apache.struts.action.ActionForward unspecified​(DynActionForm form, java.sql.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, java.sql.Connection con, java.util.function.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, getParameter
      • 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 Detail

      • mapper

        public static final com.fasterxml.jackson.databind.ObjectMapper mapper
      • log

        protected final Log log
      • setup

        protected final Setup setup
    • Constructor Detail

      • BaseAction

        protected BaseAction()
    • Method Detail

      • unspecified

        protected final org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping,
                                                                           org.apache.struts.action.ActionForm form,
                                                                           javax.servlet.http.HttpServletRequest request,
                                                                           javax.servlet.http.HttpServletResponse response)
                                                                    throws java.lang.Exception
        Standard Struts method, shouldn't be used.
        Overrides:
        unspecified in class org.apache.struts.actions.DispatchAction
        Throws:
        java.lang.Exception
      • unspecified

        @Deprecated
        protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping,
                                                                     DynActionForm form,
                                                                     javax.servlet.http.HttpServletRequest request,
                                                                     javax.servlet.http.HttpServletResponse response,
                                                                     java.sql.Connection con)
                                                              throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • unspecified

        @Deprecated
        protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping,
                                                                     DynActionForm form,
                                                                     java.sql.Connection con)
                                                              throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • unspecified

        @Deprecated
        protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping,
                                                                     DynActionForm form,
                                                                     javax.servlet.http.HttpServletRequest request,
                                                                     javax.servlet.http.HttpServletResponse response,
                                                                     ConnectionSet conSet)
                                                              throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • unspecified

        @Deprecated
        protected org.apache.struts.action.ActionForward unspecified​(org.apache.struts.action.ActionMapping mapping,
                                                                     DynActionForm form,
                                                                     ConnectionSet conSet)
                                                              throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • unspecified

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

        public org.apache.struts.action.ActionForward unspecified​(DynActionForm form,
                                                                  java.sql.Connection con)
                                                           throws java.lang.Exception
        Default action method if no parameter 'action' passed. Overwrite and implement.
        Parameters:
        form -
        con -
        Returns:
        Throws:
        java.lang.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,
                                                                        java.lang.String name)
                                                                 throws java.lang.Exception
        Overrides:
        dispatchMethod in class org.apache.struts.actions.DispatchAction
        Throws:
        java.lang.Exception
      • html

        protected org.apache.struts.action.ActionForward html​(java.sql.Connection con,
                                                              DynActionForm form,
                                                              java.util.Map<java.lang.String,​java.lang.String> mapping)
        JSP forward file path calculated using getForwardJspPath(DynActionForm, Map) function.
        Parameters:
        con -
        form -
        mapping -
        Returns:
      • html

        protected org.apache.struts.action.ActionForward html​(java.sql.Connection con,
                                                              DynActionForm form,
                                                              java.lang.String path)
        JSP forward file path.
        Parameters:
        con -
        form - must be 'null' for open interface.
        path - JSP path.
        Returns:
      • html

        protected org.apache.struts.action.ActionForward html​(ConnectionSet conSet,
                                                              DynActionForm form,
                                                              java.lang.String path)
        JSP forward file path.
        Parameters:
        conSet -
        form - must be 'null' for open interface.
        path - JSP path.
        Returns:
      • html

        @Deprecated
        protected org.apache.struts.action.ActionForward html​(java.sql.Connection con,
                                                              org.apache.struts.action.ActionMapping mapping,
                                                              DynActionForm form)
        Deprecated.
        Use html(Connection, DynActionForm, String). Returns Struts forward with name=form.getAction().
        Parameters:
        con -
        mapping -
        form -
        Returns:
      • html

        @Deprecated
        protected org.apache.struts.action.ActionForward html​(java.sql.Connection con,
                                                              org.apache.struts.action.ActionMapping mapping,
                                                              DynActionForm form,
                                                              java.lang.String name)
        Deprecated.
        Use html(Connection, DynActionForm, String). Returns Struts forward by name.
        Parameters:
        con -
        mapping -
        form -
        name - forward's name.
        Returns:
      • html

        @Deprecated
        protected org.apache.struts.action.ActionForward html​(ConnectionSet conSet,
                                                              org.apache.struts.action.ActionMapping mapping,
                                                              DynActionForm form,
                                                              java.lang.String name)
        Deprecated.
        Use html(ConnectionSet, DynActionForm, String). Returns Struts forward by name.
        Parameters:
        conSet -
        mapping -
        form -
        name - forward's name.
        Returns:
      • processUserTypedForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processUserTypedForward​(java.sql.Connection con,
                                                                                 org.apache.struts.action.ActionMapping mapping,
                                                                                 DynActionForm form,
                                                                                 javax.servlet.http.HttpServletResponse response,
                                                                                 java.lang.String htmlForwardName)
        Deprecated.
      • processUserTypedForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processUserTypedForward​(java.sql.Connection con,
                                                                                 org.apache.struts.action.ActionMapping mapping,
                                                                                 DynActionForm form,
                                                                                 java.lang.String htmlForwardName)
        Deprecated.
      • processUserTypedForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processUserTypedForward​(ConnectionSet conSet,
                                                                                 org.apache.struts.action.ActionMapping mapping,
                                                                                 DynActionForm form,
                                                                                 javax.servlet.http.HttpServletResponse response,
                                                                                 java.lang.String htmlForwardName)
        Deprecated.
      • processUserTypedForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processUserTypedForward​(ConnectionSet conSet,
                                                                                 org.apache.struts.action.ActionMapping mapping,
                                                                                 DynActionForm form,
                                                                                 java.lang.String htmlForwardName)
        Deprecated.
      • json

        protected org.apache.struts.action.ActionForward json​(java.sql.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:
      • processJsonForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processJsonForward​(ConnectionSet conSet,
                                                                            DynActionForm form)
        Deprecated.
      • processJsonForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processJsonForward​(java.sql.Connection con,
                                                                            DynActionForm form)
        Deprecated.
      • processJsonForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processJsonForward​(java.sql.Connection con,
                                                                            DynActionForm form,
                                                                            javax.servlet.http.HttpServletResponse response)
        Deprecated.
      • processJsonForward

        @Deprecated
        protected org.apache.struts.action.ActionForward processJsonForward​(ConnectionSet conSet,
                                                                            DynActionForm form,
                                                                            javax.servlet.http.HttpServletResponse response)
        Deprecated.
      • getAccess

        protected boolean getAccess​(java.lang.String accessList,
                                    java.lang.String accessItemKey,
                                    int value)
      • restoreRequestParams

        protected void restoreRequestParams​(java.sql.Connection con,
                                            DynActionForm form,
                                            boolean get,
                                            boolean set,
                                            java.lang.String... params)
                                     throws BGException
        Saves and restores HTTP request parameters. As storage used User.getPersonalizationMap(), key is 'param.' + digest from DynActionForm.getAreaId().
        Parameters:
        con -
        form - there params are taken and restored, also contains 'areaId' param.
        get - restore
        set - saves
        params - parameter names
        Throws:
        BGException
      • updatePersonalization

        protected void updatePersonalization​(DynActionForm form,
                                             java.sql.Connection con,
                                             java.util.function.Consumer<Preferences> setFunction)
                                      throws java.lang.Exception
        Stores new values in personalization map and update it if changed.
        Parameters:
        form -
        con -
        setFunction -
        Throws:
        java.lang.Exception