Wednesday, 29 April 2015


Custom Store feature to Enable/Disable using flex flow


1) Update the EMSPORT and DMEMSPOTDEF tables by executing the following two SQL statements (ensure that EMSPOT_ID and DMEMSPOTDEF_ID do not already exist):
INSERT INTO EMSPOT 
   (EMSPOT_ID,STOREENT_ID,NAME,USAGETYPE)
VALUES 
   (-1000,storeId,'BloomReach','STOREFEATURE' );
INSERT INTO  DMEMSPOTDEF 
   (DMEMSPOTDEF_ID,EMSPOT_ID,STOREENT_ID,CONTENTTYPE,CONTENT,OPTCOUNTER) 
VALUES 
   (-1000,-1000,storeId,'FeatureEnabled','true',1);
2) Restart the WebSphere Commerce server.
3) This is an example of using the Bloomreach flex flow:
<flow:ifEnabled feature="BloomReach">         
     ......
  </flow:ifEnabled>
  <flow:ifDisabled feature="BloomReach">
     ......
 </flow:ifDisabled>


FlexFlow usable in CMC, for enabling/disabling the Bloomreach feature in the store front.

Make appropriate changes to - WC_eardir\LOBTools.war\config\commerce\store\propertiesViews\storedir\StoreFlexFlowPropertiesView.def

More details - Here is the link

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.management-center_customization.doc/tutorial/ttf_tutorialcontacttooltip.htm?lang=en
StoreConfigurationRegistry to access values stored in STORECONF table

StoreConfigurationRegistry to access store configuration values in the STORECONF database table from either Java code or JSP files.
The STORECONF data is not propagated from staging to production. Therefore, you can have configurations and test systems set up in your staging environment that are different from your production environment.

Java code example
From Java code, you can access the StoreConfigurationRegistry directly. 

String value = StoreConfigurationRegistry.getSingleton().getValue(storeId, "STORECONF_Name");

public String getValue(Integer storeId, String name)

JSP file example
You can use the <wcst:storeconf> tag in a JSP file to access data from the STORECONF table. The <wcst:storeconf> tag reads from the StoreConfigurationRegistry cache to provide access to the configuration parameters. This tag is provided with the WebSphere Commerce Stores tag library (stores.tld). 
In the default JSTLEnvironmentSetup.jspf file for the Aurora starter store, the library is included, as shown here:

<%@ taglib uri="http://commerce.ibm.com/foundation-fep/stores" prefix="wcst" %>

The following example shows how to use the tag in a store page to get the parameter named wc.bazaarvoice.runtime_url from the STORECONF table:

<wcst:storeconf var="bvUrl" name="wc.bazaarvoice.runtime_url" scope="request" />

scope-
page
request
session
application
If the scope parameter is not set, then the default value is page.

Inserting Data into STORECONF OR Using Dataload

insert into storeconf (storeent_id, name, value, optcounter)values (storeent_id, 'name', 'value', 0); 

Monday, 20 April 2015


LHN - Facet Management - Queries and Tables Used

List of the tables used in Facet Filtering

Existing tables (till FEP4)
ATTR
SRCHATTR
SRCHATTRPROP

New tables (FEP5+)
FACET (SELECTION – for Multifaceted selection)
FACETDESC


FACETCATGRP  (.. SEQUENCE column to handle FACET sequence in LHN)

Use case of Facet Selection
  • Facet remains in available filters list
  • First value selected decreases counts for other facets
  • Additional selected values increase counts for other facets
  • Counts for multi-value facet remain the same


Management Centre ( to handle the facet attributes)


To View the facets associated with a particular category.

Query params-
_wcf.search.facet='$facet$';
_wcf.search.exclude.facet='$filter Facet$';

To pass the selected facet values to getData
<c:forEach var="facetValue" items="${paramValues.facet}">
                <wcf:param name="facet" value="${facetValue}" />

How to Start and Stop Solr server

cd /opt/IBM/WebSphere/AppServer/profiles/<instance_name>/bin

./stopServer.sh solrServer


./startServer.sh solrServer


Once the server is up and running - this can be verified using the below URL.. 


http://localhost:<port>/solr/Default/select?q=*%3A*
CWXFD3134E: Execution of get request failed. 

Here is the exception -
[26/03/15 12:00:57:663 GMT] 00000035 bod           I   CWXFD3134E: Execution of get request failed. com.ibm.commerce.foundation.server.services.dataaccess.exception.ConfigurationException: CWXFS1003E: Cannot determine core name based on the search profile IBM_findNavigationSuggestions. Ensure this search profile is associated with a search index.

[26/03/15 12:00:57:664 GMT] 00000035 config        I com.ibm.commerce.foundation.internal.client.taglib.config.GetDataConfig$DataTypeConfig invokeClientFacadeMethod(Object clientFacade, GetType getVerb) <Null Message>
com.ibm.commerce.catalog.facade.client.CatalogNavigationViewException
at com.ibm.commerce.catalog.facade.client.AbstractCatalogFacadeClient.checkShowCatalogNavigationView(AbstractCatalogFacadeClient.java:1796)
at com.ibm.commerce.catalog.facade.client.AbstractCatalogFacadeClient.getCatalogNavigationView(AbstractCatalogFacadeClient.java:1827)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

at java.lang.reflect.Method.invoke(Method.java:611)


Root Cause -
This issue is due to missing values within the wc-search.xml for cores and server details

Fix 
Add the below stuff in wc-search.xml

1) Add the server details within <_config:server></_config:server>  


<_config:server name="AdvancedConfiguration_1">
        <_config:common-http URL="http://localhost/solr/"
            allowCompression="true" connectionTimeout="15000"
            defaultMaxConnectionsPerHost="600" followRedirects="false"
            maxRetries="1" maxTotalConnections="600"
            retryTimeInterval="1000" soTimeout="15000"/>
</_config:server>
<_config:server name="AdvancedConfiguration_2">
        <_config:common-http URL="http://localhost:9060/solr/"
            allowCompression="true" connectionTimeout="15000"
            defaultMaxConnectionsPerHost="600" followRedirects="false"
            maxRetries="1" maxTotalConnections="600"
            retryTimeInterval="1000" soTimeout="15000"/>
</_config:server>
<_config:server name="BasicConfiguration">
        <_config:embedded/>
</_config:server>


2) Add the cores details <_config:cores></_config:cores>


<_config:cores>
        <_config:core catalog="10001" indexName="CatalogEntry"
            language="en_US" name="MC_10001_CatalogEntry_en_US"
            path="/MC_10001/en_US/CatalogEntry" serverName="AdvancedConfiguration_2"/>
        <_config:core catalog="10001" indexName="UnstructuredContent"
            language="en_US"
            name="MC_10001_CatalogEntry_Unstructured_en_US"
            path="/MC_10001/en_US/CatalogEntry/unstructured" serverName="AdvancedConfiguration_2"/>
        <_config:core catalog="10001" indexName="CatalogGroup"
            language="en_US" name="MC_10001_CatalogGroup_en_US"
            path="/MC_10001/en_US/CatalogGroup" serverName="AdvancedConfiguration_2"/>
</_config:cores>