While building a new site with Commerce Server 2009 SharePoint services, we wanted to redesign the site and modify a lot of pages. The problem is that for us to do that 3 solutions were possible per Microsoft’s documentation:
- Use the extensibility kit to edit the pages and master pages
- Change the necessary pages directly in the Layouts folder of that SharePoint hive
- Modify the pages in SharePoint designer
None of these solutions were suitable for our need and here are the reasons:
- I do not recommend using the extensibility kit because we need to re-sign all the assemblies with a new key and change all references to the public key token. Also, if you modify the extensibility kit, you are making it very difficult to upgrade to future versions of CS 09, unless you only add web parts or pages. Finally, the extensibility kit does not include the contemporary site, which is the one we want to keep as a basis.
- Changing the pages in the layouts folder is not a good idea because you basically change it for all of your sites. Of course it’s not an issue because usually there is only one CS site per machine. but still it can be an issue in a dev machine or if ever CS 09 should be used as Saas (Software as a service). Finally, this solution is not re-deployable.
- Modifying the pages in SharePoint is also a plausible solution but again it is not deployable and it breaks the site definition.
So, what is the solution? It is to repackage the Contemporary site SharePoint solution and adding your custom features and modified pages. The following modifications were done in MOSS and not in WSS. I’m sure it is possible in WSS though. Also, for the packaging in wsp, I’m using WspBuilder.
So, here we go:
1. Un-pack the MicrosoftCommerceMOSSDefaultSiteV2.WSP file to any folder, let’s say “C:\ContemporarySite”. Your contents should look like this:
2. Now you need to restructure the features and files for WspBuilder. So essentially you would have:
| Copy the following folders in 12\Templates\Features: |
| CommerceServerContemporarySiteCheckOutStepsInstance CommerceServerContemporarySiteImages CommerceServerContemporarySiteProvisioner CommerceServerContemporarySiteResourceDeployment CommerceServerContemporarySiteResources CommerceServerContemporarySiteSPListSampleData CommerceServerContemporarySiteXslts CommerceServerMyAccountSiteMapProvider |
| Copy the following folders in 12\Templates: |
| 1033 CONTROLTEMPLATES IMAGES LAYOUTS SiteTemplates |
| Copy the following folder in 12: |
| Resources |
| Copy the following files in the GAC folder: |
| Microsoft.Commerce.Portal.ContemporarySite.dll Microsoft.Commerce.Portal.ContemporarySiteCommon.dll |
Now that the basic structure is done, you are able to re-create the Contemporary site’s WSP solution and deploy it using Commerce Server SharePoint Services configurations tool. Before that though you will need to modify the SharePointCommerceServicesConfiguration.exe.config to take the new WSP file:
<sharePointSolutionGroup name="DefaultSiteAndWebPartsMoss" sharePointPlatform="moss" defaultInSilentMode="True">
<sharePointSolutions>
<sharePointSolution id="7b93b2ca-e1e4-4783-a038-14094933c002" file="MicrosoftCommerceWebParts.wsp" version="1.0.0.0" wspKey="1"/>
<sharePointSolution id="Your solution ID Here" file="Your Solution Name Here.wsp" version="1.0.0.0" wspKey="2"/>
</sharePointSolutions>
<defaultWebApplicationSettings name="SharePoint - 8088" port="8088" extendedName="SharePoint - 8089" extendedPort="8089" appPoolId="SharePoint - Pool 8088" appPoolUser="domain\someone"/>
<defaultSiteCollectionSettings create="True" title="Home" name="ContemporarySite" admin="domain\someone" template="MOSSCSContemporarySite"/>
<defaultCommerceServerSiteSettings create="True" name="ContemporarySite" description="Commerce Server Site for Commerce SharePoint Contemporary Web Site" siteWithSampleData="False" databaseServer="."/>
</sharePointSolutionGroup>
Now you can use the configuration tool to deploy your site. Please be advised though that your MOSS environement needs to be clean because you are essentially redeploying the same feature as the contemporary site. Also, do not modify the name of the Contemporary Site’s site definition configuration names such as “MOSSCSContemporarySite” because the receivers look for those configurations.
In the next part of my post, I’ll show you how to modify the master pages and add new features to your site.
Tags: commerce server 2009, sharepoint 2007