Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "© 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007."— Presentation transcript:

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

2 www.ness.com 2 Agenda Features Implementation Sharepoint Solutions Why Features?

3 www.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

4 www.ness.com Features Reduce Complexity No need to copy code Reduce 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

5 www.ness.com Features - Capabilities Scoping Installing or uninstalling Features within a deployment Activating or deactivating Features at a given scope Property bag for storing data required by a Feature

6 www.ness.com Features - Scope Site Settings Links Site Web Part Definitions Workflow Definitions Site Content Types Layout Files List Instances List Definition + Forms + Views List Instances List Item Events Item Custom Actions Web Admin Custom Actions Layout Files Farm Elements Web Application Elements Site Collection Elements Web Elements Item Custom Actions Site Settings Links Admin Custom Actions

7 www.ness.com Features - Implementation The Feature subfolder includes a Feature.xml file Install and activate the feature using command line or API A Feature can be hidden Features can have dependencies Use EventReceiver (SPFeatureReceiver) to trap feature events Validate against wss.xsd schema

8 www.ness.com Features – Feature.xml file xml with a defined schema Contains Elements ► used to define a Feature ► Used to specify the location of assemblies, files, dependencies, or properties that support the Feature for example, a "My Favorite Items" ► A custom list that stores, per user, a list of favorite items, which is created as a single hidden list per workspace when the Feature is enabled. ► A custom menu item that is attached to all lists, called "Add to Favorites," which adds an item to the Favorites list. ► A Web Part that implements usage and link tracking to display the user's top 10 favorites at the top

9 www.ness.com Features – Feature.xml file

10 www.ness.com Features – Install and activate All features must be copied in to the features folder All features must be installed on the farm A feature has effect on its scope only after activation Use Command line : stsadm.exe ‘ Install the feature stsadm -o installfeature -filename BasicCollectFeedback\feature.xml –force ‘ Activate the feature stsadm -o activatefeature -filename BasicCollectFeedback\feature.xml -url %URL% ‘ Deactivate the feature stsadm -o deactivatefeature -filename BasicCollectFeedback\feature.xml -url %URL% ‘ Uninstall the feature stsadm -o uninstallfeature -filename BasicCollectFeedback\feature.xml

11 www.ness.com Demo 1 – Create and Install a Feature 11

12 www.ness.com Features – Element Types ElementScopeDescription Content TypeSiteschema definition you can apply to multiple list definitions. Content Type Binding Siteenables 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 WebApplicationContains the definition of a document converter.

13 www.ness.com Features – Element Types ElementScopeDescription 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. FieldSiteContains 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. ReceiverWebContains an item event receiver registration. WorkflowSiteContains the definition for a workflow in a list.

14 www.ness.com Features – Field Element <Field ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}" Name="Created" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Created" Group="_Hidden" ReadOnly="TRUE" Type="DateTime" DisplayName="Created“>

15 www.ness.com Features – List Instance Element Action Description Title True High Up

16 www.ness.com Features – List Template Element

17 www.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 type Custom Forms add\update\display item.

18 www.ness.com Features – Content type Element DocumentLibraryForm

19 www.ness.com Features – Content Type Binding Element <ContentTypeBinding ContentTypeId="0x010100C5A8DB52D9D0A14D9B2FDCC96666E9F2" ListUrl="_catalogs/masterpage" />

20 www.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

21 www.ness.com Features – Module Element <![CDATA[ EditorPayments ]]>

22 www.ness.com Features – Event Regitration SimpleEvent 2 10000 SimpleEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=10b23036c9b36d6d MS.Samples.SimpleEventHandler

23 www.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:DelegateControl Union 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

24 www.ness.com Features – Delegate control Delegate declaration: Override using feature:

25 www.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

26 www.ness.com Features – Custom Action <CustomAction Id="Test1bbb" Location="EditControlBlock" Title="Test2" RegistrationType="ContentType" RegistrationId = "0x01" > Adds menu item to all the items in all the lists that use the Item content type Override using feature:

27 www.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.aspxhttp://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/http://pubsitefeature.codeplex.com/

28 www.ness.com Demo 2 – Develop Features 28

29 www.ness.com Solutions - Intro Now that we have features what is the best way to deploy Batch file Develop an installer Sharepoint Solutions

30 www.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

31 www.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

32 www.ness.com Solutions - Creating Solution files have a hierarchical structure ► a manifest file is at the root ► All the content located in subdirectories Define the files you wish to deploy in solution Manifest.xml file Defines the list of features, site definitions, resource files, web part files and assemblies to process

33 www.ness.com Solutions - Creating Manifest.xml

34 www.ness.com Solutions - Creating DDF File Declaration 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

35 www.ness.com Solutions - Creating ;*** MakeCAB Directive file ;.OPTION EXPLICIT ; Generate errors.Set CabinetNameTemplate=ShokenEncyclopedia.wsp.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory.Set CompressionType=MSZIP ;** All files are compressed in cabinet files.Set UniqueFiles="OFF".Set Cabinet=on.Set DiskDirectory1=SHOKEN ; ; ** CAB Root manifest.xml ; ; ** ShokenMainEncyclopediaPortal Feature.Set DestinationDir=ShokenMainEncyclopediaPortal..\ShokenFeatures\ShokenMainEncyclopediaPortal\Feature.xml.Set DestinationDir=ShokenMainEncyclopediaPortal\Lists ; ; ** WEB CONFIG.Set DestinationDir=CONFIG webconfig.shoken.xml ; ; ** Resources.Set DestinationDir=Resources..\Resources\shokencore.resx ;*** End

36 www.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%”

37 www.ness.com Solutions – Deploy Deploy and retract in the admin site

38 www.ness.com Solutions – Useful Utilities WSPBuider Automatically Creates the manifest file Creating the wsp file for deployment Very easy to use Download from http://wspbuilder.codeplex.com/http://wspbuilder.codeplex.com/

39 www.ness.com Solutions – Useful Utilities Solution Installer Add 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/sharepointinstallerhttp://www.codeplex.com/sharepointinstaller

40 www.ness.com Demo 3 – Creating and Deploying Solutions 40

41 www.ness.com Summary Features are the proper way to add functionality to Sharepoint Site admins can control the functionally of the site Deployment becomes an easy job Useful tools make the develop much simpler

42 www.ness.com Thank You! Kfir Sasson Kfir.Sasson@Ness.Com Ness Technologies Kfir.Sasson@Ness.Com 42


Download ppt "© 2009 Ness Technologies – Proprietary and Confidential Kfir Sasson Understanding Features & Solutions In MOSS 2007."

Similar presentations


Ads by Google