Followers

Tuesday, April 15, 2014

To Change DB connection in Search -Solr ( WebSphere Commerce Feature Pack 7)- Toolkit

Search DB mapping- settings - You may get this error if FEP7 was installed on mall DB and later DB2 localdb was restored .
         
Error:
        
          Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: Database 'c:\WCDE_E~1\db\mall' not found.DSRA0010E: SQL State = XJ004, Error Code = 40,000
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Solution:

Go to :
WAS Admin Console : Environment >Naming > Name Space Bindings
Select -> com.ibm.commerce.foundation.server.services.search.datasource
Change String value from
jdbc/WebSphere Commerce Cloudscape DataSource demo

To

jdbc/WebSphere Commerce DB2 DataSource demo

Restart Server



Installing WebSphere Commerce Feature Pack 7
========================================


Option 1: Update Commerce Developer from FEP5 to FEP7:
==========================================

1. Update RAD test server to 7.0.0.31 and developer to 7.5.5.5 iFix1 ( select IBM Software Delivery Platform , DO NOT select update all and do update). This will ask to update installation mgr to 1.7.2 also.

2. Apply FixPack 8
-Installation Manager > Update
-Select WC Developer.
-Follow instructions

3. Apply FEP7
-Installation Manager> Update  ( not Install as new)
-Select WC Developer.
-Follow Instructions​



Option 2: Uninstall Commerce Developer and install again with FEP7:
=================================================

1. Uninstall features before uninstalling Fep5


      Stop RAD and Server
      Go to :
C:\WCDE_ENT70\bin>

Execute in following order:

disableFeature.bat -DfeatureName=location-services
disableFeature.bat -DfeatureName=content-version
disableFeature.bat -DfeatureName=store-enhancements
disableFeature.bat -DfeatureName=management-center
disableFeature.bat -DfeatureName=foundation

 2. Uninstall FEP5, FP6 and Toolkit

Go to IBM Installation Manager > uninstall websphere commerce developer packages



After that DELETE C:\WCDE_ENT70 folder


3. Update WAS to 7.0.0.31

  • Open Installation mgr
  • Select update
  • Select IBM Software Delivery Platform
  • Deselect update all
  • Next
  • Give credentials if asked
  • This will ask to update installation manager to 1.7.2 . Click yes.
  • After upgrading installation manager restart installation manager and repeat above steps to update IBM Software Delivery Platform.




Update WAS screen



 4.Install Toolkit (CZ6CLML)

-Open IBM Installation Manager
-File > Preferences
-Add Repository
-Select CZ6CLML path and click ok.
-Again click Ok




-Go to install option in Installation manager
-Commerce Developer enterprise edition will be pre selected
-Next > Select installation directory as "C:\WCDE_ENT70"
-select toolkit only ( no need of sales center)
-install it





  1. Install Fixpack 8 - (7.0.0-WS-WCDeveloperEnterprise-FP008)

-Open IBM Installation Manager
-File > Preferences
-Add Repository
-Select 7.0.0-WS-WCDeveloperEnterprise-FP008 path (WCS Software\fixpacks\8.0\7.0.0-WS-WCDeveloperEnterprise-FP008\repository.config)
 and click ok.
-Again click Ok.
-Click Update in Installation Manager
-Select WebSphere Commerce Developer
-Follow instruction and install it -Fixpack 8






  1. Install FEP7  (WC_V7.0_-_FEP7_FOR_MP_ML)

-Open IBM Installation Manager
-File > Preferences
-Add Repository
-Select WC_V7.0_-_FEP7_FOR_MP_ML path (WCS Software\featurepack\7.0\WC_V7.0_-_FEP7_FOR_MP_ML\developer\repository.config)
 and click ok.
-Again click Ok.
-Click Install in Installation Manager
-Select WebSphere Commerce Developer
-Follow instruction
-Select 'ALL' features
-install fep7


 



DB2 error SQLCODE=-803, SQLSTATE=23505 occurs during di-preprocess



Solution:



--You attempt to run di-preprocess against the master catalog on IBM WebSphere Commerce Enterprise V7.0 Feature Pack 2, or a later feature pack, but the operation fails with the DB2 error SQLCODE=-803, SQLSTATE=23505 on TI_APGROUP_0.

Master catalog id in my case is 10001

--To identify if there is a catalog entry that has more than one parent category, run the following SQL query against the database:
select catentry_id, catgroup_id from catgpenrel where catentry_id in (select catentry_id from catgpenrel where catalog_id = 10001 group by catentry_id having count(catentry_id) > 1);


--To identify if the issue is caused by a category having multiple parent categories in the master catalog, run the following SQL query against the database:
select catgroup_id_parent, catgroup_id_child from catgrprel where catalog_id = 10001 and catgroup_id_child in (select catgroup_id_child from catgrprel
where catalog_id = 10001 group by catgroup_id_child having count(catgroup_id_child) > 1);


--To identify if there is a catalog entry that has more than one parent item, run the following SQL query against the database:

select catentry_id_child, catentry_id_parent from catentrel where catentry_id_child in (select catentry_id_child from catentrel  group by catentry_id_child having count(catentry_id_child) > 1);

Adding New Currency 





To add a new currency (not supported by default) to WebSphere Commerce as a site supported currency:
Procedure
  1. Add your national currency as a site-supported currency:
    insert into setcurr (setccurr, setccode, setcexp) values (<Alphabetic currency code as per ISO 4217>,
    <Numeric currency code as per ISO 4217>,<The exponential value by which a subunit of the currency (such as cents)is multiplied to get the main currency unit>)

For example:
insert into setcurr (setccurr, setccode, setcexp) values ('THB',818, -2);

  1. Add a description to your national currency at the site level for your language_id. You can add a description to your national currency in as many languages as your system supports.
    insert into setcurrdsc (setccurr, language_id, description) values(<Alphabetic currency code>, <language_id>,<description>)

Ex:
insert into setcurrdsc (setccurr, language_id, description) values('THB',-1015,'Thailand Baht');

  1. Add a currency formatting rule
    insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces) values (<storeentity> ,
    <Alphabetic currency code>, <Rounding multiple according to national law or practice. For example, specify 5 to round dollars to the nearest five cent piece.
    The default value is 1>, <How to round to a multiple of ROUNDINGMULTIPLE: R = round normally - up or down - to the nearest multiple T = truncate
    - round down for positive amounts, round up for negative amounts>,
    <The number of decimal places in a rounded or truncated monetary
    amount>);

For example:
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id, roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',0,NULL)
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id, roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-4,'R',0,NULL)
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-5,'R',0,NULL)

Like USD:
insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',2,NULL);

  1. Add a currency formatting description.
    insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,
    currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1015, 'B', null, 'B', null,null, 'B-', null, null, null, '#,##0.00', '
    Thailand Baht');
    For more information refer to the 
    CURFMTDESC table.


  1. Add a conversion rule between the default currency of the store and the created currency:
    insert into curconvert (storeent_id, fromccurr, tocurr, factor,multiplyordivide, bidirectional, updatable, curconvert_id)values(-1,'USD','THB','44.62','M','Y','Y',-12);





For Example: Adding THB for language -1015 (custom) and -1 (en_US)

---Thailand Baht -THB---

insert into setcurr (setccurr, setccode, setcexp) values ('THB',764, -2);

insert into setcurrdsc (setccurr, language_id, description) values('THB',-1015,'Thailand Baht');
insert into setcurrdsc (setccurr, language_id, description) values('THB',-1,'Thailand Baht');

insert into curformat (storeent_id, setccurr, roundingmultiple,numbrusg_id,roundingmethod, decimalplaces, minapproveamount) values(-1,'THB',1,-1,'R',2,NULL);

insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1015, 'THB', null, 'THB', null,null, 'THB-', null, null, null, '#,##0.00', 'Thailand Baht');
insert into curfmtdesc (storeent_id, numbrusg_id, setccurr, language_id,currencysymbol,customizedcurrstr, currencyprefixpos, currencysuffixpos,displaylocale,currencyprefixneg, currencysuffixneg, radixpoint, groupingchar,numberpattern, description) values (-1,-1, 'THB', -1, 'THB', null, 'THB', null,null, 'THB-', null, null, null, '#,##0.00', 'Thailand Baht');

insert into curconvert (storeent_id, fromcurr, tocurr, factor,multiplyordivide, bidirectional, updatable, curconvert_id)values(-1,'USD','THB','44.62','M','Y','Y',-12);        






New Language Creation in WCS 


Reference:






Creating Locale en_CA Steps:
 ( You can refer an existing language like en_US instead of en_GB here)

  1. Configuring bootstrap files from en_GB files

  • Copy wcs.bootstrap_en_GB.xml  and rename to wcs.bootstrap_en_CA.xml. Replace all occurrence of en_GB to en_CA
  • Copy wcs.bootstrap_en_GB_base.xml and rename to wcs.bootstrap_en_CA_base.xml. Add following two lines in it

<language language_id="&en_CA;" localename="en_CA" language="en" country="CA" encoding="UTF-8" mimecharset="iso-8859-1" />
<langpair storeent_id="-1" language_id="&en_CA;" language_id_alt="&en_US;" sequence="100" />

Note:
mimecharset
The character encoding used for MIME messaging. This value is different from the value used by browsers. For example, the de-facto character encoding for MIME messaging in Japan is iso-2022-jp, while the most commonly used character encoding in all other applications is Shift_JIS. in this example the following mimcharsets is used:
iso-8859–1  -> en
iso-8859–15 ->fr


  1. Edit the wcs.dtd file

Open the wcs.dtd file. Find the line:
<!ENTITY en_US "-1">

Add these entries:
<!ENTITY en_CA "-1001">
<!ENTITY fr_CA "-1002">

  1. Create multilanguage bootstrap files for Canadian English

  • Copy wcs.bootstrap_multi_en_GB_base.xml and rename to wcs.bootstrap_multi_en_CA_base.xml.
Replace all references from &en_GB; to &en_CA;

Search for <languageds language_id="&en_CA;" description="United States English" language_id_desc="-1" />
Add one more for new language:
<languageds language_id="&en_CA;" description="Canadian English" language_id_desc="-1001" />

Add language descriptions for all other supported languages to allow other languages to have a translation for this locale:
<languageds language_id="-1" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-2" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-3" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-4" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-5" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-6" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-7" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-8" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-9" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-10" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-20" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-21" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-22" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-23" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-11" description="Canadian English" language_id_desc="&en_CA;" />
<languageds language_id="-1001" description="Canadian English" language_id_desc="&en_CA;" />

  • Copy wcs.bootstrap_multi_en_GB.xml and rename to wcs.bootstrap_multi_en_CA.xml. Replace all references from en_GB to en_CA.

  • Locate all the remaining files that start with wcs.bootstrap_multi_en_GB_*.xml (excluding wcs.bootstrap_multi_en_GB_base.xml).
Make a copy of each file found in the previous step and rename it from wcs.bootstrap_multi_en_GB_*.xml to wcs.bootstrap_multi_en_CA_*.xml. For example, rename the copy of wcs.bootstrap_multi_en_GB_contract.xml to wcs.bootstrap_multi_en_CA_contract.xml.
Open each of the files created in the previous step for editing; replace all references of &en_GB; to &en_CA; (value used in language_id).

  • Save all files



    Loading Bootstrap Language Files into DB:

    Steps:

    1. Unzip en_CA_fr_CAConfigFiles.zip  from $TFS\BUILD\locales\Sharpie_CA and copy the files to  <WCToolkit>\schema\xml\ directory
    1. Massload en_CA locale:
               Toolkit:
    cd to <WCToolkit>/bin
    massload.bat C:\WCDE_ENT70\schema\xml\wcs.bootstrap_en_CA.xml  localdb db2admin db2admin DB2ADMIN
    massload.bat C:\WCDE_ENT70\schema\xml\wcs.bootstrap_multi_en_CA.xml localdb db2admin db2admin DB2ADMIN

    Linux Server (change db details accordingly)
    /opt/IBM/WebSphere/CommerceServer70/bin/massload.sh -dbname WCD1 -dbuser wsppusr -dbpwd wspc0nn3ct -infile /opt/IBM/WebSphere/CommerceServer70/schema/xml/wcs.bootstrap_en_CA.xml -method sqlimport -commitcount 20

    /opt/IBM/WebSphere/CommerceServer70/bin/massload.sh -dbname WCD1 -dbuser wsppusr -dbpwd wspc0nn3ct -infile /opt/IBM/WebSphere/CommerceServer70/schema/xml/wcs.bootstrap_multi_en_CA.xml -method sqlimport -commitcount 20




Creation Files for CMC

Steps for en_CA files:

  1. SRC
Create the properties file for en_CA locale.The properties files can be found in WCDE_installdir\workspace\LOBTools\src\com\ibm\commerce\tool\client\lobtools\propertiesdirectory, where tool is the directory for a Management Center tool. You will be repeating this step for the following directories:attachement, catalog, foundations, marketing, promotions, price, catalog filter, store and more ( Refer enGB).Copy all the files in the properties file level that has "en_GB" embedded in the file name. In each copied file, replace "en_GB" with "en_CA" in the file name.

  1. Create a new package for the extension properties files.
Go to : LOBTools\src\com\<company name>\commerce\client\lobtools\properties\
Copy ShellLOB_en_GB.properties and rename to ShellLOB_en_CA.properties and replace contents with - languageOptionDisplayText_en_CA=Canadian English
Also add  languageOptionDisplayText_en_CA=Canadian English to ShellLOB.properties file.

  1. Register the new properties in the resource bundle.
Go to : LOBTools\WebContent\WEB-INF\src\lzx\commerce\shell\
In the shellResourceBundle_ext.lzx file, add the following code:
<wcfResourceBundleKey name="languageOptionDisplayText_en_CA" />

Add following to UserPreferencePanel.lzx
<wcfPreferenceValue textKey="${shellResourceBundleExt.languageOptionDisplayText_en_CA}" value="en_CA" />





Steps for en_CA:

  1. Perform the following steps for the following files:

WC_installdir/components/foundation/subsomponents/search/solr/home/template/CatalogEntry/conf/locale
WC_installdir/components/foundation/subsomponents/search/solr/home/template/CatalogEntry/unstructured/conf/locale
WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogGroup/conf/locale

  1. Create a new folder for your locale. For example, en_CA indicates a English language locale for Canada.

          Copy schema.xml and stopwords.txt /article.txt from another similar locale

Schema.xml changes:

   <filter class="solr.ElisionFilterFactory" articles="article.txt"/>
        <filter class="solr.SnowballPorterFilterFactory" language="French" protected="protwords.txt" />
        <filter class="solr.ElisionFilterFactory" articles="article.txt"/>
        <filter class="solr.SnowballPorterFilterFactory" language="French" protected="protwords.txt" />