com.businessobjects.rebean.wi
Interface RankConditionPrompt

All Superinterfaces:
ConditionPrompt, FilterConditionValue

public interface RankConditionPrompt
extends ConditionPrompt

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

The RankConditionPrompt interface defines a prompt for a rank condition.

Example:Define a prompt for a rank condition
String sQuery = "SELECT SI_CUID, SI_NAME FROM"
+ " CI_APPOBJECTS WHERE SI_KIND ='"+ CeKind.UNIVERSE +"'";
IInfoObjects universes = (IInfoObjects) iStore.query(sQuery);
IInfoObject ceInfoobject = (IInfoObject)universes.get(31);
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(revenue);
ConditionContainer cond = q.createCondition(LogicalOperator.AND);
RankCondition rank = cond.createRankCondition(Podium.TOP,2,country,revenue);
String question = "How many rows you want to retrieve ?";
RankConditionPrompt rankPrompt = rank.getRankConditionPrompt();
rank.setPromptForSize(question);
// Run the query and fetch the data
dp.runQuery();
//The RankConditionPrompt can be verified by calling DocumentInstance.getMustFillPrompts().
//If the query contains prompt that has to be filled,then this method returns true.
boolean bool = doc.getMustFillPrompts();
out.print(bool);

Since:
11.7

Method Summary
 void addDefault(java.lang.String value)
          Adds a default prompt size value.
 void addDefault(ValueFromLov value)
          Illegal call on a RankConditionPrompt.
 java.lang.String getDefault(int index)
          Gets default prompt size value.
 int getDefaultValue()
          Returns the default value of prompt
 ValueFromLov getDefaultValueFromLov(int index)
          Illegal call on a RankConditionPrompt.
 void hasLOV(boolean b)
          Illegal call on a RankConditionPrompt.
 void setConstrained(boolean b)
          Illegal call on a RankConditionPrompt.
 void setDefaultValue(int size)
          Set the default value.
 void setMonoValue(boolean b)
          Illegal call on a RankConditionPrompt.
 void setOptional(boolean isOptional)
          Illegal call on a RankConditionPrompt.
 
Methods inherited from interface com.businessobjects.rebean.wi.ConditionPrompt
clearDefaultValues, getDefaultCount, getInputFormat, getKeepValues, getQuestion, getType, hasLOV, isConstrained, isMonoValue, isOptional, setKeepValues, setQuestion
 

Method Detail

addDefault

void addDefault(java.lang.String value)
Adds a default prompt size value.

Specified by:
addDefault in interface ConditionPrompt
Parameters:
value - the value
Throws:
java.lang.UnsupportedOperationException - when default value is already set.
See Also:
Prompt.getDefaultValues()

addDefault

void addDefault(ValueFromLov value)
Illegal call on a RankConditionPrompt.

Specified by:
addDefault in interface ConditionPrompt
Parameters:
value - the value which is an object of the class ValueFromLov
Throws:
java.lang.UnsupportedOperationException

hasLOV

void hasLOV(boolean b)
Illegal call on a RankConditionPrompt.

Specified by:
hasLOV in interface ConditionPrompt
Parameters:
b - when true, a list of values will be presented to the user when prompted to enter a value for prompt.
Throws:
java.lang.UnsupportedOperationException

setConstrained

void setConstrained(boolean b)
Illegal call on a RankConditionPrompt.

Specified by:
setConstrained in interface ConditionPrompt
Parameters:
b - when true, a user can type a value for this prompt.
Throws:
java.lang.UnsupportedOperationException

setMonoValue

void setMonoValue(boolean b)
Illegal call on a RankConditionPrompt.

Specified by:
setMonoValue in interface ConditionPrompt
Parameters:
b - when true, multiple values are not allowed.
Throws:
java.lang.UnsupportedOperationException

setOptional

void setOptional(boolean isOptional)
Illegal call on a RankConditionPrompt.

Specified by:
setOptional in interface ConditionPrompt
Parameters:
isOptional - true or false
Throws:
java.lang.UnsupportedOperationException
Since:
12.0
See Also:
ConditionPrompt.isOptional()

getDefault

java.lang.String getDefault(int index)
Gets default prompt size value.

Specified by:
getDefault in interface ConditionPrompt
Parameters:
index - the index of the element to return (0 based)
Returns:
the default value
Throws:
java.lang.IndexOutOfBoundsException - when index > 0
See Also:
Prompt.getDefaultValues()

getDefaultValueFromLov

ValueFromLov getDefaultValueFromLov(int index)
Illegal call on a RankConditionPrompt.

Specified by:
getDefaultValueFromLov in interface ConditionPrompt
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.UnsupportedOperationException

setDefaultValue

void setDefaultValue(int size)
Set the default value.

Parameters:
size - default prompt
Throws:
java.lang.IllegalArgumentException

getDefaultValue

int getDefaultValue()
Returns the default value of prompt

Returns:
default size.