11.4 Windows SharePoint Services 3.0 Solution Framework 253
Chapter 11
11.4 Windows SharePoint Services 3.0 Solution
Framework
The Windows SharePoint Services 3.0 solution framework provides a
method for collating the various components that comprise a solution and
packaging them together into a solution file. The solution file is basically a
Figure 11.10
Workflow project
templates added to
Visual Studio.
Figure 11.11
Visual Studio
Workflow Designer.
254 11.4 Windows SharePoint Services 3.0 Solution Framework
cabinet based format with a .wsp extension instead of a .CAB extension. As
we saw in our previous Web Part example, once the solution is created, the
solution file can then be used to deploy the contained functionality to a
SharePoint farm, which in this instance was a “Hello World” Web Part.
A solution goes through several phases during its lifecycle, from creation
through deletion. Figure 11.12 illustrates the solution lifecycle as it pertains
to the WSS 3.0 solution framework. The whole premise behind the solution
framework is to provide separation and consistency between the creation of a
solution package, which is seen as a developers task, and the actual deploy-
ment of the solution package, which is more of an administrative task. Phase
one of the lifecycle shows the creation of the solution file. There are a variety
of methods that developers can adopt when creating a solution file, and we’ll
go into more detail on these shortly—but the most important point to make
here is that the creation of the solution is a developer task; you do not need
admin privileges to create a solution package. Granted, you will most likely
want elevated privileges in your own development environment when build-
ing solutions to make your life easier; they are not, however, a requirement.
Once you have created your solution file (.wsp file) you pass that file off to
your administrator for deployment. The administrator takes your file and,
using the SharePoint command line administration tool (stsadm.exe), adds
the solution file to the WSS 3.0 configuration database. Once the solution
has been added to the solution store, the administrator can then either
deploy the solution immediately or schedule the solution to be deployed at a
future point in time. If the solution contains resources that are scoped at the
Web application level, then the administrator has the option to specify the
Web applications to which the solution should be deployed; there is also an
option available to deploy to all Web applications. Solutions that do not con-
tain Web application–scoped resources are deployed globally.
Figure 11.12
Solution lifecycle.
11.4 Windows SharePoint Services 3.0 Solution Framework 255
Chapter 11
The solution deployment process can be initiated using stsadm.exe, or
using the central administration browser user interface via the operations
solution management page. Figure 11.13 shows the deploy solution page,
from which the administrator can configure when and where a solution is
deployed. This particular example shows that the solution package
deploysampleWebpart.wsp is configured to be deployed immediately; how-
ever, the page also includes a scheduling option. The scheduling option
leverages the WSS timer services to create a timer job for the deployment.
During deployment, the files contained in the solution package are exam-
ined and placed in their appropriate location on the server. For example, if
the solution package specifies some _layouts files, they are placed in the
_layouts directory, if the solution package includes some Features the Fea-
ture folders are copied to the features directory; (
\Program Files\Common
Files\Microsoft Shared\Web server extensions\12\TEMPLATE\FEA-
TURES
), and if the solution package includes Web Parts, the Web Parts are
copied to the appropriate location, such as the global assembly cache and a
SafeControl entry is placed in the Web.config file of each Web application
to which the solution is deployed.
The solution file in our example is named deploysampleWebpart.wsp
and, as its name suggests, it is used to deploy a sample Web Part. As previ-
ously mentioned, the deployment process for a solution that includes Web
Parts involves copying the assembly files associated with the Web Part to the
global assembly cache and registering the Web Part in the Web.config file of
the appropriate Web applications. Figure 11.14 shows the solution proper-
Figure 11.13
Deploying a
solution using the
browser user
interface.

Get Microsoft SharePoint 2007 Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.