jjccx

jjccx's blog
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

在文档库加一个Feature,应用于文件而不应用于文件夹

Posted on 2008-03-28 17:08  jjccx  阅读(186)  评论(0)    收藏  举报
在文档库加一个Feature,应用于文件而不应用于文件夹

Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="7702C5CC-434F-4bd2-9D7C-F3F09106210B"
    Title="Document center menus"
    Description="This create menus for Send to History doc and Batch check in."
    Version="1.0.0.0"
    Scope="Site"
    xmlns="http://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="DocMenus.xml" />
  </ElementManifests>
</Feature>
DocMenus.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="ECBItemSendToHistory"
    RegistrationType="ContentType"
    RegistrationId="0x0101"
    GroupId="ECBItem"
    Location="EditControlBlock"
    Sequence="106"
    Title="Send To History"
    Rights="ManageLists">
    <UrlAction Url="/"/>
  </CustomAction>
</Elements>

关键的地方在于RegistrationType是ContentType, 而RegistrationId是0x0101,这个ID表示文档库里文件的内容类型
其它的,如文件夹的内容类型是0x0120