Codebanking.com Bank your code here...
HOME REGISTER TECHNICAL Q&A GENERAL Q&A SUBMIT CODE SNIPPET LOGIN
 
 Topics
 Tech Feeds
 Tech Fun

What is sharepoint feature? how it is created? how it is deployed?

When developing custom business solutions for WSS and MOSS, the first thing you need to do is gain a firm understanding of features (and I’m not referring to the general feature set). Features are a new developer-focused innovation that has been added to WSS 3.0. Basically, this provides a mechanism for defining site elements, which can be automatically activated within the context of a target site or a target site collection. The element types that can be defined by a feature include list instances, list types, menu commands, page templates, page instances, event handlers, and workflows. The example I discuss in this column involves a feature, named OfficeSpaceFeature, that creates a list and a document library and adds a custom menu item to the standard WSS Site Actions menu, allowing the user to navigate to a custom application page.

 The Feature framework has been extended to allow developers to create custom Features. Features can be deployed by using SharePoint Portal Server 2007 new form of deployment, namely Solution Deployment. Solutions are custom packages (e.g. .WSP file) or redistributable CAB files, created by developers and deployed by SharePoint Administrators. Administrator can deploy Features to individual site or to all Web front End Servers.
In this article, I will walk-through Creating and deploying an Event Handler Feature, which can be activated on Web or Site, Site Collection, Web Application or Farm Level.
Components of Feature
A Feature can include any number of files, but it must include a Feature.xml file. The Feature.xml file, or Feature manifest, is the driver of the Feature, and this is the first file SharePoint looks at when invoking a Feature.
Features are organized in folders under the Features directory located under 12 hives; Where SharePoint Server 2007 puts all of its system files, at the following path:
%SystemDrive%\Program Files\Common Files\Microsoft Shared\web server extensions\12
In addition to the Feature.xml file, Features can include sub-folders and supporting files, such as element files that include. For example, event handler references, ASPX pages deployed as part of the Feature, ASCX files, and DLL and RESX files.How to add new menu item under “Site Settings” menu in wss 3.0?

Create a new folder, called “MyListUserFeature”, in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES



2.       Create an Xml file, called “feature.xml” in the “MyListUserFeature” folder
3.       Edit the feature.xml file and add the following content
xmlversion="1.0"encoding="utf-8"?>
<FeatureId="A9CEB138-B991-4013-A1F9-26C6BB646021"
    Title="Feature My List User Feature"
    Description="Custom action on Site Actions"
    Version="1.0.0.0"
    Scope="Site"
    xmlns="http://schemas.micræsoft.com/sharepoint/">
          <ElementManifests>
                   <ElementManifestLocation="ListUsers.xml"/>
          ElementManifests>
Feature>
4.       Create an Xml file, called “ListUsers.xml” in the “MyListUserFeature” folder
5.       Edit the file and add the following content
xmlversion="1.0"encoding="utf-8"?>
<Elementsxmlns="http://schemas.micræsoft.com/sharepoint/">
 <CustomAction
    GroupId="SiteActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="1000"
    Title="List Users">
    <UrlActionUrl="/_layouts/Users.aspx"/>
 CustomAction>
Elements>
6.       Install the new feature by running the following command
Stsadm –o installfeature –filename MyListUserFeature\feature.xml
7.       Activate the new feature by running the following command
Stsadm –o activatefeature -filename MyListUserFeature \feature.xml -url http://siteurl

Now you will see the new menu item in the "Site Settings" of the site that you installed the feature.


Comments Posted:
No Comments Posted
Please login for leave your comments
 
 2010 codebanking.com      contactus@codebanking.com