mick badran breeze training consulting trainer and sharepoint specialist

28

Upload: nizana

Post on 22-Feb-2016

45 views

Category:

Documents


0 download

DESCRIPTION

NET Development on Microsoft SharePoint Technology Part 4: Templates, Features, and Solution Deployment. Mick Badran Breeze Training Consulting Trainer and Sharepoint Specialist [email protected]. User Interface Entry Points. SPUser.About. Mick Badran - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist
Page 2: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

NET Development on Microsoft SharePoint Technology

Part 4: Templates, Features, and Solution Deployment

Mick BadranBreeze TrainingConsulting Trainer and Sharepoint Specialist

[email protected]

Page 3: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

User Interface Entry Points

Page 4: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

SPUser.About• Mick Badran

– Director Breeze Training (www.breezetraining.com.au)• SharePoint 2001/2003 Experience

– Lots of training/mentoring and consulting on small, medium and large scale projects.

– Involved in TAP programs, Microsoft Ascend training, development of SPS Training material.

• SharePoint 2007 Experience– Early start in June 2005 with TAP workshops– Creation and delivery of Ascend training Australia wide.– Sharepoint migrations and implementations.– Creator of successful Australia wide MOSS bootcamps for Partners.

• Contact Details– Email: [email protected]– IM: [email protected]– Blog: http://blogs.breezetraining.com.au/mickb

Page 5: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Agenda

• Site Provisioning Flow in WSS and MOSS• A Closer Look at Site Definitions• Steps for Creating Custom Site Definitions• The Features feature in WSS 3.0• Exploring and Creating Features• Activation Dependencies and Feature Event Receivers• Packaging, Deploying, Upgrading, Retracting and

Removing SharePoint Solutions

Page 6: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Site Provisioning• Two-step process

1. Creation of a site at a specific URL

2. Populating the site based on a site template

• Designed to be a platform that can support different types of sites

- the template architecture can be extended• Site templates

– Use browser to save an existing site as a template• Stored in the database• Can be extracted as STP file

– Create site definition• Collection of files making up the template• Stored on the front-end Web server as a

physical folder

Page 7: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

The Provisioning Flow

Selection of a site template

Webtemp.xml Webtempsps.xmlWebtemp*.xml

RetrieveSite Definition in \12\Templates\SiteTemplates

Call to Microsoft.SharePoint.Publishing.PortalProvisioningProvider

InternetBlank.xml

PortalWebmanifest.xml

1 Site Portal = # Sites

Page 8: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Internet Starter Kit

Page 9: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Improvements to v3 Site Definitions

Common SharePoint-

specific definitions are

out!

Hard-coded strings are

out!

Definitions of fields, lists and

document libraries are out!

GLOBAL Template

Resources

Features

Page 10: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Closer Look at ONET.XML

• ONET.XML stores the core definition • Global Template stores common definitions

navigation barslist templatesdocument templatesconfigurations

featuresmodulesON

ET.X

ML

Page 11: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Dissecting the Team Site Definition

Page 12: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Creating Custom Site Definitions with VS.NET Extensions for WSS 3.0• Visual Studio Tools for Sharepoint• Visual Studio 2005 Project Templates

– Web Part – Team Site Definition – Blank Site Definition – List Definition

• Visual Studio 2005 Item Templates – Web Part – Custom Field – List Definition (with optional Event Receiver) – Content Type (with optional Event Receiver) – Module

• SharePoint Solution Generator – Generates a Site Definition project from an existing SharePoint site.

Page 13: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Reverse Engineering a Site with the SharePoint Solution Generator

Page 14: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Modular Provisioning: Features!

• Reusable pieces of customization• Extend existing sites• Easily installed/activated

Feature NameIDDescriptionScopeReceiver assemblyActivation DependenciesElement Manifests

Feature.xmlCustom ActionsCustom ViewsContent Type DefinitionsLayouts PagesModules (files)List InstancesList TemplatesEvent ReceiversDelegate ControlsWorkflow Bindings

Elements.xml

Page 15: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Feature - Scopes

Page 16: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

SiteCollectionFeatures

FarmFeatures

WebFeatures

Team Collaboration

Contacts

Hidden FeaturesVisible Features

DocumentLibraries

PictureLibraries

Events

Basic List Links

Announce-ments Tasks

Survey DiscussionBoard

WSSCore Links

CoreContent Types

ContentLight Up

Core ColumnTemplates

WSS Out-Of-The-Box Features

BasicWeb Parts

Page 17: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Exploring some of the OOTB Features

Page 18: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Making Features Available

• Features must be copied to \12\Template\Features folder of every Front-end Web Server

• Features must be installed

• Administrators can activate or deactivate features using• The browser• Using STSADM

• Event handlers can be hooked-up with the activate and deactivate events

Stsadm.exe –o installfeature –filename myfeature\feature.xml

Stsadm.exe –o activatefeature –filename myfeature\feature.xml –url url

Page 19: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Create! Install! Activate! And Ready To Use!

Page 20: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Activation Dependencies• Features can be designed with dependencies

– Allows one feature to assume another feature is present

• Example: Feature B might depend on Feature A– B should be written with activation dependency on A– Activating B forces A to be activated as well– Deactivating B results in deactivation of A

• Features can be defined as hidden– Hides the feature from users in administration activation

pages– Hidden features still activated by others with

dependencies

Page 21: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Feature Provisioning Events

<Feature Id="9D2F3359-7664-430b-9391-143A7CCD2942" ReceiverAssembly="LitwareAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xyz" ReceiverClass="Litware.LitwareFeatureReceiver" xmlns="http://schemas.microsoft.com/sharepoint/"></Feature>

namespace Litware { public class MyFeatureReceiver : Microsoft.SharePoint.SPFeatureReceiver { public override void FeatureInstalled(SPFeatureReceiverProperties properties) { // event hander run after feature is installed } public override void FeatureActivated(SPFeatureReceiverProperties properties) { // event hander run after feature is activated SPWeb web = (SPWeb)properties.Feature.Parent; web.Title = "Hello World"; web.Update(); } public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { // event hander run before feature is deactivated } public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { // event hander run before feature is uninstalled } }}

Define the receiver class by inheriting from SPFeatureReceiver

Point to receiver class in Feature.xml (assembly must be in GAC)

Page 22: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Feature Event Receivers

Page 23: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

SharePoint Solutions

• SharePoint Solution Packages allow you to physically distribute your solutions

– Web Parts– Site Definitions– Features– Custom Workflows– Application and Site Pages– …

ComponentComponentComponentComponent

Manifest DDF MakeCab WSP

Page 24: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

ExamplePackaging a Site Definition

ProvisionCode

DDF

MySite.WSP

ProvisionFeature

MySite.dll

feature.xml provisioner.xml

Site DefinitionFeature

feature.xml

elementManifest.xml

Site DefinitionSchemas

ONET.XML WebtempMySite.xml

# Features(lists/libraries)

feature.xml

elementManifest.xml

InstallationScript Manifest.xml

Page 25: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Packaging SharePoint Solutions

Page 26: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

A Complete SharePoint Solution Story• Solutions can be added to the Solution Store of the

server farm• Solutions can be deployed to site collections• Solutions can be upgraded with new versions• Solutions can be retracted from site collections• Solutions can be removed from the Solution Store

Page 27: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Deploying and Upgrading SharePoint Solutions

Page 28: Mick  Badran Breeze Training Consulting Trainer and  Sharepoint  Specialist

Review

• Better story for creating custom site definitions• Modular approach with Features• Better story for packaging, deploying and maintaining

solutions

• Thank you linesman…..thank you ball boys……