How solution deployment has changed development with SharePoint technologies

Background:

Anyone who is familiar with development & deployment of custom solutions on SharePoint Portal Server 2003 or Windows SharePoint Services will probably agree when I say there are certain areas lacking in the end to end process.

For example, here is a high level generic step by step process that usually happens:

  1. Spec written (some people seem to think this step is optional)
  2. Developer develops code etc… Usually on a stand-alone, single server SharePoint environment. (I personally use a VPC for all development these days)
  3. Developer packages code into an installer if you are lucky
  4. Testing
  5. Hand off to production people who go and install it on the server(s).

This would normally be really easy right? Well, in SharePoint land there are many areas where “things” need to be done during an installation. Some of these are (but not limited to):

  • Assembly deployment. GAC or BIN
  • Web.config changes. Additions to the safe controls list, CAS security policies,
  • Resource files like images,
  • Dwp files
  • Site definitions (list definitions etc…)

Depending on how your development team packaged these would depend on how much work you had to do to deploy them.

To make matters worse, depending on your physical SharePoint farm you might need to do install steps on each server. This brought in complexity around what servers had what versions at what time etc… A nightmare if you were managing a large farm with many servers.

How we make this better in MOSS and WSSv3:

In MOSS we have a good solution to all of this called the Solution Framework. Here is a little summary about what this is:

“The Windows SharePoint Services (WSS) solution framework provides a way to bundle together all of the components for extending SharePoint in a new file called a solution file (a CAB-based format with a WSP extension). A solution is a deployable, reusable package that can contain a set of features and site definitions, templates, Web Parts, and assemblies that you can apply to a site, and individually enable or disable.” – WSS SDK

Not only this but the Solution Framework takes care of deploying the solution to ALL front end web servers in the farm without the admin having to go to each box to do this manually!

You can:

  • Deploy the Solution package to the farm
  • Retract the Solutions package
  • When a new web server is added, automatically deploy the solution to it
  • Deploy new versions of the Solution

Practical example:

In the system I talked about in “Application Development on MOSS & WSSv3” we are using a Solution package to deploy:

  • A custom Site Definition
  • 6 Feature Definitions (another new MOSS technology) that are:
    • Custom Workflows x2
    • Timer Job
    • Content Type
    • Custom List definition
    • Custom Site Columns definition
  • Web part
    • SafeControls list entry

Note: I won’t talk about Features or how to create them; Todd has a good post on that subject here: http://www.sharepointblogs.com/tbaginski/archive/2006/06/02/8062.aspx

[Updated] This means when we want to deploy this solution to a new farm we simply use the STSADM -addsolution -filename to upload the solution to the farm. Once uploaded you can simply to into the “Solution management” section under the “Operations” tab in the Central Administration Site, and deploy that solution.

Once it is uploaded we can then choose to Deploy that solution.

This gives you options on when you want the deployment to take place and to what web applications. (In the shot above I had an assembly being deployed to the GAC, hence the warning)

Although all this will be/is documented in the WSS SDK, I thought I quickly go over how to make a solution file.

Consists of:

  • A CAB file containing
    • A Manifest.xml file
    • All the files for the Features etc… that make up your solution

Below is a cut down sample XML manifest.xml file for the example I used above (highlighted text is comments):

< ?xml version="1.0" encoding="utf-8" ?>
< xmlns="http://schemas.microsoft.com/sharepoint/" solutionid="{79d1a62e-3627-11db-963e-00e08161165f}" resetwebserver="TRUE">

<>
< deploymenttarget="GlobalAssemblyCache" location="Foo.Sharepoint.WebpartsFoo.SharePoint.WebParts.dll">
<>
< assembly="Foo.Sharepoint.Webparts, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=63cce650e8605f5d" namespace="Foo.Sharepoint.Webparts" typename="*">
< /SafeControls>
< /Assembly>
< deploymenttarget="GlobalAssemblyCache" location="Foo.Sharepoint.Timer/Foo.Sharepoint.Timer.dll">
< /Assemblies>

<>

< location="Foo.Sharepoint.TimerFeature.xml">

< location="Foo.CustomTypeFeature.xml">

< location="Foo.FooLibraryFeature.xml">

< location="Foo.ColumnsFeature.xml">

< location="Foo.Workflow.ProcessFooFeature.xml">

< location="Foo.Workflow.ProvisionFooFeature.xml">

< /FeatureManifests>

<>
< location="FOO">
< location="1033XMLWEBTEMPFoo.XML">
< /SiteDefinitionManifest>
< /SiteDefinitionManifests>
< /Solution>

Then you package this up along with all your Feature files into a CAB file with a “.wsp” extension. In short each feature goes into a sub-dir in the CAB that matches the path you have in the Manifest.xml file. You can use cabmake.exe to do this, or any other tool you like.

Then you are ready to go and deploy!

Although this is probably a little more work to begin with, your deployment team will thank you for it immensely.

DeepEarth: Silverlight 2.0 + Virtual Earth + DeepZoom / Seadragon

DeepEarth, a new Silverlight 2.0 mapping control, provides developers with the ability to use the Virtual Earth mapping elements in their own web applications. So what you ask? Well tt has been combined with DeepZoom, essentially Microsoft’s Seadragon technology converted for use across multiple browser and platforms… For those not in the know, Seadragon aims to make browsing images, no matter how large or how many, a speedy, seamless, and smooth experience. Deep Zoom has been put to use by a few companies, like the Hard Rock Café Memorabilia webpage.

Version 1.0 of DeepEarth was recently released with the following:

  • Fully implemented map control with property and event model
  • Fully templated set of map navigation controls
  • Layers for inclusion of Points, LineStrings and Polygons (OGS)
  • Conversion library for geography to screen coordinate systems
  • Geocoding (find an address)
  • Reverse Geocoding (getting an address from a point on the map)
  • Routing (Directions)
  • Marque zoom selection (default Ctrl-click and drag or from menu toggle)
  • Map rotation
  • Provides imagery as tile layers, a robust Virtual Earth implementation supporting the
  • official token-based tile access and web services

Now if the above video fails to sway you scoot over to the working version of DeepEarth that you can try out if you have Silverlight installed. The DeepEarth bits are available on Microsoft’s open source website, CodePlex. You’ll also need a Virtual Earth Developer Account and, if you want to get rid of the “Staging” watermark, you’ll need to send an e-mail to the Virtual Earth Licensing Team. Version 2.0 is slated for a February 2009 release.

Microsoft BizSpark – Starting up Start-Ups

Recently Microsoft announced BizSpark, a new program targetted at start-ups. It gives you access to the latest and greatest versions of SQL, VS, and Microsoft Support for a very good price. Zero dollars. In order to stem abuse there is a need for “sponsorship”. Specifically you need to belong to one of the organizations listed during signup. Other than that requirement it is a suprisingly easy process. Once in you get for three free, yes 3 and free, years:

Software

  • All the software included in the Visual Studio Team System Team Suite (VSTS) with MSDN Premium subscription Expression Studio (Version 2), plus VSTS Team Foundation Server Standard Edition – for the entire development team
  • Production license use rights, to deploy, host and support Startup’s “software as a service” applications for delivery over the Internet, using the following products: Windows Server (all versions), SQL Server (all versions), BizTalk Server, and Office SharePoint Server for hosting; and Systems Center for managing hosting server operations.

Support

  • Guidance, resources and mentoring provided by Network Partners, active members of the global software ecosystem who are qualified to provide support and advice to Startups
  • Access to MSDN Premium: managed newsgroups, online library, online concierge, etc.
  • Two technical support Incidents per Startup

Visibility

  • Each BizSpark Startup will have the opportunity to profile their company in the BizSparkDB, an online Startup directory, hosted on the Microsoft Startup Zone web site. Startups will get exposure to potential investors, partners and customers around the world.
  • Opportunity to be highlighted on the BizSparkDB as a featured company and be promoted as BizSpark Company of the Week on the Microsoft Startup Zone website.

    How to qualify?
    If you meet these three simple criteria, you can sign-up today:

  • Actively engaged in development of a software-based product or service that will form a core piece of its current or intended business[1],
  • Privately held, and in business for less than 3 years[2], and
  • Less than US $1 million in annual revenue[3].

To get in follow these steps:

1) Go to http://www.microsoft.com/bizspark/ and click “Join BizSpark now!”

2) Sign in with your Live ID or create a new Live ID

3) Click the “I Accept” check boxes, and enter your enrollment code (If you don’t already have a sponsor, contact Bill and he’ll help you get started! Btw, that’s where these steps came from!!!)

4) Provide some basic information about your start-up

5) Identify your primary contact

6) You’re done!!! Now you can manage your BizSpark account from here. Note your BizSpark Subscription ID, one of the things you’ll want to do next is activate your MSDN subscription using this ID. You’ll need to do this in order to start downloading the software.

7) To activate your MSDN subscription, visit https://msdn.microsoft.com/en-us/subscriptions/add/default.aspx and enter your name, email and the BizSpark subscription ID from the previous page, click the “I acknowledge and accept” checkbox and submit ‘OK’. (Note, it may take 4-6 hours for your MSDN subscription to become available after signing up for your BizSpark account. If MSDN doesn’t find your subscription, check back later.

8) Once you’re up and running you may want to find a Windows hoster who can work with you and your production use licenses to offer your low-cost, discounted hosting services. Through the BizSpark Start-up page you can click the “Manage Hoster Relationship” and find hosters in your country which are part of the program.

Integrating Visio 2007 and SharePoint: Task list items as a PivotDiagram

A nice way of presenting the contents of a task list with Visio 2007 is as a PivotDiagram…

To start you, or rather your end users, need either Visio or the Visio Viewer from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=d88e4542-b174-4198-ae31-6884e9edd524&DisplayLang=en

From the tasks list “Actions” -> “Create Visio Diagram”. Wait for the file to open, build, and then save to an appropriate document library.
When the visitor clicks on the link to the file it will/should load in an IE browser with tabs, zoom, and other Visio niceties

Caveat: the file will not update its display on task list item change as it is essentially an import into Visio. In my next Visio article I will explain how to overcome this hurdle.

Javascript: Functions: Remove from string & get url variable

Two handy functions that I had to use recently.

<
//Remove from string


function remove(s, t) {


i = s.indexOf(t);


r = “”;


if (i == -1) return
s;


r += s.substring(0, i) + remove(s.substring(i + t.length), t);


return r;


}



//Get querystring value


function getQuerystring(key, default_) {


if (default_ == null)
default_ = “”;


key = key.replace(/[[]/, “\[“).replace(/[]]/,
“\]”);


var regex = new
RegExp(“[\?&]” + key + “=([^&#]*)”);


var qs = regex.exec(window.location.href);


if (qs == null)


return default_;


else


return qs[1];


}

// –>

Oxite on Codeplex

http://www.codeplex.com/oxite

The team behind Microsoft’s Channel 8/9/10 developer sites has released a new blog/CMS engine named Oxite to Codeplex. Oxite was originally developed for the company’s MIX Online site and, as one might expect, it uses the typical Windows stack of ASP.NET, ASP.NET MVC, and SQL Server. Citing a lack of large-scale ASP.NET MVC samples, Redmond has published the core code under its OSI-approved, permissive open source license, Ms-PL, giving any developer the right to incorporate Oxite into their own blogging or CMS software.

SmartTools.Charts

Jan Tielens posted a rather nice example for charting with Silverlight in SharePoint 2007 over at: http://weblogs.asp.net/jan/archive/2008/12/04/3d-silverlight-charts-in-sharepoint-smarttools-charts.aspx

In essence he created a component that contains a web part that can show charts rendered by making use of the open source Silverlight control created by Visifire


SmartTools.Charts from Jan Tielens on Vimeo.