psdi.webclient.system.controller

Class AppInstance

  • All Implemented Interfaces:
    java.lang.Cloneable


    public class AppInstance
    extends PageInstance
    • Constructor Detail

      • AppInstance

        public AppInstance()
    • Method Detail

      • addMXJSPostEvent

        public void addMXJSPostEvent(java.lang.String id,
                                     java.lang.String eval)
      • getMXJSPostEvent

        public java.lang.String[] getMXJSPostEvent()
      • getTrackInRecents

        public boolean getTrackInRecents()
      • setSkin

        public void setSkin(java.lang.String skin)
      • getSkin

        public java.lang.String getSkin()
      • checkMBOShouldBeLocked

        public void checkMBOShouldBeLocked()
                                    throws java.rmi.RemoteException,
                                           MXException
        This method checks if the current MBO needs to be locked when the App is loaded.
        Throws:
        java.rmi.RemoteException
        MXException
      • createPageInstance

        public PageInstance createPageInstance(WebClientSession wcs,
                                               org.w3c.dom.Element el)
        helper method to create a page instance and initialize it. this is used by the app instance to create the main page instance, and by the dialog code to create the dialog page instance
        Parameters:
        wcs - WebClientSession
        el - dom element from the app descriptor for which to create the page (page, dialog, modelessdialog etc)
        Returns:
      • createPageInstance

        public PageInstance createPageInstance(WebClientSession wcs,
                                               org.w3c.dom.Element el,
                                               boolean loadDialogEntity)
        helper method to create a page instance and initialize it. this is used by the bound component instance showLookup()
        Parameters:
        wcs - WebClientSession
        el - dom element from the app descriptor for which to create the page (page, dialog, modelessdialog etc)
        loadDialog - boolean
        Returns:
      • pushPage

        public void pushPage(PageInstance page)
        Adds a page to the page stack, and is considered the current page.
      • getOrigId

        public java.lang.String getOrigId(java.lang.String renderId)
        Get the corresponding id for the supplied render id
        Returns:
        String for fully-qualified componentId
      • addRenderId

        public void addRenderId(java.lang.String renderId,
                                java.lang.String origId)
        Add key/value (renderid/fully-qualified id) of ids for rendering
      • removeRenderId

        public void removeRenderId(java.lang.String renderId)
      • generateStaticId

        public java.lang.String generateStaticId(java.lang.String id)
        Generate a unique is for the id passed in. If the system property "mxe.webclient.staticid" is set, we will use "static ids", else we will continue using the legacy id generation where we increment the integer renderIdCount and return the new value as a String.
        Returns:
        String value of newly generated static id
      • close

        public void close()
      • popPage

        public PageInstance popPage(PageInstance page,
                                    boolean removeImmediately)
        Removes the specified page instance from the stack.

        Closes all underlying data beans if this.savedBeans not null (when storePageBeans() has been called in order to preserve the results from a dialog)

        Parameters:
        page - - the dialog instance to be removed, or null for the topmost page
        removeImmediately - - remove the dialog from the app without delayed cleanup
        Returns:
        the closed PageInstance object
      • popPage

        public PageInstance popPage()
        Removes the current page instance from the stack.

        Closes all underlying data beans if this.savedBeans not null (when storePageBeans() has been called in order to preserve the results from a dialog)

        Returns:
        the closed PageInstance object
      • popPage

        public PageInstance popPage(PageInstance page)
        Removes the specified page instance from the stack.

        Closes all underlying data beans if this.savedBeans not null (when storePageBeans() has been called in order to preserve the results from a dialog)

        Parameters:
        page - - the dialog instance to be removed, or null for the topmost page
        Returns:
        the closed PageInstance object
      • cleanupPoppedDialog

        public void cleanupPoppedDialog()
      • storePageBeans

        public void storePageBeans(PageInstance page)
        Stores temporarily the DataBeans from the closed dialog until the request is processed. This is used by dialog pages that launch another dialog and the new dialog needs a bean from the previous one.
      • clearStoredPageBeans

        public void clearStoredPageBeans()
        Close saved beans that aren't used anymore and clear saved bean vector
      • getAppModule

        public java.lang.String getAppModule()
      • getChildren

        public java.util.List getChildren()
        override getChildren for app - app has no children, per se. but for sending down events, the children are essentially the pages on the page stack
        Overrides:
        getChildren in class BaseInstance
        Returns:
        List of children pages
      • getApplicationPage

        public PageInstance getApplicationPage()
        Helper method to get the current page that is on the page stack
        Returns:
        the top of the page stack, or the AppInstance itself if the page stack is empty
      • getCurrentPage

        public PageInstance getCurrentPage()
        Helper method to get the current page that is on the page stack
        Returns:
        the top of the page stack, or the AppInstance itself if the page stack is empty
      • getPageStack

        public java.util.Stack getPageStack()
        Returns the page stack; it may be empty for pageless applications
        Returns:
        The page stack
      • getPoppedDialogs

        public java.util.Vector getPoppedDialogs()
        Returns the list of popped dialogs. When handling the render at the end of the event process, we need to go through this list and handle a render on each.
        Returns:
        The list of popped dialogs
      • getAppBean

        public DataBean getAppBean()
        Returns a reference to the presentations DataBean, which in most cases should be an AppBean but does have to be.
        Returns:
        DataBean - reference to presentation's datasrc.
      • getAppHandlerInstance

        public ControlInstance getAppHandlerInstance()
        Deprecated. - use this instance directly instead
      • getAppHandler

        public ControlHandler getAppHandler()
        Deprecated. FIREFOX - use getAppControl() instead
      • getDataBean

        public DataBean getDataBean(java.lang.String beanId)
        Returns a reference to a DataBean found in the current app. This method looks for the bean in all pages in the stack.
      • getResultsBean

        public ResultsBean getResultsBean()
        Retrieves the DataBean that belongs to the AppBean returned by getAppBean(). Returns null if getAppBean() returns an object that is not an instance of AppBean.
        Returns:
        the DataBean that belongs to the AppBean, or null if there is no AppBean
        See Also:
        AppInstance.getAppBean()
      • setAppLinkBean

        public void setAppLinkBean(DataBean bean)
        Cache the bean in the application instance with the key "aPpLiNkBeAn"
        Parameters:
        bean - - the bean to be cached, or null to clear the cache
      • getAppLinkBean

        public DataBean getAppLinkBean()
        Returns:
        The data bean cached in the application instance with the key "aPpLiNkBeAn"
      • onListTab

        public boolean onListTab()
        Checks to see if the user's current tab is the "list" tab.
      • getCurrentPageId

        public java.lang.String getCurrentPageId()
        Returns:
        the String ID of the current page
      • getApp

        public java.lang.String getApp()
        Deprecated. FIREFOX - use getId()
        Returns:
        The internal name of the application (such as startcntr, wotrack)
      • getAppTitle

        public java.lang.String getAppTitle()
      • getAppImage

        public java.lang.String getAppImage()
      • inAppLinkMode

        public boolean inAppLinkMode()
        Returns:
        true if the application is linked to
      • setAppLinkMode

        public void setAppLinkMode()
        Sets link mode for this instance so that the GUI knows to modify the page layout. The link mode cannot be reset
      • getPreviousPage

        public PageInstance getPreviousPage()
        Returns:
        The previous page in the stack (the page behind the top page), or null when there is no such page
      • isRendered

        public boolean isRendered()
        returns whether or not the app has been rendered on the client.
        Returns:
      • setRendered

        public void setRendered(boolean b)
        set the rendered flag
      • hasSaveAccess

        public boolean hasSaveAccess()
        The method retrieves and caches the save authorization for the first MBO it sees. As long as the concept of MBO-based security is not implemented, this will work just fine
        Returns:
        True only if the Mbo associated with the presentation bean is authorized to perform the save operation
      • getAppQueryOptions

        public java.util.Map getAppQueryOptions()
        The underlying container is sorted according to the natural order for the key's class
        Returns:
        The query options for the application and the current user
      • getAppMenuOptions

        public java.util.Map getAppMenuOptions()
        The underlying container is sorted according to the natural order for the key's class
        Returns:
        The menu options for the application and the current user
      • getAppActionMenuOptions

        public java.util.Map getAppActionMenuOptions()
      • showOptionForRL

        public boolean showOptionForRL(java.lang.String sigopt)
                                throws java.rmi.RemoteException,
                                       MXException
        This method evaluates if a given Sigoption has a PreRequisite of SAVE if the app is enabled for Edit mode and if the MBO is not locked. If the App is not enabled for EditMode this method returns True by default.
        Parameters:
        sigopt -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getAppSearchOptions

        public java.util.Map getAppSearchOptions()
        The underlying container is sorted according to the natural order for the key's class
        Returns:
        The search options for the application and the current user
      • getAppToolbarOptions

        public java.util.Map getAppToolbarOptions()
        The underlying container is sorted according to the natural order for the key's class
        Returns:
        The toolbar options for the application and the current user
      • getAppToolbarOptions

        public java.util.Map getAppToolbarOptions(boolean filterSavePrerequsite)
        Returns a Map of toolbar options where the prerequisite SAVE is not defined for a given Sigoption only if the application is enabled for Edit Mode and @param filterSavePrerequsite is true. Otherwise the method returns AppInstance.getAppToolbarOptions()
        Parameters:
        filterSavePrerequsite -
        Returns:
      • setStartupWhereClause

        public void setStartupWhereClause(java.lang.String startupWhereClause)
      • getStartupWhereClause

        public java.lang.String getStartupWhereClause()
      • setAppStartupQueryName

        public void setAppStartupQueryName(java.lang.String appStartupQueryName)
      • getStartupQueryName

        public java.lang.String getStartupQueryName()
      • getUserDefaultQuery

        public java.util.Map getUserDefaultQuery()
      • getAppSearchOptions

        public java.util.Map getAppSearchOptions(java.lang.String position)
      • getAppQuickSearchOptions

        public java.util.Map getAppQuickSearchOptions()
      • hasBookmarkMenuOption

        public boolean hasBookmarkMenuOption()
      • applinkreturn

        public int applinkreturn()
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Description copied from class: ControlInstance
        Render this control's components
        Overrides:
        render in class PageInstance
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • gototab

        public int gototab()
        Event handler for the gototab. Calls PageInstance.gotTab(String) for the event value
        Returns:
        the status from PageInstance.gotTab()
      • changetab

        public int changetab()
        Processes the changetab event: the event value is the id of the tab instance that needs to receive the focus. It must be on the application page, and is expected ot be one of the main tabs.
      • changetabcond

        public int changetabcond()
                          throws MXException,
                                 java.rmi.RemoteException
        Processes the changetabcond event: the event value is the id of the tab instance that needs to receive the focus. It must be on the application page, and is expected ot be one of the main tabs. The change will only occur if there is a single record that results for the qbe setting.
        Throws:
        MXException
        java.rmi.RemoteException
      • setRefreshCanvas

        public void setRefreshCanvas(boolean state)
      • getRefreshCanvas

        public boolean getRefreshCanvas()
      • setReload

        public void setReload(boolean state)
      • getReload

        public boolean getReload()
      • removeDataBean

        public DataBean removeDataBean(java.lang.String beanId)
      • showwfinfo

        public int showwfinfo()
        showwfinfo event handler
      • getHotkeys

        public Hotkeys getHotkeys()
      • isSigOptionCheck

        public java.util.Map isSigOptionCheck(WebClientEvent wce)
                                       throws MXException
        Throws an MXException if the event passed in is a sigoption (in the list of of possible sigoptions for the app) and the user doesn't have the privilege
        Parameters:
        WebClientEvent - - event to check
        Throws:
        MXException
      • isSigOptionCheck

        public boolean isSigOptionCheck(java.lang.String sigoption)
                                 throws MXException
        Throws an MXException if the string passed in is a sigoption (in the list of of possible sigoptions for the app) and the user doesn't have the privilege
        Parameters:
        String - - sigOption to check
        Throws:
        MXException
      • openURL

        public void openURL(java.lang.String url,
                            boolean newWindow,
                            java.lang.String windowId,
                            java.lang.String options)
        Used to open a URL
      • openURL

        public void openURL(java.lang.String url,
                            boolean newWindow)
      • hasSigOptionAccess

        public boolean hasSigOptionAccess(java.lang.String sigoption)
        Returns true if the user has app level privileges for a given sigoption. (This doesn't take into account of conditions.)
        Parameters:
        sigoption - The sigoption that will be checked to see if the user has some sort of privileges for it.
        Returns:
        true if the user has app level privileges for the sigoption, false if not.
      • isSigOption

        public boolean isSigOption(java.lang.String sigoption)
        Returns a Map containing all possible sigoption for an application regardless of whether or not the user has access to them.
        Returns:
        Map - A map of all the app's sigoptions.
        Throws:
        MXException
        java.rmi.RemoteException
      • allowPageEdits

        public boolean allowPageEdits()
        This checks to see if the user has save access to the application, if not and the user is on the main page, then return false. Otherwise return true. We need to allow the user to make chanes in dialogs even if they don't have app save permissions.
      • allowEvent

        public boolean allowEvent(WebClientEvent event)
        This was added to stop event processing if the user doesn't have save permissions and the AppBean has been modified on the main page. This allows the clear, changetab and record navigation actions.
      • getDesignerDialogList

        public java.util.HashMap getDesignerDialogList()
      • getTabManaged

        public boolean getTabManaged()
      • setQueryCancelMboset

        public void setQueryCancelMboset(MboSetRemote qcMboset)
      • getQueryCancelMboset

        public MboSetRemote getQueryCancelMboset()
      • setQueryCancelResultsBean

        public void setQueryCancelResultsBean(DataBean qcDatabean)
      • getQueryCancelResultsBean

        public DataBean getQueryCancelResultsBean()
      • isdoclinkweblogic

        public boolean isdoclinkweblogic()
      • setApphelp

        public void setApphelp(java.lang.String help)
      • getApphelp

        public java.lang.String getApphelp()
      • isAsyncEnabled

        public boolean isAsyncEnabled()
        Checks to see if async is enabled at the app and system level
        Returns:
        boolean is async enabled (set during init using property from app and system property)
      • isMobile

        public boolean isMobile()
        returns the boolean value of the ismobile property
      • getEntityRelationshipModel

        public EntityRelationshipModel getEntityRelationshipModel()
        This method returns the EntityRelationshipModel for the application.
        Returns:
        EntityRelationshipModel for the application
      • hasAttributeErrors

        public boolean hasAttributeErrors()
        Returns true is the app has any
        Returns:
        List - list of errors return from the Mbos of fields with error
      • hasAnyErrors

        public boolean hasAnyErrors()
      • setAttributeErrorList

        public void setAttributeErrorList(java.util.List fieldErrorList)
      • stillHasAttributeError

        public boolean stillHasAttributeError(ERMAttributeError error)
      • setRedirectURL

        public void setRedirectURL(java.lang.String url)
        Set the url to redirect the user to.
        Parameters:
        url - The url to redirect to
      • deepRequiredEnabled

        public boolean deepRequiredEnabled()
      • getWarningType

        public int getWarningType()
      • getRedirectURL

        public java.lang.String getRedirectURL()
        Gets the url to redirect the user to. If null no redirect necessary
        Returns:
        The url to redirect to.
      • isReferenceApp

        public boolean isReferenceApp()
        Returns if this app is a reference app.
        Returns:
        true if this app is a reference app
      • addJavaScript

        public void addJavaScript(java.lang.String script)
        Adds text to the buffer of Javascript to be processed on the client when asked for
        Parameters:
        script -
      • propagateRequiredErrors

        public MXException propagateRequiredErrors(MXException e,
                                                   java.util.List requiredErrorList)
        This method does three things:
        If there are more than one required field in the list (passed in by the requiredErrorList parameter) it will create a new exception, with a message listing all of the required fields. It will also place focus on the the first field in the list. Then finally it will generate new SetValueErrors for each requied field and pass it to the associated control.
        Parameters:
        e - MXException MXException with the required field is blank message that this method will replace out param of MboValue title with the label from the presentation, if only one required field needs a value.
        requiredErrorList - The list of ERMAttributeErrors that need to be sent to controls bound to those attributes
        Returns:
        either the passed in exception or a new MXException listing all the required fields in it's message
      • propagateRequiredException

        public MXRequiredFieldException propagateRequiredException(MXRequiredFieldException e,
                                                                   java.util.List requireds)
        Deprecated. call propagateRequiredErrors instead
        This method does three things:
        If there are more than one required field in the list (passed in by the requireds parameter) it will create a new exception, with a message listing all of the required fields. It will also place focus on the the first field in the list. Then finally it will generate new SetValueErrors for each requied field and pass it to the assocaited control.
        Parameters:
        e - MXRequiredFieldException with the list of required fields to be show to the user and indicated in the UI
        Returns:
        either the passed in exception or a new MXRequiredFieldException listing all the required fiedls in it's message
      • getErrorLevel

        public int getErrorLevel()
        Overridden to just look at the aplicaiton page.
        Overrides:
        getErrorLevel in class PageInstance
        Returns:
      • setRetryErrorValues

        public void setRetryErrorValues(boolean retryErrorValues)
        Parameters:
        retryErrorValues - the retryErrorValues to set
      • hasHandledRequiredFieldException

        public boolean hasHandledRequiredFieldException()
        Returns true if the required field excpetion has already been handled. This is needed so multiple calls to save won't show multiple messages
        Returns:
      • isSigOptionConditional

        public boolean isSigOptionConditional(java.lang.String sigOption)
                                       throws java.rmi.RemoteException,
                                              MXException
        Returns true if the sigoption passed in has conditional UI, a condition, or site conditions.
        Parameters:
        sigOption -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • addErrorToMasterList

        public void addErrorToMasterList(SetValueError setValueError)
        Adds the error to the appinstance's master list of errors
        Parameters:
        setValueError -
      • getErrorFromMasterList

        public SetValueError getErrorFromMasterList(ApplicationError appError)
        Returns the SetValueError associated with the ApplicationError that is passed in. This can return null but most likly shouldn't.
        Parameters:
        appError -
        Returns:
      • removeErrorFromMasterList

        public void removeErrorFromMasterList(SetValueError setValueError)
        Removes the SetValueError from the AppInstances list of errors from the master list of errors.
      • getAutoFillForPage

        public com.ibm.json.java.JSONObject getAutoFillForPage(PageInstance page)
      • getDatastoreSet

        public DatastoreSet getDatastoreSet()
        gets the datastore set containing datastore config information
        Returns:
      • getKeyLabel

        public java.lang.String getKeyLabel()
        Used to retrieve the label of the key field for use in helper strings on UI
        Returns:
        label
      • setRecHover

        public void setRecHover(org.w3c.dom.Element rhElement,
                                ComponentInstance sourceComponent)
        Create the control instance that is the record hover instance for the current record
        Parameters:
        rhElement -
      • getRecHover

        public RecordHover getRecHover()
        Returns the current RecHoverInstance
        Returns:
      • clearRecHover

        public void clearRecHover()
        Clears out the current rec hover control instance
      • isMainrecActionMenu

        public boolean isMainrecActionMenu()
        Description copied from class: ControlInstance
        Returns true if this control is the Tool Bar Action Menu or the Navigation Menu.
        Overrides:
        isMainrecActionMenu in class ControlInstance
        See Also:
        psdi.webclient.controls.ToolbarCombobox.isMainrecActionMenu, psdi.webclient.system.controller.AppInstance.isMainrecActionMenu
      • setListTableOrderBy

        public void setListTableOrderBy(java.lang.String orderBy)
      • getListTableOrderBy

        public java.lang.String getListTableOrderBy()
      • getAppIdList

        public java.util.Hashtable getAppIdList()
      • getNextToolbarNumber

        public int getNextToolbarNumber()