com.businessobjects.rebean.wi
Interface ConditionPrompt

All Superinterfaces:
FilterConditionValue
All Known Subinterfaces:
RankConditionPrompt

public interface ConditionPrompt
extends FilterConditionValue

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

The ConditionPrompt interface defines a prompt for a condition.


Method Summary
 void addDefault(java.lang.String value)
          Adds a value that will be entered into the prompt by default.
 void addDefault(ValueFromLov value)
          Adds a value that will be entered into the prompt by default.
 void clearDefaultValues()
          Clears any default values.
 java.lang.String getDefault(int index)
          Returns a default value at a given index.
 int getDefaultCount()
          Returns the count of default values.
 ValueFromLov getDefaultValueFromLov(int index)
          Returns a default value at a given index.
 java.lang.String getInputFormat()
          Returns the default input format for the object of this prompt.
 boolean getKeepValues()
          Checks if the value(s) entered will be kept for the next time when the user is prompted.
 java.lang.String getQuestion()
          Returns the question that will be presented to the user when the prompt needs a value.
 ObjectType getType()
          Returns the type of the object of the underlying ConditionObject.
 boolean hasLOV()
          Checks if this prompt have a list of values.
 void hasLOV(boolean b)
          When set to true, a list of values will be presented to the user when prompted to enter a value for prompt.
 boolean isConstrained()
          Checks if the user can type a value for this prompt.
 boolean isMonoValue()
          Checks if multiple values are allowed.
 boolean isOptional()
          Checks if entering a value for this ConditionalPrompt is optional.
 void setConstrained(boolean constrain)
          Determines whether a user can type a value.
 void setKeepValues(boolean b)
          Specifies if values are kept after entering them.
 void setMonoValue(boolean mono)
          Determines whether multiple values are allowed.
 void setOptional(boolean isOptional)
          Specifies if entering value for this ConditionalPrompt is optional.
 void setQuestion(java.lang.String question)
          Changes the question that will be presented to the user when the prompt needs a value.
 

Method Detail

getQuestion

java.lang.String getQuestion()
Returns the question that will be presented to the user when the prompt needs a value.

Returns:
the question

setQuestion

void setQuestion(java.lang.String question)
Changes the question that will be presented to the user when the prompt needs a value.

Note: The question string is used as the unique identifier. If the same question is used for more than one prompt, the user will be prompted only once.

Parameters:
question - The question to be asked.
Throws:
java.lang.NullPointerException - When question is null.

getType

ObjectType getType()
Returns the type of the object of the underlying ConditionObject.

Returns:
The object type.

getInputFormat

java.lang.String getInputFormat()

Returns the default input format for the object of this prompt. Depending on the ObjectType of the underlying ConditionObject's DataSourceObject, a value will be returned.

This method is especially useful for determining the way a date is expected, for example this might be dd/mm/yy or mm/dd/yy. The default input format depends on the locale passed to ReportEngine.init(Object, String).

Note that, as there is no way to tell if an ObjectType.NUMERIC represents a currency, in no case will this return a currency format.

Returns:
the default input format for this prompt
See Also:
ConditionPrompt.getType(), ReportEngine.getDefaultFormatNumber(FormatNumberType)

isConstrained

boolean isConstrained()
Checks if the user can type a value for this prompt.

Returns:
true when a user can type a value for this prompt

setConstrained

void setConstrained(boolean constrain)
Determines whether a user can type a value.

Parameters:
constrain - when true, a user can type a value for this prompt.

isMonoValue

boolean isMonoValue()
Checks if multiple values are allowed.

Returns:
true when multiple values are not allowed.

setMonoValue

void setMonoValue(boolean mono)
Determines whether multiple values are allowed.

Parameters:
mono - when true, multiple values are not allowed.

hasLOV

boolean hasLOV()
Checks if this prompt have a list of values.

Returns:
true, when this prompt has a list of values.

hasLOV

void hasLOV(boolean b)
When set to true, a list of values will be presented to the user when prompted to enter a value for prompt.

Parameters:
b - when true, a list of values will be presented to the user when prompted to enter a value for prompt.

getKeepValues

boolean getKeepValues()
Checks if the value(s) entered will be kept for the next time when the user is prompted.

Returns:
true when values are kept.

setKeepValues

void setKeepValues(boolean b)
Specifies if values are kept after entering them. If so, the next time the user is prompted, the same values will be preselected, if not, the default values will be entered.

Parameters:
b - when true, values entered will be kept for the next time this prompt is presented.

setOptional

void setOptional(boolean isOptional)
Specifies if entering value for this ConditionalPrompt is optional.

If specified true , then entering value for the current ConditionalPrompt is optional i.e. user can skip this prompt when running a query. If set to false, then a value must be selected when running a query.

Example:Setting optional prompts

   String universeId =((IUniverse)ceInfoobject).buildUniverseIdString();
         DocumentInstance doc = repEng.newDocument(universeId);
         ReportContainer report = doc.createReport("Report1");
         DataProviders dps = doc.getDataProviders();
         // Retrieve the 1st data provider
         DataProvider dp = dps.getItem(0);
         // Retrieve the universe objects
         DataSource ds = dp.getDataSource();
         DataSourceObject country = ds.getClasses().getChildByName("Country");
         DataSourceObject revenue = ds.getClasses().getChildByName("Revenue");
         Query q = dp.getQuery();
         // Add result objects to the query
         q.addResultObject(country);
         // q.addResultObject(year);
         q.addResultObject(revenue);
         ConditionContainer condCon = q.createCondition(LogicalOperator.OR);
         ConditionObject condObj = condCon.createConditionObject(country);
         FilterCondition filterCon = condObj.createFilterCondition(Operator.IN_LIST);
         ConditionPrompt condPrompt = filterCon.createConditionPrompt("Country ?");
         condPrompt.setOptional(true);
         // Run the query and fetch the data
         dp.runQuery();
         doc.refresh();
         out.print("Document has prompt: " +doc.getMustFillPrompts());
         Prompts prompts = doc.getPrompts();
         Prompt prompt = prompts.getItem(0);
         out.print("Prompt is Optional: "+prompt.isOptional());
 

Parameters:
isOptional - true or false
Since:
12.0
See Also:
ConditionPrompt.isOptional()

isOptional

boolean isOptional()
Checks if entering a value for this ConditionalPrompt is optional.

Returns:
true if entering value is optional, otherwise false.
Since:
12.0
See Also:
ConditionPrompt.setOptional(boolean), Prompt.isOptional()

addDefault

void addDefault(java.lang.String value)
Adds a value that will be entered into the prompt by default.

Parameters:
value - the value
Throws:
java.lang.NullPointerException - when value is null
See Also:
Prompt.getDefaultValues()

addDefault

void addDefault(ValueFromLov value)
Adds a value that will be entered into the prompt by default.

Parameters:
value - the value which is an object of the class ValueFromLov
Throws:
java.lang.NullPointerException - when value is null
Since:
11.5

getDefault

java.lang.String getDefault(int index)
Returns a default value at a given index.

Parameters:
index - the index of the element to return (0 based)
Returns:
the default value
Throws:
java.lang.ArrayIndexOutOfBoundsException - when index is invalid (index < 0 || index >= getDefaultCount())
See Also:
Prompt.getDefaultValues()

getDefaultValueFromLov

ValueFromLov getDefaultValueFromLov(int index)
Returns a default value at a given index.

Parameters:
index - the index of the element to return (0 based)
Returns:
the default value which is an object of the class ValueFromLov
Throws:
java.lang.ArrayIndexOutOfBoundsException - when index is invalid (index < 0 || index >= getDefaultCount())
Since:
11.5

getDefaultCount

int getDefaultCount()
Returns the count of default values.

Returns:
the count of default values

clearDefaultValues

void clearDefaultValues()
Clears any default values.