I need to fetch data of CATENTDESCOVR using Databean.
Is there any databean provided by IBM to get the data?
I am using IBM WebSphere Commerce V7.0 Feature Pack 8
I need to fetch data of CATENTDESCOVR using Databean.
Is there any databean provided by IBM to get the data?
I am using IBM WebSphere Commerce V7.0 Feature Pack 8
The short answer is that there isn't a DataBean for accessing this data.
The [beginning of the] long answer is that you need to use the BOD+DSL layers in order to access such data. Either through JSP using the getData tag (Aurora uses this tag extensively) or using Java code (sometimes using XPath expressions...). You can also trace the query: see here.
However, to my understanding, the idea of overrides is that they are transparent to the front-end. I.e. the description overrides are replacing the main descriptions when they are set-up. see here
Not sure what you're trying to do with accessing this data directly. Override WCS logic?
this is good question and here below is the explanation how CATENTDESCOVR works , this answer is based on WCS 7.0 , FEP 7 . but I believe fep 8 have same api , i don't think IBM enhanced this in fep8!
if you look at how these data are indexed and stored in solr in schema.xml you will find following line
<!--
Catentry's description override: map to table CATENTDESCOVR
-->
<field name="nameOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
<field name="shortDescriptionOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
<field name="keywordOverride" type="wc_text" indexed="true" stored="true" multiValued="true"/>
please note here the multiValued="true"
, this means that if you have multible stores belongs to same Esite , the solr index the nameOvr , descOvr as multivalued for that catentryId , but solr have no idea which overridden name belongs to which store , that bean said , IBM solr index the master catalog data not store specific data .
this brings the question how the overridden name is shown per store in store front?
the answer is by utilizing WC-Search post-processor:
com.ibm.commerce.foundation.server.services.rest.search.postprocessor.solr.SolrRESTSearchCatalogEntryViewDescriptionQueryPostprocessor
if you look at the implementation of this postprocessor you will find the following high level steps :
1- get the catOvrGrpId by:
catOvrGrpId = CatalogOverrideHelper.getOverrideGroupIdForStore(this.iStoreId)
2- get the required overridden data by calling the DSL service:
JDBCQueryService service = new JDBCQueryService("com.ibm.commerce.catalog");
queryParameters.put("language", langIds);
queryParameters.put("UniqueID", catEntryUniqueIDs);
queryParameters.put("catOverrideGroupID", groupIds);
service.executeQuery("IBM_Get_CatentryDescOverride_By_LangId_And_CatentryId_And_GroupId",
queryParameters);
3- convert the array list returned to JSON compatible result:
populateOverrideCatalogEntries((List)listOfPhysicalObjects, catalogEntryViews);
you can reused the codes above and try to de-compile SolrRESTSearchCatalogEntryViewDescriptionQueryPostprocessor
to understand how you can read these information from database.
the query for IBM_Get_CatentryDescOverride_By_LangId_And_CatentryId_And_GroupId
is exist under Search/xml/config/com.ibm.commerce.catalog/wc-query-utilities.tpl
Hope this will be informative for you.
Thanks Abed
The CATENTDESCOVR will already have been indexed in your solr core.
Look in solr\home\MC_10001\en_US\CatalogEntry\conf, for in the wc-data-config.xml, and you can see it being mapped into the core.
When you request data from solr, one of the Post processing filters defined in the wc-search.xml of the Search EAR project will fill in the override value as the "name" or "shortdesc" of the returned values.
So, you really only need to call the rest service as normal to get this value. Provided ofcourse you are wanting it from the frontend.
If you need it backend, you can use the CatalogEntryFacadeClient to perform the solr query.