The Presentation API has methods that extract standard and implicit refinements from dimensions.
When a refinement dimension has been retrieved, these calls can extract refinement information from the dimension:
API method or property |
Purpose |
---|---|
Java:
.NET:
|
Retrieves the dimension name. |
Java:
.NET:
|
Retrieves the dimension ID. This ID can
then be used with the
|
Java:
.NET:
|
Retrieves a list of refinement dimension
values. This list will be empty unless the dimension has been specified by the
|
The following code samples show how to retrieve refinement dimension
values from a navigation request where a dimension has been identified in the
Ne
parameter.
Example 31. Java example of extracting standard refinements
Navigation nav = ENEQueryResults.getNavigation(); DimensionList dl = nav.getRefinementDimensions(); for (int I=0; I < dl.size(); I++) { Dimension d = (Dimension)dl.get(I); DimValList refs = d.getRefinements(); for (int J=0; J < refs.size(); J++) { DimVal ref = (DimVal)refs.get(J); String name = ref.getName(); Long id = ref.getId(); } }
Example 32. .NET example of extracting standard refinements
Navigation nav = ENEQueryResults.Navigation; DimensionList dl = nav.RefinementDimensions; for (int I=0; I < dl.Count; I++) { Dimension d = (Dimension)dl[I]; DimValList refs = d.Refinements; for (int J=0; J < refs.Count; J++) { DimVal ref = (DimVal)refs[J]; String name = ref.Name; Long id = ref.Id; } }
If a dimension contains implicit refinements, they can be extracted from the dimension with:
The call returns a
DimLocationList
object, which (if not empty)
encapsulates
DimLocation
objects that contain the implicit
dimension value (a
DimVal
object) and all of the dimension location’s
ancestors (also
DimVal
objects) up to, but not including, the
dimension root.
You can also use these methods to test whether a dimension is fully implicit (that is, if the dimension has no non-implicit refinements and has no descriptors):
The following code samples show how to test if a dimension is fully implicit and, if so, how to retrieve the implicit refinement dimension values from that dimension.
Example 33. Java example of extracting implicit refinements
Navigation nav = ENEQueryResults.getNavigation(); DimensionList compDims = nav.getCompleteDimensions(); for (int j=0; j<compDims.size(); ++j) { Dimension dim = (Dimension) compDims.get(j); if (dim.isImplicit()) { DimLocationList dimLocList = dim.getImplicitLocations(); for (int i = 0; i < dimLocList.size(); i++) { %> Implicit dimension value: <%= ((DimLocation)dimLocList.get(i)).getDimValue().getName() %><% } } }
Example 34. .NET example of extracting implicit refinements
Navigation nav = ENEQueryResults.Navigation; DimensionList compDims = nav.CompleteDimensions; for (int j=0; j<compDims.Count; ++j) { Dimension dim = (Dimension) compDims[j]; if (dim.IsImplicit()) { DimLocationList dimLocList = dim.ImplicitLocations; for (int i = 0; i < dimLocList.Count; i++) { %> Implicit dimension value: <%= ((DimLocation)dimLocList[i]).DimValue.Name %> <% } } }