psdi.webclient.system.session

Class WebClientSession

  • java.lang.Object
    • psdi.webclient.system.session.WebClientSession
  • All Implemented Interfaces:
    java.util.EventListener, javax.servlet.http.HttpSessionBindingListener


    public class WebClientSession
    extends java.lang.Object
    implements javax.servlet.http.HttpSessionBindingListener
    • Method Detail

      • isPostTivoli09Skin

        public boolean isPostTivoli09Skin()
      • getSkin

        public java.lang.String getSkin()
      • getSkinName

        public java.lang.String getSkinName()
      • getAdaptorInstance

        public SessionContext getAdaptorInstance()
        Deprecated. FIREFOX
        Returns:
        the adaptor instance associated with this master object
      • getMxSessionConnected

        public boolean getMxSessionConnected()
      • setMxSessionConnected

        public void setMxSessionConnected(boolean flag)
      • isConnected

        public boolean isConnected()
      • applySkin

        public void applySkin()
      • isMobileUserAgent

        public boolean isMobileUserAgent()
      • getUserAgentName

        public java.lang.String getUserAgentName()
        Returns the current Agent (browser) string Identifier
      • getUserAgentReplacement

        public java.lang.String getUserAgentReplacement()
        Returns string to use in replacing the #{browser} keyword. This currently only does IE or FF if not IE
      • getUserAgent

        public int getUserAgent()
      • handleRequest

        @TracePrimary
        public void handleRequest(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response)
                                         throws javax.servlet.ServletException,
                                                java.io.IOException
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • printHttpHeaders

        protected void printHttpHeaders(javax.servlet.http.HttpServletRequest request)
      • printRequestParameters

        @Deprecated
        protected void printRequestParameters(javax.servlet.http.HttpServletRequest request)
                                                   throws java.io.IOException
        Deprecated. 
        Throws:
        java.io.IOException
      • fixRowForTableDetails

        public java.lang.String fixRowForTableDetails(java.lang.String compId)
        When updating tabledetails and changing row during setvalue, the value could get applied to the wrong row. On tbalerows, the rownum is part of the componentId and this allows us to use the row when doing the setvalue. On tabledetails it is not feasible to use the rownum as part of the component ids
        Parameters:
        compId - - id of the component that is getting a setvalue
        Returns:
        String row
      • getProxyRequestContextURL

        public java.lang.String getProxyRequestContextURL()
        Reconstructs the ProxyServlet Request Context Path. The returned URL contains a protocol, server name, port number and application context.
      • getProxyBaseURL

        public java.lang.String getProxyBaseURL()
        Reconstructs the BASE URL the client used to make the request. The returned URL contains a protocol, server name, port number. .
      • getPortalMsg

        public java.lang.String getPortalMsg()
        Gets the message used by TIP to be sent to other portlets
      • setPortalMsg

        public void setPortalMsg(java.lang.String aMsg)
        Sets the message used by TIP to be sent to other portlets
      • getContextChanged

        public boolean getContextChanged()
        Gets the message used by TIP to be sent to other portlets
      • setContextChanged

        public void setContextChanged(boolean aBool)
        Sets the message used by TIP to be sent to other portlets
      • showwfinfo

        public int showwfinfo()
      • setErrorFieldFocus

        public void setErrorFieldFocus(java.lang.String currentFocusId,
                                       boolean forceRow)
      • printDebugMessage

        public void printDebugMessage(int level,
                                      java.lang.String message)
      • handleEvent

        @TracePrimary
        public int handleEvent(WebClientEvent event)
        Parameters:
        event - the event to process
        Returns:
        the status returned by the event processing handler, or PROCESS_NEXT_EVENT in case of any failure to process
      • hasWorkflowInfo

        public boolean hasWorkflowInfo()
      • getEventQueue

        public EventQueue getEventQueue()
        Return a reference to the EventQueue
      • queueEvent

        public void queueEvent(WebClientEvent event)
        Adds an event to the EventQueue.
      • getCurrentPageId

        public java.lang.String getCurrentPageId()
        Returns the current app's current page id.
      • getCurrentPage

        public PageInstance getCurrentPage()
        Returns the current app's current page instance.
      • getDataBean

        public DataBean getDataBean(java.lang.String beanId)
      • checkForDialogAccess

        public boolean checkForDialogAccess(java.lang.String dialogId,
                                            org.w3c.dom.Element dialog)
      • findDialog

        public PageInstance findDialog(java.lang.String dialogId)
        Returns the dialog control instance with the supplied id if it exists. If the dialog exists in the library the control is cloned and added as a child to the current application. This is done so the dialog can inherit the datasrc and any other global properties from the application. If the dialog is not found null is returned.
        Parameters:
        dialogId - the id of the dialog
        Returns:
        the dialog page
      • getUniqueId

        public java.lang.String getUniqueId()
        Generate a unique id for a newly inserted (or pasted) control. Used by designer
      • findDialogInDesignerApps

        public ControlInstance findDialogInDesignerApps(java.lang.String dialogId)
        Returns the dialog control instance with the supplied id if it exists for App Designer. If the dialog exists in the library the control is cloned and added as a child to the current application. This is done so the dialog can inherit the datasrc and any other global properties from the application. If the dialog is not found null is returned.
        Parameters:
        dialogId - the id of the dialog
        Returns:
        the dialog page
      • loadDialog

        public int loadDialog(java.lang.String dialogId)
      • loadDialog

        public int loadDialog(java.lang.String dialogId,
                              boolean showmessages,
                              java.lang.String longOpMessage)
      • loadDialogInDesignerApps

        public int loadDialogInDesignerApps(java.lang.String dialogId)
      • getControlInstance

        public ControlInstance getControlInstance(java.lang.String id)
        Helper method to get a control instance from the app.page.controlInstanceIndex. If the id equals the id of the current application, the application instance is returned
        Returns:
        the control instance, or null if not found
      • getControlInstance

        public ControlInstance getControlInstance(java.lang.String id,
                                                  boolean tableDownload)
      • getCurrentAppId

        public java.lang.String getCurrentAppId()
      • getPreviousApp

        public AppInstance getPreviousApp()
        Returns:
        the previous app in the app stack. Returns null if there's only the current application. This doesn't pop the app of the stack.
      • getMXSession

        public MXSession getMXSession()
        Returns the MXSession for the user.
      • getHttpSession

        public javax.servlet.http.HttpSession getHttpSession()
      • setHttpSession

        public void setHttpSession(javax.servlet.http.HttpSession https)
      • pushApp

        public void pushApp(AppInstance ai)
        Push the app on the app stack
      • popApp

        public AppInstance popApp()
        Removes the top application instance from the stack. Closes the application which removes all its pages and closes all underlying data beans
        Returns:
        The closed AppInstance object, see AppInstance.close()
      • clearStack

        public void clearStack()
        Removes all apps form the app stack. Typically this is only called when changing app (not app linking).
      • getAppStack

        public java.util.Stack getAppStack()
        Returns a the app stack of the SessionContext. This stack should contain all app linked apps.
      • setCurrentEvent

        public void setCurrentEvent(WebClientEvent event)
      • getCurrentEvent

        public WebClientEvent getCurrentEvent()
        Returns:
        the event being currently processed by handleEvent.
      • getFirstHandledEvent

        public WebClientEvent getFirstHandledEvent()
        Returns:
        the very first event processed by handleEvent.
      • getOriginalEvent

        public WebClientEvent getOriginalEvent()
        Returns:
        the original event that came in on the request. this event will of course have the original control and component, accessible by calling getSourceControl() getSourceComponent()
      • setEventState

        public void setEventState(int state)
      • getEventState

        public int getEventState()
      • getCurrentEventHandler

        public ControlInstance getCurrentEventHandler()
        returns a reference to the current control instance that's prcessing an event
      • setCurrentEventHandler

        public void setCurrentEventHandler(ControlInstance eventHandler)
      • setPerfStat

        public void setPerfStat(java.lang.String flag)
        set performance statistics flag (true / false ), first time it is set from webclient.properties files
      • getPerfStat

        public boolean getPerfStat()
        Return performance statistics flag (true / false ), first time it is set from webclient.properties files
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
        Returns the current request being handled by the WebClientSession.
      • getRequestType

        public static WebClientSession.RequestType getRequestType(javax.servlet.http.HttpServletRequest request)
        Returns the request type from the ServletRequest
      • setRequest

        public void setRequest(javax.servlet.http.HttpServletRequest request)
        Sets the current HttpServletRequest that the WebClientSession is handling, and sets its request type
        Parameters:
        request - HttpServletRequest object sent to the Tpae UI framework (via the WebClientServlet) from the client (browser).
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
        Returns:
        Returns the response.
      • setResponse

        public void setResponse(javax.servlet.http.HttpServletResponse response)
        Parameters:
        response - The response to set.
      • createMXSession

        public MXSession createMXSession()
      • hasWarnings

        public boolean hasWarnings()
      • getWarnings

        public java.util.ArrayList getWarnings()
      • removeWarnings

        public java.util.List removeWarnings()
        Clears (removes) all warnings from the warning list and returns them.
      • addWarnings

        public void addWarnings(java.util.List warningList)
        Adds warnings to the app-persisted warnings stack. The warningsStack is used to iterate the list of warnings and display them to the user. Warnings are collected after operations such as bean method calls, remote method calls and setvalue calls. The display of warnings is handled by the showwarnings event in the presentation control.
      • getLoginEvent

        public WebClientEvent getLoginEvent()
                                     throws java.io.IOException
        Returns:
        Returns the event to send/queue after the user logs in.
        Throws:
        java.io.IOException
      • getLocale

        public java.util.Locale getLocale()
      • setHideNavMenu

        public void setHideNavMenu(boolean hide)
      • getHideNavMenu

        public boolean getHideNavMenu()
      • setHideTitlebar

        public void setHideTitlebar(boolean hide)
      • getHideTitlebar

        public boolean getHideTitlebar()
      • setOuterApplication

        public void setOuterApplication(java.lang.String outerApp)
      • getOuterApplication

        public java.lang.String getOuterApplication()
      • setEmbeddedMessagePrefix

        public void setEmbeddedMessagePrefix(java.lang.String prefix)
      • getEmbeddedMessagePrefix

        public java.lang.String getEmbeddedMessagePrefix()
      • getHelpLangCode

        public java.lang.String getHelpLangCode()
        Get the language code for help url
      • getTimeZone

        public java.util.TimeZone getTimeZone()
      • setTimeZone

        public void setTimeZone(java.lang.String strTimeZone)
                         throws java.rmi.RemoteException,
                                MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getUserInfo

        public UserInfo getUserInfo()
      • getUserLanguageCode

        public java.lang.String getUserLanguageCode()
        Returns:
        the lower case of the user language code or null if not found
      • getMaxMessageMboSetRemote

        public MboSetRemote getMaxMessageMboSetRemote()
        Get the cached MaxMessageMboSetRemote
      • setMaxMessageMboSetRemote

        public void setMaxMessageMboSetRemote(MboSetRemote setmboSet)
        Set cache for the MaxMessageMboSetRemote object. It is constructed once through WebClientRuntime.getMaxMessage method.
      • getUserApps

        public java.util.Set getUserApps()
      • getOriginalApp

        public java.lang.String getOriginalApp(java.lang.String currentApp)
        Returns the name of the original app, given the name of a duplicated app
        Parameters:
        currentApp - the application name of the duplicated app
        Returns:
        the original app name
      • getAppDesc

        public java.lang.String getAppDesc(java.lang.String appId)
        Returns the description of an application from the database
        Parameters:
        appId - the application ID
        Returns:
        the application description
      • getClonedApps

        public java.util.Set getClonedApps(java.lang.String originalApp)
      • getOriginalApps

        public java.util.Set getOriginalApps(java.lang.String currentApp)
        Returns a set of original app names, given the name of a cloned app
        Parameters:
        currentAppName - the application name of the cloned app
        Returns:
        the a set of parent app names
      • getAppMainTable

        public java.lang.String getAppMainTable(java.lang.String currentApp)
        Returns the name of the main table for the passed app
        Parameters:
        currentApp - the application name
        Returns:
        the main table for the app
      • getSpellSessionAdapter

        public SpellingSessionAdapter getSpellSessionAdapter()
        Returns the SpellingSessionAdapter object in use during this Spelling Session
        Returns:
        Returns the SpellingSessionAdapter object
      • setSpellSessionAdapter

        public void setSpellSessionAdapter(SpellingSessionAdapter spellSessionAdapter)
        Sets the SpellingSessionAdapter object to be used during this Spelling Session
        Parameters:
        spellAdapter - the SpellingSessionAdapter object
      • pauseQueue

        public void pauseQueue()
        Pauses processing the queue. This is only done for message boxes.
      • isQueuePaused

        public boolean isQueuePaused()
        Returns whether or not the queue has been paused and stores off the remaining queued events to be done after the user closes the messagebox.
      • unPauseQueue

        public void unPauseQueue()
        Adds the saved queued events to the event queue so they can be processed.
      • runLongOp

        public boolean runLongOp(DataBean dataSrc,
                                 WebClientEvent event)
        Initiates a long op method on the passed in datasrc. The passed in method is the method called by the new thread.

        The method is called typically three times for a single long operation initialted by the user's action:
      • By the calling thread when the operation is initiated: that creates the asynchronous thread. This is done necessarily from an event handler method
      • By the new thread - if the method returns true then the caller knows that it is running in its own thread and can perform the operation. This is expecially useful when the method is the same handler that was used in the step above - and is typical for how application beans use asynchronous processing
      • By the cleanup code after it closes the long operation dialog and before it disposes of the thread object - to give a chance to the event handler which is the same as the one in the first step to do clean-up. At that point the status is completed - either successfully or with an error, and the call returns false without creating a new thread. The handler uses haslongOpCompleted() to determine the need to perform the cleanup
Returns:
true if the long operation was started
  • runLongOp

    public boolean runLongOp(DataBean dataSrc,
                             WebClientEvent event,
                             boolean showMessages,
                             java.lang.String longOpMessage)
  • runLongOp

    public boolean runLongOp(DataBean dataSrc,
                             java.lang.String method)
    Initiates a long op method on the passed in datasrc. The passed in method is the method called by the new thread.

    The method is called typically three times for a single long operation initialted by the user's action:
  • By the calling thread when the operation is initiated: that creates the asynchronous thread. This is done necessarily from an event handler method
  • By the new thread - if the method returns true then the caller knows that it is running in its own thread and can perform the operation. This is expecially useful when the method is the same handler that was used in the step above - and is typical for how application beans use asynchronous processing
  • By the cleanup code after it closes the long operation dialog and before it disposes of the thread object - to give a chance to the event handler which is the same as the one in the first step to do clean-up. At that point the status is completed - either successfully or with an error, and the call returns false without creating a new thread. The handler uses haslongOpCompleted() to determine the need to perform the cleanup
Returns:
true if the long operation was started