SharePoint 创建一个新的Feature

为了部署方便,在project中应建立和wss路径相似的目录结构。建立目录结构TEMPLATE\FEATURES\工程名,这个目录下建立feature.xml和element.xml

<Feature Id=”” Title=”Hello World Feature” Description=”This is my very first custom feature” Scope=”Web” Hidden=”FALSE” ImageUrl=”menuprofile.gif”

ReceiverAssembly=”HelloWorld, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=b59ad8f489c4a334″
ReceiverClass=”HelloWorld.FeatureReciever”

xmlns=”http://schemas.microsoft.com/sharepoint/“>

<ElementManifests>
<ElementManifest Location=”elements.xml” />
</ElementManifests>

</Feature>

Title:active feature时的名字,Description:active feature时的描述,

Scope:feature部署的level,WEB代表部署到每个site,

hidden:若为TRUE,则该feature不能从UI上激活,即不暴漏给用户,只能用命令行或者在其他feature激活时通过代码激活,FALSE即可以让用户来操作。

ReceiverAssembly,ReceiverClass:如果在active feature或deactive feature时添加event,可以使用该属性引用定义该event的类。

程序运行时会在GAC和该网站站点下_app_bin这两个地方查找该程序集。

<ElementManifests>
<ElementManifest Location=”elements.xml” />
</ElementManifests>

这个节点指该feature中真正的内容

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s