Thursday, July 30, 2009

Custom Feature in MOSS and its uses

What and Why Custom Features

  • Features in Microsoft Office SharePoint Server 2007 allow you to easily package up functionality that can be deployed and installed across the server farm. This article walks you through the steps of creating and installing a custom Feature.

  • Features are a major enhancement to the template framework of Microsoft Office SharePoint Server 2007 (MOSS). Features allow you to test, deploy, and activate custom functionality inside Office SharePoint Server 2007 and provide a way to make functionality available across your server farm. This functionality can be custom workflows, content types, modifications to the user interface, or new templates for lists and document libraries. For example, you can roll out the definition of a custom document library to any number of team sites by packaging it up as a Feature, complete with metadata expressed in the Collaborative Markup Language (CAML) in the schema. You can package the Feature up as a SharePoint solution and provide it to an administrator, where it can be installed and deployed as a unit.

  • Another benefit of using Features is in the use of site definition (ONET.xml) files. ONET.xml files provide Windows SharePoint Services with information about the navigation, lists, and document libraries that users can create. In the previous version of SharePoint, ONET.xml files have a tendency to get very large. With the advent of Features, the ONET.xml file shrinks because Features can now contain the information that was previously defined in the ONET.xml file.
  • Features provide a level of reusability by providing you with a means to package and deploy functionality as a unit. You can install the Feature at the level of a server farm and then active it only when needed. This has the additional benefits of allowing you to deploy updates to all Web front-end machines in one operation, more easily applying source-control to site resources, and allowing less-technical people to roll-out or roll-back changes, if required.

Exploring the Components of a Feature

Features are typically stored on the SharePoint server at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES. Each Feature has its own sub-directory that resides in this directory. Inside each Feature's sub-directory, you will find, as a minimum, a header file named feature.xml. The feature.xml file points to a manifest file that tells SharePoint where to find the code and XML that defines the Feature. The feature.xml file contains the Feature element that specifies the location of assemblies, files, dependencies, or properties that support the Feature. Optionally, the Feature element may point to an XML file that contains an Element element which defines the components and types that make up the Feature.

No comments: