Tuesday, November 29, 2011

Solr Re-indexing steps WCS 7

Pre-requests: you need to have V7 FEP2+.

IBM WCS is now a fully operational search engine. the product now includes Lucene Solr as the interal search engine, also incorporates industry best practices.


Once you get the latest database, follow these steps to re-index the products.

  1. Install "WebSphere Commerce Developer Enterprise" version 7
  2. Update "WebSphere Commerce Developer Enterprise" to version 7.0.0.5
  3. Stop Server
  4. Enable the Store Enhancement Features
    1. cd WCDE_installdir\bin
    2. enableFeature.bat -DfeatureName=store-enhancements
  5. Publish the Madisons Feature Pack Store Archive:
    1. Publish Madisons-FEP.sar
  6. Enable the Solr foundation
    1. cd WCDE_installdir\bin
    2. enableFeature.bat -DfeatureName=foundation [DsolrHome=C:\IBM\WCDE_ENT70\search\solr\home]
  7. Setup the Search Index: (WC Server must be Stoped)
    1. cd 'WCDE_installdir'\components\foundation\subcomponents\search\bin
    2. setupSearchIndex.bat -masterCatalogId 10001 -instance WCDE_ENT70 -dbuser db2admin -dbuserpwd db2admin [-solrhome C:\IBM\WCDE_ENT70\search\solr\home]
    3. To see log file : \WCDE_ENT70\components\foundation\subcomponents\search\log\wc-search-index-setup.log
    4. Once successfully completed the status code could be : Program exiting with exit code: 0
  8. Preprocess the Search index: (Run the di-preprocess.bat file against the search index, again server stopped at this point)
    1. cd WCDE_installdir\bin
    2. di-preprocess.bat C:\IBM\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\ [-fullbuild true] [-localename en_US]
  9. Test the current Solr index to ensure that a request can be recognized: (Server should be started)
    1. http://host_name/solr/Default/select?q=*%3A*
  10. Build out the index (first make sure to start the WC server):
    1. cd WCDE_installdir\bin
    2. di-buildindex.bat -masterCatalogId 10001 
  11. Test the indexed Solr index to ensure results are returning:
    1. http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=catentry_id:10251
  12. Enable the store to display the search breadcrumb and faceting filters:
    1. Open Management Center
    2. Click "Management Center Tools" menu and select "Store Management"
    3. Select the "Madisons" store and click the "Catalog" tab
    4. check "Search-based navigation"
    5. click Save
  13. Test live on the starter store:
    1. http://localhost/webapp/wcs/stores/servlet/Madisons/index.jsp
    2. http://localhost/webapp/wcs/stores/servlet/en/eliteesite/home

Tuesday, November 22, 2011

Deleting order items and requisition lists

When a user deletes an order item or requisition list item the table rows representing those items are removed from the database. If enabled, these rows are updated to belong to the trashcan. You can clear the trashcan by running the OrderTrashCanClear scheduled job which will delete the rows, or by using the Database Clean up utility. This feature is disabled by default.

It is highly recommended that you clean your database of order items both before you enable the OrderTrashCan feature, and periodically afterwards. Order item deletion is a common operation, and as a result, a large number of deleted order items can build up in the ORDERITEMS table.

1. Open wc-sever.xml configuration file
2. Within the file, the text can be put next to "ExpectedInventorySynchronize" element.


TrashCanRequisitionListSegmentLen="30"
TrashCanOrderItemSegmentLen="50"
TrashCanEnabled="true"/>

This setting deletes order item entries from the ORDERITEMS table. If TrashCanEnabled is set to "true", when a user deletes an order item or requisition list item, the table rows representing those items are not deleted from the database. Instead, the items are updated to belong to the trashcan.

Monday, November 21, 2011

Disable Access Control Policy WCS (Developent)

Developer while creating new Views commands controllers is to define the access control policy, Although it is a must have step for security reasons, I have always wondered why we need to do this during development time, Just to test and views without having to create the policies during development. Well yes, It's possible with a simple configuration.

In toolkit, navigate to your instance.xml file, on WCS 7 , this will be typically located in
D:\IBM\WCDE_ENT70\workspace\WC\xml\config\wc-server.xml



In toolkit, navigate to your instance.xml file, on WCS 7 , this will be typically located in
D:\IBM\WCDE_ENT70\workspace\WC\xml\config\wc-server.xml

you have to find xml elemented named "Instance

AccessControlUnitTest="true"

and place above attribute with value immediately after "Instance" Elements

Save and restart your test server, from now on any controller and view command that you create will not require a acppolicy to be loaded.

Monday, November 14, 2011

Configuring tracing and logging for the loading utilities

you can configure an additional message log file, messages.txt, and a trace file, traces.txt, for the loading utilities. This can be helpful in getting more information to help determine any problems you may encounter.

1. Open the following in a text editor:

WC_installdir/xml/loader/WCALoggerConfig.xml

Note: There are two locations of the WCALoggerConfig.xml file. WCDE_installdir/xml/loader/WCALoggerConfig.xml is used by the loader utilities when run from the command line, and the file WC_installdir/instances/ instance_name/xml/loader/WCALoggerConfig.xml is used by the loader utilities in the server context, for example during the store publish process.


The component tags define the components for which trace is enabled.

Friday, November 11, 2011

How to find version of fix pack of WAS?

1. Go to WAS_installer\runtimes\base_v7\bin>versionInfo.bat

output:

WVER0010I: Copyright (c) IBM Corporation 2002, 2005, 2008; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.1.26, dated 8/9/08

--------------------------------------------------------------------------------
IBM WebSphere Application Server Product Installation Status Report
--------------------------------------------------------------------------------

Report at date and time November 11, 2011 5:39:01 PM IST

Installation
--------------------------------------------------------------------------------
Product Directory C:\Program Files\IBM\SDP\runtimes\base_v7
Version Directory C:\Program Files\IBM\SDP\runtimes\base_v7\properties\version
DTD Directory C:\Program Files\IBM\SDP\runtimes\base_v7\properties\version\dtd
Log Directory C:\Program Files\IBM\SDP\runtimes\base_v7\logs
Backup Directory C:\Program Files\IBM\SDP\runtimes\base_v7\properties\version\nif\backup
TMP Directory C:\DOCUME~1\SETTU~1.GOP\LOCALS~1\Temp

Product List
--------------------------------------------------------------------------------
BASE installed

Installed Product
--------------------------------------------------------------------------------
Name IBM WebSphere Application Server
Version 7.0.0.13
ID BASE
Build Level cf131039.07
Build Date 10/2/10
Architecture Intel (32 bit)

--------------------------------------------------------------------------------
End Installation Status Report
--------------------------------------------------------------------------------

Friday, October 14, 2011

Inventory issues

A. Enable the following trace components on your WebSphere Commerce instance server:

com.ibm.websphere.commerce.WC_ORDER=all:com.ibm.websphere.
commerce.WC_INVENTORY=al
l

B. The environment is now configured to capture the necessary data when the problem occurs. Reproduce the problem on your environment and proceed to the next step.

3. Collect all necessary data

1. Trace from the WebSphere Commerce Server:
\logs\server1\*
2. What type of inventory system are you using for your store? For example: Are you using WebSphere Commerce to manage your inventory, are you integrating with a backend system, or are you not tracking inventory at all?
To determine the type of inventory, run the following query:

SELECT INVENTORYSYSTEM FROM STORE WHERE STORE_ID=

The possible values are:

-1=ATP
-2=Non-ATP
-3=No inventory
-4=External inventory management system (introduced in WC 6.0.0.1)

3. Configuration Data from the Database

a) SELECT * FROM STORE
b) SELECT * FROM FFMCENTER
c) SELECT * FROM SHPARRANGE
d) If you are using the ATP inventory, collect the following data:

SELECT * FROM BASEITEM WHERE BASEITEM_ID=(SELECT BASEITEM_ID FROM CATENTRY WHERE CATENTRY_ID=)
SELECT * FROM STOREITEM WHERE BASEITEM_ID=
SELECT * FROM ITEMSPC WHERE BASEITEM_ID=
SELECT * FROM INVSTVW WHERE STORE_ID= AND
ITEMSPC_ID=(SELECT ITEMSPC_ID FROM CATENTRY WHERE CATENTRY_ID=)

Otherwise, if you are using non-ATP inventory, collect the following data:
SELECT * FROM INVENTORY WHERE STORE_ID= AND CATENTRY_ID=

Scenario
Describe the failing scenario in detail.


Monday, October 3, 2011

No Products Can Be Added To Shopping Cart

All WebSphere Commerce sites running version 5.6.x, 6.0 and 7.0 might experience this problem.

Shoppers cannot add items to the shopping cart. A message similar to the following is displayed when the shopper adds an item:

CMN2022E: The command is unable to determine an appropriate fulfillment center for an OrderItem.

Content

PROBLEM:

When shoppers try to add items to cart, the following exception is displayed in the trace log with WC_ORDERS:

[6/23/08 4:40:18:116 CDT] 7bd409f2 WC_ORDER d mrCJugify4dA55bTXDzHHQEg6SE%3d%0a com.ibm.commerce.fulfillment.commands.ShippingArrangementWrapper.isValid Shipping arrangement 10001 is not effective for the specified time.
com.ibm.commerce.fulfillment.commands.ResolveFulfillmentCenterCmdImpl.performExecute No fulfillment center has enough inventory: catalogEntryId=333109, quantity=1.0, shipModeId=10001
[6/23/08 4:40:18:117 CDT] 7bd409f2 CommerceSrvr E com.ibm.commerce.fulfillment.commands.ResolveFulfillmentCenterCmdImpl performExecute CMN2022E: The command is unable to determine an appropriate fufillment center for an OrderItem.


NOTE: If you are not experiencing this problem on your site then your store was not published with this condition and no immediate actions are required.



SOLUTION:
Check the SHPARRANGE table and verify that the ENDDATE field has not expired. If it has expired or is set to expire on a date earlier than desired for your site, update this field as per the examples below.

Below are some examples of how to change the ENDDATE.


To change the shipping ENDDATE from '2008-06-22-23.00.00.000000' to a setting which will never expire, update the database with one of the following statements:

For DB2:
"update shparrange set enddate = null where enddate = '2008-06-22-23.00.00.000000'"

For Oracle:
"update shparrange set enddate = null where enddate = timestamp'2008-06-22 23:00:00'"



To change the shipping arrangment ENDDATE from '2008-06-22-23.00.00.000000' to expire in 2018, update the database with one of the following statements:

For DB2:
"update shparrange set enddate = '2018-06-22-23.00.00.000000' where enddate = '2008-06-22-23.00.00.000000'"

For Oracle:
"update shparrange set enddate = timestamp'2018-06-22 23:00:00' where enddate = timestamp'2008-06-22 23:00:00'"