Class PromptCartXHTMLTransform

    • Field Detail

      • searchAvailable

        public FormalParameter searchAvailable
        Specifies whether the transform should display a search section.
        Not all prompt types support searching for elements, so even if this parameter is true, the search box might not be available.
        This flag is used as a boolean value.
      • availableSize

        public FormalParameter availableSize
        The number of elements that the Available list box displays.
        This flag is used as an int value.
      • selectedSize

        public FormalParameter selectedSize
        The number of elements that the Selected list box displays.
        This flag is used as an int value.
      • matchCase

        public FormalParameter matchCase
        Specifies whether the match case checkbox is displayed or not next to a search section.
        Indicates whether or not to show match case checkbox next to search section. Not all prompt types support searching for elements, so even if this parameter is true, the search box might not be available.
        This flag is used as a boolean value.
      • _imgBlank

        protected java.lang.String _imgBlank
        Reference to a transparent image to use for display purposes
    • Constructor Detail

      • PromptCartXHTMLTransform

        public PromptCartXHTMLTransform()
        Default no-args constructor, initialize all the formal parameters.
    • Method Detail

      • initializeFormalParameters

        public void initializeFormalParameters()
        Initialize formal parameters.
      • initializeCss

        public void initializeCss()
        Initializes the CSS information to be used by this transform.
        It invokes parent function in order to initialize all shared CSS classes.
        Overrides:
        initializeCss in class AbstractPromptObjectTransform
      • initializeImages

        public void initializeImages()
        Initialize the images for this transform.
        Extends parent method which is also invoked in order to get all shared images initialized as well.
        Overrides:
        initializeImages in class AbstractPromptObjectTransform
      • initializeCart

        public void initializeCart()
        Initializes this transform's Cart instance properties to the default values required.
        Cart instance is obtained by calling function getCart()
      • updateIncrementalFetchCartProperties

        protected void updateIncrementalFetchCartProperties()
        Updates incremental fetch properties in the Cart object.
        The total of units is calculated after processing available units, hence, we need to reflect this in Cart incremental fetch properties.
      • supports

        public boolean supports​(java.lang.Class c)
        Indicates whether given Class is supported.
        Specified by:
        supports in interface Transform
        Overrides:
        supports in class AbstractTransform
        Parameters:
        c - Class to be checked
        Returns:
        boolean true if supported.
        Since:
        MicroStrategy Web 9.0.0
      • isIncrementalFetchAvailable

        protected boolean isIncrementalFetchAvailable()
        Indicates whether incremental fetch feature is available.
        If there's already a predefined list of answers, then incremental fetch gets disabled.
        Returns:
        boolean true incremental fetch is available.
      • isSearchPossible

        protected boolean isSearchPossible​(WebDisplayUnit unit)
        Indicates whether it's possible to filter elements based on the display unit.
        Parameters:
        unit - the display unit for which we want to check:
        Returns:
        true if it's possible to search (filter) elements of the given type.
      • isSearchActive

        protected boolean isSearchActive()
        Indicates whether a search pattern was entered.
        It looks at the getSearchPattern method and if it isn't null then we determine user has entered a search pattern.
        Returns:
        boolean true if search is active.
      • getSearchPattern

        protected java.lang.String getSearchPattern()
        Specifies the pattern text from the PromptObject instance.
        This is accomplished by asking the user search pattern.
        Returns:
        String search pattern.
      • getErrorMessage

        protected java.lang.String getErrorMessage​(WebBeanError promptError)
        Specifies a localized error message.
        Error message is associated to promptError code.
        Overrides:
        getErrorMessage in class AbstractPromptObjectTransform
        Parameters:
        promptError - instance of WebBeanError, most likely an validation error thrown in process prompt phase.
        Returns:
        error message as String. Text is localized to active language.
      • getCart

        protected Cart getCart()
        Indicates an active Cart instance.
        Active Cart instance returned isn't null.
        Returns:
        Cart instance related to this transform.
      • createCart

        protected Cart createCart()
        Create a new instance of GUI Element Cart using the GUIElementFactory.
        Returns:
        a new instance of the Cart
        Since:
        MicroStrategy Web 8.0.1
      • getAvailableItems

        protected java.util.Enumeration getAvailableItems()
        Indicates collection consisted of all available items.
        Get all available display units and create an Enumeration instance with them.
        Returns:
        Enumeration instance of all WebDisplayUnits available items.
      • getSelectedItems

        protected java.util.Enumeration getSelectedItems()
        Indicates collection consisted of all selected items.
        Get all selected display units and create an Enumeration instance with them. For Level prompt: the values from the enumeration are instances of WebDimtyUnit For objects/elements prompt: In DHTML mode, the values are instances of WebDisplayUnits. In HTML mode, the values are instances of WebDisplayUnitEntry.
        Returns:
        Enumeration instance of all selected items.
      • getDescription

        public java.lang.String getDescription()
        Indicates the description for this Transform.
        Specified by:
        getDescription in interface Transform
        Returns:
        String with the description for the transform.
      • areThereAvailableSelections

        public boolean areThereAvailableSelections()
        Validates size of available selections is greater than zero.
        Overrides:
        areThereAvailableSelections in class AbstractPromptObjectTransform
        Returns:
        boolean True if available selection is greater than zero. Returns False otherwise.
      • renderCart

        public void renderCart​(MarkupOutput out)
        Renders a shopping cart output by calling different methods that will render the individual sections of the prompt layout. The output is organized with a series of DIV HTML tags created.
        The methods used for the cart output are listed below, where out is a MarkupOutput instance where the HTML generated by these calls is saved.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • isUpDownArrowsAvailable

        public boolean isUpDownArrowsAvailable()
        Indicates whether or not UP and DOWN arrows are displayable.
        It reads Cart property EnumCartProperties.UP_AND_DOWN_AVAILABLE which indicates whether or not these arrows can be displayed.
        Returns:
        boolean true if cart property is set to display arrows.
      • isSearchAvailable

        public boolean isSearchAvailable()
        Indicates whether or not search area is displayable.
        It reads Cart property EnumCartProperties.SEARCH_AVAILABLE which indicates whether or not search area can be displayed.
        Returns:
        boolean true if cart property is set to display search area.
      • renderLabel

        public void renderLabel​(MarkupOutput out,
                                int descriptorId,
                                java.lang.String name)
        Renders an HTML label tag.
        Utility method for rendering a label tag on the HTML output to generate. Internally calls the Cart instance to render the label using its renderLabel method.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
        descriptorId - int identifier of the descriptor to display as label
        name - String value to assign to the for attribute of the LABEL HTML tag to display.
      • renderLabel

        public void renderLabel​(MarkupOutput out,
                                java.lang.String descriptor,
                                java.lang.String name)
        Renders an HTML label tag.
        Utility method for rendering a label tag on the HTML output to generate. Internally calls the Cart instance to render the label using its renderLabel method.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
        descriptor - String with the descriptor to display as label
        name - String value to assign to the for attribute of the LABEL HTML tag to display.
      • renderIncrementalFetch

        public void renderIncrementalFetch​(MarkupOutput out)
        Renders the incremental fetch information for the cart available list.
        It updates the incremental fetch information before rendering it.
        Parameters:
        out - MarkupOutput instance where the output HTML will be stored.
      • renderAvailable

        public void renderAvailable​(MarkupOutput out)
        Renders the available list of elements on the cart. Sample code for this method would be defined as follows:
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderSearch

        public void renderSearch​(MarkupOutput out)
        Renders the search section of the cart.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderAdd

        public void renderAdd​(MarkupOutput out)
        Renders the add button information for the cart. Sample code for this method would be defined as follows:
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderAddAll

        public void renderAddAll​(MarkupOutput out)
        Renders the add all button information for the cart.
        Generates JavaScript information to be associated with the button if it's to be rendered on a DHTML environment.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderRemoveAll

        public void renderRemoveAll​(MarkupOutput out)
        Renders the remove all button information for the cart. Generates JavaScript information to be associated with the button if it's to be rendered on a DHTML environment.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderRemove

        public void renderRemove​(MarkupOutput out)
        Renders the remove button information for the cart.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderSelected

        public void renderSelected​(MarkupOutput out)
        Renders the selected list information of the cart.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderUp

        public void renderUp​(MarkupOutput out)
        Render the up button information for the cart.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved
      • renderDown

        public void renderDown​(MarkupOutput out)
        Render the down button information for the cart.
        Parameters:
        out - MarkupOutput instance where the HTML content generated by this method will be saved