psdi.webclient.components

Class BIMViewer

  • All Implemented Interfaces:
    java.lang.Cloneable, DataBeanListener


    public class BIMViewer
    extends BoundComponentInstance
    Component class to expose an API for integrating 3D BIM viewers with Maximo. The reference implementation is the Autodesk NavisWOrks ActiveX control
    PrefixUse
    eventCall from control jsp via JavaScript sentEvent function
    jspCall from control jsp to dynamically generate JavaScriptn
    jspCall from control jsp to dynamically generate JavaScriptn
    • Constructor Detail

      • BIMViewer

        public BIMViewer()
    • Method Detail

      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Description copied from class: BoundComponentInstance
        Needed to override this method to cache original values for data, readonly, required and applink
        Overrides:
        render in class BoundComponentInstance
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        See Also:
        ComponentInstance.render()
      • checkVisibility

        public int checkVisibility()
        Determine if the control is visible or on a tab that is hidden
        Returns:
      • eventSelect

        public int eventSelect()
                        throws java.rmi.RemoteException,
                               MXException
        Called from the viewer .jsp every time the selection is changed. The event parameter is string that is a ; delimited set of values. The first value in the list is the the location ID for the model. The second value is the currently selected item. The remaining members are the members of the selection set including the selected item
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • eventRezise

        public void eventRezise()
        Called from the .jsp when the user selects a new size for the control. The size is saved in the session so it persists across refreshes
      • eventReziseDlg

        public void eventReziseDlg()
        Called from the .jsp when the user selects a new size for the control and the control is displayed on a dialog. The size is saved in the session so it persists across refreshes
      • updateCurrentSelection

        protected void updateCurrentSelection(java.lang.String value)
      • jspGetMultiSelection

        public java.util.Set jspGetMultiSelection()
      • jspScript

        public java.lang.String jspScript(java.lang.String id)
                                   throws java.rmi.RemoteException,
                                          MXException
        Generate JavaScript to configure the current state of the control

        This method supports the following control states and changes between those states: - The entire control is either in its proper position on the screen or is "Stored" off the top of the screen - There is a model file for the current bound value and the active X control is displayed, or there is not and it is hidden and a message is displayed - If it is a partial refresh and the HTML does not need to be rerendered, then this code is executed inside a script tag in the hidden frame. IF it is run as part of rendering the control then it is run wint the control HTML in the MAINDOC - If it is a partial refresh, it may update the selected value, the both the model file and the selected value, or post a message to the status line

        Throws:
        java.rmi.RemoteException
        MXException
      • scriptResize

        public java.lang.String scriptResize()
      • jspGetScriptModelList

        public java.lang.String jspGetScriptModelList()
        Generate JavaScript to add all the models in _currentModelList to the ComboBox specified by listCtrlId
        Parameters:
        listCtrlId -
        Returns:
        JavaScript fragment
      • scriptFooter

        public java.lang.String scriptFooter()
      • jspGetRezieOption

        public int jspGetRezieOption()
        Retrieves a stored resize option from the HTTP session and makes it available to the .jsp. This version is used when the viewer is displayed on an application main tab
        Returns:
      • jspGetRezieDlgOption

        public int jspGetRezieDlgOption()
        Retrieves a stored resize option from the HTTP session and makes it available to the .jsp. This version is used when the viewer is displayed on an dialog
        Returns:
      • jspGetStatusUpdate

        public java.lang.String jspGetStatusUpdate()
        Provides an update to the control status line and resets hasStatusUpdate to false
        Returns:
        Test of status update
      • jspGetViewerTop

        public int jspGetViewerTop()
        If the control is displayed on a tab of an application, its really not on the tab, it at the bottom of the page below the tab set. This prevents reloading of the control and of control data as the use moved between tabs. To cause it to display correctly, the control class tracks which tab is visible and if the control should be displayed. If it should, top is set to a value on the tab if it shouldn't, top is set to a large negative value
        Returns:
      • jspHasStatusUpdate

        public boolean jspHasStatusUpdate()
        Indicates if there is a status message to display on the control Status line
        Returns:
        True if there is a status message
      • getAppType

        public int getAppType()
        Allows the .jsp to to application type specific processing including setting appopiate lable text
        Returns:
        The type of the applcation the controls is supporting
      • getBackgroundColor

        public java.lang.String getBackgroundColor()
      • getBoarderColor

        public java.lang.String getBoarderColor()
      • getForegroundColor

        public java.lang.String getForegroundColor()
      • getHighlightColor

        public java.lang.String getHighlightColor()
      • getBinding

        public java.lang.String getBinding()
      • getCurrentSelection

        public java.util.Set getCurrentSelection()
      • getHeight

        public int getHeight()
      • getMboKey

        public java.lang.String getMboKey()
        Get the key value for the bound Mbo: Location, assetnum, wonum
      • getLeftOffset

        public int getLeftOffset()
      • getLookupValue

        public java.lang.String getLookupValue()
      • getMxVersion

        public int getMxVersion()
      • getRecordType

        public int getRecordType()
        Allows the .jsp to do application type specific processing including setting appropriate label text
        Returns:
        The type of the application the controls is supporting
      • getSiteId

        public java.lang.String getSiteId()
      • getValue

        public java.lang.String getValue()
      • getViewerType

        public java.lang.String getViewerType()
      • getWidth

        public java.lang.String getWidth()
      • isForceUpdate

        public boolean isForceUpdate()
      • isHasMultiSelect

        public boolean isHasMultiSelect()
      • isModelListChanged

        public boolean isModelListChanged()
        Track if the list of models in the location hierarchy from the current asset of location up to the building has changed
        Returns:
      • isMultiSelectAllowed

        public boolean isMultiSelectAllowed()
        Determines if the user is allowed to select more than one item at a time
        Returns:
      • isSelectionValid

        public boolean isSelectionValid()
      • forceUpdate

        public void forceUpdate()
      • setModelListChanged

        public void setModelListChanged(boolean state)
      • isValueChanged

        public boolean isValueChanged()
        Track if the selected value is different form the currently selected value to allow optimization
      • setValueChanged

        public void setValueChanged(boolean state)
      • isControlVisible

        public boolean isControlVisible()
      • setControlVisible

        public void setControlVisible(boolean vis)
      • setMultiSelect

        public void setMultiSelect(java.lang.String modelLocation,
                                   java.util.Set selection)
                            throws java.rmi.RemoteException,
                                   MXException
        Parameters:
        selection - A set of items using the value bound to the control to display as the current selection in the control Called from dialogs that use the model as a display mechanism
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLeafLocation

        protected Location lookupLeafLocation()
                                       throws java.rmi.RemoteException,
                                              MXException
        Gets the starting location for search for a model file. If this is an asset the the location is the location attribute of the asset. If this is a location the the location is itself
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocation

        public LocationRemote lookupLocation(java.lang.String location)
                                      throws java.rmi.RemoteException,
                                             MXException
        Queries the database for a location record based on location and siteid attributes
        Parameters:
        location -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocationFromModelId

        public LocationRemote lookupLocationFromModelId(java.lang.String modelId)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Use the value of an item in the model to find the Maximo location for that item using the current dataattibute binding of the control Used by dialogs that include or are launched by the control
        Parameters:
        value - The value of the datafield bound to the control. Usually is modelid
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocationFromModelId

        public LocationRemote lookupLocationFromModelId(java.lang.String modelLocation,
                                                        java.lang.String modelId)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocationFromModelId

        public LocationRemote lookupLocationFromModelId(java.lang.String modelLocation,
                                                        java.lang.String modelId,
                                                        java.lang.String siteId)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Get the location from the bound value if the control is bound to either location of asset
        Parameters:
        location -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocationModelId

        public java.lang.String lookupLocationModelId(java.lang.String location,
                                                      java.lang.String siteId)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Looks up a location based on the datasrc for the control (Usually modelId)
        Parameters:
        location -
        siteId -
        Returns:
        The location field of the location associated with the imput value, or null
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocationFromWO

        public java.lang.String lookupLocationFromWO(java.lang.String woKey,
                                                     java.lang.String siteId)
        SQL Lookup of the location associated with a work order
        Parameters:
        woKey -
        siteId -
        Returns:
      • lookupModelsForLocation

        protected MboSetRemote lookupModelsForLocation(java.lang.String location)
                                                throws java.rmi.RemoteException,
                                                       MXException
        Get a building model definition associated with a location if one exists
        Parameters:
        location -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupUid

        protected long lookupUid(java.lang.String modelId)
                          throws java.rmi.RemoteException,
                                 MXException

        Get the UID for the Maximo record associated with the modelId

        Model IDs always refer t locations so if the control is bound to asset The asset at the location must be queried. It is assumed the operating locations are used and therefore there is no more than one asset at a location

        Parameters:
        locationId - The location for the model. Used to disambiguate the modelId
        modelId -
        siteId -
        Returns:
        Unique identifier for location or asset associated with a model ID
        Throws:
        MXException
        java.rmi.RemoteException
      • lookupLocations

        public static LocationSetRemote lookupLocations(MboRemote mbo,
                                                        java.lang.String location,
                                                        java.lang.String siteId)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Queries the database for a location record based on location and siteid attributes
        Parameters:
        location -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupLocation

        public static LocationRemote lookupLocation(MboRemote mbo,
                                                    java.lang.String location,
                                                    java.lang.String siteId)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Queries the database for a location record based on location and siteid attributes
        Parameters:
        location -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • lookupAssetsAtLocation

        public static MboSetRemote lookupAssetsAtLocation(MboRemote locationMbo)
        Get all the assets at the specified location
        Parameters:
        locationMbo -
        Returns:
        null or a set of assets