com.ibm.tivoli.maximo.miniapps.scheduler

Class AbstractTreeGridMiniAppBean

    • Field Detail

      • TESTIDS_ENABLED_PROPERTY

        public static final java.lang.String TESTIDS_ENABLED_PROPERTY
        See Also:
        Constant Field Values
      • SCHEDULER_MSG_GROUP

        public static final java.lang.String SCHEDULER_MSG_GROUP
        See Also:
        Constant Field Values
      • props

        protected java.util.Properties props
      • templates

        protected java.util.Map templates
      • userLocalizedTreeGridLabels

        protected com.ibm.json.java.JSONObject userLocalizedTreeGridLabels
      • lastSavedState

        protected SKDState lastSavedState
      • calTimezone

        protected java.util.TimeZone calTimezone
      • calLocale

        protected java.util.Locale calLocale
      • readOnlyRightClickMenus

        protected java.util.List readOnlyRightClickMenus
    • Constructor Detail

      • AbstractTreeGridMiniAppBean

        public AbstractTreeGridMiniAppBean()
    • Method Detail

      • getUserInfo

        public UserInfo getUserInfo()
      • getAppDescForApp

        protected java.lang.String getAppDescForApp(java.lang.String appName,
                                                    UserInfo userInfo)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Return the description from maxapps table
        Parameters:
        appName -
        Returns:
        description
        Throws:
        java.lang.Exception
        MXException
        java.rmi.RemoteException
      • addQuickSearch

        public void addQuickSearch(UIOptions opts)
      • addToggleDependencies

        public void addToggleDependencies(UIOptions opts,
                                          boolean create)
      • addLinkToWorkViewFilter

        public void addLinkToWorkViewFilter(UIOptions opts,
                                            boolean create,
                                            boolean initialState)
      • addFilterToggle

        public void addFilterToggle(UIOptions opts)
      • onReset

        public void onReset()
        OnReset is called whenever we need to clear the state of our beean. And reinitialize it for a new state. ie, when Maximo changes a record, etc, we need to clear the bean data, the load the state for that record
        Specified by:
        onReset in interface ResetListener
      • getAppMboString

        protected java.lang.String getAppMboString(java.lang.String field)
      • getAppMboYORN

        protected boolean getAppMboYORN(java.lang.String field)
      • getCurrentProjectId

        public java.lang.String getCurrentProjectId()
        Gets the current project ID that we are working with
        Returns:
      • isGUIMirrored

        public boolean isGUIMirrored()
      • setGridTitleInUIOptions

        public void setGridTitleInUIOptions(UIOptions opts,
                                            boolean readOnly)
                                     throws java.rmi.RemoteException,
                                            MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • isScenario

        protected boolean isScenario()
      • isDefaultScenario

        protected boolean isDefaultScenario()
      • isSnapshot

        protected boolean isSnapshot()
      • isScenarioOrSnapshot

        protected boolean isScenarioOrSnapshot()
      • async_export_echo

        public void async_export_echo(WebClientSession sess)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getLastKnownState

        public java.lang.String getLastKnownState()
                                           throws java.io.IOException,
                                                  MXException
        Load the last Known state for this bean, if it has not been loaded already
        Returns:
        Throws:
        java.io.IOException
        MXException
      • async_upload_state

        public com.ibm.json.java.JSONObject async_upload_state(WebClientSession sess,
                                                               java.lang.String cfgid,
                                                               java.lang.String cookie)
                                                        throws java.rmi.RemoteException,
                                                               MXException
        Accept current state from the UI for this bean's view, and save it for later.
        Parameters:
        sess -
        cfgid -
        cookie -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • async_load_text

        public com.ibm.json.java.JSONObject async_load_text(WebClientSession sess)
        Used to load the localized text for TreeGrid
        Parameters:
        sess -
        Returns:
      • loadSKDUIInfo

        public SKDUIInfo loadSKDUIInfo()
                                throws MXException,
                                       java.io.IOException
        Load the Scheduler UI Info data for the given application.
        Parameters:
        sess -
        appName -
        Returns:
        Throws:
        MXException
        java.io.IOException
      • async_get_table_context_menu

        public TMenu async_get_table_context_menu(WebClientSession sess,
                                                  java.lang.String projectId,
                                                  java.lang.String id,
                                                  java.lang.String column,
                                                  java.lang.String value)
                                           throws java.lang.Exception
        Called for an ITEM to fetch the Menu for a given item. The menu items should contain a Menu Name (display) and an action value. The Action Value will later be passed to the on_handle_conent_menu_item callback.
        Parameters:
        id - Activity ID
        col - Table Column
        Returns:
        Throws:
        java.lang.Exception
      • on_handle_applink_menu_item

        public java.lang.Object on_handle_applink_menu_item(WebClientSession sess,
                                                            java.lang.String id,
                                                            java.lang.String action,
                                                            java.lang.String values)
                                                     throws MXException,
                                                            java.rmi.RemoteException
        Called form the Browser Client with the Activity ID and Action. The action was was the same action that was created during the
        Parameters:
        id -
        action -
        Throws:
        MXException
        java.rmi.RemoteException
      • callMethod

        public java.lang.Object callMethod(java.lang.String methodName,
                                           java.lang.Class[] paramTypes,
                                           java.lang.Object[] params)
                                    throws MXException,
                                           java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • callBeanMethod

        public java.lang.Object callBeanMethod(java.lang.String method,
                                               java.lang.Class[] paramTypes,
                                               java.lang.Object[] params)
                                        throws MXException,
                                               java.lang.NoSuchMethodException,
                                               java.rmi.RemoteException
        Throws:
        MXException
        java.lang.NoSuchMethodException
        java.rmi.RemoteException
      • async_upload_changes

        public ReplyBuilder async_upload_changes(WebClientSession sess)
        This is called by the TreeGrid component, in the browser, when it has changes that it needs to sync with the server. This does not cause a "save" but rather, it simply sets the changes to be processed when a save happens.
        Parameters:
        sess -
        Returns:
      • populateErrorReply

        protected void populateErrorReply(ReplyBuilder reply,
                                          java.lang.Throwable e)
      • getDate

        protected java.util.Date getDate(com.ibm.json.java.JSONObject o,
                                         java.lang.String prop)
      • getTimeZone

        public java.util.TimeZone getTimeZone()
      • getBoolean

        protected java.lang.Boolean getBoolean(com.ibm.json.java.JSONObject o,
                                               java.lang.String prop)
      • getAppName

        public java.lang.String getAppName()
        Return the configure AppName for the Scheduler MiniApp, as configured in the presenation xml file
        Returns:
      • getTooltip

        public abstract DynamicTooltip getTooltip(WebClientSession sess,
                                                  java.lang.String projectid,
                                                  java.lang.String col,
                                                  java.lang.String id)
                                           throws MXException,
                                                  java.rmi.RemoteException,
                                                  java.lang.InterruptedException,
                                                  java.util.concurrent.ExecutionException
        Returns a Tooltip HTML for a given activity id
        Parameters:
        sess -
        projectid -
        col -
        id -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getTooltipForCPM

        public abstract DynamicTooltip getTooltipForCPM(WebClientSession sess,
                                                        java.lang.String projectid,
                                                        java.lang.String fromId,
                                                        java.lang.String toId)
                                                 throws MXException,
                                                        java.rmi.RemoteException,
                                                        java.lang.InterruptedException,
                                                        java.util.concurrent.ExecutionException
        Returns a Tooltip HTML for a given activity id's CPM
        Parameters:
        sess -
        projectid -
        fromid -
        toid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getTooltipForDate

        public abstract DynamicTooltip getTooltipForDate(WebClientSession sess,
                                                         java.lang.String projectid,
                                                         java.lang.String col,
                                                         java.lang.String id,
                                                         long date)
                                                  throws MXException,
                                                         java.rmi.RemoteException,
                                                         java.lang.InterruptedException,
                                                         java.util.concurrent.ExecutionException
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getTooltipForPoint

        public DynamicTooltip getTooltipForPoint(java.lang.String id,
                                                 int pointIndex)
                                          throws MXException,
                                                 java.rmi.RemoteException,
                                                 java.lang.InterruptedException,
                                                 java.util.concurrent.ExecutionException
        Parameters:
        id -
        pointIndex - Point Index in the GanttPoints for row id. Points start at index 0.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getProjectId

        protected java.lang.String getProjectId(com.ibm.json.java.JSONObject projectOptions)
        return the project id from the JSONObject options, or if null, then return the current project id.
        Parameters:
        projectOptions -
        Returns:
      • getProjectOptions

        protected com.ibm.json.java.JSONObject getProjectOptions(java.lang.String projectId)
        Creates a JSONObject project options with the given ID
        Parameters:
        projectId -
        Returns:
      • async_push_client_message

        public void async_push_client_message()
        This is a sample "handler" showing how you would push a message from the sever to the browser ui. The JavaScript in the browser would need to "subscribe()" to the message id that is used, which isn this case, is 'miniapp.scheduler.pushevent'. This ID can be any ID that you want to use, provided the JavaScript is subscribed to it.
        In JavaScript it would look like this..
         topic.subscribe("miniapp.scheduler.pushevent", function(data) {
            alert("GOT A PUSHED MESSAGE: " + data);
         });
         
      • sendEventToTreeGrid

        public void sendEventToTreeGrid(java.lang.String eventId,
                                        java.lang.String eventArg)
        Will push a Dojo topic with the given eventId as the topic and eventArg as the event message
        Parameters:
        eventId -
        eventArg -
      • getPresentationOptions

        public com.ibm.json.java.JSONObject getPresentationOptions()
        Returns the "options" attribute, parsed as JSON from the presentation element.
        Returns:
      • getOptions

        public java.util.Map getOptions()
        any options defined here, are passed to the contructor of the Dojo MiniApp control (child controls, such as GanttWidget, ResourceViewWidget,etc)
        Specified by:
        getOptions in interface HasOptions
      • isShowingWeather

        public boolean isShowingWeather()
                                 throws java.rmi.RemoteException,
                                        MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • addMessages

        protected void addMessages(com.ibm.json.java.JSONObject msgs)
        SubClasses can add additional messages for the client
        Parameters:
        msgs -
      • getContextMenuFor

        protected abstract TMenu getContextMenuFor(TMenu menu,
                                                   UserInfo userInfo,
                                                   java.lang.String projectId,
                                                   java.lang.String propName,
                                                   java.lang.String propValue,
                                                   java.lang.String[] ids)
                                            throws java.lang.Exception
        Given the parameters, return a TMenu (TreeGrid Menu) context menu.
        Parameters:
        menu -
        userInfo -
        projectId -
        propName -
        propValue -
        ids -
        Returns:
        Throws:
        java.lang.Exception
      • label

        public java.lang.String label(java.lang.String key)
      • label

        public java.lang.String label(java.lang.String key,
                                      java.lang.String def)
      • sortSKDAction

        public java.util.HashMap sortSKDAction(java.util.HashMap skdActivityActions,
                                               java.lang.String frame)
        Taken from scheduler applet... it sorts the SKDAction menu items
        Parameters:
        skdActivityActions -
        Returns:
      • appendCss

        public void appendCss(java.lang.StringBuilder sb,
                              java.lang.String key,
                              java.lang.String value)
      • getBaseImageUrl

        public java.lang.String getBaseImageUrl()
      • loadMiniAppResource

        public java.lang.String loadMiniAppResource(java.lang.String path)
      • getSchedulerProperties

        public java.util.Properties getSchedulerProperties()
                                                    throws java.io.IOException,
                                                           MXException
        Throws:
        java.io.IOException
        MXException
      • loadSchedulerProperties

        protected java.util.Properties loadSchedulerProperties()
                                                        throws java.io.IOException,
                                                               MXException
        Throws:
        java.io.IOException
        MXException
      • loadTemplate

        public java.lang.String loadTemplate(java.lang.String id)
                                      throws java.io.IOException,
                                             MXException
        Throws:
        java.io.IOException
        MXException
      • loadTooltip

        public java.lang.String loadTooltip(java.lang.String id)
                                     throws java.io.IOException,
                                            MXException
        Throws:
        java.io.IOException
        MXException
      • isAiviationLicensePresent

        public static boolean isAiviationLicensePresent(WebClientSession sess)
                                                 throws java.lang.Exception,
                                                        java.rmi.RemoteException
        Returns true, if the aviation license is present, otherwise false.
        Returns:
        boolean true, if acm license is present, otherwise false.
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • isAiviationMROLicensePresent

        public static boolean isAiviationMROLicensePresent(WebClientSession sess)
                                                    throws java.lang.Exception,
                                                           java.rmi.RemoteException
        Returns true, if the aviation license is present, otherwise false.
        Returns:
        boolean true, if acm license is present, otherwise false.
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • isLicensePresent

        public static boolean isLicensePresent(WebClientSession sess,
                                               java.lang.String lic)
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
        Throws:
        java.lang.Exception
        java.rmi.RemoteException
      • isLicensePresent

        public static boolean isLicensePresent(java.lang.String lic)
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
        Throws:
        java.lang.Exception
        java.rmi.RemoteException
      • resolveTemplate

        public java.lang.String resolveTemplate(java.lang.String templateName,
                                                MboRemote projectMbo)
        Description copied from interface: SKDTemplateResolver
        Return the complete template contents for the given template name
        Specified by:
        resolveTemplate in interface SKDTemplateResolver
        Returns:
      • setupBean

        public void setupBean(WebClientSession wcs)
        Description copied from class: DataBean
        This method must be call after the bean is instantiated. It tells the bean what it's clientSession is , the control that created the bean and the event that caused the creation of the bean. Also gets the values the orderyby, whereclause, apprestrictions, rowsperpage, and parentdatasrc properties from the control (the one that instantiated the bean) if any are set. Plus it gets the list of bound controls from the presentations control handler.
        Overrides:
        setupBean in class DataBean
      • initializeProjectData

        public void initializeProjectData()
      • createUIOptions

        protected UIOptions createUIOptions(java.lang.String projectId)
                                     throws MXException,
                                            java.io.IOException
        Create the UIOptions for the project
        Parameters:
        projectId -
        Returns:
        Throws:
        MXException
        java.io.IOException
      • getUIOptions

        protected UIOptions getUIOptions(java.lang.String projectId)
                                  throws java.io.IOException,
                                         MXException
        Get the UI Options/Hints for rendering TreeGrid
        Parameters:
        projectId -
        Returns:
        Throws:
        java.io.IOException
        MXException
      • refreshToolbarItems

        protected void refreshToolbarItems(UIOptions uiOptions2)
        This is called everytime getUIOptions is called, in case, bean needs to refresh the state of the options
        Parameters:
        uiOptions2 -
      • getUIOptions

        public UIOptions getUIOptions()
        Convenience method for getting options by defaulting the project id
        Returns:
      • addResourceDisplay

        protected void addResourceDisplay(UIOptions opts)
      • setSerializationHelper

        public void setSerializationHelper(MXSerializationHelper mxSerializationHelper)
      • clearSavedState

        public void clearSavedState()
      • getApplicationResource

        public java.lang.String getApplicationResource(java.lang.String path)
      • getShiftWorkPeriodInfoForDate

        public java.util.List getShiftWorkPeriodInfoForDate(IMXGanttModel sched,
                                                            java.util.Properties props,
                                                            java.util.Date d)
                                                     throws java.io.IOException
        Find Shift Info for a given date in the Schedule.
        Parameters:
        sched - Schedule
        props - Schedule Properties
        d - date in schedule
        Throws:
        java.io.IOException
      • getTooltipForDateInSchedule

        public DynamicTooltip getTooltipForDateInSchedule(IMXGanttModel schedule,
                                                          java.util.Properties props,
                                                          long date)
                                                   throws MXException,
                                                          java.rmi.RemoteException,
                                                          java.lang.InterruptedException,
                                                          java.util.concurrent.ExecutionException
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getActualStartEnd

        public abstract Range getActualStartEnd()
      • getCalculatedProjectMinMax

        public abstract Range getCalculatedProjectMinMax()
      • beanSupplier

        public Supplier beanSupplier()
      • uiOptionsSupplier

        public Supplier uiOptionsSupplier()
      • getShiftWorkPeriodInfoForDate

        public AbstractTreeGridMiniAppBean.ShiftInfo getShiftWorkPeriodInfoForDate(IMXGanttModel model,
                                                                                   java.util.Date d)
                                                                            throws java.io.IOException
        Returns the ShiftInfo for the given date in the model, if the model has shift information loaded. IF multiple Shifts overlapp, then only the first one is returned
        Parameters:
        gantt -
        model -
        Throws:
        java.io.IOException
      • getTooltip

        protected DynamicTooltip getTooltip(WebClientSession sess,
                                            IMXGanttModel model,
                                            java.lang.String col,
                                            java.lang.String id)
                                     throws MXException,
                                            java.rmi.RemoteException,
                                            java.lang.InterruptedException,
                                            java.util.concurrent.ExecutionException
        Load the Tooltip for the given Model and ID
        Parameters:
        sess -
        model -
        col -
        id -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • updateDateTimeProperty

        public void updateDateTimeProperty(java.lang.String prop,
                                           com.ibm.json.java.JSONObject obj,
                                           IMXActivity act)
      • updateStringProperty

        public void updateStringProperty(java.lang.String prop,
                                         com.ibm.json.java.JSONObject obj,
                                         IMXActivity act,
                                         boolean acceptEmptyString)
      • updateIntProperty

        public boolean updateIntProperty(java.lang.String prop,
                                         com.ibm.json.java.JSONObject obj,
                                         IMXActivity act)
        Updates the prop in obj to IMXActivity act object. Returns true if the value is actually updated.
        Parameters:
        prop -
        obj -
        act -
        Returns:
        if activity was updated
      • updateBooleanProperty

        public void updateBooleanProperty(java.lang.String prop,
                                          com.ibm.json.java.JSONObject obj,
                                          IMXActivity act)
      • CfgId

        public static java.lang.String CfgId(java.lang.String base)