学习自定义moss菜单

最近觉得可以自定义moss菜单很有意思,上网一看,相关文档还真是不少。有谈论“网站操作”部分添加的,有“文档库”操作下面添加的,还有对于相关文档的。我呢,在这里引用一下前辈们的成果,也做了一下自定义moss菜单的展示。(我这里主要是介绍对于文档库和列表库的,

参考源文档 <http://hgm654.blog.51cto.com/368545/73600> )

测试效果如下图:

image

image

首先定义一个feature.xml,如下:

<?xml version="1.0" encoding="utf-8" ?>

<Feature Id="CFEC088A-A7C9-4de6-961B-964B2AAFBBB4" Title="myaction" Description="my custom action"

               Scope="Web" Hidden="False" ImageUrl="menuprofile.gif" DefaultResourceFile="customDocumentLibrary"

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

      <ElementManifests>

              <ElementManifest Location="elements.xml"></ElementManifest>

     </ElementManifests>

</Feature>

然后定义一个elements.xml,如下:

 

<?xml version="1.0" encoding="utf-8" ?>

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

     <!--文档库新建菜单下-->

      <CustomAction Id="NewActionDocLib" GroupId="NewMenu" RegistrationType="List" RegistrationId="101" Rights="ManagePermissions"

                               Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="我的新建文档"

                              Description="my Newactions" ImageUrl="/_layouts/images/ACL16.GIF">

            <UrlAction Url="/_layouts/litwarefeaturelab.aspx?command=NewDocCommand"></UrlAction>

    </CustomAction>

    <!--列表库的新建菜单下-->

   <CustomAction Id="NewActionList" GroupId="NewMenu" RegistrationType="List" RegistrationId="100" Rights="ManagePermissions"

                              Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="我的新建列表"

                              Description="myNewactions"  ImageUrl="/_layouts/images/ACL16.GIF">

          <UrlAction Url="/_layouts/litwarefeaturelab.aspx?command=DocLibCommand"></UrlAction>

</CustomAction>

</Elements>

其实上面对于文档库和列表库的操作唯一的不同点就是RegistrationId,对于文档库是101,列表库是100,学习中,正好碰到一个老外总结的这个部分,和大家分享一下(http://datacogs.com/datablogs/archive/2008/03/26/913.aspx)

InvalidType = -1

GenericList = 100

DocumentLibrary = 101

Survey = 102

Links = 103

Announcements = 104

Contacts = 105

Events = 106

Tasks = 107

DiscussionBoard = 108

PictureLibrary = 109

DataSources = 110

WebTemplateCatalog = 111

UserInformation = 112

WebPartCatalog = 113

ListTemplateCatalog = 114

XMLForm = 115

MasterPageCatalog = 116

NoCodeWorkflows = 117

WorkflowProcess = 118

WebPageLibrary = 119

CustomGrid = 120

DataConnectionLibrary = 130

WorkflowHistory = 140

GanttTasks = 150

Meetings = 200

Agenda = 201

MeetingUser = 202

Decision = 204

MeetingObjective = 207

TextBox = 210

ThingsToBring = 211

HomePageLibrary = 212

Posts = 301

Comments = 302

Categories = 303

Pages = 850 (thanks to Anders Jacobsen for this one)

IssueTracking = 1100

AdminTasks = 1200

posted @ 2008-06-19 17:41  范文轩  阅读(700)  评论(0编辑  收藏  举报