com.ibm.tivoli.maximo.miniapps.scheduler

Class BaseTreeGridMiniAppBean

    • Field Detail

      • ONE_HOUR_IN_MILLISECONDS

        protected static final int ONE_HOUR_IN_MILLISECONDS
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseTreeGridMiniAppBean

        public BaseTreeGridMiniAppBean()
    • Method Detail

      • 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
        Overrides:
        onReset in class AbstractTreeGridMiniAppBean
      • 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.
        Overrides:
        async_get_table_context_menu in class AbstractTreeGridMiniAppBean
        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,
                                                            com.ibm.json.java.JSONObject selection)
                                                     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 - - menu id
        value - - menu value
        values - - json string array of object unique ids
        selection - - the original selection that was used when this menu item was created
        Throws:
        MXException
        java.rmi.RemoteException
      • getGanttConfigInfo

        public GanttConfigInfo getGanttConfigInfo(WebClientSession sess,
                                                  java.lang.String appName,
                                                  java.lang.String projectId)
                                           throws java.lang.Exception
        Fetches the GanttConfigInfo for the for the given projectid
        Parameters:
        sess -
        appName -
        projectId -
        Returns:
        Throws:
        java.lang.Exception
      • 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.
        Overrides:
        async_upload_changes in class AbstractTreeGridMiniAppBean
        Parameters:
        sess -
        Returns:
      • processMove

        protected void processMove(java.util.concurrent.Future modelFuture,
                                   com.ibm.json.java.JSONObject change,
                                   WebClientSession sess,
                                   ReplyBuilder reply)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • processChange

        public abstract void processChange(java.util.concurrent.Future model,
                                           com.ibm.json.java.JSONObject change,
                                           WebClientSession sess,
                                           ReplyBuilder reply)
                                    throws java.lang.Exception
        Will be called for each change in the changes model
        Parameters:
        model -
        change -
        sess -
        Throws:
        java.lang.Exception
      • updateStartEndTimes

        public int updateStartEndTimes(java.util.concurrent.Future model,
                                       com.ibm.json.java.JSONObject change,
                                       WebClientSession sess,
                                       MXActivity mxa)
                                throws java.lang.Exception
        Start and End times need to be updated at the same time, or else ILOG will grow or shrink the activity bar when setting the start/end times separately.
        Parameters:
        change -
        mxa -
        Returns:
        -1 on error, or 0 meaning nothing updated, or 1 start updated, 2 is end updated, 3 is both updated
        Throws:
        java.lang.Exception
      • updateDuration

        public void updateDuration(MXGanttModel model,
                                   java.util.Date oldStartTime,
                                   java.util.Date oldEndTime,
                                   java.util.Date newStartTime,
                                   java.util.Date newEndTime,
                                   MXActivity mxa)
                            throws java.lang.Exception
        Start and End times need to be updated at the same time, or else ILOG will grow or shrink the activity bar when setting the start/end times separately.
        Parameters:
        change -
        mxa -
        Throws:
        java.lang.Exception
      • loadSKDUIInfo

        public SKDUIInfo loadSKDUIInfo()
                                throws MXException,
                                       java.io.IOException
        Deprecated. This was moved to the base class, we should remove it here at some point
        Load the Scheduler UI Info data for the given application.
        Overrides:
        loadSKDUIInfo in class AbstractTreeGridMiniAppBean
        Parameters:
        sess -
        appName -
        Returns:
        Throws:
        MXException
        java.io.IOException
      • getTooltip

        public 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
        Specified by:
        getTooltip in class AbstractTreeGridMiniAppBean
        Parameters:
        sess -
        projectid -
        col -
        id -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • getTooltipForCPM

        public 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
        Specified by:
        getTooltipForCPM in class AbstractTreeGridMiniAppBean
        Parameters:
        sess -
        projectid -
        fromid -
        toid -
        Returns:
        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
        Overrides:
        getTooltipForPoint in class AbstractTreeGridMiniAppBean
        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
      • loadProject

        public java.util.concurrent.Future loadProject(com.ibm.json.java.JSONObject projectOptions)
                                                throws java.rmi.RemoteException,
                                                       MXException
        Returns a Future for the given Gantt Model. The model will be loading, and a call to .get() will block until the model is fully loaded. Multiple threads can call .get() and each will block until the model is loaded. Using a future enables us to not have to worry about the order of Model requests from the Browser, since they all block, until the Model is fully loaded.
        Parameters:
        projectOptions - JSONObject of parameters to pass the model. Can be null.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getProject

        protected MXGanttModel getProject()
        Convience method that calls through the load project to get the current project. This should only be called if you KNOW the project has already been loaded
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • getContextMenuFor

        protected 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.
        Specified by:
        getContextMenuFor in class AbstractTreeGridMiniAppBean
        Parameters:
        menu -
        userInfo -
        projectId -
        propName -
        propValue -
        ids -
        Returns:
        Throws:
        java.lang.Exception
      • getActivitites

        public java.util.List getActivitites(java.lang.String[] ids,
                                             java.util.concurrent.Future model)
                                      throws java.lang.Exception
        Retuns are list of MXActivity objects for a given array of IDs.
        Parameters:
        ids -
        model -
        Returns:
        Throws:
        java.lang.Exception
      • addActionMenuItems

        public void addActionMenuItems(TMenu popupmenu,
                                       java.lang.String[] selectedactivitys,
                                       java.util.concurrent.Future modelFutre,
                                       IMXActivityPropertyInfo actproptinfo,
                                       java.lang.String projectId,
                                       java.lang.String propName,
                                       java.lang.String propValue,
                                       java.lang.String frame)
                                throws java.lang.Exception
        Adds SKDAction items to the TMenu.
        Throws:
        java.lang.Exception
        java.lang.InterruptedException
      • isLocked

        public boolean isLocked(MXActivity activity)
      • isResourceLocked

        public boolean isResourceLocked(MXActivity activity)
      • addModelChange

        public void addModelChange(MXGanttModel model,
                                   MXActivity currentActivity,
                                   WebClientSession session)
                            throws java.rmi.RemoteException,
                                   java.lang.Exception
        Throws:
        java.rmi.RemoteException
        java.lang.Exception
      • addModelChange

        public void addModelChange(MXGanttModel model,
                                   com.ibm.json.java.JSONObject obj,
                                   MXActivity currentActivity,
                                   WebClientSession session)
                            throws java.rmi.RemoteException,
                                   java.lang.Exception
        Throws:
        java.rmi.RemoteException
        java.lang.Exception
      • addGotoToolbarOptions

        public void addGotoToolbarOptions(UIOptions opts)
      • addZoomToToolbarOptions

        public void addZoomToToolbarOptions(UIOptions opts)
      • addLockDurationIcon

        public void addLockDurationIcon(UIOptions opts,
                                        boolean create)
      • addLockResourceIcon

        public void addLockResourceIcon(UIOptions opts,
                                        boolean create)
      • addFixUI

        public void addFixUI(UIOptions opts)
      • 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 AbstractTreeGridMiniAppBean
      • refreshToolbarItems

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

        public boolean canNotAssignTo(java.lang.String assignaction,
                                      MXActivity act,
                                      java.lang.String[] selectedactivitys,
                                      MXGanttModel model)
        Check if assign labr or crew for selected rows
        Parameters:
        activity -
        Returns:
      • addLockScheduleIcon

        public void addLockScheduleIcon(UIOptions opts,
                                        boolean create)