psdi.webclient.system.controller

Class ControlInstance

    • Field Detail

      • PARAM_PARENTCOMPONENT

        public static final java.lang.String PARAM_PARENTCOMPONENT
        See Also:
        Constant Field Values
      • PARAM_PARENTCONTROL

        public static final java.lang.String PARAM_PARENTCONTROL
        See Also:
        Constant Field Values
      • PARAM_PRESENTATION

        public static final java.lang.String PARAM_PRESENTATION
        See Also:
        Constant Field Values
      • PARAM_TABGROUP_MAIN

        public static final java.lang.String PARAM_TABGROUP_MAIN
        See Also:
        Constant Field Values
      • PARAM_APPTABTYPE

        public static final java.lang.String PARAM_APPTABTYPE
        See Also:
        Constant Field Values
      • PARAM_DESIGNMODE

        public static final java.lang.String PARAM_DESIGNMODE
        See Also:
        Constant Field Values
      • PARAM_SCREENREADER

        public static final java.lang.String PARAM_SCREENREADER
        See Also:
        Constant Field Values
      • PARAM_VERTICALLABEL

        public static final java.lang.String PARAM_VERTICALLABEL
        See Also:
        Constant Field Values
      • RERENDER_PROPERTY

        public static final java.lang.String RERENDER_PROPERTY
        See Also:
        Constant Field Values
      • LOG_CATEGORY

        protected static final Category LOG_CATEGORY
      • labelParams

        protected java.util.Map labelParams
      • labelOverride

        public java.lang.String labelOverride
      • amIinitialize

        public boolean amIinitialize
      • errorsValidated

        protected boolean errorsValidated
      • errorChanged

        protected boolean errorChanged
      • errorLevel

        protected int errorLevel
    • Constructor Detail

      • ControlInstance

        public ControlInstance()
    • Method Detail

      • getAdaptorInstance

        public ControlHandler getAdaptorInstance()
        Deprecated. 
      • getElement

        public org.w3c.dom.Element getElement()
        Returns:
        Returns the element.
      • 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 BaseInstance
      • parseParamvalues

        public java.util.Map parseParamvalues()
        Builds a map of the dynamic parameters for this control. These parameters are used during the rendering of this control to set its property "label". The method is public because two controls (as a legacy from MXES): table and section, use the paramvalues of their child sectionheader to set their own label.
        See Also:
        Table.initialize(), Section.initialize()
      • setElement

        public void setElement(org.w3c.dom.Element element)
        Parameters:
        element - The element to set.
      • getProperty

        public java.lang.String getProperty(java.lang.String key,
                                            java.lang.String defaultValue)
        Deprecated. FIREFOX
        TO REPLACE: Depending on the circumstances, either deal in the calling code with a value that sets WebClientRuntime.isNull(String) to true or define a default value in the control or component registry as appropriate
        Parameters:
        key -
        defaultValue -
        Returns:
        the property, or the default if not found or if it is found empty
      • getPropertyIgnoreFlags

        public java.lang.String getPropertyIgnoreFlags(java.lang.String key)
        Return the value of the property for the instance or it's descriptor only. This method ignores property's flags, so it the property is global, it won't get the value from it's parent control. Translated is also ignored.
        Parameters:
        key -
        Returns:
        String - the value of the property
      • getProperty

        public java.lang.String getProperty(java.lang.String key)
        Change get properties method: get descriptor's property, if not there throw InvalidPropertyException (print stack trace) if the property is in the control's properties, return it if it's null (not returned from the control) and the descriptor property is global, ask parent if parent != null
        Overrides:
        getProperty in class BaseInstance
        Returns:
        the property, or null if key is not found or if it is found empty
      • findProperty

        @TraceDisabled
        public java.lang.String findProperty(java.lang.String key)
      • setConditionalProperties

        protected void setConditionalProperties(java.util.HashMap newProperties)
        Takes a HashMap of properties to be set on the instance. These properties are considered conditional properties, which means any conditional property that was set previously and not in the list passed in, will be removed from the instance so the default property will be used. (By default meaning, what's set in the descriptor or if the property is global, the parent's value.)
      • setPropertyUncle

        public ControlInstance setPropertyUncle(ControlInstance newUncle)
        Change the control that is used to get inherited properties
        Parameters:
        new - Uncle the new source for inherited properties
        Returns:
        the old value, or null
      • registerDesignerEditedProperty

        public void registerDesignerEditedProperty(java.lang.String propName)
        Register a property to be persisted in the database. This method is expected to be called only from the application designer
      • isDesignerEditedProperty

        public boolean isDesignerEditedProperty(java.lang.String propName)
        Returns:
        true if the property has been registered through registerDesignerEditedProperty
      • isPersistentProperty

        public boolean isPersistentProperty(java.lang.String propName)
        Returns:
        true if the property is to be persisted in the database: either when it comes from the source presentation or has been registered through registerDesignerEditedProperty
      • errorLevelChanged

        public boolean errorLevelChanged()
      • hasChanged

        public boolean hasChanged()
      • setChangedFlag

        public void setChangedFlag()
      • setChangedFlag

        public void setChangedFlag(boolean flag)
      • getComponents

        public java.util.List getComponents()
        Returns:
        Returns the topComponent.
      • addComponent

        public void addComponent(ComponentInstance component)
        Parameters:
        topComponent - The topComponent to set.
      • hasSigOptionAccess

        protected boolean hasSigOptionAccess(java.lang.String sigoption,
                                             DataBean dataBean,
                                             int row)
                                      throws java.rmi.RemoteException,
                                             MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • sigOptionCheck

        protected void sigOptionCheck()
        Checks to see if the control's sigoption property is set. If it is, then access is checked for the sigoption. If the user desn't have access then the control's visibility is set to false, and inputmode changed to masked. The the user has privileges for the sigoption, then the method looks to see if there are any conditional properties associated with the sigoption and sets them on it's instance.
      • clearFlags

        protected void clearFlags()
      • reInitialize

        public void reInitialize()
      • preRender

        public boolean preRender()
      • preRenderChecks

        public void preRenderChecks()
      • render

        public int render()
                   throws java.lang.NoSuchMethodException,
                          java.lang.IllegalAccessException,
                          java.lang.reflect.InvocationTargetException
        Render this control's components
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • eventCheck

        public void eventCheck()
        Checks to see if the control has an mxevent and if the user has access to it. If not, the control is disabled. Otherwise the control is enabled.
      • setDisabled

        public void setDisabled(boolean disabled)
        Sets whether or not the instance is disabled. Each control or component will handle being disabled in it's own way.
        Parameters:
        disabled - - true: disabled, false (default) not disabled
      • hasChildElements

        public boolean hasChildElements()
        (called by the component jsps)
      • handleEvent

        public int handleEvent(WebClientEvent event)
                        throws java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
        processes an event on this control instance. if the control has a method matching the event, the method is called and processing is complete. if the method does not exist on the control, the control calls the method on the component instance that matches the id given by event.getTarget()... this is the component that the event was originally targeted for.
        Overrides:
        handleEvent in class BaseInstance
        Returns:
        int return value @see WebClientBean
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • broadcastEvent

        public int broadcastEvent(WebClientEvent event)
        Broadcast an event down through the entire control/component hierarchy starting with this control. Continue broadcasting event to child controls and components as long as nobody says to stop, by returning a status of EVENT_STOP_ALL
      • getComponent

        public ComponentInstance getComponent(java.lang.String id)
        Look in the pages in the page stack for a component instance with the given id.
        Parameters:
        id - - Id of the component to be found
        Returns:
        ComponentInstance object found on one of the page instances.
      • renderChildren

        public void renderChildren()
                            throws java.lang.NoSuchMethodException,
                                   java.lang.IllegalAccessException,
                                   java.lang.reflect.InvocationTargetException
        this method renders the children (called by the component jsps)
        Throws:
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • setNeedsRender

        public void setNeedsRender(boolean needsRender)
      • needsRender

        public boolean needsRender()
      • setFocus

        public void setFocus()
        Allows programmatic setting of focus item. This gets set as the focuscontainer and the first component within that has takesfocs="true" and is not readonly will receive focus.
      • setFocus

        public void setFocus(java.lang.String id)
      • setFocusTable

        public void setFocusTable()
      • clearComponent

        public void clearComponent()
      • copy

        public java.lang.Object copy(java.lang.String newId)
      • getDesignerProperty

        public java.lang.String getDesignerProperty(java.lang.String key,
                                                    org.w3c.dom.Element el)
      • findDesignerProperty

        public java.lang.String findDesignerProperty(java.lang.String key,
                                                     org.w3c.dom.Element el)
      • setTableControl

        public void setTableControl(Table table)
      • getTableControl

        public Table getTableControl()
      • setOnTableRow

        public void setOnTableRow()
      • setOnTableFilterRow

        public void setOnTableFilterRow()
      • isOnTableFilterRow

        public boolean isOnTableFilterRow()
      • setOnTableTitleRow

        public void setOnTableTitleRow()
      • isOnTableTitleRow

        public boolean isOnTableTitleRow()
      • isSelected

        public boolean isSelected()
      • setSelected

        public void setSelected(boolean selected)
      • isVisible

        public boolean isVisible()
        Description copied from class: BaseInstance
        Return whether or not the instance is visible or not (Whether or not it should be shown) Each control or component will handle visibility in it's own way.
        Overrides:
        isVisible in class BaseInstance
        Returns:
        true - visible, false - not visible
      • hasVisibleChildren

        public boolean hasVisibleChildren()
      • isFirstChildVisible

        public boolean isFirstChildVisible()
      • launchexternal

        public int launchexternal()
      • propertyChanged

        protected void propertyChanged(java.lang.String property)
        Propagates the property changed to the child controls
        Overrides:
        propertyChanged in class BaseInstance
        Parameters:
        property - - the property that was changed
        See Also:
        propertyChanged
      • isMasked

        public boolean isMasked()
      • isDisabled

        public boolean isDisabled()
      • setVisibility

        public void setVisibility(boolean visible)
      • hasMaskedChanged

        public boolean hasMaskedChanged()
      • setGeneratedControl

        public void setGeneratedControl(ControlInstance generated)
        Sets original control (defined in XML) used to clone this one.
        Parameters:
        original -
      • getGeneratedControl

        public ControlInstance getGeneratedControl()
        Returns original control (defined in XML) used to clone this one.
        Parameters:
        original -
      • setOriginalControl

        public void setOriginalControl(ControlInstance original)
        Sets original control (defined in XML) used to clone this one.
        Parameters:
        original -
      • getOriginalControl

        public ControlInstance getOriginalControl()
        Returns original control (defined in XML) used to clone this one.
        Parameters:
        original -
      • setDesignerSelected

        public ControlInstance setDesignerSelected(boolean selected)
        Sets whether this control is selected in the app designer
        Parameters:
        selected - - boolean
      • getDesignerSelected

        public boolean getDesignerSelected()
        Is this control selected in the app designer
        Returns:
        boolean - selected
      • getDesignerSelectedControl

        public ControlInstance getDesignerSelectedControl()
      • canInsert

        public boolean canInsert(ControlInstance newControl)
        Can this control have the new control inserted Extend this method if a control has rules for whether or not it can have a new control inserted into it
        Parameters:
        - - New Control to insert
        Returns:
        - boolean
      • canInsert

        public boolean canInsert()
      • canRemove

        public boolean canRemove()
        Can the control be removed Extend this method if a control has rules for whether or not it can be removed
        Returns:
        - boolean
      • getDescriptorControl

        public ControlInstance getDescriptorControl()
        Used to override in a control that must use a generated control for source and target. This allows the control to return a valid control from the descriptor
        Returns:
        this control
      • instantiatedatasrc

        public void instantiatedatasrc()
      • isReInitialize

        public boolean isReInitialize()
        Should the control reInitialize before it's next render
        Returns:
        the reInitialize
      • setReInitialize

        public void setReInitialize(boolean reInitialize)
        Sets the control to reInitialize before it's next render
        Parameters:
        reInitialize - the reInitialize to set
      • isGenerated

        public boolean isGenerated()
        Was this control created via the createRuntimeControlInstance method?
        Returns:
        the generated
      • setGenerated

        public void setGenerated(boolean generated)
        Marks this control as being created via the createRuntimeControlInstance method
        Parameters:
        generated - the generated to set
      • getSkipPreRender

        public boolean getSkipPreRender()
      • setSkipPreRender

        public void setSkipPreRender(boolean skip)
      • resolveParams

        public java.lang.String resolveParams(java.lang.String value)
        Replace all {} params in the string and mark this as alwaysrefresh=true We support the following
        • label="{DATAATTRIBUTE}{DATAATTRIBUTE}"
        • label="{DATAATTRIBUTE}"
        • label="{SYSTEM_PARAM}"
        • label="{C_DATA}"

          but not a nested one label="{SOMETEXT {DATAATTRIBUTE}}"
        Parameters:
        value -
        Returns:
      • resolveParam

        public java.lang.String resolveParam(java.lang.String param)
        Resolves system level parameters as well as calling userinfo methods to get specific user information If the param resolves to one of the system properties, return it. If the param starts with 'userinfo.' get the rest of the param and attempt to call it as a method on userInfo If the param is still not resolved, call getProperty(param)
      • walkForId

        public java.lang.String walkForId(java.lang.String baseType)
      • walkForId

        public java.lang.String walkForId(java.lang.String baseType,
                                          java.lang.String prop,
                                          java.lang.String proValue)
      • quickinsert

        public int quickinsert()
        This event translates the event quickinsert to changeapp and - critically - adds the request parameter additionalevent with a value "insert".
      • isToBeDisplayedOnCurrentTab

        public boolean isToBeDisplayedOnCurrentTab(java.lang.String tabDisplay)
        Currently used by toolbar menu buttons and action dropdown menu entries. Compares the passed in display tab to the control's page
        Returns:
      • isToBeDisplayedOnTab

        public static boolean isToBeDisplayedOnTab(java.lang.String tabToCheck,
                                                   java.lang.String tabDisplay)
      • setBoundComponent

        public void setBoundComponent(BoundComponentInstance boundComponent)
        If set the boundComponent is checked to see if there is field level data restriction on the attribute the component is bound to. If there is and the attribute is hidden then the control will be hidden. There can only be one bound component check per control (even if there are more than one bound components), so is the component is already set, the call is ignored.
        Parameters:
        boundComponent -
      • getBoundComponent

        public BoundComponentInstance getBoundComponent()
        Retuens the BoundComponentInstance the control uses to do a field level data restriction check.
        Returns:
        BoundComponentInstance
      • setReRenderFlags

        public void setReRenderFlags()
      • getProperties

        public ControlProperties getProperties()
        Deprecated. call getProperty(String) instead
        Returns:
        a wrapper around properties to ensure typecasting works
      • licenseCheck

        protected boolean licenseCheck()
      • getDataSource

        public java.lang.String getDataSource()
      • resetDataSource

        public void resetDataSource(java.lang.String value)
      • getDataBean

        public DataBean getDataBean()
        Return the databean that is defined by the control's datasrc property. Will return null is datasrc property is null or the datasrc/databean isn't instantiated within the control's AppInstance.
        Returns:
      • setIncluded

        public void setIncluded()
      • setIncluded

        public void setIncluded(boolean included)
      • isIncluded

        public boolean isIncluded()
      • isHiddenByLicense

        public boolean isHiddenByLicense()
      • parentPropertyChanged

        protected void parentPropertyChanged(java.lang.String property)
        Called by the parent instance to this BaseInstance telling that one of it's properties has changed. This method will check to see if the "child" instance has that property in it's descriptor and marked as a global property. If it is then this "child" instance will add the property to it's changed property list.
        Parameters:
        property - - The parent instance property that has changed.
      • determineErrorLevel

        protected int determineErrorLevel()
      • getErrorLevel

        public int getErrorLevel()
        Checks to see if the control has any child errors and returns the most severe error.
        Returns:
      • clearErrors

        public void clearErrors()
      • childHasErrorFocus

        public void childHasErrorFocus()
        Notifies the parent control that a child has focus due to focuing on a field with an error. Bubbles up the call to parent control so if the control is a container it may need to do something to insure the child is visible (for example a collapsed section will need to expand)
      • setErrorFocusOnControl

        public void setErrorFocusOnControl(UIERMBoundControl ermControl,
                                           int mboIndex)
      • hasChangedConditionally

        public boolean hasChangedConditionally(java.lang.String property)
        Returns true if the property's value has been changed by conditional IU during the current call to render
      • stopRender

        public boolean stopRender()
        This method checks to see if the parent control is visible or not. If not it returns false preventing the control from rendering itself. Always returns true if the control in in the table filter row.
        Returns:
      • setPropertyOriginator

        public void setPropertyOriginator(ControlInstance control)
      • getTakesValueComponent

        public BoundComponentInstance getTakesValueComponent(java.lang.String attribute)
        Returns the BoundComponentInstance that is bound to the passed in attribute and has has the takesvalue property set to true. If there is only one component in the list that component is returned regardless of the attribute passed in (which should match anyway). This can return null if there are not "registered" takesvalue components or there is more than on registered component and the passed in attribute is null or doesn't match the the dataattribute property of any of the takesvalue components
      • findComponentByDescriptorId

        public ComponentInstance findComponentByDescriptorId(java.lang.String componentId)
        This method searches this control's components and returns the ComponentInstance whose descriptor id matches passed in id. The descriptor id is different than the instance id because typically the the instance id will have the control's id included in it. The descriptor id is the qualified id as defined in the control-registry component definition for the control. This method will not search child controls for the component. It only searches for components created by this control.
      • findUseForLablledByComponent

        public ComponentInstance findUseForLablledByComponent()
      • getRecordHover

        public org.w3c.dom.Element getRecordHover()
      • isMainrecActionMenu

        public boolean isMainrecActionMenu()
        Returns true if this control is the Tool Bar Action Menu or the Navigation Menu.
        See Also:
        psdi.webclient.controls.ToolbarCombobox.isMainrecActionMenu, psdi.webclient.system.controller.AppInstance.isMainrecActionMenu
      • createRenderId

        public java.lang.String createRenderId(java.lang.String id,
                                               PageInstance page)
      • isFocusable

        public boolean isFocusable()
      • setFocusable

        public void setFocusable(boolean focusable)
      • getConditonallyChanged

        public java.util.ArrayList getConditonallyChanged()
      • sigOptionCheckForLookups

        public void sigOptionCheckForLookups()
        IJ34793: Conditional properties are set to the last row rendered, so when a table is first rendered the conditional properties on row 0 are not set correctly. To fix this, this public method has been created to access the protected sigOptionCheck() method in order to set the conditional properties.