Tools
Almost three years back, I created a post which explains how to delete commerce server site in CS2007. At that time, people are not aware on how to delete a site & they used to do the mistakes.
http://microsoftblog.co.in/commerceserver/how-to-delete-commerce-server-site/
You can also find clear steps mentioned in MSDN now. Microsoft has provided tools to import or export commerce server sites but it doesn’t provide any tool to delete commerce server site. I have attempted to delete commerce server site on single click. I have assumed few things to make this tool work (ideal way is to read MSCS_Admin database to read commerce site configurations & delete them accordingly). Feel free to use the code to customize according to your needs.
Here is the snapshot of how the tool looks like.
If you like this post, please click on our sponsor advertisement.
What will happen if you perform rebuild catalogs. As you know, virtual catalogs holds aggregate content from one ore more base/virtual catalogs. When you add a product from base catalog to virtual catalog, the items in the virtual catalog inherit from base catalog. These relationships can be viewed in the virtual catalog. So, any changes to the base catalog will not be automatically propagated to virtual catalog, unless we explicitly performs rebuild virtual catalog process.
In one of our application there are nearly 40+ virtual catalogs and data is inserted in base catalog by business users. When ever they add products to base catalog, they need to execute “Rebuild All” virtual catalogs from catalog manager.
- This works fine if they executes rebuild process once at a time. If more than one rebuild operation performs on single catalog, there is huge possibility of SQL deadlocks. If that happens then all future rebuilds will hang and no progress will happen; unless we kill the process (or restart SQL server server service).
- The other disadvantage is that frequent building of virtual catalogs will bring the application performance slow.
- Some times business users modifies the data but forgot to rebuild the virtual catalogs and finally complains that the site is not showing up new products.
To overcome the above problems, first we need to educate the business users on how effectively they can work on the business tools and second, a small utility which will perform rebuild catalogs once in a day. Utility can be developed easily through commerce server API. In the below code sample, we are getting all catalogs from CS, checking if it is virtual catalog or not and performing rebuild process on only virtual catalogs. Based on virtual catalog configuration, the time to complete build process depends, so during that process we should not execute another rebuild process. In below code, I am sleeping the process for two seconds and checking it back whether the process has completed. This process continues till last virtual catalogs gets rebuild.
| var catalogsDataSet = catalogSystem.GetCatalogs(); int count = catalogsDataSet.Catalogs.Count; for (int i = 0; i < count; i++) { var catalogName = catalogsDataSet.Catalogs[i].CatalogName; var productCatalog = catalogSystem.GetCatalog(catalogName); if (productCatalog.IsVirtualCatalog) { Console.WriteLine(“Rebuilding…. : ” + catalogName); var virtualCatalog = (VirtualCatalog)productCatalog; var rebuildProgress = virtualCatalog.Rebuild(true); while (rebuildProgress.Status == CatalogOperationsStatus.InProgress) { System.Threading.Thread.Sleep(2000); rebuildProgress.Refresh(); Console.WriteLine(“Rebuilding In progress… : ” + catalogName); } } } |
For the system administrator/business users, I have created a tool which perform this task.
Click here to download
How to use this tool? It is very simple. Download the utility On commerce server machine, open command prompt, navigate to the folder and run the utility from the command prompt.
RebuildAllVirtualCatalogs.exe local <commerce server site name>
If you are running the tool outside of commerce server box then use following command
RebuildAllVirtualCatalogs.exe agent http://localhost/CatalogWebService/CatalogWebService.asmx
Here is how the utility performs virtual catalog rebuild.
Developers: Full code version –
Click here to download
If you like this post, please click on our sponsor advertisement.
