SPSource Walkthrough

The first thing needed is to set up two site collections - one for design, and one for development. The design site is where changes are made via SPD and the UI, and the dev site is where the WSP is deployed.

design site
design1url.gif

dev site
dev1url.gif

To illustrate a simple example, I'll create a new publishing layout page in the design site based on the Welcome Page content type.
SpSourceWelcomePage_Settings.gif

The new page has now been added to the master page gallery as seen in SPD.
SpSourceVisibleInSPD.gif

I'll add some markup, web part zones, and content placeholders to the page, and save it.
LayoutPageWithMarkup.gif

When I create a page in the SharePoint UI, the new page template is now available.
CreatePage.gif

As shown in the UI:
EditPage_FirstView.gif

In my Visual Studio project, which is based on STSDev, I'll add a new Feature (STSDev, WSP Builder, and WSPProjectTemplate all have been tested and work)
NewFeature.gif

Now I'll add a new file named PublishingPages.spsource to the feature.
NewPublishingPagesSPSOURCEFile.gif

This file is nothing more than a stripped-down version of the file provisioning module that was needed before. I just set the Url of the list where the source file is, and add a File element for each file I want to bring down.
PublishingPagesSpSourceFile.gif

To execute SPSource, I have a CMD file at the root of my project that passes one parameter to the executable, the url of the design site.
SPSourceCMD.gif

Once executed, the both the file provisioning module and the files themselves will be located in the Feature folder. Sub-folders are possible, and multiple spsource files are allowed per folder. The source SharePoint files will be added to the same folder as the spsource file, and the file provisioning module will be placed at the root of the feature.
PublishingPostSPSource.gif

You can see that the file provisioning module contains the properties set in the document library.
ProvisioningFile.gif

And the source of the ASPX page is the same as what was created in SharePoint designer.
PageLayoutInVS.gif

Next, I add the ElementManifest and ElementFile lines to the Feaure.xml file called CustomPublishingPages (only files at the Feature root are needed for WSPProjectTemplate)
featurefilewithelements.gif

When I deploy the WSP and activate the Feature, the new page layout is now available!
newPageInDev.gif

Last edited Aug 8, 2008 at 8:49 AM by richfinn, version 17

Comments

No comments yet.