Fire my passion

Anything with my most passion……
了解一下WSS中的Feature

今天有了一点点收获,就是自定义WSS网站操作按钮。

方法很简单,大概就是在WSS中增加一个Feature。大概步骤是:

  1. 在SharePoint的Feature文件夹下建立一个子文件夹
  2. 在该文件夹中建立两个xml文件:Feature.xml , Elements.xml
  3. Feature.xml文件中的内容是:

    <Feature Title="New Simple Form Toolbar Button"

    Scope="Web"

    Id="{5B7C862A-BF4A-4ff1-AE9B-036452035307}"

    xmlns="http://schemas.microsoft.com/sharepoint/">

    <ElementManifests>

    <ElementManifest Location="Elements.xml" />

    </ElementManifests>

    </Feature>

     

    Title:用于描述这个Feature的文字

    Scope:定义在网站范围,结果菜单仅会出现在特定的已经激活该功能的网站中。如果定义在网站集范围(Scope="Site"),则网站集中每个网站都会应用此Feature

    Id : Feature的ID

    ElementManifest的Location:定义elements.xml的名称和路径

     

  4. Elements.xml文件的内容是:

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">

    <CustomAction

    Id="viewall"

    GroupId="SiteActions"

    Location="Microsoft.SharePoint.StandardMenu"

    Sequence="2000"

    Title="查看所有网站内容"

    Description="查看所有网站内容"

    RequireSiteAdministrator="True" >

    <UrlAction Url="~site/_layouts/viewlsts.aspx"/>

    </CustomAction>

    </Elements>

    ID:记录 Element的ID

    GroupId:有待研究(需要研究的东西还很多阿)

    Location:这个很重要,大概是定义你的这个元素的位置,比如"网站操作"按钮下,还是其他位置

    Sequence:指定这个元素的先后位置,2000表示位置在第2000个

    Title:指定元素的标题

    Description:元素的描述

    RequireSiteAdministrator:只有管理员权限的用户可见

     

  5. 执行命令行安装、激活Feature
    1. stsadm –o installfeature
    2. stsadm –o activatefeature

ok!到此就完成了,很简单吧,虽然有很多不太清楚的地方,不过研究一下会越来越明白的~

 

加油了 呵呵

posted on 2007-10-12 14:39  everx  阅读(248)  评论(0编辑  收藏  举报