Class HttpSecureAppServlet

    • Field Detail

      • boolHist

        protected boolean boolHist
    • Constructor Detail

      • HttpSecureAppServlet

        public HttpSecureAppServlet()
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig config)
        Description copied from class: HttpBaseServlet
        Loads basic configuration settings that this class and all that extend it require to function properly. Also instantiates XmlEngine object. This method is called upon load of the class, which is configured to be loaded upon start of the application server. See also web.xml (load-on-startup).
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class HttpBaseServlet
      • setClassInfo

        protected void setClassInfo​(String type,
                                    String id,
                                    String module)
        Sets information about the artifact the servlet is for. This method is called from generated 2.50 windows to set tab and module, before calling this init, so it is not needed to query database to retrieve this info.
      • service

        public void service​(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws IOException,
                            javax.servlet.ServletException
        Description copied from class: HttpBaseServlet
        A dispatcher method that calls the initialization upon every request to the servlet before it hands over the final dispatchment to the HttpServlet base class.
        Overrides:
        service in class HttpBaseServlet
        Parameters:
        request - HttpServletRequest object where details of the HTTP request are.
        response - HttpServletResponse object where the response will be written and returned to the user.
        Throws:
        IOException
        javax.servlet.ServletException
      • isBackOfficeAccessRequired

        protected boolean isBackOfficeAccessRequired()
        Returns:
        true if the default role to be selected for the service execution needs to have access to the back office or false if a role without access to the back office can be used.
      • hasGeneralAccess

        protected boolean hasGeneralAccess​(VariablesSecureApp vars,
                                           String type,
                                           String id)
        Cheks access passing all the parameters
        Parameters:
        vars -
        type - type of element
        id - id for the element
        Returns:
        true in case it has access false if not
      • logout

        protected void logout​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws IOException,
                              javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • invalidateSession

        protected void invalidateSession​(javax.servlet.http.HttpServletRequest request)
      • setHistoryCommand

        protected void setHistoryCommand​(javax.servlet.http.HttpServletRequest request,
                                         String strCommand)
      • advise

        protected void advise​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              String strTipo,
                              String strTitulo,
                              String strTexto)
                       throws IOException
        Throws:
        IOException
      • advisePopUp

        protected void advisePopUp​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   String strTitulo,
                                   String strTexto)
                            throws IOException
        Throws:
        IOException
      • advisePopUp

        protected void advisePopUp​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   String strTipo,
                                   String strTitulo,
                                   String strTexto)
                            throws IOException
        Throws:
        IOException
      • advisePopUpRefresh

        protected void advisePopUpRefresh​(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          String strType,
                                          String strTitle,
                                          String strText)
                                   throws IOException
        Creates a pop up that when closed, will refresh the parent window.
        Parameters:
        response - the HttpServletResponse object
        strType - the type of message to be displayed (e.g. ERROR, SUCCESS)
        strTitle - the title of the popup window
        strText - the text to be displayed in the popup message area
        Throws:
        IOException - if an error occurs writing to the output stream
      • bdError

        protected void bdError​(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               String strCode,
                               String strLanguage)
                        throws IOException
        Throws:
        IOException
      • bdErrorGeneralPopUp

        protected void bdErrorGeneralPopUp​(javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           String strTitle,
                                           String strText)
                                    throws IOException
        Throws:
        IOException
      • bdErrorConnection

        protected void bdErrorConnection​(javax.servlet.http.HttpServletResponse response)
                                  throws IOException
        Throws:
        IOException
      • pageError

        protected void pageError​(javax.servlet.http.HttpServletResponse response)
                          throws IOException
        Throws:
        IOException
      • pageErrorPopUp

        protected void pageErrorPopUp​(javax.servlet.http.HttpServletResponse response)
                               throws IOException
        Throws:
        IOException
      • whitePage

        protected void whitePage​(javax.servlet.http.HttpServletResponse response)
                          throws IOException
        Throws:
        IOException
      • whitePage

        protected void whitePage​(javax.servlet.http.HttpServletResponse response,
                                 String strAlert)
                          throws IOException
        Throws:
        IOException
      • printPageClosePopUp

        protected void printPageClosePopUp​(javax.servlet.http.HttpServletResponse response,
                                           VariablesSecureApp vars,
                                           String path)
                                    throws IOException,
                                           javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • printPageClosePopUp

        protected void printPageClosePopUp​(javax.servlet.http.HttpServletResponse response,
                                           VariablesSecureApp vars,
                                           String path,
                                           String tabTitle)
                                    throws IOException,
                                           javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • printPageClosePopUp

        protected void printPageClosePopUp​(javax.servlet.http.HttpServletResponse response,
                                           VariablesSecureApp vars)
                                    throws IOException,
                                           javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • printPagePopUpDownload

        protected void printPagePopUpDownload​(javax.servlet.ServletOutputStream os,
                                              String fileName)
                                       throws IOException,
                                              javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • printPagePopUpDownloadAndRefresh

        protected void printPagePopUpDownloadAndRefresh​(javax.servlet.ServletOutputStream os,
                                                        String fileName)
                                                 throws IOException,
                                                        javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • printPageClosePopUpAndRefreshParent

        protected void printPageClosePopUpAndRefreshParent​(javax.servlet.http.HttpServletResponse response,
                                                           VariablesSecureApp vars)
                                                    throws IOException,
                                                           javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • pageErrorCallOut

        protected void pageErrorCallOut​(javax.servlet.http.HttpServletResponse response)
                                 throws IOException
        Throws:
        IOException
      • readProperties

        protected void readProperties​(VariablesSecureApp vars)
        Reads some configuration properties from Openbravo.properties and sets them in session
      • renderJR

        protected void renderJR​(VariablesSecureApp variables,
                                javax.servlet.http.HttpServletResponse response,
                                String strReportName,
                                String strFileName,
                                String strOutputType,
                                HashMap<String,​Object> designParameters,
                                ScrollableFieldProvider sfp,
                                Map<Object,​Object> exportParameters)
                         throws javax.servlet.ServletException
        Render a jrxml based report using a ScrollableFieldProvider as its datasource.
        Throws:
        javax.servlet.ServletException
        See Also:
        renderJR(VariablesSecureApp, HttpServletResponse, String, String, String, HashMap, JRDataSource, Map, boolean)