300 likes | 910 Views
DM400. Best Practices for SharePoint Solution Deployment. Ted Pattison Instructor Ted Pattison Group. SharePoint Training from People You Know and Trust http://www.TedPattison.net. Industry’s Leading Experts & SharePoint MVPs
E N D
DM400 Best Practices for SharePoint Solution Deployment Ted Pattison Instructor Ted Pattison Group
SharePoint Training from People You Know and Trusthttp://www.TedPattison.net Industry’s Leading Experts & SharePoint MVPs Andrew Connell - Shane Young - David Mann - John Holliday - Scot HillierNicola Young - Sahil Malik - Chris Predeek - Ted Pattison
Agenda • Deployment in a Web Farm environment • The Root Files directory • Solution Packages • Demos of developing SharePoint Solutions • Features • Custom application pages • Custom page templates • Custom field types • Web Parts • Updates to web.config
The WSS Farm • WSS deployment based on a farm • Farm requires Web server(s) and database server • Farm can be single server or multi-server • Each farm has exactly one configuration database
SharePoint Customization Versus Development • Site Customizations • Changes to one particular site recorded in content DB • Done using the browser or the SharePoint Designer • Easy to do but hard to reuse • WSS Development • Creation of reusable templates/components • Templates/components installed on Web server • Development based on Visual Studio projects • Project source files checked into source code control • Projects can be moved through staging to production
WSS Component Development • Feature-based Components • Custom Application Page • Site Page Templates • Master Pages • Web Parts • Site Columns and Content Types • Custom List and Document Library Definitions • List-based Event Handlers Custom Workflows • Components creating without using features • Custom Field Types • Site Definitions
The Root Files directory • This is where many of your development files need to be deployed • Most files go into templates directory Web Service files GLOBAL .RESX files Admin Pages User Controls Features Images Application Pages Site Definitions Field*.xml files
SharePoint Solution Packages • What is a Solution Package? • Templates and/or components in an installable unit • CAB file with .WSP extension • Package that contains metadata (manifest.xml) • Best Practice in SharePoint Solution Deployment • Use solution packages… period! • Add support for building/testing solution package early! MyStuff.wsp manifest.xml Other Stuff Templates/components
A sample manifest.xml file • Defines Solution properties and contents
Building the .WSP file • Commonly done using MAKECAB.EXE • Requires .DDF input file Solution Package Build Process Input DDF File Output WSP File MAKECAB.EXE
The DDF File Up Close • DDF file must build proper folder structure • Prefer .Set DestinationDir instruction MyStuff.wsp
Two Phases of WSP Deployment .WSP Install ConfigDB (1) Solution Package Installation • .WSP file is copied to ConfigDB (2) Solution Package Deployment • .WSP pushed out to Web servers • Usually requires IIS Reset operation • Done in production farm in off hours WSP • REM - Install CustomApplicationPages.wsp in WSS Solution Package Store • %STSADM% -o addsolution -filename MyStuff.wsp • REM – force batch file to run timer job synchronously • %STSADM% -o execadmsvcjobs .WSP Deploy WFE ConfigDB WFE WSP WFE • REM - Deploy Solution Package MyStuff.wsp to Web servers in farm • %STSADM% -o deploysolution -name MyStuff.wsp -immediate • REM – force batch file to run timer job synchronously • %STSADM% -o execadmsvcjobs
Solution Management in WSS • WSS Central Admin provides some control • Allows you to see and deploy .WSP files • Does not provide a way to install .WSP files
Solution Package Properties • WSS Central Admin allows some inspection
Helpful Development Tools • From Microsoft • Visual Studio 2005 Extensions for WSS • VSTO 3.0 in Visual Studio 2008 • From SharePoint Development Community • The WSPBuilder utility • The STSDEV utility
The STSDEV Utility • Low-tech tool for creating solution packages • Think of it as an educational proof-of-concept • Helpful in getting started • Used to promote best practices • What does it do? • Generates Visual Studio files (.sln, csproj, .aspx, .cs) • Creates project with RootFiles directory structure • Eliminates need to edit manifest.xml file • Eliminates need to edit.ddf file • Takes care of GUIDs and assembly names • Provides custom tasks in .targets for common SharePoint development operations
Walkthough of Using STSDEV • STSDEV based on Solution Providers
Demo: CustomApplicationPages • Best Practices • Create solution-specific directory in LAYOUTS • Use code-behind with DLL installed in GAC • Adding a complimentary feature for navigation
Demo: CustomSitePages • Best Practices • Use file-based templates for page creation • Add SafeControl setting when using custom controls • Deploy .ascx files into CONTROLTEMPLATES • Clean up during feature deactivation
Demo: LitwareFieldTypes • Best Practices • Deploying custom field type using a .WSP • Avoiding naming conflicts with .ascx files
Demo: Acme.WebParts • Best Practices • Adding SafeControl entries using manifest.xml • Deploy feature to push .webpart files into Web Part gallery
Demo: Mega.WebParts • Best Practices • Deploying Web Part DLLs in bin directory • Adding CAS setting using manifest.xml
Demo: LitwareAppSetting • Best Practices • Programmatically updating web.config • Providing control with WebApplication feature
Sample Code from this session • http://www.TedPattison.net/downloads.aspx
Summary • Deployment in a Web Farm environment • The Root Files directory • Solution Packages • Demos of developing SharePoint Solutions • Features • Custom application pages • Custom page templates • Custom field types • Web Parts • Updates to web.config
SUBMIT AN EVALUATION For a chance to win an 8GB ZUNE! Submit evaluations on MySPC www.MicrosoftSharePointConference.com
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.