public class

PromptCartTransform

extends AbstractPromptExpressionTransform
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.PromptCartTransform
Known Direct Subclasses
Known Indirect Subclasses

This class is deprecated.
Use PromptCartXHTMLTransform instead

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.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.beans.EnumPromptsBeanEvents
Fields
protected String _addImage
protected String _endImage
protected String _findImage
protected String _firstImage
protected String _nextImage
protected String _previousImage
protected String _removeImage
public FormalParameter addImage Image to add units to the selected list.
public FormalParameter availableSize The number of elements that the Available list box displays.
public FormalParameter endImage Image to page to last list of units in incremental browsing.
public FormalParameter findImage Image to submit searching for units.
public FormalParameter firstImage Image to page to first list of units in incremental browsing.
public FormalParameter matchCase Specifies whether the match case checkbox is displayed or not next to a search section.
public FormalParameter nextImage Image to page to next block of units in incremental browsing.
public FormalParameter previousImage Image to page to previous block of units in incremental browsing.
public FormalParameter removeImage Image to remove elements from the selected list.
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
PromptCartTransform()
Default no-args constructor, initialize all the formal parameters.
Public Methods
boolean areThereAvailableSelections()
Indicates whether or not there is a least one item in available collection,
Verifies size of available selections is greater than zero.
boolean canTransform(Transformable data)
Indicates whether or not this given transform can be used to transform given component.
String getDescription()
Returns a description of this transform.
void initializeCart()
Initializes all Cart properties to default values.
void initializeFormalParameters()
Initialize formal parameters.
void initializeImages()
Initializes the images for this transform.
void initializePromptContent()
Initializes prompt's content.
boolean isAnswerComplex()
Determines if the answer can be rendered in the GUI.
void renderCart(MarkupOutput out)
Renders shopping's cart area.
void renderPromptContent(MarkupOutput out)
Renders layout where prompt's content will displayed.
Protected Methods
Enumeration getAvailableItems()
Returns all available items encapsulated in Enumeration class.
Cart getCart()
Returns active cart instance.
String getErrorMessage(WebBeanError promptError)
Returns a localized error message.
String getSearchPattern()
Returns search pattern text defined in Prompt Object.
Enumeration getSelectedItems()
Returns an enumeration of all selected items.
boolean isIncrementalFetchAvailable()
Indicates whether or not, incremental fetch feature is available.
boolean isSearchActive()
Indicates whether a search patter was entered or not.
boolean isSearchPossible(WebDisplayUnit unit)
Indicates whether or not it's possible to filter elements based on the display unit object.
void processSelectedItems()
Initialize selected items list.
void setExtraArguments()
Specifies extra arguments for this prompt.
void updateIncrementalFetchCartProperties()
Updates incremental fetch properties in 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.Transform

Fields

protected String _addImage

protected String _endImage

protected String _findImage

protected String _firstImage

protected String _nextImage

protected String _previousImage

protected String _removeImage

public FormalParameter addImage

Image to add units to the selected list.

public FormalParameter availableSize

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

public FormalParameter endImage

Image to page to last list of units in incremental browsing.

public FormalParameter findImage

Image to submit searching for units.

public FormalParameter firstImage

Image to page to first list of units in incremental browsing.

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 nextImage

Image to page to next block of units in incremental browsing.

public FormalParameter previousImage

Image to page to previous block of units in incremental browsing.

public FormalParameter removeImage

Image to remove elements from the selected list.

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 PromptCartTransform ()

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

Public Methods

public boolean areThereAvailableSelections ()

Indicates whether or not there is a least one item in available collection,
Verifies size of available selections is greater than zero.
Returns false when selections are less or equal to zero.

Returns
  • boolean true if available selection is greater than 0

public boolean canTransform (Transformable data)

Indicates whether or not this given transform can be used to transform given component.
Data should be instance of PromptObject, either an Object, Element or Dimension prompt type.
Returns true only if the prompt is of type EnumWebPromptType.WebPromptTypeObjects or EnumWebPromptType.WebPromptTypeElements.

Parameters
data object (PromptObject) to transform
Returns
  • boolean true if the data is a PromptObject of a Expression WebPrompt.

public String getDescription ()

Returns a description of this transform.

Returns
  • String text description.

public void initializeCart ()

Initializes all Cart properties to default values.
Cart instance used by this transform needs to be initialized accordingly. Properties for controlling Incremental fetch, Javascript functions, etc are specified in the method.
Cart instance is retrieve by invoking getCart() method which returns an instance of Cart object.

public void initializeFormalParameters ()

Initialize formal parameters.

public void initializeImages ()

Initializes the images for this transform.
This function has been extended and it invokes parent method as well.

public void initializePromptContent ()

Initializes prompt's content.
Extends initializePromptContent() by calling processIncrementalFetch and processSelectedItems.
Parent method gets also invoked. Then, processSelectedItems() method is invoked.
It also initialize the Cart object associated by invoking initializeCart() method.

Throws
WebObjectsException if something goes wrong during initialization process.

public boolean isAnswerComplex ()

Determines if the answer can be rendered in the GUI.

Returns
  • boolean true if answer is complex.

public void renderCart (MarkupOutput out)

Renders shopping's cart area.
Prior to rendering the cart, incremental fetch values are updated. Within the cart object, flow executes renderAvailable(), renderArrows() and renderSelected() methods.

Parameters
out where to write the output of the method.

public void renderPromptContent (MarkupOutput out)

Renders layout where prompt's content will displayed.
It calls renderCart method for rendering prompt question layout.

Parameters
out where to write the output of the method.

Protected Methods

protected Enumeration getAvailableItems ()

Returns all available items encapsulated in Enumeration class.
It gets all available display units and creates an Enumeration instance which is returned.

Returns
  • Enumeration of WebDisplayUnits objects.

protected Cart getCart ()

Returns active cart instance.
Makes sure this instance isn't null and if it's, a new one is created through GUI element factory.

Returns
  • Cart instance.

protected String getErrorMessage (WebBeanError promptError)

Returns a localized error message.
Error message is associated to promptError code passed in.

Parameters
promptError instance of WebBeanError, most likely an validation error thrown in process prompt phase.
Returns
  • error message as String. Error is localized to active language

protected String getSearchPattern ()

Returns search pattern text defined in Prompt Object.
It calls getPrompt() method in order to get an instance of current Prompt object.

Returns
  • String search pattern.

protected Enumeration getSelectedItems ()

Returns an enumeration of all selected items.
It gets all selected display units and creates an Enumeration instance which is returned.

Returns
  • Enumeration of WebDisplayUnits objects.

protected boolean isIncrementalFetchAvailable ()

Indicates whether or not, incremental fetch feature is available.
Only element or object prompt types are allowed to expose incremental fetch and 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 patter was entered or not.
It looks at PromptObject's user search pattern 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 or not it's possible to filter elements based on the display unit object.
If given unit is a WebElementsPrompt or WebObjectsPrompt instance, then it returns false only if it has a pre-defined list or there an active search in progress.
If given unit is an WebDimensionAttribute instance, it gets its WebAttribure object and calls recursively isSearchPossible() function,
For WebAttribute instances, search isn't possible if any of the attribute's form happens to have a Date datatype.

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 processSelectedItems ()

Initialize selected items list.
This cart only supports Element and Objects prompts lists. It gets prompt answer and from it, it obtains its enumeration instance which contains all possible answers.

Throws
WebObjectsException when invoking API functions in order to retrieve prompt answers.

protected void setExtraArguments ()

Specifies extra arguments for this prompt.
Arguments such as answer format are initialized here. If DHTML mode is on, answer format is set to Flat (values defined in EnumPromptAnswerFormat enumeration). If HTML is on then, answer format is set to List.
Also, if DHTML is on, answer argument is set to empty string because answers will processed from given string in request.
These arguments will be render later as hidden inputs.

protected void updateIncrementalFetchCartProperties ()

Updates incremental fetch properties in Cart object.
Mostly, the total of units is calculated after processing available units, hence, we need to reflect this in Cart incremental fetch properties.