Introduced in Feature Pack 3

Creating a new access profile and mapping it to the new search profile

Introduced in Feature Pack 3 In this lesson, you create a new access profile and map it to the search profile. In previous lessons, you created the X_findCatalogEntryWarranty search profile to retrieve warranty data from the search index. However, expression builders used on the storefront to display data expect an access profile as a parameter.

About this task

Procedure

  1. Create a new custom access control policy file and call it WarrantyAccessControlPolicies.xml in the following directory:
    • WebSphere Commerce DeveloperWCDE_installdir\xml\policies\xml
  2. Copy the following snippet into the file:
    
    <Policies>
      <Action Name="GetCatalogNavigationView.MyCompany_Store_Warranty" CommandName="GetCatalogNavigationView.MyCompany_Store_Warranty"/>
    	<ActionGroup Name="Search-CatalogEntry-AllUsers-AccessProfileActionGroup" OwnerID="RootOrganization">
    		<ActionGroupAction Name="GetCatalogNavigationView.MyCompany_Store_Warranty"/>
    	</ActionGroup>	
    </Policies>
    
  3. Save your changes and close the file.
  4. Use the acpload utility to load the new XML file:
    1. Stop the WebSphere Commerce server.
    2. Open the command prompt and navigate to WCDE_installdir\bin.
    3. Run acpload.bat WarrantyAccessControlPolicies.xml
    4. Examine the acpload.log file in WCDE_installdir\logs to verify that there were no errors.
    5. You can verify this by navigating to the Organization Administration Console and selecting Access Management > Action Groups > Search-CatalogEntry-AllUsers-AccessProfileActionGroup > Show Action > GetCatalogNavigationView.MyCompany_Store_Warranty.

      See acpload utility for more information.

  5. Create a new custom configuration file and call it wc-component.xml in the following directory:
    • WebSphere Commerce DeveloperWCDE_installdir\workspace\WC\xml\config\com.ibm.commerce.catalog-ext
    This XML file maps the X_findCatalogEntryWarranty search profile to the MyCompany_Store_Warranty access profile previously defined. You will then use the MyCompany_Store_Warranty access profile to view data in the storefront.
  6. Copy the following snippet into the file:
    
    <_config:DevelopmentComponentConfiguration
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-component.xsd "
    	xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">
    	<_config:extendedconfiguration>
    		<_config:configgrouping name="AccessProfileToSearchProfileMapping">
    			<_config:property name="MyCompany_Store_Warranty" value="X_findCatalogEntryWarranty"/>
    		</_config:configgrouping>
    	</_config:extendedconfiguration>
    </_config:DevelopmentComponentConfiguration>
    
  7. Save your changes and close the file.

Results