280 likes | 426 Views
Kfir Sasson. Understanding Features & Solutions In MOSS 2007. Agenda. Why Features?. Features Implementation. Sharepoint Solutions. Features - Intro. Do you really have only 1 environment? What is the wrong way?? Backup <-> Restore
E N D
Kfir Sasson Understanding Features & Solutions In MOSS 2007
Agenda Why Features? Features Implementation Sharepoint Solutions
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
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
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
Features - Scope Farm Elements Item Custom ActionsSite Settings LinksAdmin Custom Actions Web Application Elements Item Custom ActionsSite Settings LinksAdmin Custom Actions Site Settings LinksSite Web Part DefinitionsWorkflow DefinitionsSite Content TypesLayout FilesList Instances Site Collection Elements List Definition + Forms + ViewsList InstancesList Item EventsItem Custom ActionsWeb Admin Custom ActionsLayout Files Web Elements
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
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
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.
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
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
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
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/
Solutions - Intro • Now that we have features what is the best • way to deploy • Batch file • Develop an installer • Sharepoint Solutions
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
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
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
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%”
Solutions – Deploy • Deploy and retract in the admin site
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/
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/sharepointinstaller
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
Thank You!Kfir SassonKfir.Sasson@Ness.ComNess Technologies 42