|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.iquery.builder.DisabledTotalsBuilder
public class DisabledTotalsBuilder
Builder class for disabling totals and sub-totals. Changes are NOT committed to the model until build() is called.
// new builder DisabledTotalsBuilder builder = newDisabledTotalsBuilder(ds); Map<DataItem, Set<TotalingType>> disabledTotalsBuilt = builder // builder .totalingType(TotalingType.ALLTOTAL, Role.COLUMN) // turn on all totaling for the query's Columns .totalingType(TotalingType.ALLTOTAL, Role.ROW) // turn on all totaling for the query's Rows .disable(dsDataItems.get(0), TotalingType.AXISTOTAL) // turn off axis total for DIR_1 .disable(dsDataItems.get(1), TotalingType.ALLTOTAL) // turn off axis+sub totals for DIR_2 .enable(dsDataItems.get(2), TotalingType.ALLTOTAL) // force axis+sub totals to be show for DIR_3 .persistGroups(true) // persist this info upon saving query .build();
Method Summary | |
---|---|
java.util.Map<DataItem,java.util.Set<TotalingType>> |
build()
Build and return and Intelligent Query object, based on parameters supplied to the Builder implementation. |
DisabledTotalsBuilder |
clear(DataItem... dataItems)
Clears all totaling types for the data items given. |
DisabledTotalsBuilder |
clear(TotalingType... totalingTypes)
Clears all data items for the totaling types given. |
static void |
clearByDataItem(BusinessQuery businessQuery,
java.util.Map<DataItem,java.util.Set<TotalingType>> mapping)
Directly updates the business query with the mapping of data items and to be cleared totaling types. |
static java.util.List<DataItem> |
clearTotaling(BusinessQuery businessQuery,
TotalingType totalingType)
Clears the totaling lists for the business query. |
static void |
clearTotaling(BusinessQuery businessQuery,
TotalingType totalingType,
DataItem... dataItems)
Clear the data items for the given totaling type. |
DisabledTotalsBuilder |
disable(DataItem dataItem,
TotalingType... totalingTypes)
Disable the item for the totaling types given. |
DisabledTotalsBuilder |
disable(TotalingType totalingType,
DataItem... dataItems)
Disable the totaling type for the items given. |
static void |
disableByDataItem(BusinessQuery businessQuery,
java.util.Map<DataItem,java.util.Set<TotalingType>> mapping)
Directly updates the business query with the mapping of data items and disabled totaling types. |
static void |
disableTotaling(BusinessQuery businessQuery,
TotalingType totalingType,
DataItem... dataItems)
Set the data items to have a disabled totaling for the given totaling type. |
DisabledTotalsBuilder |
enable(DataItem dataItem,
TotalingType... totalingTypes)
Enable the item for the totaling types given. |
DisabledTotalsBuilder |
enable(TotalingType totalingType,
DataItem... dataItems)
Enable the totaling type for the items given. |
static void |
enableByDataItem(BusinessQuery businessQuery,
java.util.Map<DataItem,java.util.Set<TotalingType>> mapping)
Directly updates the business query with the mapping of data items and enabled totaling types. |
static void |
enableTotaling(BusinessQuery businessQuery,
TotalingType totalingType,
DataItem... dataItems)
Set the data items to have a enabled totaling for the given totaling type. |
BusinessQuery |
getBusinessQuery()
|
java.util.Map<DataItem,java.util.Set<TotalingType>> |
getByDataItems()
Get a mapping from data selection WITH pending changes that have not been committed with build(). |
java.util.Map<TotalingType,java.util.Set<DataItem>> |
getByTotalingTypes()
Get a mapping from data selection WITH any pending changes that have not been committed with build(). |
java.util.Set<DataItem> |
getDisabledItemsForType(TotalingType totalingType)
Get the data items disabled for the totaling type given WITH any pending changes that have not been committed with build(). |
static java.util.Map<DataItem,java.util.Set<TotalingType>> |
getDisabledTotalingByItem(BusinessQuery businessQuery)
Returns a mapping of data items to the totaling types disabled for that data item. |
static java.util.Map<DataItem,java.util.Set<TotalingType>> |
getDisabledTotalingByItem(BusinessQuery businessQuery,
boolean recursive)
returns a mapping of data items to the totaling types disabled for that data item. |
static java.util.Map<TotalingType,java.util.Set<DataItem>> |
getDisabledTotalingByType(BusinessQuery businessQuery)
Returns a mapping of data items to the totaling types disabled for that data item. |
static java.util.Map<TotalingType,java.util.Set<DataItem>> |
getDisabledTotalingByType(BusinessQuery businessQuery,
boolean recursive)
Returns a mapping of data items to the totaling types disabled for that data item. |
java.util.Set<TotalingType> |
getDisabledTypesForItem(DataItem dataItem)
Get the total types disabled for the data item given WITH any pending changes that have not been committed with build(). |
boolean |
isBuilt()
returns true if the builder has changes pending and the build() method has not been called since those changes were made. |
static boolean |
isDisabledTotaling(BusinessQuery businessQuery,
DataItem item,
TotalingType totalingType)
Returns true if the total is disabled for that data item or any of the base items for that data item. |
static boolean |
isDisabledTotaling(BusinessQuery businessQuery,
DataItem item,
TotalingType totalingType,
boolean checkParentModels,
boolean checkRootItems)
Returns true if the total is disabled for that data item. |
static boolean |
isDisabledTotaling(DataSelection businessQuery,
DataItem item,
TotalingType totalingType,
boolean checkParentModels)
Returns true if the total is disabled for that data item or any of the base items for that data item. |
boolean |
isPersistGroups()
returns true if the active groups for this builder's data selection will be persisted to XML |
static boolean |
isPersistGroups(BusinessQuery businessQuery)
returns true if the active groups for this builder's data selection will be persisted to XML |
boolean |
isRemovePending()
returns true if the builder's next build() will remove all of the grouping behaviors. |
void |
load(BusinessQuery businessQuery)
Clears any pending changes and loads a complete snapshot of the disabled totals from the specified data selection. |
DisabledTotalsBuilder |
persistGroups(boolean enable)
Clears all totaling types for the data items given. |
static void |
persistGroups(BusinessQuery businessQuery,
boolean persistGroups)
turns on persistence of active groups for this query. |
DisabledTotalsBuilder |
remove()
Removes the disabled totaling behaviors for the data selection all together on the next build. |
static java.util.List<DataItem> |
removeTotaling(BusinessQuery businessQuery)
version of the above remove() that acts directly on the business query |
static java.util.List<DataItem> |
removeTotaling(BusinessQuery businessQuery,
TotalingType totalingType)
Removes the disabled totaling for the totaling type from the business query. |
static void |
setQueryTotaling(BusinessQuery businessQuery,
TotalingType totalingType,
Role role)
turns on totaling for the specified totaling type and role |
DisabledTotalsBuilder |
totalingType(TotalingType totalingType,
Role role)
turns on totaling for the specified totaling type and role |
Method Detail |
---|
public BusinessQuery getBusinessQuery()
public boolean isBuilt()
public boolean isRemovePending()
public java.util.Map<DataItem,java.util.Set<TotalingType>> build() throws MetadataException
Builder
Builder
implementation.
null
is never returned from this method. A MetadataException
will be thrown in the case where the object could not be constructed.
build
in interface Builder<java.util.Map<DataItem,java.util.Set<TotalingType>>>
T
.
MetadataException
- if the object could not be buildBuilder.build()
public void load(BusinessQuery businessQuery)
dataSelection
- public java.util.Map<DataItem,java.util.Set<TotalingType>> getByDataItems()
public java.util.Map<TotalingType,java.util.Set<DataItem>> getByTotalingTypes()
public java.util.Set<DataItem> getDisabledItemsForType(TotalingType totalingType)
totalingType
-
public java.util.Set<TotalingType> getDisabledTypesForItem(DataItem dataItem)
dataItem
-
public DisabledTotalsBuilder totalingType(TotalingType totalingType, Role role)
public static void setQueryTotaling(BusinessQuery businessQuery, TotalingType totalingType, Role role) throws MetadataException
MetadataException
public DisabledTotalsBuilder persistGroups(boolean enable)
dataItems
-
public boolean isPersistGroups()
public static void persistGroups(BusinessQuery businessQuery, boolean persistGroups) throws MetadataException
MetadataException
public static boolean isPersistGroups(BusinessQuery businessQuery)
public DisabledTotalsBuilder disable(TotalingType totalingType, DataItem... dataItems) throws MetadataException
totalingType
- dataItems
- totalingType
-
MetadataException
public DisabledTotalsBuilder disable(DataItem dataItem, TotalingType... totalingTypes)
dataItem
- totalingTypes
-
public static void disableTotaling(BusinessQuery businessQuery, TotalingType totalingType, DataItem... dataItems) throws MetadataException
MetadataException
public static void disableByDataItem(BusinessQuery businessQuery, java.util.Map<DataItem,java.util.Set<TotalingType>> mapping) throws MetadataException
dataSelection
- mapping
-
MetadataException
public DisabledTotalsBuilder enable(TotalingType totalingType, DataItem... dataItems) throws MetadataException
totalingType
- dataItems
-
MetadataException
public DisabledTotalsBuilder enable(DataItem dataItem, TotalingType... totalingTypes)
dataItem
- totalingTypes
-
public static void enableTotaling(BusinessQuery businessQuery, TotalingType totalingType, DataItem... dataItems) throws MetadataException
MetadataException
public static void enableByDataItem(BusinessQuery businessQuery, java.util.Map<DataItem,java.util.Set<TotalingType>> mapping) throws MetadataException
dataSelection
- mapping
-
MetadataException
public DisabledTotalsBuilder clear(TotalingType... totalingTypes)
totalingTypes
-
public DisabledTotalsBuilder clear(DataItem... dataItems)
dataItems
-
public static void clearTotaling(BusinessQuery businessQuery, TotalingType totalingType, DataItem... dataItems) throws MetadataException
MetadataException
public static void clearByDataItem(BusinessQuery businessQuery, java.util.Map<DataItem,java.util.Set<TotalingType>> mapping) throws MetadataException
dataSelection
- mapping
-
MetadataException
public DisabledTotalsBuilder remove()
dataItems
-
public static java.util.List<DataItem> removeTotaling(BusinessQuery businessQuery) throws MetadataException
MetadataException
public static java.util.Map<TotalingType,java.util.Set<DataItem>> getDisabledTotalingByType(BusinessQuery businessQuery)
businessQuery
-
public static java.util.Map<TotalingType,java.util.Set<DataItem>> getDisabledTotalingByType(BusinessQuery businessQuery, boolean recursive)
businessQuery
- recursive
- if true then parent models will be searched.
public static java.util.Map<DataItem,java.util.Set<TotalingType>> getDisabledTotalingByItem(BusinessQuery businessQuery)
businessQuery
-
public static java.util.Map<DataItem,java.util.Set<TotalingType>> getDisabledTotalingByItem(BusinessQuery businessQuery, boolean recursive)
businessQuery
- recursive
- if true then parent models will be searched.
public static boolean isDisabledTotaling(BusinessQuery businessQuery, DataItem item, TotalingType totalingType)
dataSelection
- item
- totalType
-
public static boolean isDisabledTotaling(DataSelection businessQuery, DataItem item, TotalingType totalingType, boolean checkParentModels)
item
- checkParentModels
- check parent business queries for data items that do not have TOTAL_NONE set.dataSelection
- totalType
-
public static boolean isDisabledTotaling(BusinessQuery businessQuery, DataItem item, TotalingType totalingType, boolean checkParentModels, boolean checkRootItems)
item
- checkParentModels
- check parent business queries for data items that do not have TOTAL_NONE set.checkRootItems
- if not found by the item then if it is a data item reference it starts walking up the base items.dataSelection
- totalType
-
public static java.util.List<DataItem> removeTotaling(BusinessQuery businessQuery, TotalingType totalingType) throws MetadataException
MetadataException
public static java.util.List<DataItem> clearTotaling(BusinessQuery businessQuery, TotalingType totalingType) throws MetadataException
MetadataException
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |