com.ibm.tivoli.maximo.skd.control

Class BaseViewerControl

    • Field Detail

      • APPLET_EVENT_NAME

        public static final java.lang.String APPLET_EVENT_NAME
        Name of the Event in this control that will handle dispatching events to the Applet "skdappletevent"
        See Also:
        Constant Field Values
      • APPLET_EVENT_TARGET_EVENT_NAME

        public static final java.lang.String APPLET_EVENT_TARGET_EVENT_NAME
        Key for Event.set/getParameter() that holds the applet event name "skdappletevent_targeteventname"
        See Also:
        Constant Field Values
      • ATTR_CLEAR_STATE

        public static final java.lang.String ATTR_CLEAR_STATE
        If present in the Session it will force the applet to clear state
        See Also:
        Constant Field Values
      • appletEventName

        protected java.lang.String appletEventName
      • appletEventData

        protected java.io.Serializable appletEventData
    • Constructor Detail

      • BaseViewerControl

        public BaseViewerControl()
    • Method Detail

      • skdappletevent

        public int skdappletevent()
        skdappletevent is a means for the server code to dispatch events to the applet, where the applet can choose to listen for specific events and respond to them accordingly. The Structore of an applet event will include an event parameter called 'skdappletevent_targeteventname' that will contain the name of the event to send to the applet. The event's getValue() will contain the payload. Since this has to cross javascript boundaries, the event data will be Serialized and then Base64 encoded when passed to the Applet. The applet will Base64 decode the message and unserialize the data before dispatching it to the event listeners. The Applet must define a method called handleServerEvent(String name, String base64data) as the entry point for handling the message.
        Returns:
        EVENT_HANDLED
      • getAppletEventName

        public java.lang.String getAppletEventName()
        Return the applet event name or null if there isn't a pending event
        Returns:
      • getEncodedAppletEventData

        public java.lang.String getEncodedAppletEventData()
        Returns the event data as Serialized data that is Base64 encoded and then URLEncoded to ensure that it can pass safely over javascript to the applet. The Applet will Url decode and Base64 the object stream and convert it into the Java object to be passed as the event args.
        Returns:
      • replaceSingleQuotes

        public static java.lang.String replaceSingleQuotes(java.lang.String replaceString)
        Replaces single quotes with two single quotes.
      • clearAppletEvent

        public void clearAppletEvent()
        Clear the pending event data.
      • hasAppletEvent

        public boolean hasAppletEvent()
        Returns true if there is a pending event that the renderer needs to send to the applet
        Returns:
      • needToRefreshProjectData

        public boolean needToRefreshProjectData()
      • structureChangedEvent

        public void structureChangedEvent(DataBean speaker)
        Overridden to capture structureChangedEvent The applet must render with a delay
        Specified by:
        structureChangedEvent in interface DataBeanListener
      • initialize

        public void initialize()
        Description copied from class: BaseInstance
        should be extended to do any setup required by the instance. for example, the DatasrcInstance will call initialize to create data sources found in the bind list.
        Overrides:
        initialize in class ControlInstance
      • getAppletVisible

        public boolean getAppletVisible()
        Returns true if applet is visible
        Returns:
        boolean
      • setAppletVisible

        public void setAppletVisible(boolean vis)
        Sets applet visible state
        Parameters:
        vis - boolean
      • getRefreshVisibility

        public boolean getRefreshVisibility()
        Returns true if visibility needs to be refreshed.
        Returns:
        boolean
      • setRefreshVisibility

        public void setRefreshVisibility(boolean vis)
        Sets refresh visibility flag.
        Parameters:
        vis - boolean
      • showerror

        public int showerror()
        Fetches the MXException from the current event and shows error message box If the value is string then it merely store its and marks controls changed.
        Returns:
        WebClientBean.EVENT_HANDLED
      • checkVisibility

        public int checkVisibility()
        Set visibility for control's applet component if the current tab is Gannt Viewer.
        Returns:
        WebClientBean.EVENT_HANDLED
      • acceptselect

        public int acceptselect()
        Sets cursor and marks control as changed
        Returns:
        WebClientBean.EVENT_HANDLED
      • getError

        public java.lang.String getError()
        Returns error
        Returns:
        String
      • setError

        public void setError(java.lang.String error)
        Sets error string
        Parameters:
        error - as String
      • getProcessId

        public java.lang.String getProcessId()
        Gets process Id
        Returns:
        String
      • setProcessId

        public void setProcessId(java.lang.String processId)
        Sets process id
        Parameters:
        processId -
      • updateapplet

        public int updateapplet()
        General use event handler to handle whenever we need to refresh the applet data; kind of replaces the 'refresh' event from MXES.
        Returns:
        WebClientBean.EVENT_HANDLED
      • isSetCursor

        public boolean isSetCursor()
        Returns cursor flag
        Returns:
        true if cursor is set
      • setSetCursor

        public void setSetCursor(boolean setCursor)
        Sets cursor flag
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Important method. Called before components jsp is called. Applets visibility is checked.
        Overrides:
        render in class DatasrcInstance
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • applyfilter

        public int applyfilter()
        Called when fine or cancel button is clicked on filter dialog.
      • setApplyFilter

        public void setApplyFilter(boolean newVal)
        Called after setQBE called on applet
      • isfilterapplied

        public boolean isfilterapplied()
        Applets filter applied or not is checked.
      • applyconstraint

        public int applyconstraint()
        Called after edit constraint called on applet
      • setConstraintEdited

        public void setConstraintEdited(boolean newVal)
        Called after edit constraint called on applet
      • wasConstraintEdited

        public boolean wasConstraintEdited()
        Applets edit constraint applied or not is checked.
      • toBeSaved

        public boolean toBeSaved()
        Returns true if the underlying databean requires a save
        Returns:
      • hasClearState

        public boolean hasClearState()
        Returns true if the applet should forcefully clear it's applet state.
        Returns: