Class CartImpl

    • Constructor Detail

      • CartImpl

        public CartImpl()
        CartImpl constructor, initialize all Cart properties.
    • Method Detail

      • initializeCart

        public void initializeCart()
        InitializeCart, for initializing all Cart properties to default values.
        Specified by:
        initializeCart in interface Cart
      • setEnabled

        public void setEnabled​(boolean value)
        Description copied from interface: Cart
        Function for enabling or disabling the interaction scripts on the cart rendering.
        Specified by:
        setEnabled in interface Cart
        Parameters:
        value - true
        Since:
        MicroStrategy Web 9.0.0
      • renderCart

        public void renderCart​(MarkupOutput out,
                               CartElements availableItems,
                               CartElements selectedItems)
        renderCart, function that abstracts standard Cart output.
        Specified by:
        renderCart in interface Cart
        Parameters:
        out - where to write the output of the method.
        availableItems - enumeration of all available items
        selectedItems - enumeration of all selected items
        Since:
        MicroStrategy Web 8.0.0
      • renderCart

        public void renderCart​(MarkupOutput out,
                               java.util.Enumeration availableItems,
                               java.util.Enumeration selectedItems)
        renderCart, function that abstracts standard Cart output.
        Specified by:
        renderCart in interface Cart
        Parameters:
        out - where to write the output of the method.
        availableItems - enumeration of all available items
        selectedItems - enumeration of all selected items
      • renderIncrementalFetch

        public void renderIncrementalFetch​(MarkupOutput out)
        renderIncrementalFetch, function that renders incremental fetch.
        Specified by:
        renderIncrementalFetch in interface Cart
        Parameters:
        out - where to write the output of the method.
      • generateAvailableCartElements

        protected CartElements generateAvailableCartElements​(java.util.Enumeration cartElements)
        Since:
        MicroStrategy Web 9.0.0
      • renderAvailable

        public void renderAvailable​(MarkupOutput out,
                                    java.util.Enumeration availableItems)
        renderAvailable, function that abstracts Available output.
        Specified by:
        renderAvailable in interface Cart
        Parameters:
        out - where to write the output of the method.
        availableItems - enumeration of all available items
      • renderAvailable

        public void renderAvailable​(MarkupOutput out,
                                    CartElements items)
        This function will display available list of units defined in CartElements collection. It'll abstract what format to be used for rendering available list.
        Specified by:
        renderAvailable in interface Cart
        Parameters:
        out - where to write the output of the method..
        items - collection of CartElements to be displayed in available list.
        Since:
        MicroStrategy Web 8.0.0
      • renderAvailableItem

        protected void renderAvailableItem​(Tag parent,
                                           CartElement item)
      • generateSelectedCartElements

        protected CartElements generateSelectedCartElements​(java.util.Enumeration cartElems)
        Since:
        MicroStrategy Web 9.0.0
      • renderSelected

        public void renderSelected​(MarkupOutput out,
                                   java.util.Enumeration items)
        renderSelected, function that abstracts Selected output.
        Specified by:
        renderSelected in interface Cart
        Parameters:
        out - where to write the output of the method.
        items - enumeration of all selected items
      • renderSelected

        public void renderSelected​(MarkupOutput out,
                                   CartElements items)
        This function will display selected list of units defined in CartElements collection. It'll abstract what format to be used for rendering selected list.
        Specified by:
        renderSelected in interface Cart
        Parameters:
        out - where to write the output of the method..
        items - collection of CartElements to be displayed.
        Since:
        MicroStrategy Web 8.0.0
      • renderSelectedItem

        protected void renderSelectedItem​(Tag parent,
                                          CartElement item)
      • renderSelectedItem

        protected void renderSelectedItem​(MarkupOutput out,
                                          CartElement item)
        Since:
        MicroStrategy Web 9.0.0
      • setOptionTagTitle

        protected void setOptionTagTitle​(Tag optionTag,
                                         CartElement item)
        if OPTION_TITLE is true, sets cart element's display name as title for
        Parameters:
        item - - CartElement
      • renderRemove

        public void renderRemove​(MarkupOutput out)
        renderRemove, function that abstracts Remove arrow functionality and output.
        Specified by:
        renderRemove in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderRemoveAll

        public void renderRemoveAll​(MarkupOutput out)
        renderRemove, function that abstracts Remove arrow functionality and output.
        Specified by:
        renderRemoveAll in interface Cart
        Parameters:
        out - where to write the output of the method.
        Since:
        MicroStrategy Web 8.0.0
      • renderActionImage

        public void renderActionImage​(MarkupOutput out,
                                      java.lang.String[] jsFunction,
                                      java.lang.String name,
                                      java.lang.String value,
                                      java.lang.String imageSource,
                                      java.lang.String imageClass,
                                      java.lang.String title)
        Dsiplays an image that the user will be enabled to click on and submit a request.
        Parameters:
        out - where to write the output of the method
        jsFunction - array of String with the JavaScript information to trigger when the user clicks on the image. If none is provided or the current output mode of the cart is does not support DHTML then the information will not be used.
        imageClass - full css class the image to create will have
        imageSource - full image path for the image to be rendered
        title - tooltip to associate with the image to render
        name - identifier for the image tag to create.
        Since:
        MicroStrategy Web 9.0.0
      • renderActionImage

        @Deprecated
        public void renderActionImage​(MarkupOutput out,
                                      java.lang.String[] jsFunction,
                                      java.lang.String name,
                                      java.lang.String imageClass,
                                      java.lang.String title)
        Deprecated.
        Dsiplays an image that the user will be enabled to click on and submit a request.
        Specified by:
        renderActionImage in interface Cart
        Parameters:
        out - where to write the output of the method
        jsFunction - array of String with the JavaScript information to trigger when the user clicks on the image. If none is provided or the current output mode of the cart is does not support DHTML then the information will not be used.
        imageClass - full css class the image to create will have
        title - tooltip to associate with the image to render
        name - identifier for the image tag to create.
        Since:
        MicroStrategy Web 8.0.0
      • renderAdd

        public void renderAdd​(MarkupOutput out)
        renderAdd, function that abstracts Add arrow functionality and output.
        Specified by:
        renderAdd in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderAddAll

        public void renderAddAll​(MarkupOutput out)
        renderAdd, function that abstracts Add arrow functionality and output.
        Specified by:
        renderAddAll in interface Cart
        Parameters:
        out - where to write the output of the method.
        Since:
        MicroStrategy Web 8.0.0
      • renderUp

        public void renderUp​(MarkupOutput out)
        Displays move up HTML image arrow button.
        Specified by:
        renderUp in interface Cart
        Parameters:
        out - where to write the output of the method.
        Since:
        MicroStrategy Web 8.0.0
      • renderDown

        public void renderDown​(MarkupOutput out)
        Displays move down HTML image arrow button.
        Specified by:
        renderDown in interface Cart
        Parameters:
        out - where to write the output of the method.
        Since:
        MicroStrategy Web 8.0.0
      • renderJavascriptFunction

        @Deprecated
        public void renderJavascriptFunction​(java.lang.String[] function,
                                             MarkupOutput out)
        Deprecated.
        Function for rendering javascript code based upon parameters passed in function array. First element in array determine function name; remaining elements in array are the function arguments.
        Parameters:
        function - array of function name and parameters.
        out - where to write the output of the method.
      • renderMatchCase

        public void renderMatchCase​(MarkupOutput out)
        Function that outputs AND / OR match output HTML radio button. This is a global operator that groups all qualifications made by the user.
        Specified by:
        renderMatchCase in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderSearch

        public void renderSearch​(MarkupOutput out)
        Function that abstracts HTML output for search section.
        Specified by:
        renderSearch in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderSearchField

        public void renderSearchField​(MarkupOutput out)
        Function that renders search HTML textbox field where to enter search criteria.
        Specified by:
        renderSearchField in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderSearchButton

        public void renderSearchButton​(MarkupOutput out)
        Function that renders search HTML image button.
        Specified by:
        renderSearchButton in interface Cart
        Parameters:
        out - where to write the output of the method.
      • renderLabel

        public void renderLabel​(MarkupOutput out,
                                java.lang.String labelName)
        Function for displaying HTML labels.
        Specified by:
        renderLabel in interface Cart
        Parameters:
        out - where to write the output of the method.
        labelName - string of label to be displayed.
      • renderLabel

        public void renderLabel​(MarkupOutput out,
                                java.lang.String labelName,
                                java.lang.String forValue)
        Function for displaying HTML labels.
        Specified by:
        renderLabel in interface Cart
        Parameters:
        out - where to write the output of the method.
        labelName - string of label to be displayed.
        forValue - string value for the FOR attribute of the LABEL HTML tag.
        Since:
        MicroStrategy Web 8.0.0
      • toString

        public java.lang.String toString()
        Returns Class name
        Overrides:
        toString in class java.lang.Object
        Returns:
        Class name
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object obj)
        Function used for setting Cart properties. Key is the name of the property and obj its value.
        Specified by:
        setProperty in interface Cart
        Parameters:
        key - name of property
        obj - property's value.
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Function that returns value for a given Cart's property.
        Specified by:
        getProperty in interface Cart
        Parameters:
        key - name of property
        Returns:
        Objest value held by property
      • setHideWaitPageFlag

        @Deprecated
        public void setHideWaitPageFlag​(boolean flag)
        Deprecated.
        - not needed anymore because we don't use anchor tags for executing javascript anymore.
        Function for making sure javascript code for hiding wait page is appended to add/remove image buttons
        Specified by:
        setHideWaitPageFlag in interface Cart
        Parameters:
        flag - true if extra code is appended.
      • getClickableSpan

        public Tag getClickableSpan​(java.lang.String[] jsHref)
        Generate a Tag instance for an SPAN HTML element with an onClick handler using the information provided
        Parameters:
        jsHref - a String array with JavaScript information to assign to the onclick attribute of the tag. The first element of the array will be the name of the method, the following elements will be the arguments of the method in the same order as specified.
        Returns:
        a Tag instance initialized, created as an SPAN HTML element. The JavaScript information will be assigned to it only if the EnumCartProperties.OUTPUT_MODE property has been assigned as True indicating it is on DHTML mode.
        Since:
        MicroStrategy Web 8.0.0
      • getClickableDiv

        public Tag getClickableDiv​(java.lang.String[] jsHref)
        Since:
        MicroStrategy Web 9.0.0
      • getSelectTag

        public Tag getSelectTag​(java.lang.String name,
                                java.lang.String size,
                                java.lang.String style,
                                java.lang.String[] jsDblClick)
        Generate a Tag instance for a SELECT HTML element with the information provided
        Parameters:
        name - String with the id and name information the HTML tag will have
        size - String with the size information the select tag will have
        style - String with the style information the tag will have
        jsDblClick - a String array with JavaScript information to assign to the ondblclick event of the tag. The first element of the array will be the name of the method, the following elements will be the arguments of the method in the same order as specified.
        Returns:
        a Tag instance initialized, created as a SELECT HTML element. The JavaScript information will be assigned to it only if the EnumCartProperties.OUTPUT_MODE property has been assigned as True indicating it is on DHTML mode. The tag will allow multi-select if the EnumCartProperties.MULTI_SELECT property indicates so.
        Since:
        MicroStrategy Web 8.0.0
      • renderGenericCart

        protected void renderGenericCart​(MarkupOutput out,
                                         java.lang.Object availableItems,
                                         java.lang.Object selectedItems)
        Since:
        MicroStrategy Web 8.0.0
      • renderCartCurtain

        protected void renderCartCurtain​(MarkupOutput out,
                                         java.lang.String cssPrefix)
        Render a curtain
        Since:
        MicroStrategy Web 9.0.0
      • renderAddRemoveButtonsInCart

        protected void renderAddRemoveButtonsInCart​(MarkupOutput out,
                                                    java.lang.Object availableItems)
        Since:
        MicroStrategy Web 9.0.0
      • renderSearchDiv

        protected void renderSearchDiv​(MarkupOutput out,
                                       java.lang.String cssPrefix)
        Since:
        MicroStrategy Web 9.0.0
      • getRemoveTitle

        protected java.lang.String getRemoveTitle()
        Returns:
        The title used for the remove button
        Since:
        MicroStrategy Web 9.0.0
      • getRemoveAllTitle

        protected java.lang.String getRemoveAllTitle()
        Returns:
        The title used for the remove all button
        Since:
        MicroStrategy Web 9.0.0
      • getAddTitle

        protected java.lang.String getAddTitle()
        Returns:
        The title used for the add button
        Since:
        MicroStrategy Web 9.0.0
      • getAddAllTitle

        protected java.lang.String getAddAllTitle()
        Returns:
        The title used for the add all button
        Since:
        MicroStrategy Web 9.0.0
      • getUpTitle

        protected java.lang.String getUpTitle()
        Returns:
        The title used for the up button
        Since:
        MicroStrategy Web 9.0.0
      • getDownTitle

        protected java.lang.String getDownTitle()
        Returns:
        The title used for the down button
        Since:
        MicroStrategy Web 9.0.0