You can create static selections so that users can use
the saved search queries and results. When users choose a static selection,
they get the same search results every time they run the selection.
Static selections are useful for storing a specific query result that
you want to store as it is. For examples, you might want create a
selection to store the sales results of cars for March.
Before you begin
Ensure that you know what results that you want returned from
the static selection.
Procedure
- Create the selection. Use any one of the following methods:
user interface, Java™ API, or
script API.
Option |
Description |
User interface |
- Click Product Manager > Catalogs > Catalog Console..
- Choose a catalog.
- Click Rich Search.
- Provide the required details.
- From the Save search as field, select Static
Selection.
- Provide a name for the selection.
- Provide the search criteria.
- Click Search.
|
Java API |
The following sample Java API
code creates a static selection.Context ctx = PIMContextFactory.getCurrentContext();
SelectionManager mgr = ctx.getSelectionmanager();
Catalog ctg = ctx.getCatalogManager().getCatalog("my catalog");
Hierarchy ctr = ctx.getHierarchyManager().getCatalog("my hierarchy");
StaticSelection sel = mgr.createStaticSelection(ctg, ctr, "my static selection");
sel.save();
|
Script API |
The following sample script creates a static selection.var ctg = getCtgByName("my catalog");
var sel = new BasicSelection(ctg, "my static selection");
var item = ctg.getCtgItemByPrimaryKey("pk1");
sel.addEntryToSelection(item);
sel.saveSelection();
Note: From the script API, when
the development team deprecates BasicSelection and
if the new StaticSelection script op exists then
change var sel = new BasicSelection to var
sel = new StaticSelection .
|
The selection is created, users can view it in the Selection
console.
- Optional: Run the static selection.