|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface RankCondition
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheRankCondition interface represents a ranking applied to a
Query.
Applying ranking to a DataSource permits the results of the
Query to be filtered in such a way that only results relating
to only the highest and lowest n values of a defined data
column are displayed.
Example:Applying percentage ranking to a query.
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.BOTTOM_PERCENTAGE,1,country,revenue);
// Run the query and fetch the data
dp.runQuery();
Query,
Podium,
ObjectQualification,
DataSource.isRankConditionSupported(),
ConditionContainer.createRankCondition(com.businessobjects.rebean.wi.Podium, int, com.businessobjects.rebean.wi.DataSourceObject, com.businessobjects.rebean.wi.DataSourceObject)| Method Summary | |
|---|---|
void |
addForEachObject(DataSourceObject forEach)
Adds a DataSourceObject of type
ObjectQualification.DIMENSION. |
ConditionContainer |
copyCondition(ConditionContainer cont)
Makes a copy of a ConditionContainer and adds it in this
RankCondition. |
ConditionContainer |
createCondition(LogicalOperator op)
Creates a ConditionContainer for this
RankCondition. |
RankConditionPrompt |
createRankConditionPrompt(java.lang.String question)
Creates a RankConditionPrompt for rank size input. |
DataSourceObject |
getBasedOnObject()
Returns the DataSourceObject of type
ObjectQualification.MEASURE the RankCondition
is based on. |
ConditionContainer |
getCondition()
Returns the condition part of this RankCondition. |
DataSourceObject |
getFilteredObject()
Returns the object being filtered on to create the ranking. |
DataSourceObject |
getForEachObject(int index)
Returns the ForEach dimension at a specified index. |
int |
getForEachObjectsCount()
Returns the number of ForEach dimensions. |
Podium |
getPodium()
Returns the Podium applied on this object. |
java.lang.String |
getPromptForSize()
Returns the question of the rank prompt size. |
RankConditionPrompt |
getRankConditionPrompt()
Returns the RankConditionPrompt when
RankCondition.isPromptSizeActive() returns true. |
int |
getSize()
Returns rank reference value. |
boolean |
hasCondition()
Checks if any conditions have been set on this RankCondition. |
boolean |
isPromptSizeActive()
Checks if rank size is defined in a prompt or have a static value. |
void |
removeCondition()
Deletes the condition part of this RankCondition. |
void |
removeForEachObject(int index)
Removes a ForEach dimension at the specified index. |
void |
setBasedOnObject(DataSourceObject basedOnObject)
Sets the DataSourceObject of type
ObjectQualification.MEASURE the RankCondition
will be based on. |
void |
setFilteredObject(DataSourceObject filterObject)
Sets the object being filtered upon to create the ranking. |
void |
setPodium(Podium op)
Changes the Podium applied to the
RankCondition object. |
void |
setPromptForSize(java.lang.String question)
Sets a prompt in RankCondition. |
void |
setSize(int value)
Sets rank reference value. |
| Methods inherited from interface com.businessobjects.rebean.wi.FilterConditionNode |
|---|
getFilterConditionNode, getID, getName, remove, removeAllChildren |
| Methods inherited from interface com.businessobjects.rebean.wi.TreeNode |
|---|
getChildAt, getChildCount, getIndex, getParent, isLeaf |
| Method Detail |
|---|
Podium getPodium()
Podium applied on this object. Depending on
whether the RankCondition is designed to return the
highest or lowest n values of the Query, the
returned value will be either:
Podium.TOPPodium.BOTTOMPodium.TOP_PERCENTAGEPodium.BOTTOM_PERCENTAGE
Podium instance.Query,
Podium,
DataSource.isRankConditionSupported()void setPodium(Podium op)
Podium applied to the
RankCondition object. Depending on whether the
RankCondition is required to return the highest or lowest
n values or n percent values of the
Query, op will be either:
Podium.TOPPodium.BOTTOMPodium.TOP_PERCENTAGEPodium.BOTTOM_PERCENTAGE
op - A Podium instance.
java.lang.NullPointerException - When op is null.void setSize(int value)
If Podium is TOP or BOTTOM,
the rank reference value is the number of results should returned. If
Podium is TOP_PERCENTAGE or
BOTTOM_PERCENTAGE,the rank reference value is 100 based.
This call will remove the RankConditionPrompt if it exists
and than RankCondition.isPromptSizeActive() becomes false.
value - The rank reference.
java.lang.IllegalArgumentException - When value < 0 .
FilterConditionException - while Podium = TOP_PERCENTAGE/BOTTOM_PERCENTAGE
and value > 100.int getSize()
void setPromptForSize(java.lang.String question)
This is a easier way to create a RankConditionPrompt.
You could get the new RankConditionPrompt by
RankCondition.getRankConditionPrompt().
question - the question will be presented to user while running query.
java.lang.NullPointerException - when question is null.
Example:
DataSource ds;
DocumentInstance doc;
DataProvider dp;
Query query;
// you should check if DataSource supports rankcondition query
if (ds.isRankConditionSupported()) {
ConditionContainer condCont = query.createCondition(LogicalOperator.AND);
RankCondition rkObj = condCont.createRankCondition(Podium.TOP, 5,
filterObj, baseonObj);
rkObj.setPromptForSize(promptQuestion);
dp.runQuery();
if (doc.getMustFillPrompts()) {
Prompts prompts = doc.getPrompts();
Prompt prompt = prompts.getItem(0);
prompt.enterValues(new String[] { "7" });
doc.setPrompts();
}
}
RankCondition.createRankConditionPrompt(String)boolean isPromptSizeActive()
RankCondition.getPromptForSize() returns the prompt's question.
true rank size should be defined via a running
query prompt. false rank size is defined by
RankCondition.setSize(int sz)java.lang.String getPromptForSize()
RankConditionPrompt createRankConditionPrompt(java.lang.String question)
RankConditionPrompt for rank size input. While
running query, a prompt for size will be shown.
Note: RankCondition.isPromptSizeActive() returns true after
this call. You should use RankCondition.setSize(int) to remove a
RankConditionPrompt.
RankConditionPromptRankConditionPrompt getRankConditionPrompt()
RankConditionPrompt when
RankCondition.isPromptSizeActive() returns true.
RankConditionPromptRankConditionPromptDataSourceObject getFilteredObject()
DataSourceObject being used as a filter.DataSourceObjectvoid setFilteredObject(DataSourceObject filterObject)
Note: the object to be filtered on has to be of type
ObjectQualification.DIMENSION or
ObjectQualification.DETAIL.
filterObject - A DataSourceObject>/code> instance.
- Throws:
java.lang.NullPointerException - When filterObject is null.
java.lang.IllegalArgumentException - When filterObject is neither of type
ObjectQualification.DIMENSION nor ObjectQualification.DETAIL.DataSourceObject getBasedOnObject()
DataSourceObject of type
ObjectQualification.MEASURE the RankCondition
is based on.
RankCondition is based on.void setBasedOnObject(DataSourceObject basedOnObject)
DataSourceObject of type
ObjectQualification.MEASURE the RankCondition
will be based on.
basedOnObject - A DataSourceObject instance of type
ObjectQualification.MEASURE.
java.lang.NullPointerException - When basedOnObject is null.
java.lang.IllegalArgumentException - When basedOnObject isn't a
ObjectQualification.MEASURE object.void addForEachObject(DataSourceObject forEach)
DataSourceObject of type
ObjectQualification.DIMENSION. A for each object is a
DIMENSION on which a ranking will be applied for each different value.
forEach - A DataSourceObject.int getForEachObjectsCount()
DataSourceObject getForEachObject(int index)
index - The index.
index position
java.lang.IndexOutOfBoundsException - When index >= v.size() or
index < 0.void removeForEachObject(int index)
index - The index of the object to be romoved.
java.lang.IndexOutOfBoundsException - When index >= v.size() or
index < 0.boolean hasCondition()
RankCondition.
true when at least one condition has been
set.ConditionContainer getCondition()
RankCondition.
ConditionContainer or null when
there is no condition.ConditionContainer createCondition(LogicalOperator op)
ConditionContainer for this
RankCondition. If this RankCondition has
already a condition container, that will be replaced with the new one.
op - The logical operator to be applied on this condition.
ConditionContainer.ConditionContainer copyCondition(ConditionContainer cont)
ConditionContainer and adds it in this
RankCondition. If this RankCondition has
already a condition container, then it will be replaced with the new one.
cont - The ConditionContainer to be copied.
ConditionContainer.void removeCondition()
RankCondition.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||