The Navigation and DimGroup classes have methods to access information about dimension groups.
The dimensions in a dimension group are encapsulated in a DimGroup object. In turn, a DimGroupList object contains a list of dimension groups (DimGroup objects).
The next two sections show how to access the Navigation and DimGroupList objects for dimension group information. The code samples show how to loop over a DimGroupList object, access each dimension group in the object, and get each group’s name and ID.
There are three calls on the Navigation object that access the DimGroupList object. All three return a DimGroupList object that contains group names, group IDs, and the child dimensions:
|
API method or property |
Purpose |
|---|---|
|
Java: .NET: |
Gets an object that has information about the dimension groups for the dimensions with descriptors in the current navigation state. |
|
Java: .NET: |
Gets an object that contains the dimensions with refinements available in the current navigation state. |
|
Java: .NET: |
Gets an object that contains all of the information contained in the above two calls. |
Once the application has the DimGroupList object, it can render the dimension group information with these methods and properties:
|
API method or property |
Purpose |
|---|---|
|
Java: .NET: |
Used on the |
|
Java: .NET: |
With these calls, the application is able to assess whether the current group is implicit (having an ID of zero) or explicit (having an ID greater than zero). |
|
Java: .NET: |
Used to access the name of the current dimension group. If this returns a null object, then the current dimension group was implicitly created. |
|
Java: .NET: |
Used in initiating a loop in order to access the dimensions in the group. |
|
Java: .NET: |
Used to access a specific dimension in the group without looping. This method requires either a dimension ID or a dimension name to be passed in. |
Example 29. Java example of getting a dimension group ID and name
DimGroupList refDimGroups = nav.getRefinementDimGroups();
// Loop over the list of dimension groups
for (int i=0; i<refDimGroups.size(); i++) {
// Get an individual dimension group
DimGroup dg = (DimGroup)refDimGroups.get(i);
long dimGroupId = dg.getId();
// If ID is zero, group is implicit, otherwise get its name
if (dimGroupId != 0) {
String dimGroupName = dg.getName();
}
for (int j=0; j<dg.size(); j++) {
// retrieve refinement dimension values
...
}
}
Example 30. .NET example of getting a dimension group ID and name
DimGroupList refDimGroups = nav.RefinementDimGroups;
// Loop over the list of dimension groups
for (int i=0; i<refDimGroups.Count; i++) {
// Get individual dimension group
DimGroup dg = (DimGroup)refDimGroups[i];
long dimGroupId = dg.Id;
// If ID is zero, group is implicit, otherwise get its name
if (dimGroupId != 0) {
String dimGroupName = dg.Name;
}
for (int j=0; j<dg.Count; j++) {
// retrieve refinement dimension values
...
}
}

