Category Archives: Real Nice Rugs

SharePoint 2010 Sample Sandbox Application – Real Nice Rugs

Way back in 2008 I wrote about my intention to build an ecommerce site on WSS 3.0 – it never happened because I was just too busy. To make up for my failure to deliver on I built one on SharePoint 2010. You can see it here –

The current version is a sandbox deployment running on SharePoint Foundation 2010 Beta and it is a fully functioning storefront that uses PayPal for the checkout process.

The tools I used to create this site are SharePoint Foundation, Visual Studio 2010, SharePoint Designer 2010, and Elumenotion SharePoint Skinner. I will be using this site as a basis for a number of blog posts that will follow. Planned topics include:

  • Defining and Deploying Fields and Content Types with Visual Studio 2010
  • Creating and Deploying Custom Master Pages and Style Sheets
  • Using the Dialog Framework for Popovers
  • Custom Code to Provision the Site
  • Configuring Deployment and Build Steps for Visual Studio 2010 SharePoint Projects
  • Building Web Parts for Sandboxed Solutions Part 1 – Simple Part to Hide the Ribbon
  • Building Web Parts for Sandboxed Solutions Part 2 – Web Part for Categories
  • Building Web Parts for Sandboxed Solutions Part 3 – Complex Web Parts – The List Item Display Web Part

This list is tentative and I’ll add more as I go. The reason for this is that the site is still very much a work in progress and it runs on beta software at the moment. Later this month, time permitting, I will add non-sandboxed functionality to support the custom welcome mat functionality.

Here is a screenshot. If you find the series helpful, I hope you’ll consider buying one of Dad’s welcome mats!

Author: Doug Ware

WSSStore Base Solution Structure

In the previous post I introduced the tools I’m using to create the new Real Nice Rugs site. I also talked about the version control and introduced the Visual Studio 2008 solution containing the project’s base site definition. In this post I’m going talk about the solution package itself.

You can download the version that goes with this post here.

Project Structure

This project uses WSPBuilder to create web solution packages. WSPBuilder works by examining the project’s folder structure and creating a cabinet file containing a solution manifest and all of the project’s files. The manifest tells SharePoint where to put each file from the cabinet into the 12 hive.

The folder structure looks like this:


A Web Template file is an xml file that advertises the presence of a site definition to SharePoint. The web templates on your server are in the 12TEMPLATE1033XML folder (1033 is my LCID, it indicates EN-US, but yours may differ). The name of each web template starts with the literal text, WEBTEMP. The web template for this solution is WEBTEMPWSSSTORE.XML. I created this file using the existing WEBTEMP.XML from my development server’s 12 hive as a starting point.


<!– _lcid="1033" _version="12.0.4518" _dal="1" –>

<!– _LocalBinding –>

xmlns:ows="Microsoft SharePoint">



Title="WSS Store"



Description="A simple eCommerce site."

DisplayCategory="Capitalism" >




SharePoint uses this information on the Create Site Collection page.

This particular web template points to two other sections of the 12 hive: the images folder and the site template.

12TEMPLATEImages – RNRImage.png

The 12TEMPLATEImages folder maps to the /_layouts/images/ URI on every site collection. The project contains the single image, RNRImage.png, indicated by the ImageUrl attribute.

12TEMPLATESiteTemplatesRNR – Default.aspx

SharePoint uses the value of the webtemp’s Template element Name attribute. The Name attribute in the template is RNR.

This folder contains the default web part page, default.aspx. In this example, the file is a copy of the STS (Team Site) default.aspx file.


The web template indicates that there is a site template named RNR. SharePoint looks for the site template file in the site template’s XML folder. The site template definition is always named ONET.XML.

You can see the ONET.XML for this version of the site definition here. I will fully describe this file and how I made it in a subsequent post.

The other two files in the project, FullDeployBuildEvent.txt and UpgradeBuildEvent.txt, are outside of the 12 hive structure. WSPBuilder will not include them in the package. These contain different post-build event command scripts that build and deploy the solution. Iteration 0

This is the third post in a series about my attempt to create a basic eCommerce platform on WSS 3.0 to replace the site I use to sell welcome mats. You can read about the project here and see all the posts in this category here.

To complete iteration 0 I need to pick my toolset and set up version control.

My Toolset

I know that I’ll be adding to the toolset over time, especially when I begin to integrate forms based authentication and credit card processing. I have some ideas about both of these, but I am deferring selection of those components until later. For now, my toolset will consist of:

I’ll use VS2008 to create the project and the individual artifacts. I’ll use SPD to create my master pages. WSPBuilder will help me package everything into a Web solution package, and my own SharePoint Skinner will help me create my style sheets and themes. (Who knows? maybe I’ll finally finish v1.1 of skinner in the process!)

Version Control

Since I’m doing all of this in full view of you, my readers, I’ve decided to use the source control services provided by CodePlex. I created a new project named WSSStore located here. I am using Visual Studio Team System 2008 Team Explorer. You can download it here.

Setting Up the Project

I didn’t intend to start any concrete implementation until iteration 1, but I went ahead and made a new project containing a basic site definition so that I could finish setting up the CodePlex site. I’ll explain the contents of the project in a subsequent post, but there are a couple things you need to do in order to build the solution.

The first thing you need to do is install the WSPBuilder files to your development server’s local disk. The release files are in a ZIP archive, so just extract them to a directory of your choice.

The project uses the following Post-build event command line script in the VS project’s properties to build the package and deploy the solution:

cd $(ProjectDir)


stsadm -o retractsolution -name $(ProjectName).wsp -immediate

stsadm -o execadmsvcjobs

stsadm -o deletesolution -name $(ProjectName).wsp

stsadm -o addsolution -filename $(ProjectName).wsp

stsadm -o deploysolution -name $(ProjectName).wsp -allowgacdeployment -immediate

stsadm -o execadmsvcjobs


For this to work you must add the locations of stsadm.exe and wspbuilder.exe to the Path environment variable.

In Explorer, right-click My Computer and select Properties. On the Advanced tab, click Environment Variables.

The Environment Variables dialog box will open. Select Path and click Edit.

Add the following to the end of the path:

;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12bin;C:ThePlaceYouPutWSPBuilder;

Click the various OK buttons to save the path and you’ll be able to build the solution.

After you build the solution, the WSS Store template will appear on the Create Site and Create Site Collection pages. This version is simply a blank site definition.

The source code for this iteration is available on CodePlex and is also downloadable as a zip file here. – The Plan

If you don’t know what this is about, see this post.

I’m sure we all agree that no one should ever start a project without having a plan. In my case it’s critical because I’m doing this on the side as time permits and I want to document the entire process. I need a plan so that when a week goes by between cycles spent building the site definition; I won’t have to start by saying, ‘now where was I?’

You need to see my plan because I promised to be honest and not obscure my bone-head moves or general screw-ups by saying, ‘I meant to do that’.

That said… here is my high-level plan.

Iteration 0 – Project Initiation

This is what I started today.

  1. Stick neck out and make promises
  2. Advertise to the blogosphere
  3. Pick toolset
  4. Setup version control

Iteration 1 – Basic Site Definition

In this cycle I am going to create a new site definition that contains the various lists and libraries I expect to need in the final solution. I won’t customize any of the lists in this phase and I will ignore the shopping cart and its related elements. This is a rough-draft of the super-structure.

  1. Create a Blank site collection.
  2. Use the browser UI to add lists and libraries.
  3. Create a site definition (not a template) based on 1 & 2.

Iteration 2 – Security

In this iteration I will define groups, permission levels, and get the custom membership provider working.

  1. Define user roles and groups
  2. Define and implement permission levels
  3. Custom membership
  4. Web Solution Package integration

Iteration 3 – Product Catalog

In this phase the site will begin to resemble a commerce site.

  1. Implement product content type and custom forms
  2. Implement product document library
  3. Implement catalog viewer web part
  4. Web Solution Package integration

Iteration 4 – Shopping Cart

It’s an ecommerce site, it needs a shopping cart!

  1. Figure out how this is going to work
  2. Revise plan
  3. Web Solution Package integration

Iteration 5 – Check-out

In this phase the site will get the ability to finalize an order and collect payment.

  1. Collect billing and shipping info
  2. Credit card gateway
  3. Confirm transaction emails
  4. Web Solution Package integration

Iteration 6 – Fulfillment workflows

This cycle includes workflows to communicate with the suppliers, track shipments, and notify customers of status.

  1. Define workflows.
  2. Implement workflows.
  3. Web Solution Package integration

Iteration 7 – Branding

In this iteration we’ll do the branding. I’ll be talking to some gfx artists soon to start figuring out the Real Nice Rugs layouts. So, this really runs parallel to the other cycles.

  1. Define branding.
  2. Create themes.
  3. Create master pages.
  4. Web Solution Package integration

Wow! That’s a lot to do. I’ll be lucky to make the holiday season, but at least I know what I’m facing, and you know what to look forward to, unless I fail utterly. J No pressure.

–Doug Ware

How We’ll Do It – Rebuilding

One of my little side businesses is I started it to give my father an online outlet for his welcome mat business. It hasn’t been a huge success because neither Dad nor I have the time to really do proper marketing or to maintain the site. One of the reasons for this is that, while the hosted ecommerce package is functional, if you want the good tools you have to pay more and at our relatively low volume it doesn’t seem worthwhile.

Things would be better if the platform had more functionality and was more usable. But, even if the upgraded package paid for itself through more sales, we intend to add custom printing to the product mix later this year. When we do, the site will need custom functionality that the package we’re using doesn’t offer at any price. And so, the time has come to start building a custom solution.

I’m happy to say that Elumenotion is growing both in terms of our consulting projects and training offerings, but this means I’ll have even less time to work on this side project. Therefore, it’s critical that the new site do what we need with little manual intervention and also be easy enough to use that anyone can maintain the catalog. I think a simple ecommerce platform built on Windows SharePoint Services will be just the ticket!

I love the "How We Did It: *" posts on the SharePoint Team Blog. Each of these is a little case study on a successful project and it’s always interesting to see how people did their projects. But, whenever I read a case study (of any kind), I always wonder how it really went. You know… what skeletons were buried? What went unsaid?

Because of this, I will be brave (foolish?) and keep a running diary as I build the new platform and I will make the resulting site definition available for download.

This little project is not my number 1 priority, but I did promise Dad I’d have it done before the Christmas holiday buying season starts. I invite you to follow along. Feel free to comment and criticize, and if you like the rugs, maybe buy one for your Dad or Mom. J

Right now we only ship in the US, but that will also change soon.

–Doug Ware



Good Week

I’m having a good week!

On Monday I attended the Halo 3 launch party at Microsoft. Everyone had a great time although I am a better target than a killer in a death match.

That same day, Skinner crossed the 1000 download mark in just under one month! I knew WSS needed it, but when I put it up I said I’d be happy with a 1000 downloads ever. I’ve gotten a few good feature requests that I am working on. Look for a new release soon!

Finally, my new ecommerce site, RealNiceRugs, officially launched. If you need something to wipe your feet on, check it out! Below is one of my wares, the most excellent weather forecast rug! Get one… it’s never wrong.