After installing commerce server 2009, you can able to find commerce SharePoint extensibility kit under commerce server folder. By using this kit, we can able to extend OOB SharePoint website easily. This is a very interesting topic, as we will end up spending a lot of time getting this kit customized/deployed (with lot of troubles). Instead of directly jumping into the code, it’s important to understand the existing architecture and how to get good value we get out of it. Note that no two commerce server implementations are same and developers has to extend or customize commerce server site as well as default website to meet to the requirements. Developers can either extend commerce entity by adding new properties and operation sequences or sometimes we have to call external/internal services to push/pull information or we may need to customize the flow of the website (B2C takes payment on checkout but B2B may take payment after dispatch, etc).
Before we discuss further, let’s check different layers of commerce foundation.
Runtime API is at the bottom of the stack which resides in the Microsoft.CommerceServer namespace. These hasn’t been removed in CS2009, so all of your old CS2007 code will still work in the new system, but I highly recommend to migrate to new CS2009 API when doing new development as new API architecture provides us flexibility to extend the application easily and also allow us to scale out the application easily in production but the only big disadvantage I see is the impact to application performance.
Multi-Channel Commerce Foundation are the set of libraries which encapsulate the CS2007 API allowing us for a consistent programming model across the various functional stacks (IE: profiles works similar to catalog works similar to marketing – before in CS2007, we used to either use runtime API or agent mode or local mode or access to web services). Microsoft owns and maintains this code and this is what you’re encouraged to code against if you’re doing development in CS2009. The API is actually designed to support full XML serialization of all DTOs, so the idea here was to allow CS to exist in an App-Tier independent of what exists on the front end.
Commerce SharePoint Extensibility Kit
This is everything that sits in the Microsoft.Commerce.Portal namespaces—the idea here is to encapsulate the Multi-Channel Commerce Foundation code to accelerate application deployment on SharePoint. Don’t expect Microsoft to fix any of the issue in this code – if you reach them, they will ask tell you to fix it as you have the source code. Microsoft don’t give us much in the way of deployment guidelines on how to get this out in a production environment. If you observe the code, the source code can be refractor for better maintainability (I used resharper tool and able to find issues like unnecessary usage of namespaces, etc). Additionally, you’re not able to deploy the OOB owned WSP and your custom WSP on the same farm without getting all sorts of conflicts around package contents, so you need to pull the old WSP out or rebrand everything in the package to get this working in parallel with the existing extensibility kit. Here are the steps we should follow
1. Signed your CommerceSharePointExtensibilityKit project with new key and change the key where ever applicable in the solution.
2. Rebuilt them to create the .wsp files "MicrosoftCommerceMOSSDefaultSite.wsp","MicrosoftCommerceWSSDefaultSite.wsp" and "MicrosoftCommerceWebParts.wsp"
3. Retracted & delete already installed commerce server solutions .
4. Deploy both "MicrosoftCommerceMOSSDefaultSite.wsp" and "MicrosoftCommerceWebParts.wsp" on sharepoint site.
So, now that you’ve got fair knowledge, what’s the best practice? As a architect/tech lead you should start balance between what functionality you’re getting out of the core package and how much further you need to customize or introduce into your codebase.
Ask to Microsoft: It would be better Microsoft to include few scripts (batch files), which automatically removes existing WSP and installed new WSP files.
I am still learning and I will blogging the same here.. so, keep visiting my blog.
If you like this post, please click on our sponsor advertisement.
