在Sharepoint Designer中设置CustomAction
2011-10-17 10:14
447 查看
关于在SharepointDesigner中设置CustomAction的备忘,没有啥逻辑性,只是一些知识点。
下面是用SPD的一些限制
SPD中只能针对某List设置Custom Action,无法实现一次性为多个List或某一类List批量设置。
无法在Site Actions, SiteSetting等其他地方设置CustomAction。
无法实现根据当前是否有Items处于选择状态或其他因素启用或禁用CustomAction。
...
虽然有很多缺点,但是不需要编码,还是有很多用武之地的。
可以在以下5个地方添加Custom Action:
1. List Item Menu (LIM)
2. Display Form Ribbon
3. Edit Form Ribbon
4. New Form Ribbon
5. View Ribbon
有以下三种CustomAction:
1. Navigate to Form
2. Initiate Workflow
3. Navigate to URL,可以在里面加入javascript,需要注意的是如果在你输入的URL中如果包含某个Workflow的名字,就会被SPD自动替换成Initiate workflow这种Action,我就遇到过这种情况,被折腾得很惨。
在CustomAction中可以使用一些token,如下表:
You can find further information on using tokens in SharePoint at
http://msdn.microsoft.com/en-us/library/ms458635.aspx
http://msdn.microsoft.com/en-us/library/ff458385.aspx
http://blogs.msdn.com/b/sharepointdev/archive/2010/12/09/tokenization-in-the-sharepoint-2010-server-ribbon.aspx
在Dialog中启动CustomAction
javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/Lists/CustomList/DispForm.aspx?ID={ItemId}", title: "Custom Form"}); return false;
CMDUI.xml,这里面有系统内置的Action的配置,是很好的参考资源
%SystemDrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.xml
http://sitename/_layouts/1033/images/formatmap16x16.png. *32x32.png
Location ID
下表是默认的location,全部的LocationID,请参考:http://msdn.microsoft.com/en-us/library/ee537543.aspx
Rights Mask
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx
sequence number
0 代表在最前,可以在CMDUI.xml中得到内置Action的序列号
-------------------------------------------------------------
其他有用的link:
http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=436
下面是用SPD的一些限制
SPD中只能针对某List设置Custom Action,无法实现一次性为多个List或某一类List批量设置。
无法在Site Actions, SiteSetting等其他地方设置CustomAction。
无法实现根据当前是否有Items处于选择状态或其他因素启用或禁用CustomAction。
...
虽然有很多缺点,但是不需要编码,还是有很多用武之地的。
可以在以下5个地方添加Custom Action:
1. List Item Menu (LIM)
2. Display Form Ribbon
3. Edit Form Ribbon
4. New Form Ribbon
5. View Ribbon
有以下三种CustomAction:
1. Navigate to Form
2. Initiate Workflow
3. Navigate to URL,可以在里面加入javascript,需要注意的是如果在你输入的URL中如果包含某个Workflow的名字,就会被SPD自动替换成Initiate workflow这种Action,我就遇到过这种情况,被折腾得很惨。
在CustomAction中可以使用一些token,如下表:
Token | Description |
---|---|
~site | The current website (relative link) |
~sitecollection | The current site collection (relative link) |
{ItemId} | The (GUID) ID of a list item |
{ItemUrl} | The URL of a list item |
{ListId} | The ID of a list |
{SiteUrl} | The URL of the site (Web) within a site collection |
{Source} | Fully qualified request URL |
{SelectedListId} | The (GUID) ID of the list that is currently selected from a list view |
{SelectedItemId} | The (GUID) ID of the item that is currently selected from the list view |
You can find further information on using tokens in SharePoint at
http://msdn.microsoft.com/en-us/library/ms458635.aspx
http://msdn.microsoft.com/en-us/library/ff458385.aspx
http://blogs.msdn.com/b/sharepointdev/archive/2010/12/09/tokenization-in-the-sharepoint-2010-server-ribbon.aspx
在Dialog中启动CustomAction
javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/Lists/CustomList/DispForm.aspx?ID={ItemId}", title: "Custom Form"}); return false;
CMDUI.xml,这里面有系统内置的Action的配置,是很好的参考资源
%SystemDrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.xml
http://sitename/_layouts/1033/images/formatmap16x16.png. *32x32.png
Location ID
下表是默认的location,全部的LocationID,请参考:http://msdn.microsoft.com/en-us/library/ee537543.aspx
Ribbon Location | List or Library | Ribbon Control and Group ID |
---|---|---|
Display Form | List | Ribbon.ListForm.Display.Manage.Controls._children |
Library | Ribbon.ListForm.Display.Actions.Controls._children | |
Edit Form | List | Ribbon.ListForm.Edit.Actions.Controls._children |
Library | Ribbon.DocLibListForm.Edit.Actions.Controls._children | |
New Form | List | Ribbon.ListForm.Edit.Actions.Controls._children |
Library[*] | Ribbon.DocLibListForm.New.Actions.Controls._children | |
View Form | List | Ribbon.ListItem.Actions.Controls._children |
Library | Ribbon.Documents.Manage.Controls._children | |
Quick Step | List | Ribbon.ListItem.QuickSteps.Controls._children |
Library | Ribbon.Documents.QuickSteps.Controls._children |
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx
sequence number
0 代表在最前,可以在CMDUI.xml中得到内置Action的序列号
-------------------------------------------------------------
其他有用的link:
http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=436
相关文章推荐
- 在Sharepoint Designer中设置CustomAction
- 在SharePoint管理中心管理SharePoint Designer设置
- 在SharePoint管理中心管理SharePoint Designer设置
- SharePoint Designer 2010的新增功能
- [转]如何设置SharePoint BreadCrumb
- SharePoint 2013 开发——SharePoint Designer 2013工作流
- SharePoint Designer 2007 is now FREE !
- SharePoint Designer 2007 IS NOW FREE
- SPS2003配置数据库的设置 - [SharePoint Server]
- sharepoint designer 使用技巧(四)进度条显示
- SharePoint Designer 2010创建BCS比较和通配符筛选器
- Use SharePoint Designer 2010 to implment a fuzzy query for SharePoint 2010 custom list
- 使用InfoPath和SharePoint Designer进行无代码工作流开发
- 通过SharePoint Designer对SharePoint 2010的Master Page进行自定制
- 一步一步SharePoint 2007之九:改变SharePoint Designer的Contributor Mode
- 即将开讲利用Sharepoint+infopath+Sharepoint Designer课程!
- 一步一步SharePoint 2007之十七:解决实现Form认证后无法再用SharePoint Designer编辑网站的问题
- [转][SharePoint Designer-2]DataForm Web Part解析
- SharePoint Designer定制MOSS/WSS表单页面
- 总结:SharePoint Designer 2010 DVWP (1) -- 概述 -- XsltListViewWebPart和DataFormWebPart