public class

CartImpl

extends AbstractGuiElement
implements Cart EnumCartProperties
java.lang.Object
   ↳ com.microstrategy.web.app.gui.AbstractGuiElement
     ↳ com.microstrategy.web.app.gui.CartImpl
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Title: CartImpl.

Description: CartImpl abstraction it renders an HMTL "shopping cart" style and exposes a set of functions for individually rendering each part of the Cart output.

Copyright: Copyright (c) 2002

Company: Microstrategy, Inc.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.app.gui.EnumCartProperties
[Expand]
Inherited Fields
From class com.microstrategy.web.app.gui.AbstractGuiElement
Public Constructors
CartImpl()
CartImpl constructor, initialize all Cart properties.
Public Methods
Tag getClickableDiv(String[] jsHref)
Tag getClickableSpan(String[] jsHref)
Generate a Tag instance for an SPAN HTML element with an onClick handler using the information provided
Object getProperty(String key)
Function that returns value for a given Cart's property.
Tag getSelectTag(String name, String size, String style, String[] jsDblClick)
Generate a Tag instance for a SELECT HTML element with the information provided
void initializeCart()
InitializeCart, for initializing all Cart properties to default values.
void renderActionImage(MarkupOutput out, String[] jsFunction, String name, String imageClass, String title)
This method is deprecated. No replacement.
void renderActionImage(MarkupOutput out, String[] jsFunction, String name, String value, String imageSource, String imageClass, String title)
Dsiplays an image that the user will be enabled to click on and submit a request.
void renderAdd(MarkupOutput out)
renderAdd, function that abstracts Add arrow functionality and output.
void renderAddAll(MarkupOutput out)
renderAdd, function that abstracts Add arrow functionality and output.
void renderAvailable(MarkupOutput out, CartElements items)
This function will display available list of units defined in CartElements collection.
void renderAvailable(MarkupOutput out, Enumeration availableItems)
renderAvailable, function that abstracts Available output.
void renderCart(MarkupOutput out, Enumeration availableItems, Enumeration selectedItems)
renderCart, function that abstracts standard Cart output.
void renderCart(MarkupOutput out, CartElements availableItems, CartElements selectedItems)
renderCart, function that abstracts standard Cart output.
void renderDown(MarkupOutput out)
Displays move down HTML image arrow button.
MarkupOutput renderElement()
Function that returns instance of output writer.
void renderIncrementalFetch(MarkupOutput out)
renderIncrementalFetch, function that renders incremental fetch.
void renderJavascriptFunction(String[] function, MarkupOutput out)
This method is deprecated. use getClickableSpan(String[]) instead.
void renderLabel(MarkupOutput out, String labelName, String forValue)
Function for displaying HTML labels.
void renderLabel(MarkupOutput out, String labelName)
Function for displaying HTML labels.
void renderMatchCase(MarkupOutput out)
Function that outputs AND / OR match output HTML radio button.
void renderRemove(MarkupOutput out)
renderRemove, function that abstracts Remove arrow functionality and output.
void renderRemoveAll(MarkupOutput out)
renderRemove, function that abstracts Remove arrow functionality and output.
void renderSearch(MarkupOutput out)
Function that abstracts HTML output for search section.
void renderSearchButton(MarkupOutput out)
Function that renders search HTML image button.
void renderSearchField(MarkupOutput out)
Function that renders search HTML textbox field where to enter search criteria.
void renderSelected(MarkupOutput out, CartElements items)
This function will display selected list of units defined in CartElements collection.
void renderSelected(MarkupOutput out, Enumeration items)
renderSelected, function that abstracts Selected output.
void renderUp(MarkupOutput out)
Displays move up HTML image arrow button.
void setEnabled(boolean value)
Function for enabling or disabling the interaction scripts on the cart rendering.
void setHideWaitPageFlag(boolean flag)
This method is deprecated. - not needed anymore because we don't use anchor tags for executing javascript anymore.
void setProperty(String key, Object obj)
Function used for setting Cart properties.
String toString()
Returns Class name
Protected Methods
CartElement addCartElement(CartElements result, WebDisplayUnit item)
CartElements generateAvailableCartElements(Enumeration cartElements)
CartElements generateSelectedCartElements(Enumeration cartElems)
String getAddAllTitle()
String getAddTitle()
String getDownTitle()
String getRemoveAllTitle()
String getRemoveTitle()
TagsFactory getTagsFactory()
Obtain an instance of the TagsFactory class
String getUpTitle()
void renderAddRemoveButtonsInCart(MarkupOutput out, Object availableItems)
void renderAvailableItem(MarkupOutput out, CartElement item)
void renderAvailableItem(Tag parent, CartElement item)
void renderCartCurtain(MarkupOutput out, String cssPrefix)
Render a curtain
void renderCartDiv(MarkupOutput out, Object availableItems, Object selectedItems, String cssPrefix)
void renderGenericCart(MarkupOutput out, Object availableItems, Object selectedItems)
void renderSearchDiv(MarkupOutput out, String cssPrefix)
void renderSelectedItem(Tag parent, CartElement item)
void renderSelectedItem(MarkupOutput out, CartElement item)
void setOptionTagTitle(Tag optionTag, CartElement item)
if OPTION_TITLE is true, sets cart element's display name as title for
[Expand]
Inherited Methods
From class com.microstrategy.web.app.gui.AbstractGuiElement
From class java.lang.Object
From interface com.microstrategy.web.app.gui.Cart
From interface com.microstrategy.web.app.gui.GuiElement

Public Constructors

public CartImpl ()

CartImpl constructor, initialize all Cart properties.

Public Methods

public Tag getClickableDiv (String[] jsHref)

public Tag getClickableSpan (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 OUTPUT_MODE property has been assigned as True indicating it is on DHTML mode.

public Object getProperty (String key)

Function that returns value for a given Cart's property.

Parameters
key name of property
Returns
  • Objest value held by property

public Tag getSelectTag (String name, String size, String style, 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 OUTPUT_MODE property has been assigned as True indicating it is on DHTML mode. The tag will allow multi-select if the MULTI_SELECT property indicates so.

public void initializeCart ()

InitializeCart, for initializing all Cart properties to default values.

public void renderActionImage (MarkupOutput out, String[] jsFunction, String name, String imageClass, String title)

This method is deprecated.
No replacement.

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.
name identifier for the image tag to create.
imageClass full css class the image to create will have
title tooltip to associate with the image to render

public void renderActionImage (MarkupOutput out, String[] jsFunction, String name, String value, String imageSource, String imageClass, 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.
name identifier for the image tag to create.
imageSource full image path for the image to be rendered
imageClass full css class the image to create will have
title tooltip to associate with the image to render

public void renderAdd (MarkupOutput out)

renderAdd, function that abstracts Add arrow functionality and output.

Parameters
out where to write the output of the method.

public void renderAddAll (MarkupOutput out)

renderAdd, function that abstracts Add arrow functionality and output.

Parameters
out where to write the output of the method.

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.

Parameters
out where to write the output of the method..
items collection of CartElements to be displayed in available list.

public void renderAvailable (MarkupOutput out, Enumeration availableItems)

renderAvailable, function that abstracts Available output.

Parameters
out where to write the output of the method.
availableItems enumeration of all available items

public void renderCart (MarkupOutput out, Enumeration availableItems, Enumeration selectedItems)

renderCart, function that abstracts standard Cart output.

Parameters
out where to write the output of the method.
availableItems enumeration of all available items
selectedItems enumeration of all selected items

public void renderCart (MarkupOutput out, CartElements availableItems, CartElements selectedItems)

renderCart, function that abstracts standard Cart output.

Parameters
out where to write the output of the method.
availableItems enumeration of all available items
selectedItems enumeration of all selected items

public void renderDown (MarkupOutput out)

Displays move down HTML image arrow button.

Parameters
out where to write the output of the method.

public MarkupOutput renderElement ()

Function that returns instance of output writer.

Returns
  • MarkupOutput

public void renderIncrementalFetch (MarkupOutput out)

renderIncrementalFetch, function that renders incremental fetch.

Parameters
out where to write the output of the method.

public void renderJavascriptFunction (String[] function, MarkupOutput out)

This method is deprecated.
use getClickableSpan(String[]) instead.

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.

public void renderLabel (MarkupOutput out, String labelName, String forValue)

Function for displaying HTML labels.

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.

public void renderLabel (MarkupOutput out, String labelName)

Function for displaying HTML labels.

Parameters
out where to write the output of the method.
labelName string of label to be displayed.

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.

Parameters
out where to write the output of the method.

public void renderRemove (MarkupOutput out)

renderRemove, function that abstracts Remove arrow functionality and output.

Parameters
out where to write the output of the method.

public void renderRemoveAll (MarkupOutput out)

renderRemove, function that abstracts Remove arrow functionality and output.

Parameters
out where to write the output of the method.

public void renderSearch (MarkupOutput out)

Function that abstracts HTML output for search section.

Parameters
out where to write the output of the method.

public void renderSearchButton (MarkupOutput out)

Function that renders search HTML image button.

Parameters
out where to write the output of the method.

public void renderSearchField (MarkupOutput out)

Function that renders search HTML textbox field where to enter search criteria.

Parameters
out where to write the output of the method.

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.

Parameters
out where to write the output of the method..
items collection of CartElements to be displayed.

public void renderSelected (MarkupOutput out, Enumeration items)

renderSelected, function that abstracts Selected output.

Parameters
out where to write the output of the method.
items enumeration of all selected items

public void renderUp (MarkupOutput out)

Displays move up HTML image arrow button.

Parameters
out where to write the output of the method.

public void setEnabled (boolean value)

Function for enabling or disabling the interaction scripts on the cart rendering.

Parameters
value true

public void setHideWaitPageFlag (boolean flag)

This method is 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

Parameters
flag true if extra code is appended.

public void setProperty (String key, Object obj)

Function used for setting Cart properties. Key is the name of the property and obj its value.

Parameters
key name of property
obj property's value.

public String toString ()

Returns Class name

Returns
  • Class name

Protected Methods

protected CartElement addCartElement (CartElements result, WebDisplayUnit item)

protected CartElements generateAvailableCartElements (Enumeration cartElements)

protected CartElements generateSelectedCartElements (Enumeration cartElems)

protected String getAddAllTitle ()

Returns
  • The title used for the add all button

protected String getAddTitle ()

Returns
  • The title used for the add button

protected String getDownTitle ()

Returns
  • The title used for the down button

protected String getRemoveAllTitle ()

Returns
  • The title used for the remove all button

protected String getRemoveTitle ()

Returns
  • The title used for the remove button

protected TagsFactory getTagsFactory ()

Obtain an instance of the TagsFactory class

Returns

protected String getUpTitle ()

Returns
  • The title used for the up button

protected void renderAddRemoveButtonsInCart (MarkupOutput out, Object availableItems)

protected void renderAvailableItem (MarkupOutput out, CartElement item)

protected void renderAvailableItem (Tag parent, CartElement item)

protected void renderCartCurtain (MarkupOutput out, String cssPrefix)

Render a curtain

protected void renderCartDiv (MarkupOutput out, Object availableItems, Object selectedItems, String cssPrefix)

protected void renderGenericCart (MarkupOutput out, Object availableItems, Object selectedItems)

protected void renderSearchDiv (MarkupOutput out, String cssPrefix)

protected void renderSelectedItem (Tag parent, CartElement item)

protected void renderSelectedItem (MarkupOutput out, CartElement item)

protected void setOptionTagTitle (Tag optionTag, CartElement item)

if OPTION_TITLE is true, sets cart element's display name as title for

Parameters
item - CartElement
Returns
  • String