© 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features &...

28
© 2009 Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Understanding Features & Solutions In MOSS 2007 Solutions In MOSS 2007

Transcript of © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features &...

Page 1: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

©2009 Ness Technologies – Proprietary and Confidential

Kfir Sasson

Understanding Features & Solutions Understanding Features & Solutions In MOSS 2007In MOSS 2007

Page 2: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com 2

AgendaAgenda

Features Implementation

Sharepoint Solutions

Why Features?

Page 3: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features - Intro

Do you really have only 1 environment?What is the wrong way??

Backup <-> Restore

Maybe Making the necessary Customization on every environment?

Copy recourses & assemblies manually or by a script

Reusability of developed component – hard work for the site designers

Page 4: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features

Reduce Complexity No need to copy codeReduce versioning and inconsistency issues Easier to activate or deactivate functionality in deployment Control site behavior by toggling a Feature on or off in the UI

Page 5: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features - Capabilities

ScopingInstalling or uninstalling Features within a deploymentActivating or deactivating Features at a given scopeProperty bag for storing data required by a Feature

Page 6: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features - Scope

Site Settings LinksSite Web Part DefinitionsWorkflow DefinitionsSite Content TypesLayout FilesList Instances

List Definition + Forms + ViewsList InstancesList Item EventsItem Custom ActionsWeb Admin Custom ActionsLayout Files

Farm ElementsFarm Elements

Web Application Web Application ElementsElements

Site Collection Site Collection ElementsElements

Web ElementsWeb Elements

Item Custom ActionsSite Settings LinksAdmin Custom Actions

Item Custom ActionsSite Settings LinksAdmin Custom Actions

Page 7: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features - Implementation

The Feature subfolder includes a Feature.xml file Install and activate the feature using command line or APIA Feature can be hiddenFeatures can have dependenciesUse EventReceiver (SPFeatureReceiver) to trap feature eventsValidate against wss.xsd schema

Page 8: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Install and activate

All features must be copied in to the features folderAll features must be installed on the farmA feature has effect on its scope only after activationUse Command line : stsadm.exe‘ Install the feature

stsadm -o installfeature -filename BasicCollectFeedback\feature.xml –force‘ Activate the featurestsadm -o activatefeature -filename BasicCollectFeedback\feature.xml -url %URL%

‘ Deactivate the featurestsadm -o deactivatefeature -filename BasicCollectFeedback\feature.xml -url %URL%‘ Uninstall the featurestsadm -o uninstallfeature -filename BasicCollectFeedback\feature.xml

Page 9: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Demo 1 – Create and Install a Feature

11

Page 10: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Element Types

Element Scope Description

Content TypeSite schema definition you can apply to multiple list definitions.

Content Type Binding

Site enables the user to provision a content type on a list.

ControlAllA delegate control contains a registration for a well-known control installed on a Web page.

Custom ActionAll• Content type links for the content type settings page

• Drop-down menu actions for the drop-down menu that appears for an item

• Form toolbar buttons for New, Edit, or Display form toolbars.

• Site Settings link for the Site Settings page.

Custom Action Group

AllDefines a group of custom actions.

Document Converter

WebApplication Contains the definition of a document converter.

Page 11: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Element Types

Element Scope Description

Feature/Site Template Association

Farm, WebApplication, Site

Binds a feature to a site definition or template so that created sites are provisioned with the feature.

FieldSite Contains a field definition that can be reused among multiple lists.

Hide Custom Action

AllHides a custom action that has been added through another custom action.

List InstanceSite, WebProvisions a SharePoint site with a specific list of data.

List TemplateSite, WebContains a list definition or template, which defines a list that can be provisioned in a SharePoint site.

ModuleSite, WebContains a set of files with which to provision sites.

ReceiverWeb Contains an item event receiver registration.

WorkflowSite Contains the definition for a workflow in a list.

Page 12: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Content Type Element

Defines a content type that will be available on the site Control inheritance using the content type ID

► Parent content type ID + two hexadecimal values ► Parent content type ID + "00" + hexadecimal GUID

Connect existing fields to the content typeCustom Forms add\update\display item.

Page 13: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Module Element

specify files with which to provision SharePoint sites. Important attributes:

► Name► List – list type number► Url – the url of the list

File Element► URL – the name of the file► Path – the path to the file

AllUsersWebPart – define webparts in a page

Page 14: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Delegate Control

Declare candidate controls for a particular functionality Provides a mechanism for choosing a single functionality provider Can replace the content of any Sharepoint:DelegateControlUnion between server farm, Web application, site collection, and Web site levels The control that has the lowest sequence number is added to the control tree by means of the DelegateControl

Page 15: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Custom Action

A custom action represent► A link► Toolbar button► Menu item► any control that can be added to a toolbar or menu that a user sees

Add a control to toolbars

Page 16: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Features – Useful Utilities

MOSS Feature Generator► Create site columns, list templates, content types features► Drag & Drop► Features created in a few minutes ► Download from http://www.sharepointblogs.com/alfred/default.aspx

MOSS Publishing Feature Generator► Creates Module features with selected layouts and master pages► Very easy to use ► Download from http://pubsitefeature.codeplex.com/

Page 17: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Demo 2 – Develop Features

28

Page 18: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions - Intro

Now that we have features what is the best way to deploy

• Batch file

• Develop an installer

• Sharepoint Solutions

Page 19: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions

Bundle all of the components for extending WSS A solution file is a CAB-based format with a .wsp extension A unified infrastructure for deploying solutions Integrated deployment

► Easily install files on the front-end Web servers in a server farm

Solution framework allows you to do the following► Deploy new solutions and upgrade existing solutions across the farm ► Synchronize a front-end Web server so that its state is consistent with

The state of other servers in the farm

Page 20: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions - Creating

Contains the following components ► Site definitions► Feature definitions and their element definitions and files► Web Part files (*.webpart, *.dwp)► Template files and root files, which can include the following:

► _layouts files► Resources (*.resx)► Resource files (for example, *.doc or *.xls)

► Assemblies, which can include the following:► Safe control entries► Resources

Page 21: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions - Creating

DDF FileDeclaration file for the cab creator utility

Use the makecab.exe utility

The format of a .ddf file is basically in the same style as the .inf file

declare a standard header and then enumerate

All files must be included

MakeCab /F soultion.ddf

Page 22: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions - Deploy

Use command line stsadm

Stsadm –o addsolution –filename “wsp file”

Stsadm –o deploysolution –name %packagename% -local – allowGacDeployment –url %TargetUrl%

Stsadm –o retractsolution –name %packagename% -local –url %TargetUrl%

Stsadm –o deletesolution –filename “%pakagename%”

Page 23: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions – Deploy

Deploy and retract in the admin site

Page 24: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions – Useful Utilities

WSPBuiderAutomatically Creates the manifest file

Creating the wsp file for deployment

Very easy to use

Download from http://wspbuilder.codeplex.com/

Page 25: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Solutions – Useful Utilities

Solution InstallerAdd solution to the SharePoint solution store.

Deploy solution on one or more web applications.

Activate feature on one or more site collections Upgrade solution.

Retract and remove solution.

Download from http://www.codeplex.com/sharepointinstaller

Page 26: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Demo 3 – Creating and Deploying Solutions

40

Page 27: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Summary

Features are the proper way to add functionality to SharepointSite admins can control the functionally of thesite Deployment becomes an easy jobUseful tools make the develop much simpler

Page 28: © 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007.

www.ness.comwww.ness.com

Thank You!

Kfir [email protected] Technologies

42