Class AbstractPreferencesTransform

    • Field Detail

      • LEVEL_PREFERENCES

        public static final int LEVEL_PREFERENCES
        Allowed value for the levelFlag formal parameter. Specifies that the transform will display the preferences section.
        Value = 1
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • LEVEL_APPLY

        public static final int LEVEL_APPLY
        Allowed value for the levelFlag formal parameter. Specifies that the transform will display the apply button.
        Value = 2
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • LEVEL_APPLY_TO

        public static final int LEVEL_APPLY_TO
        Allowed value for the levelFlag formal parameter. Specifies that the transform will display the apply to select box.
        If missing the preferences will be saved to the current project only.
        Value = 4
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • LEVEL_LOAD_DEFAULTS

        public static final int LEVEL_LOAD_DEFAULTS
        Allowed value for the levelFlag formal parameter. Specifies that the transform will display the Load Defaults button.
        Value = 8
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • LEVEL_FORM

        public static final int LEVEL_FORM
        Allowed value for the levelFlag formal parameter. Specifies that the transform will render a form tag surrounding the whole output.
        Value = 8
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • LEVEL_ALL

        public static final int LEVEL_ALL
        Allowed value for the levelFlag formal parameter. Convenience flag to indicate all possible LEVEL values.
        Value = 16777215
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • levelFlag

        public FormalParameter levelFlag
        Indicates the level of information to use when displaying the preferences bean.
        The information include the preferences section, the apply to select box and the load defaults button Default value is LEVEL_ALL
        Since:
        MicroStrategy Web 8.0.0
      • upperLeftCornerImage

        public FormalParameter upperLeftCornerImage
        Deprecated.
        This image is no longer required, the header of the preferences page is defined with css styles
        Specifies the image for the upper left corner of the preferences' frame.
        Allowed Values:
        The value to indicate should be a valid image file name, with any necessary path information not included already on the Usage:
        This may be changed to change the look and feel (i.e. color) of the preferences page.
      • upperRightCornerImage

        public FormalParameter upperRightCornerImage
        Deprecated.
        This image is no longer required, the header of the preferences page is defined with css styles
        Specifies the image for the upper right corner of the preferences' frame.
        Allowed Values:
        The value to indicate should be a valid image file name, with any necessary path information not included already on the Usage:
        This may be changed to change the look and feel (i.e. color) of all preferences pages.
      • formID

        public FormalParameter formID
        Specifies the ID to use for the preferences' HTML Form.
        Allowed Values:
        Any string allowed in an ID tag of an HTML form.
        Usage:
        This may be changed to execute some Javascript that needs to make reference to the preferences form with a specific name.
      • FP_LEVEL_FLAG

        public static final java.lang.String FP_LEVEL_FLAG
        Constant specifying the name of the formal parameter for defining the level flag. Value is levelFlag.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • FP_UPPER_RIGHT_CORNER_IMAGE

        public static final java.lang.String FP_UPPER_RIGHT_CORNER_IMAGE
        Constant specifying the image for the upper right corner of the preferences.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • FP_UPPER_LEFT_CORNER_IMAGE

        public static final java.lang.String FP_UPPER_LEFT_CORNER_IMAGE
        Constant specifying the image for the upper left corner of the preferences.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • FP_FORM_ID

        public static final java.lang.String FP_FORM_ID
        Constant specifying the ID to use for the preferences's HTML Form.
        Since:
        MicroStrategy Web 8.0.0
        See Also:
        Constant Field Values
      • _upperLeftCornerImage

        protected java.lang.String _upperLeftCornerImage
        Deprecated.
        The formal parameter associated with this property has been deprecated.
      • _upperRightCornerImage

        protected java.lang.String _upperRightCornerImage
        Deprecated.
        The formal parameter associated with this property has been deprecated.
    • Constructor Detail

      • AbstractPreferencesTransform

        public AbstractPreferencesTransform()
        Default empty constructor. Initialize formal parameters.
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Returns the textual description of the transform
        Specified by:
        getDescription in interface Transform
        Returns:
        the textual description of the transform
      • initializeTransform

        public void initializeTransform​(Transformable data)
        Description copied from class: AbstractAppTransform

        This method initialize the private and protected fields of the transform, such as width and height. It also invokes the initializeWebComponent, initializeImages and initializeCss methods.

        This method is automatically called from the transform method. Transforms which would like to invoke other methods in this instance directly (for example, to invoke some render methods), need first to call this method to guarantee that the Transform is ready to generate output.
        Specified by:
        initializeTransform in interface AppTransform
        Overrides:
        initializeTransform in class AbstractAppTransform
        Parameters:
        data - the bean to transform.
      • renderUpdateConfirmation

        public void renderUpdateConfirmation​(MarkupOutput out)
        Render a confirmation message to show updating is successful or error happened.
        Parameters:
        out - output by this transform
      • transformHeader

        protected void transformHeader​(MarkupOutput out)
        Generates the Header of the Preferences dialog
        Parameters:
        out - where to create the output
      • renderTitle

        public void renderTitle​(MarkupOutput out)
        Since:
        MicroStrategy Web 8.0.1
      • getTitle

        public java.lang.String getTitle()
        Returns:
        the Title for the dialog. By default the current group.
      • transformFooter

        protected void transformFooter​(MarkupOutput out)
        Generates the footer of the Preferences dialog
        Parameters:
        out - where to create the output
      • renderApplyChanges

        public void renderApplyChanges​(MarkupOutput out)
        Since:
        MicroStrategy Web 8.0.1
      • renderApplyChangesButton

        public void renderApplyChangesButton​(MarkupOutput out)
        Since:
        MicroStrategy Web 8.0.1
      • renderApplyChangesCombobox

        public void renderApplyChangesCombobox​(MarkupOutput out)
        Renders a combobox with the options to "Apply to current project" or to all projects
        Since:
        MicroStrategy Web 8.0.1
      • renderLoadDefaults

        public void renderLoadDefaults​(MarkupOutput out)
        Since:
        MicroStrategy Web 8.0.1
      • transformBody

        protected abstract void transformBody​(MarkupOutput out)
        Abstract method that must be override by the concrete class. This is called to generate the main body of the Preference dialog
        Parameters:
        out - where to create the output
      • renderPreferenceHeader

        protected void renderPreferenceHeader​(java.lang.String preferenceName,
                                              java.lang.String header,
                                              MarkupOutput out)
        Deprecated.
        This method cannot be invoked from a layout-xml. Instead, call renderPreferenceHeader(MarkupOutput, String preferenceName, String text).
        Renders the title of a Preference.
        Parameters:
        preferenceName - the preference name
        header - the title to display
        out - where to create the output
      • renderPreferenceHeader

        protected void renderPreferenceHeader​(MarkupOutput out,
                                              java.lang.String preferenceName,
                                              java.lang.String header)
        Renders the title of a Preference.
        Parameters:
        preferenceName - the preference name
        header - the title to display
        out - where to create the output
        Since:
        MicroStrategy Web 8.0.1
      • renderPreferenceBodyText

        protected void renderPreferenceBodyText​(java.lang.String preferenceName,
                                                java.lang.String bodytext,
                                                MarkupOutput out)
        Deprecated.
        This method cannot be invoked from a layout-xml. Instead, call renderPreferenceBodyText(MarkupOutput, String preferenceName, String text).
        Renders the text of a Preference. If the preference value is marked as invalid, then the text is highlighted.
        Parameters:
        preferenceName - the preference name
        bodytext - the title to display
        out - where to create the output
      • renderPreferenceBodyText

        protected void renderPreferenceBodyText​(MarkupOutput out,
                                                java.lang.String preferenceName,
                                                java.lang.String text)
        Renders the text of a Preference.
        Parameters:
        out - where to create the output
        preferenceName - the preference name
        text - the title to display
        Since:
        MicroStrategy Web 8.0.1
      • renderPreferenceBodyText

        protected void renderPreferenceBodyText​(MarkupOutput out,
                                                java.lang.String preferenceName,
                                                java.lang.String text,
                                                java.lang.String tagID)
        Renders the text of a Preference. This method associate the text label to its corresponding radiobox or checkbox.
        Parameters:
        preferenceName - the preference name
        text - the title to display
        tagID - the element ID with which this text is associated
        out - where to create the output
        Since:
        MicroStrategy Web 9.0.0
      • renderPreferenceBodyText

        protected void renderPreferenceBodyText​(MarkupOutput out,
                                                java.lang.String preferenceName,
                                                java.lang.String text,
                                                java.lang.String[] notes)
        Renders the text of a Preference.
        Parameters:
        out - where to create the output
        preferenceName - the preference name
        text - the title to display
        notes -
        Since:
        MicroStrategy Web 8.0.1
      • renderNoteInformation

        public void renderNoteInformation​(MarkupOutput out)
        Since:
        MicroStrategy Web 8.0.1
      • renderPreferenceBodyNote

        protected void renderPreferenceBodyNote​(MarkupOutput out,
                                                java.lang.String preferenceName,
                                                java.lang.String text)
        Renders a note for a Preference.
        Parameters:
        out - MarkupOutput instance where to create the output
        preferenceName - the preference name
        text - the text to display
        Since:
        MicroStrategy Web 8.0.1
      • renderJavascript

        protected void renderJavascript​(MarkupOutput out)
        This method is called to generate all javascript functions related to this transform.
        Since:
        MicroStrategy Web 8.0.1
      • renderImage

        public void renderImage​(MarkupOutput out,
                                java.lang.String image)
        Renders a transform's image
        Overrides:
        renderImage in class AbstractAppTransform
        Parameters:
        out - where to write the output of the method.
        image - the image name
      • renderFormStart

        public void renderFormStart​(MarkupOutput out,
                                    WebEvent event)
        Renders the start of the Preference's Form. This method also renders the hidden inputs associated with the event
        Parameters:
        out - where to write the output of the method.
        event - the WebEvent to render
      • getFormID

        protected java.lang.String getFormID()
        Returns the ID to use for the form that contains the preferences inputs. This is the value of the formID formal parameter.
        Since:
        MicroStrategy Web 8.0.1
      • renderFormEnd

        public void renderFormEnd​(MarkupOutput out,
                                  WebEvent event)
        Renders the Form end tag
        Parameters:
        out - where to write the output of the method.
      • renderSaveMessageText

        public void renderSaveMessageText​(MarkupOutput out)
        Render the save message text that should be presented to the user once the saving has been successful.
        Parameters:
        out - MarkupOutput where to write the output of the method
        Since:
        MicroStrategy Web 8.0.0
      • renderSaveMessage

        public void renderSaveMessage​(MarkupOutput out)
        If a preference was updated and there were no errors, this method shows a success message to the user.
        Parameters:
        out - where to write the output of the method.
      • renderInvalidMessage

        public void renderInvalidMessage​(MarkupOutput out)
      • getPreference

        protected java.lang.String getPreference​(java.lang.String name,
                                                 PreferenceLevel level)
        Returns the value of the preference with the given name. The value is automatically selected for the current level.
        Parameters:
        name - the name (key) of the preference
        level - level at which the preference should be requested
        Returns:
        preference.getValue() for the current level.
      • getPropertyValue

        protected java.lang.String getPropertyValue​(java.lang.String propertyValue,
                                                    java.lang.String argumentName)
        Check to see if the property comes in the request keys.
        If yes, it will return the value of the @param argumentName from the request keys.
        If not, it will return back the value which was passed in.
        Note:This happens when there are validation error for instance.
        Parameters:
        propertyValue - the value of the property
        Returns:
        the property value
      • getPreference

        protected java.lang.String getPreference​(java.lang.String name)
        Returns the value of the preference with the given name, at the given level
        Parameters:
        name - name of the preference
        Returns:
        preference.getValue() for the requested level
      • getPreferencesBean

        protected PreferencesBean getPreferencesBean()
        Returns the current PreferencesBean
        Returns:
        this PreferencesBean
      • getUpdateEvent

        protected WebEvent getUpdateEvent()
        Returns the update WebEvent used to update the Preferences value.
        Returns:
        a WebEvent to use for updating
      • getLoadDefaultsEvent

        protected WebEvent getLoadDefaultsEvent()
        Since:
        MicroStrategy Web 8.0.0
      • isAdminLevel

        protected boolean isAdminLevel()
      • renderPreference

        public abstract void renderPreference​(java.lang.String preferenceName,
                                              MarkupOutput out)
        Deprecated.
        Call the corresponding renderXXX method directly.
        Render individual preferences based on the name provided
        Parameters:
        preferenceName - name id of the preference
        Since:
        MicroStrategy Web 7.5.1
      • getSupportedBeanType

        public java.lang.Class getSupportedBeanType()
        Description copied from class: AbstractAppTransform
        Returns the supported bean type. This abstract Transform supports all WebComponents so every sub-class should override this method to return the class of the Bean the Transform is expecting, for example:
         public class CustomReportClass extends AbstractAppTransform {
        
            public Class getSupportedBeanType() {
                //This Transform is expected to work only with a ReportBean,
                //therefore this method needs to return this class:
                return ReportBean.class;
            }
        
         }
         
        Specified by:
        getSupportedBeanType in interface Transform
        Overrides:
        getSupportedBeanType in class AbstractAppTransform
        Returns:
        a root class/interface supported by this transform.