You can use selected dimension values to create additional queries.
The following two sections show how you can use the selected refinements to generate queries that remove selected dimension values as well as select ancestors of the selected descriptors.
Once you have the selected dimension values, additional queries can be generated for the action of removing a selection. A descriptor is a specific type of selected dimension value. The descriptor is the hierarchically lowest selected dimension value for a dimension.
One query that can be generated from the descriptor is the query where a descriptor is removed. You can use the ENEQueryToolkit
to generate the query where the descriptor is removed from the current query. You pass in the Navigation
object and the descriptor to generate the navigation query, as in these examples:
// Java version DimValIdList removed = ENEQueryToolkit.removeDescriptor(nav, desc); // .NET version DimValIdList removed = ENEQueryToolkit.RemoveDescriptor(nav, desc);
The Java removeDescriptor()
and .NET RemoveDescriptor()
methods generate a DimValIdList
object. The object can be used as the Navigation (N
) parameter for the additional query by calling the Java toString()
or .NET ToString()
method of this object.
The following code snippets show how to create queries that remove descriptors.
Example 41. Java example of creating queries that remove descriptors
// Get the descriptor from the dimension DimVal desc = dim.getDescriptor(); // Remove the descriptor from the navigation DimValIdList dParams = ENEQueryToolkit.removeDescriptor(nav,desc); %> <a href="/controller.jsp?N=<%= dParams.toString() %>"> <img src="delete.gif"></a> <%
Example 42. .NET example of creating queries that remove descriptors
// Get the descriptor from the dimension DimVal desc = dim.Descriptor; // Remove the descriptor from the navigation DimValIdList dParams = ENEQueryToolkit.RemoveDescriptor(nav,desc); %> <a href="/controller.aspx?N=<%= dParams.ToString() %>"> <img src="delete.gif"></a> <%
Another query that you could generate from selected dimension values would be a query for selecting an ancestor. An ancestor is any hierarchical ancestor of a dimension’s current descriptor. The resulting query from selecting an ancestor is the existing navigation state with the current descriptor removed, and the ancestor that is selected as the new descriptor. As with removing a descriptor, you would use the ENEQueryToolkit
class:
// Java version DimValIdList selected = ENEQueryToolkit.selectAncestor(nav,anc,desc); // .NET version DimValIdList selected = ENEQueryToolkit.SelectAncestor(nav,anc,desc);
The Java selectAncestor()
and .NET SelectAncestor()
methods take the Navigation
object, the ancestor to select, and the descriptor as parameters.
Example 43. Java example of selecting an ancestor as the new descriptor
// Get the ancestor DimVal anc = (DimVal)ancestors.get(i); // Use the ancestor in the navigation DimValIdList sParams = ENEQueryToolkit.selectAncestor(nav,anc,desc); %> <a href="/controller.jsp?N=<%= sParams.toString() %>"> <%= anc.getName() %></a> <%
Example 44. .NET example of selecting an ancestor as the new descriptor
// Get the ancestor DimVal anc = (DimVal)ancestors[i]; // Use the ancestor in the navigation DimValIdList sParams = ENEQueryToolkit.SelectAncestor(nav,anc,desc); %> <a href="/controller.aspx?N=<%= sParams.ToString() %>"> <%= anc.Name %></a> <%