Managing the SharePoint 2010 Application Lifecycle - Part 1
-
Upload
chris-obrien -
Category
Documents
-
view
2.433 -
download
1
description
Transcript of Managing the SharePoint 2010 Application Lifecycle - Part 1
Managing the SharePoint Application Lifecycle – beyond
version 1.0.0.0PART 1
DEV103
Chris O’Brien - MVP
Chris O’Brien, MVP, MCSD.Net, MCTS www.sharepointnutsandbolts.com Twitter: @ChrisO_Brien
Hands-on developer Author of ALM chapter in MVP book Creator of Content Deployment Wizard tool Regular speaker at UK user group
What is ALM?
Definition: Considering all aspects of app through
lifetime Key aspect: managing upgrades and
change SharePoint presents unique challenges –
complex platform!
Part 1 (this session)
Upgrading a SharePoint application
• SP2010 upgradable Features• How to version a Feature• Using code/XML to upgrade
Initial build • Feature development – XML/code• Building Feature XML
Part 2 (Weds 2pm)
Upgrading a SharePoint application
• How to upgrade different artifacts
• Changes to WSP framework
• Assembly versioning in SP2010
• Versioning recommendations
Considerations in initial build
Decision: provisioning with XML or code? Drivers to use code approach:
Ability to debug provisioning! More control over sequencing Upgrading artifacts requires code anyway
BUT, some XML always required: Site definitions, list templates, delegate
controls, custom actions
Developing Feature XML
By hand Some ‘startup’ support with VS item
templates Copy/paste from last project
NEW – reverse-engineer with tools Step 1: Save site as template (WSP) Step 2: Import WSP in VS2010
Feature framework changes
ReceiversNew XML
Can now add event receiver to specific list declaratively:
PropertyBag
Used to set list item values declaratively Also entries on root web, web, list
New XML
WorkflowAssociation
Used to add workflow to list/ctype
New XML
WebTemplate
Similar to site def, for web only Also used in sandbox
New XML
CustomAction
Expanded for ribbon customization Can also add JS to page (SPSite-scoped)
New XML
Demo
WSP IMPORTStreamlining the initial site build
WSP import gotchas
OOTB site def artifacts included NOT full fidelity:
Can’t do BCS entities, code WFs, list/site defs and more..
NOT supported to import 2007 WSP! Round-trip/customized files issue Web part properties – serialized as binary
WSP import recommendations
Do not use generated VS project itself
Selectively move artifacts into ‘created’ VS project(s)
Feature versioning/upgrade
Approaches for upgrading
Create new feature Staple to existing site def for new sites Script activation on existing sites
Upgrade existing feature Old way: reactivate feature
– ISSUE: Some artifacts get duplicated– ISSUE: May be undesirable for activation code to
run multiple times
New way: upgrade feature
Versioning/upgrading Features
Version attribute now has a purpose! Define what should occur in 1.0.0.0-2.0.0.0
UpgradeActions element XML – some new XML for common
scenarios Code – specify method/parameters in
CustomUpgradeActions element– New FeatureUpgrading method – add logic here
Feature upgrade XML
ApplyElementManifests Integrate new artifacts into existing Feature Sometimes all you need!
AddContentTypeField Add columns to content type
MapFile Repoint a file to new location on filesystem
(uncustomized files only)
Feature dependencies
Can now depend on specific version of Feature (MinimumVersion)
Depended-on Features auto-upgraded where possible
Plus same dependency rules as 2007: Cannot depend on lower scope Hidden features cannot have dependencies
Demo
UPGRADING A FEATUREUpdating functionality
Triggering upgrade
NOT automatic on deployment/ reactivation!
Run [Foo].QueryFeatures() to find Features requiring upgrade
Run SPFeature.Upgrade() on all/selected No UI, PS cmdlet, STSADM cmd to do this
Upgrade tool on Codeplex http://spfeatureupgrade.codeplex.com (soon!):
Feature upgrade gotchas
Messages not logged by default – change ULS settings for : “Feature Infrastructure”, “Fields”, “General”
BeginVersion inclusive but EndVersion not
Newly-activated Feature instances out of sync = Feature design issue
Ensure obey ‘elements by scope’ rules!
Summary
WSP import useful in initial build
Now have standardized framework for upgrading applications New XML e.g. AddFieldToContentType Implement code in FeatureUpgrading event
Next time..
How to upgrade different artifacts
WSP framework changes
How to version assemblies in SP2010
Versioning recommendations • Features• Assemblies
Thank you for attending!
Part 2 – Tues 11:45am