public class

PromptExpressionCartXHTMLTransform

extends PromptCartXHTMLTransform
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
             ↳ com.microstrategy.web.app.transforms.PromptExpressionCartXHTMLTransform
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Renders Expression prompt in "shopping cart" style.
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
public FormalParameter loadFileSeparator Specifies separator to be used when parsing uploaded file values.
public FormalParameter logicalOperatorAvailableUserDefined Specifies a custome boolean value indicating whether or not to displaye logical operators.
public FormalParameter logicalOperatorDefault Specifies 'And/Or' match case default value.
public FormalParameter logicalOperatorSelectionMethod Specifies whether the 'And/Or' match case checkbox is displayed or not next the selected list in cart style ouput.
public FormalParameter truncateUploadedAnswersDisplay Specifies whether or not to truncate selected list output to certain number of characters.
public FormalParameter truncateUploadedAnswersDisplaySize Specifies maximum number of characters displayed when truncate expression is requested.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.PromptCartXHTMLTransform
From class com.microstrategy.web.app.transforms.AbstractPromptExpressionTransform
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
Public Constructors
PromptExpressionCartXHTMLTransform()
Default no-args constructor, initialize all the formal parameters as Parent class has defined.
Public Methods
boolean areUPandDownButtonsAvailable()
Indicates whether or not UP and Down buttons are enabled.
boolean canTransform(Transformable data)
Indicates whether or not, given component (data) can be processed by this transform.
String getDescription()
Indicates the description for this Transform.
void initializeCart()
Initializes this transform's CartExpression instance properties to the default values required.
void initializeCss()
Initializes CSS information to be used by this transform.
boolean isAnswerComplex()
Determines whether or not current answer is complex.
boolean isCalendarAvailable()
Indicates whether or not Calendar object is enabled.
boolean isExpressionAFilter()
Determines whether or not, prompt's expression type corresponds to a Filter.
boolean isExpressionAMetric()
Indicates whether or not prompt's expression is Metric Qualification.
boolean isInputFromTextFile()
Determines if the input for this prompt comes from text file or not.
boolean isNextInputButtonAvailable()
Indicates whether or not 'Next Input' button is enabled.
void renderAvailableLabel(MarkupOutput out)
Renders label associated to Available section.
void renderCalendarButton(MarkupOutput out)
Renders the calendar button information.
void renderCart(MarkupOutput out)
Renders a shopping cart output by calling different methods that will render the individual sections of the prompt layout.
void renderInputTextFile(MarkupOutput out)
Renders the text box input where the user will be enabled to enter or view the text file from where the prompt information comes up.
void renderMatch(MarkupOutput out)
Renders the AND or OR information for this cart expression.
void renderNextInputButton(MarkupOutput out)
Renders the Output Level box option.
void renderOperatorLabel(MarkupOutput out)
Renders label associated to Operators section.
void renderOperators(MarkupOutput out)
Renders the applicable operators for this prompt expression.
void renderPromptContent(MarkupOutput out)
Renders the prompt question layout content by calling the renderCart() method.
void renderQualificationInputBox(MarkupOutput out)
Renders the text box input where the expression value may be written.
Protected Methods
boolean checkLogicalOperatorMethod(int iConst)
Validates whether or not, given operator mode (iConst) is enabled.
CartExpression createCartExpression()
Create a new CartExpression using the GUIElement Factory
WebExpression getAnswer()
Indicates the answer instance of the prompt being transformed.
WebAttributeForms getAttributeForms(WebAttribute attribute)
Returns collection of forms associated to given Attribute.
Cart getCart()
Returns instance of Cart object.
CartExpression getCartExpression()
Returns an instance of CartExpression object.
Enumeration getSelectedItems()
Returns collection consisted of all selected items.
boolean isCart()
void processAvailableItems()
Indicates the list of avaialble units to display for this cart.
void processIncrementalFetch()
Initializes incremental fetching settings.
void processSelectedItems()
Initializes selected items list for this cart expression transform.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.PromptCartXHTMLTransform
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

public FormalParameter loadFileSeparator

Specifies separator to be used when parsing uploaded file values.

public FormalParameter logicalOperatorAvailableUserDefined

Specifies a custome boolean value indicating whether or not to displaye logical operators.

public FormalParameter logicalOperatorDefault

Specifies 'And/Or' match case default value. The value for this formal parameter comes from the EnumDSSXMLFunction enumeration.

public FormalParameter logicalOperatorSelectionMethod

Specifies whether the 'And/Or' match case checkbox is displayed or not next the selected list in cart style ouput.

public FormalParameter truncateUploadedAnswersDisplay

Specifies whether or not to truncate selected list output to certain number of characters.
This formal parameter will be ignored if uploading answers isn't enabled. Default value indicates not to truncate.

public FormalParameter truncateUploadedAnswersDisplaySize

Specifies maximum number of characters displayed when truncate expression is requested.
This formal parameter will be ignored if uploading answers isn't enabled. Default value is 100 characters.

Public Constructors

public PromptExpressionCartXHTMLTransform ()

Default no-args constructor, initialize all the formal parameters as Parent class has defined.

Public Methods

public boolean areUPandDownButtonsAvailable ()

Indicates whether or not UP and Down buttons are enabled.

Returns
  • boolean true if enabled.

public boolean canTransform (Transformable data)

Indicates whether or not, given component (data) can be processed by this transform.
Extends canTransform by returning True only if the prompt is of type WebPromptTypeExpression

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 CartExpression instance properties to the default values required.

public void initializeCss ()

Initializes CSS information to be used by this transform.

public boolean isAnswerComplex ()

Determines whether or not current answer is complex.

Returns
  • boolean True if answer is complex.

public boolean isCalendarAvailable ()

Indicates whether or not Calendar object is enabled.

Returns
  • boolean value indicating if a calendar is available for this prompt output, by asking the Cart initialized instance isCalendarAvailable.

public boolean isExpressionAFilter ()

Determines whether or not, prompt's expression type corresponds to a Filter.

Returns
  • boolean true if expression is a Filter type.

public boolean isExpressionAMetric ()

Indicates whether or not prompt's expression is Metric Qualification.
It gets prompts expression and compares its type against DssXmlFilterSingleMetricQual.

Returns
  • boolean true if expression is a Metric Qualification.

public boolean isInputFromTextFile ()

Determines if the input for this prompt comes from text file or not.
This is accomplished by checking the inputFromTextFile formal parameter value.

Returns
  • boolean True if input of this prompt can come from text file.

public boolean isNextInputButtonAvailable ()

Indicates whether or not 'Next Input' button is enabled.

Returns
  • boolean true if enabled.

public void renderAvailableLabel (MarkupOutput out)

Renders label associated to Available section.

Parameters
out MarkupOutput where to write label.

public void renderCalendarButton (MarkupOutput out)

Renders the calendar button information. Sample code for this method would be defined as follows:

   _cart.getCalendar().showOrHideCalendarButton(out, (String) _cart.getProperty(EnumCartProperties.AVAILABLE_ARGUMENT));
 

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.

   renderLabel(out,
               (String) _cart.getProperty(EnumCartProperties.AVAILABLE_LABEL),
               (String) _cart.getProperty(EnumCartProperties.AVAILABLE_ARGUMENT));
   renderIncrementalFetch(out);
   renderAvailable(out);
   renderLabel(out, (String) _cart.getProperty(EnumCartProperties.OPERATOR_LABEL), (String) _cart.getProperty(EnumCartProperties.OPERATOR_ARGUMENT));
   renderOperators(out);
   renderLabel(out, (String) _cart.getProperty(EnumCartProperties.INPUT_LABEL), (String) _cart.getProperty(EnumCartProperties.INPUT_ARGUMENT));
   renderQualificationInputBox(out);
   if (((Boolean) _cart.getProperty(EnumCartProperties.BUTTON_NEXT_INPUT_AVAILABLE)).booleanValue()) {
     renderLabel(out, " ", null);
     renderNextInputButton(out);
   }
   renderAdd(out);
   renderRemove(out);
   renderLabel(out,
               (String) _cart.getProperty(EnumCartProperties.SELECTED_LABEL),
               (String) _cart.getProperty(EnumCartProperties.SELECTED_ARGUMENT));
   renderSelected(out);
   if (((Boolean) _cart.getProperty(EnumCartProperties.UP_AND_DOWN_AVAILABLE)).booleanValue()) {
     renderUp(out);
     renderDown(out);
   }
   renderMatch(out);
   if (isCalendarAvailable()) {
     renderCalendarButton(out);
   }
   if (isInputFromTextFile()) {
     renderInputTextFile(out);
   }
 

Parameters
out where to write the output of the method.

public void renderInputTextFile (MarkupOutput out)

Renders the text box input where the user will be enabled to enter or view the text file from where the prompt information comes up. Sample source code for this method would be defined as follows:

         WebEvent event = getPromptsBean().getWebEvent(EnumPromptsBeanEvents.PROMPTS_EVENT_PROCESS_ALL_PROMPTS);
        if (event != null) {
            out.append(getDescriptor(1381)); //Descriptor: Import filter from a file:
            String argumentName = event.getArgumentName(EnumPageEvents.WebEventArgumentTextFileAnswer, getPrompt().getPromptPosition());

            //the browse button.
            out.append("<INPUT TYPE=\"file\" NAME=\"");
            out.append(argumentName);
            out.append("\" LABEL=\"");
            out.append(getDescriptor(1825));    //Descriptor: Browse
            if (isDhtmlMode) {
                out.append("\" ONFOCUS=\"javascript: selectInOperator('" + getArgumentName(PROMPTS_EVENT_ARGUMENT_FUNCTION) + "');");
            }
            out.append("\" SIZE=30 /> ");

            //Generating the dotted arrow image.
            String dottedArrowImgName = _imagesFolder + _dottedArrowImg.getValue();
            HTMLHelper.generateIMG(out, 0, dottedArrowImgName, 39, 22, "", 0);
            out.append(" ");

            if (isDhtmlMode) {
                //Check the preferences the admin set for the file extensions.
                String sValidExtensions = "";

                AppContext promptsAppContext = getPromptsAppContext();

                if (promptsAppContext != null) {
                    Preferences pref = promptsAppContext.getPreferences();

                    sValidExtensions = pref.getValue(EnumWebPreferences.WebPreferencePromptsUploadFileExtensions);
                }
                //We will append a script that sets the variables.
                out.append("<SCRIPT>");
                out.append(" var sValidExtensions = '," + sValidExtensions + ",';");
                out.append("var sInvalidFileMessage= '" + StringUtils.replaceString(getDescriptor(1261), "##", sValidExtensions) + "';");
                out.append("var sEventID='" + String.valueOf(event.getID()) + "';");
                out.append("</SCRIPT>");
            }
            //the LoadFile button.
            String buttonName = event.getArgumentName(EnumPageEvents.WebEventArgumentLoadFile, getPrompt().getPromptPosition());

            out.append("<INPUT TYPE=\"submit\" NAME=\"");
            out.append(buttonName);
            out.append("\" VALUE=\"");
            out.append(getDescriptor(1348));    //Descriptor: Load File
            out.append("\" ID=\"" + buttonName);
            if (isDhtmlMode) {
                out.append("\" ONCLICK=\"javascript: selectInOperator('" + getArgumentName(PROMPTS_EVENT_ARGUMENT_FUNCTION) + "'); return(checkFileExtension('" + argumentName + "'));");
            }
            out.append("\" />");
        }
 

Parameters
out MarkupOutput instance where the HTML content generated by this method will be saved

public void renderMatch (MarkupOutput out)

Renders the AND or OR information for this cart expression. Sample code for this method would be defined as follows:

   _cart.renderMatch(out);
 

Parameters
out MarkupOutput instance where the HTML content generated by this method will be saved

public void renderNextInputButton (MarkupOutput out)

Renders the Output Level box option. Sample code for this method would be defined as follows:

   _cart.renderButtonNextInput(out);
 

Parameters
out MarkupOutput instance where the HTML content generated by this method will be saved

public void renderOperatorLabel (MarkupOutput out)

Renders label associated to Operators section.

Parameters
out MarkupOutput where to write label.

public void renderOperators (MarkupOutput out)

Renders the applicable operators for this prompt expression. Sample code for this method would be defined as follows:

   _cart.renderOperators(out);
 

Parameters
out MarkupOutput instance where the HTML content generated by this method will be saved

public void renderPromptContent (MarkupOutput out)

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

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

public void renderQualificationInputBox (MarkupOutput out)

Renders the text box input where the expression value may be written.
Sample code for this method would be defined as follows:

   _cart.renderInput(out);
 

Parameters
out MarkupOutput instance where the HTML content generated by this method will be saved

Protected Methods

protected boolean checkLogicalOperatorMethod (int iConst)

Validates whether or not, given operator mode (iConst) is enabled.
Test if the logicalOperatorSelectionMethod formal parameter value contains this flag

Parameters
iConst logical operator mode flag to use for testing the formal parameter value
Returns
  • True if the level logical operator mode flag is included in the logicalOperatorSelectionMethod parameter value. Otherwise returns False.

protected CartExpression createCartExpression ()

Create a new CartExpression using the GUIElement Factory

Returns
  • a new instance of the CartExpression

protected WebExpression getAnswer ()

Indicates the answer instance of the prompt being transformed.

Returns

protected WebAttributeForms getAttributeForms (WebAttribute attribute)

Returns collection of forms associated to given Attribute.
It returns all forms if current Prompted report isn't an XDA MDX type. If that's the case, then it checks (WebExpressionPrompt.getDisplayedForms()) which kind of forms are to be returned.

Parameters
attribute WebAttribute
Returns
  • WebAttributeForms

protected Cart getCart ()

Returns instance of Cart object.
Overrides getCart by providing a CartExpression given by the getCartExpression method.

Returns
  • Cart instance related to this transform.

protected CartExpression getCartExpression ()

Returns an instance of CartExpression object.
An active CartExpression instance is returned, making sure this instance isn't null.

Returns

protected Enumeration getSelectedItems ()

Returns collection consisted of all selected items.
Extends processSelectedItems by giving support for prompts of the type WebPromptTypeExpression.

Returns
  • an Enumeration initialized with the selected items list.

protected boolean isCart ()

protected void processAvailableItems ()

Indicates the list of avaialble units to display for this cart.

Throws
WebObjectsException if an error happens while processing the information.

protected void processIncrementalFetch ()

Initializes incremental fetching settings.

protected void processSelectedItems ()

Initializes selected items list for this cart expression transform.

Throws
WebObjectsException if an error happens while processing the information.