Moss drip (1): How to develop and deploy feature

Source: Internet
Author: User

Features is a new, out-of-the-box feature of MOSS 2007, Features stored on a SharePoint server under the following path: C:\Program files\common files\microsoft Shared\Web Server Extensions\12\template\features. Each featrue has its own subdirectory under this path, and a file named Feature.xml is found in each feature subdirectory, which stores some metadata information about featrue.

Below I use feature to implement a small function, add a custom menu in "website action", first use VS2005 to build a HelloWorld class library project, then add Folder HelloWorld, Add the Feature.xml file code to the folder as follows:

<Feature Id="B2CB42E2-4F0A-4380-AABA-1EF9CD526F20" Title="Hello World Feature" Description="这是我的第一个Feature" Scope="Web" Hidden="FALSE" ImageUrl="TPG\canteen.gif" ReceiverAssembly="HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b38a04419cc857d9" ReceiverClass="HelloWorld.FeatureReceiver" xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml" />
</ElementManifests>
</Feature>

Here's a description of the metadata information contained in the Featrue element.

ID: A GUID that uniquely identifies the feature, which can be obtained using the GUID's build tool;

Scope: The value can be either Web or site, which indicates whether the feature is applied to the entire site collection or only to a single subweb. If you scope= web, activate under [Site Actions-Site Settings-Site Administration-site features], if scope= "site" to activate under [Website actions-Site Settings-Site Administration-site collection features].

Hidden: Value can be true or false. This setting specifies whether this feature is displayed on the Site feature page.

Defaultresourcefile: The name of the resource file, feature relies on it to provide additional configuration information.

<ElementManifests> element: This element contains the location of another XML file, and the content of the <Elemnets> contained in this file is feature to implement.

Then we add the Elements.xml file with the following code:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="SiteActionsToolbar" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="100" Title="Hello World" Description="使用feature方式自定义菜单" ImageUrl="_layouts/images/crtsite.gif">
<UrlAction Url="http://msdn.microsoft.com" />
</CustomAction>
</Elements>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.