Creating views
You can create views to provide a more efficient or task-specific view of items, create groups of attributes that are related to a specific data entry or data maintenance process. You can create multiple views of the same catalog, and create views that are shared by multiple users. For example, a general view to view all the attributes, a marketing view to see marketing related attributes only, and a technical view to see only technical attributes.
Before you begin
Procedure
- Use any one of the following methods: user interface, Java™, or script.
You can create catalog view and hierarchy view. You can display a set of attributes in tabs.
To create a view, provide details of the container (catalog or hierarchy) for which the view is being created and the name of the view. You should select the attribute collections that you want to edit or view from the screens in the PIM system when you create the views.
Option Description User interface To create a catalog view:- Click Product Manager > Catalogs > Catalog Console.
- From the Catalog Console pane, select a catalog, and click Views.
- In the Catalog View pane, provide a name for the view in the Catalog View Name field, and click Next.
- Specify the attribute collections that you want to view or edit in the screens of the PIM
system. You can apply the attribute collection to the following screens:
- Edit Item - If you open an item in the single-edit page, then the catalog view becomes applicable.
- Bulk Edit - If you open an item in the multi-edit page, then the catalog view becomes applicable.
- Item List - Applicable, if you open an item from
Product Manager > Selections.
Note: You must first create a selection on the catalog.Important: The application currently does not support Item Popup and Item Location attribute collections.
- Click Save.
To create a hierarchy view:- Click Product Manager > Catalogs > Hierarchy Console.
- From the Hierarchy Console pane, select a hierarchy, and click Views.
- In the Hierarchy View pane, provide a name for the view in the Hierarchy View Name field, and click Next.
- Specify the attribute collections that you want to view or edit in the screens of the PIM
system. You can apply the attribute collection to the following screens:
- Category Edit - If you open a category in the single-edit page, then the hierarchy view becomes applicable.
- Category Bulk Edit - If you open a category in the multi-edit page, then the hierarchy view becomes applicable.
- Click Save.
To create a tab view:You can create tabs for screens in both catalog view and hierarchy view.
To display attribute collections in tabs:- Click Tab View > New.
- In the tab detail pane, provide a name for the view in the Tab Name field.
- Select the attribute collections to be displayed in the tab, and click Save.
Java API Sample 1: The following sample Java API code creates a catalog view. Context ctx = PIMContextFactory.getCurrentContext(); CatalogManager manager = ctx.getCatalogManager(); Catalog catalog = manager.getCatalog("Catalog"); View view = catalog.createView("View"); ScreenView screenView = view.getScreenView(ScreenType.ITEM_SINGLE_EDIT); Collection<AttributeCollection> attrColls = new ArrayList<AttributeCollection>(); AttributeCollection attrColl1 = ctx.getAttributeCollectionManager().getAttributeCollection("AttributeCollection"); AttributeCollection attrColl2 = ctx.getAttributeCollectionManager().getAttributeCollection("AttributeCollection1"); attrColls.add(attrColl1); attrColls.add(attrColl2); screenView.setEditableAttributeCollections(attrColls); List<AttributeCollection> attrColls1 = new ArrayList<AttributeCollection>(); attrColls.add(attrColl1); ScreenViewFilter filter = screenView.addFilter("Filter"); filter.setAttributeCollections(attrColls1); view.save();
Sample 2: The following sample Java API code creates a hierarchy view. Context ctx = PIMContextFactory.getCurrentContext(); HierarchyManager manager = ctx.getHierarchyManager(); Hierarchy hierarchy = manager.getCatalog("Hierarchy"); View view = hierarchy.createView("View"); ScreenView screenView = view.getScreenView(ScreenType.CATEGORY_SINGLE_EDIT); Collection<AttributeCollection> attrColls = new ArrayList<AttributeCollection>(); AttributeCollection attrColl = ctx.getAttributeCollectionManager().getAttributeCollection("AttributeCollection"); attrColls.add(attrColl); screenView.setEditableAttributeCollections(attrColls); view.save();
Script API Sample 1: The following sample script API creates a catalog view. var catalog = getCtgByName("Catalog"); var view = new CtgView(catalog, "CatalogView"); var perms = []; perms[0] = "E"; perms[1] = "V"; var attrGroups = []; attrGroups[0] = "AttrGroup"; attrGroups[1] = "AttrGroup1"; view = view.setCtgView("ITEM_EDIT", attrGroups, perms); view.saveCtgView(); var attrGroup1 = getAttrGroupByName("AttrGroup"); var attrGroups1 = []; attrGroups1[0] = attrGroup1; var tab1 = view.getNewCtgTab("Filter1", attrGroups1); view.addCtgTab(tab1); view.saveCtgTabs();
Sample 2: The following sample script API creates a hierarchy view. var view = new CtgView(hier, "HierarchyView"); var perms = []; perms[0] = "E"; perms[1] = "V"; var attrGroups = []; attrGroups[0] = "AttrGroup"; attrGroups[1] = "AttrGroup1"; view = view.setCtgView("CATEGORY_EDIT", attrGroups, perms); view.saveCtgView(); var attrGroup1 = getAttrGroupByName("AttrGroup"); var attrGroups1 = []; attrGroups1[0] = attrGroup1; var tab1 = view.getNewCtgTab("Filter1", attrGroups1); view.addCtgTab(tab1); view.saveCtgTabs();
Sample 3: The following sample script API creates a tab view inside a workflow. //Workflow Creation Starts var sWFLName = ("Test Workflow"); var sACGName = ("Default"); var oWFL = new Workflow(sWFLName, "CATALOG"); oWFL.setWflAccessControlGroup(sACGName); var oWFLName1Step1 = oWFL.createWflStep("GENERAL", "Step-1"); var saWFLName1Step1_AG_R = []; saWFLName1Step1_AG_R.add("TestCtgAttrColl"); var saWFLName1Step1_AG_E = []; saWFLName1Step1_AG_E.add("TestCtgAttrColl1"); var saWFLName1Step1_AG_V = []; saWFLName1Step1_AG_V.add("TestCtgAttrColl"); //Assigning attributes groups to step oWFLName1Step1.setRequiredAttributeGroups("ITEM_EDIT", saWFLName1Step1_AG_R); oWFLName1Step1.setEditableAttributeGroups("ITEM_EDIT", saWFLName1Step1_AG_E); oWFLName1Step1.setViewableAttributeGroups("ITEM_EDIT", saWFLName1Step1_AG_V); var stepPerformers = []; stepPerformers.add("Admin"); oWFLName1Step1.setWflStepPerformerUsers(stepPerformers); oWFL.getWflInitialStep().mapWflStepExitValueToNextStep("SUCCESS", oWFLName1Step1); oWFLName1Step1.mapWflStepExitValueToNextStep("DONE", "Success"); out.writeln(oWFL.saveWfl()); ////Workflow Creation Ends //Step Tab creation Starts var oContView = oWFLName1Step1.getWflStepView("ITEM_EDIT"); out.writeln(oContView); var attrGrpNames = oContView.getCtgViewAttrGroupsList(); out.writeln(attrGrpNames.size()); var tabAttrGrps=[]; for(i=0;i<attrGrpNames.size();i++) { out.println("getAttrGroupByName(" + attrGrpNames[i] + ")"); attrGrp = getAttrGroupByName(attrGrpNames[i]); out.writeln(attrGrp); tabAttrGrps[i] = attrGrp; } var tab = oContView.getNewCtgTab("Test",tabAttrGrps); oContView.addCtgTab(tab); var tab1 = oContView.getNewCtgTab("Test1",tabAttrGrps); oContView.addCtgTab(tab1); oContView.saveCtgTabs(); oContView.saveCtgView(); out.writeln(oWFL.saveWfl());
Important: To enable the TAB View, first save the workflow and then proceed with creation of the TAB VIEW.The view is created. Users can create, delete, and modify views through the Catalog Console. - Verify the view. From the upper right, select the view from the list.