Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

18
©2010 Microsoft Corporation. All rights reserved. RTM Content - Published May 2010 Feature and Solution Framework in SP2010 Ayman El-Hattab Technology Solution Professional MEA Center of Expertise SharePoint MVP [email protected] www.aymanelhattab.com

description

 

Transcript of Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Page 1: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Feature and Solution Framework in SP2010

Ayman El-HattabTechnology Solution ProfessionalMEA Center of ExpertiseSharePoint [email protected] www.aymanelhattab.com

Page 2: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Session Objectives

Become familiar with the Feature frameworkUnderstand how Solutions workFarm Solutions Vs. Sandboxed Solutions

Page 3: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Features

Provide the primary deployment unit for SharePointCan deliver functionality for Farms (SPFarm), Web Applications (SPWebApplication), Sites (SPSite) and Webs (SPWeb)Defined using CAMLAllow .NET execution on Installation, Uninstallation, Activation, Deactivation and Upgrade.

Page 4: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Capabilities of FeaturesInstall filesModify user interface elementsDefine data structure and storage elements

ColumnsContent TypesLists and Libraries

Create Site DefinitionsDefine WorkflowsApply propertiesAlmost everything you see and you don’t see in SharePoint

Page 5: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Features in the SharePoint Root

14\Template\FeaturesSubdirectory for each feature (14\Template\Features\[Feature Name])Feature.xml (Manifest, Scope,…)0 or more Elements (Fields, Content Types, etc…)0 or more feature resources or element files (Master Page, Web Part,…)

Page 6: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Feature and Solution Framework in SP2010

Exploring OOB Features in SharePoint Root (14 hive)

Demo

Page 7: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Installation and Activation

It’s not enough to just put some XML files on the disk to make use of the featureInstall

WSP (Best Practice).STSADM or PowerShell

Activate FeatureSite AdministrationSTSADM or PowerShell

Page 8: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Feature and Solution Framework in SP2010

Manually Create, Install and Activate a Module Feature

Demo

Page 9: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Demo Recap

We manually created a feature with a module element.A module element can be used to deploy any files ( Master Pages, CSS Files, Images,…)We manually installed the feature using stsadm command line utility.We manually activated the Web-scoped feature from Site settings page.

Page 10: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Other feature elementsSite ColumnsContent Types (Reusable collection of site columns)List DefinitionsList InstancesContent Type BindingWeb PartsSite TemplatesWorkflow / Workflow AssociationEvent Handlers (Triggers)Others

Page 11: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Defining Data Structures

Field element defines a Site ColumnsContentType element defines a Site Content TypeListInstance defines an instance of a list definitionContentTypeBinding element binds a content type to a list

Page 12: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Defining Data Structures (The easy way!)

Prototype and extract CAML definitions using SharePoint Manager 2010Create a site collection for prototyping and another one for developmenthttp://spm.codeplex.com

Page 13: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Feature and Solution Framework in SP2010

Defining Data Structures Using Features

Demo

Page 14: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Solutions

Package features and other resources into one package for deployment (cabinet file)Can contain assemblies (Receivers, Code Behind for pages or user controls, Web Part code,…)WSPBuilder for SharePoint 2007 (http://wspbuilder.codeplex.com )Easily created with Visual Studio 2010.

Page 15: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Farm SolutionsHow does it work in detail

MySolution.wsp(WSS Solution Cab)

Feature Manifests Config DB

UI, CommandLine, OM“deploy”command

adddelete

Deploy/Upgraderetract

Site definitions

Assemblies

Farm Servers

Pages

Page 16: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Sandboxed SolutionsSolution catalog

Great choice for hosted scenarios.Uploaded to the Solution gallery available at the site collection level and can be monitored and tracked by admins (No more infinite loops).

Page 17: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP

Feature and Solution Framework in SP2010

Creating solutions by saving a site as a template!

Demo

Page 18: Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP