public class

PromptCartXHTMLTransform

extends AbstractPromptExpressionTransform
implements LayoutTransform
java.lang.Object
   ↳ com.microstrategy.web.transform.AbstractTransform
     ↳ com.microstrategy.web.transform.AbstractLayoutTransform
       ↳ com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
         ↳ com.microstrategy.web.app.transforms.AbstractPromptExpressionTransform
           ↳ com.microstrategy.web.app.transforms.PromptCartXHTMLTransform
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Renders prompt content in a "shopping cart" style. It provides of minimun settings for creating simplest prompt cart style.
This class is extended by different types of prompts specializing current behavior for meeting prompt specific needs.
The output of this Transform generates well-formed XHTML, supports layout-xml, and it's designed to use external css files for all formatting.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.beans.EnumPromptsBeanEvents
Fields
protected String _imgBlank Reference to a transparent image to use for display purposes
public FormalParameter availableSize The number of elements that the Available list box displays.
public FormalParameter matchCase Specifies whether the match case checkbox is displayed or not next to a search section.
public FormalParameter searchAvailable Specifies whether the transform should display a search section.
public FormalParameter selectedSize The number of elements that the Selected list box displays.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractPromptExpressionTransform
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
Public Constructors
PromptCartXHTMLTransform()
Default no-args constructor, initialize all the formal parameters.
Public Methods
boolean areThereAvailableSelections()
Validates size of available selections is greater than zero.
boolean canTransform(Transformable data)
Indicates if the prompt is of type WebPromptTypeObjects WebPromptTypeDimty or WebPromptTypeElements.
String getDescription()
Indicates the description for this Transform.
void initializeCart()
Initializes this transform's Cart instance properties to the default values required.
void initializeCss()
Initializes the CSS information to be used by this transform.
void initializeFormalParameters()
Initialize formal parameters.
void initializeImages()
Initialize the images for this transform.
void initializePromptContent()
Initializes prompt content.
boolean isAnswerComplex()
Indicates if the answer can be rendered in the GUI.
boolean isSearchAvailable()
Indicates whether or not search area is displayable.
boolean isUpDownArrowsAvailable()
Indicates whether or not UP and DOWN arrows are displayable.
void renderAdd(MarkupOutput out)
Renders the add button information for the cart.
void renderAddAll(MarkupOutput out)
Renders the add all button information for the cart.
void renderAvailable(MarkupOutput out)
Renders the available list of elements on the cart.
void renderCart(MarkupOutput out)
Renders a shopping cart output by calling different methods that will render the individual sections of the prompt layout.
void renderDown(MarkupOutput out)
Render the down button information for the cart.
void renderIncrementalFetch(MarkupOutput out)
Renders the incremental fetch information for the cart available list.
void renderLabel(MarkupOutput out, String descriptor, String name)
Renders an HTML label tag.
void renderLabel(MarkupOutput out, int descriptorId, String name)
Renders an HTML label tag.
void renderPromptContent(MarkupOutput out)
Renders the prompt question.
void renderRemove(MarkupOutput out)
Renders the remove button information for the cart.
void renderRemoveAll(MarkupOutput out)
Renders the remove all button information for the cart.
void renderSearch(MarkupOutput out)
Renders the search section of the cart.
void renderSelected(MarkupOutput out)
Renders the selected list information of the cart.
void renderUp(MarkupOutput out)
Render the up button information for the cart.
boolean supports(Transformable data)
Indicates whether or not this object is supported.
boolean supports(Class c)
Indicates whether given Class is supported.
Protected Methods
Cart createCart()
Create a new instance of GUI Element Cart using the GUIElementFactory.
Enumeration getAvailableItems()
Indicates collection consisted of all available items.
Cart getCart()
Indicates an active Cart instance.
String getErrorMessage(WebBeanError promptError)
Specifies a localized error message.
String getSearchPattern()
Specifies the pattern text from the PromptObject instance.
Enumeration getSelectedItems()
Indicates collection consisted of all selected items.
boolean isIncrementalFetchAvailable()
Indicates whether incremental fetch feature is available.
boolean isSearchActive()
Indicates whether a search pattern was entered.
boolean isSearchPossible(WebDisplayUnit unit)
Indicates whether it's possible to filter elements based on the display unit.
void onBeforeApplyDefaultDisplaySettings()
void processSelectedItems()
Initializes selected items list for this cart transform.
void setExtraArguments()
Sets extra arguments for this prompt.
void updateIncrementalFetchCartProperties()
Updates incremental fetch properties in the Cart object.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractPromptExpressionTransform
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
From class com.microstrategy.web.transform.AbstractLayoutTransform
From class com.microstrategy.web.transform.AbstractTransform
From class java.lang.Object
From interface com.microstrategy.web.transform.LayoutTransform
From interface com.microstrategy.web.transform.Transform

Fields

protected String _imgBlank

Reference to a transparent image to use for display purposes

public FormalParameter availableSize

The number of elements that the Available list box displays.
This flag is used as an int value.

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.

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.

public FormalParameter selectedSize

The number of elements that the Selected list box displays.
This flag is used as an int value.

Public Constructors

public PromptCartXHTMLTransform ()

Default no-args constructor, initialize all the formal parameters.

Public Methods

public boolean areThereAvailableSelections ()

Validates size of available selections is greater than zero.

Returns
  • boolean True if available selection is greater than zero. Returns False otherwise.

public boolean canTransform (Transformable data)

Indicates if the prompt is of type WebPromptTypeObjects WebPromptTypeDimty or WebPromptTypeElements.

Parameters
data object Transformable instance with PromptObject to transform
Returns
  • boolean True if the data is a transformable by this class.

public String getDescription ()

Indicates the description for this Transform.

Returns
  • String with the description for the transform.

public void initializeCart ()

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

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.

public void initializeFormalParameters ()

Initialize formal parameters.

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.

public void initializePromptContent ()

Initializes prompt content.
Extends initializePromptContent by calling processSelectedItems and it's own initializeCart.

Throws
WebObjectsException if an error happens while the prompt is initialized.

public boolean isAnswerComplex ()

Indicates if the answer can be rendered in the GUI.

Returns
  • boolean True if answer is complex.

public boolean isSearchAvailable ()

Indicates whether or not search area is displayable.
It reads Cart property SEARCH_AVAILABLE which indicates whether or not search area can be displayed.

Returns
  • boolean true if cart property is set to display search area.

public boolean isUpDownArrowsAvailable ()

Indicates whether or not UP and DOWN arrows are displayable.
It reads Cart property 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.

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

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

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

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.

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

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.

public void renderLabel (MarkupOutput out, String descriptor, 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.

public void renderLabel (MarkupOutput out, int descriptorId, 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.

public void renderPromptContent (MarkupOutput out)

Renders the prompt question.
It renders given prompt layout content by calling the renderCart() method.

Parameters
out MarkupOutput instance where the output HTML will be stored.

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

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

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

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

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

public boolean supports (Transformable data)

Indicates whether or not this object is supported.

Parameters
data Transformable to be checked
Returns
  • boolean true if supported

public boolean supports (Class c)

Indicates whether given Class is supported.

Parameters
c Class to be checked
Returns
  • boolean true if supported.

Protected Methods

protected Cart createCart ()

Create a new instance of GUI Element Cart using the GUIElementFactory.

Returns
  • a new instance of the Cart

protected Enumeration getAvailableItems ()

Indicates collection consisted of all available items.
Get all available display units and create an Enumeration instance with them.

Returns

protected Cart getCart ()

Indicates an active Cart instance.
Active Cart instance returned isn't null.

Returns
  • Cart instance related to this transform.

protected String getErrorMessage (WebBeanError promptError)

Specifies a localized error message.
Error message is associated to promptError code.

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.

protected String getSearchPattern ()

Specifies the pattern text from the PromptObject instance.
This is accomplished by asking the user search pattern.

Returns
  • String search pattern.

protected 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.

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.

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.

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.

protected void onBeforeApplyDefaultDisplaySettings ()

protected void processSelectedItems ()

Initializes selected items list for this cart transform.
Which supports WebElementsPrompt, WebObjectsPrompt and WebDimtyPrompt lists. Any other type will leave the list as null.

Throws
WebObjectsException if an error happens while processing the information.

protected void setExtraArguments ()

Sets extra arguments for this prompt.
These arguments will be render later as hidden inputs.

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.