SharePoint小技巧记录如下,不断更新中
0 、前一个页面的RUL
ASP.NET Request.Referrer
jsp String request_url=request.getHeader("Referer");
asp Request.ServerVariables("HTTP_REFERER")
1 、WebForm中Group效果的html
2、WebForm中滚动字幕效果的html
html 滚动字幕代码
基本语法:
举例:
文字移动属性的设置:
方向
举例:
循环 :
举例:
速度:
举例:
延时 :
举例:
外观(Layout)设置:
对齐方式(Align)
对齐上沿、中间、下沿。
底色 :
举例:
#=rrggbb 16 进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
面积 :
举例:
啦啦啦,我会移动耶!
啦啦啦,我会移动耶!
空白:(Margins)
举例:
大家好!
2:在DREAMWEAVER这个工具里怎么插入一个打开网叶就自动播放音乐,而且整个过程隐藏的音频播放,如果用 html 代码写怎么写
答:
背景音乐
另及:
ONMOUSEOUT=this.start() :用来设置鼠标移出该区域时继续滚动
ONMOUSEOVER=this.stop(): 用来设置鼠标移入该区域时停止滚动
3、SharePoint中的权限提升有一个小的注意点,
在以前SharePoint 2003 中,impersonate 是一个可以在sps 环境中使用所有功能的至高无上选择,通过impersonate 就可以通过Object Modal 的方式操作SharePoint 的所有功能。但是到了Microsoft Office SharePoint Server 2007 (moss2007 ,SharePoint Portal Server 2003 的后续版本) 这个又出现了新的变化,Impersonate 被丢弃了,而取而代之的是声称跟好的SPSecurity.RunWithElevatedPrivileges() , 它通过传入一个无返回,无输入参数的委托作为参数,对委托的方法以提升权限后的身份去运行,来达到通过Object Modal 方式访问Moss 中所有资源和功能的目的。
在网上有些文章指出SPSecurity.RunWithElevatedPrivileges 这个方法实际上是用了IIS 中应用程序池中的用户去代替当前用户去运行,委托中的代码。这的确如此
但是这个方法并不是一步到位,直接的去使用应用程序池的用户,而是通过了一个所谓的“代理人”去完成这个事。无论在将Moss 的Web 应用程序部署为Windows 集成身份验证还是自定义的Forms 验证,在Moss 的所有列表库或文档库中的权限列表中,都会看到一个人,就是SHAREPOINT\System 这个用户,这个用户也是映射为当前的web 应用的网站集管理员,一般是第一个管理员。
Moss 2007 中,就是通过这个系统默认的管理帐号去模拟IIS 中应用程序池的用户,来达到对当前用户操作提升权限的效果。这就是说,其实在提升权限之后的一切操作都是以这个系统帐户(SHAREPOINT\system) 的身份去执行的,所以可以看到,若通过提升权限后进行的对文档库或列表进行添加、修改,在列表项的作者或修改人都会是系统帐户,而不是当前登录那个人的帐户,除非当前登录的人是网站集的管理员。
因为,SPSecurity.RunWithElevatedPrivileges 是通过模拟一个固定的帐户去进行操作,所以就带来了另一个问题,就是当这“代理人”系统帐户对列表或文档没有权限的时候,就像上图那样,系统帐户对列表的权限是受限访问,SPSecurity.RunWithElevatedPrivileges 就会不起作用,而且在代码的层面上很难发现这个问题。所以在需要通过调用SPSecurity.RunWithElevatedPrivileges来提升权限操作的列表或文档库,都需要确保系统帐户(SHAREPOINT\system)在该列表或文档库中存在,并且这个帐户的权限必须为完全控制。
这样调用提升权限时才会成功。
<Field ID="{7F55A8F0-4555-46BC-B24C-222240B862AF}" Type="RichHTML" Name="NewsBodyField" DisplayName="News Body" StaticName="NewsBodyField" Hidden="False" Required="True" Sealed="False" />
<Field ID="{7F55A8F0-4555-46BC-B24C-222240B862AF}" Type="RichHtmlField" Name="NewsBodyField" DisplayName="News Body" StaticName="NewsBodyField" Hidden="False" Required="True" Sealed="False" />
http://msdn.microsoft.com/en-us/library/ms437580.aspx
4、ItemDeleting中获取SPContext
SPContext.Current在EventHandler中的ItemDeleting,也就是事件发生之前是不能获取的,详细解释如下网页,里面有解决办法,看来对底层的东西很不熟悉啊。
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/ccff5abe-07e7-48d6-bf85-ebb3d6397186/
5、Caml查询的精确匹配时间
caml查询的时候默认是不精确匹配时间的,需要加上一个属性,就是
IncludeTimeValue='true'
使得caml查询变成
<Eq>
<FieldRef Name='_ModerationStatus' />
<Value Type='ModStat'>已批准Value>
Eq>
<Leq>
<FieldRef Name='" + list.Fields["公告发布时间"].InternalName + @"' />
<Value Type='DateTime' IncludeTimeValue='true'>" + DateTime.Now.ToString() + @"ZValue>
Leq>
Where>
6、WebPart中获取当前页面的ListViewWebPart
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using System.Xml;
using System.ComponentModel;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace WebPartDemo5
{
[Guid("6aa788c7-9a39-487c-8e9d-31b17c863968")]
public class WebPartDemo5 : Microsoft.SharePoint.WebPartPages.WebPart
{
private string _strText;
[Personalizable]
[WebBrowsable]
[WebDisplayName("请输入一段文字")]
[WebDescription("Web Part上将会出现这段文字")]
[Category("个性设置")]
public string StrText
{
get
{
return _strText;
}
set
{
_strText = value;
}
}
public WebPartDemo5()
{
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
foreach (Microsoft.SharePoint.WebPartPages.WebPart wp in this.Zone.WebParts)
{
if (wp is Microsoft.SharePoint.WebPartPages.ListViewWebPart)
{
this.Controls.Add(new LiteralControl(StrText));
Microsoft.SharePoint.WebPartPages.ListViewWebPart listWp = wp as Microsoft.SharePoint.WebPartPages.ListViewWebPart;
XmlDocument doc = new XmlDocument();
doc.LoadXml(listWp.ListViewXml);
XmlNode node = doc.DocumentElement.SelectSingleNode("Query");
node.InnerXml=@"
listWp.ListViewXml = doc.InnerXml;
break;
}
}
}
catch (Exception ex)
{
this.Controls.Add(new LiteralControl(ex.Message));
}
}
}
}
7、2009-2-25更新
1)两个应用的Session是不通用的,也就是说在一个应用中存储一个session["username"],在另外一个应用中不能获取,另外一个应用存储的session["username"]和前一个应用的不是一回事,互相不能访问,他们在不同的会话中。
2) 两个应用对应的是两个本地目录。
3)同一个应用的,不同网站集之间session可以互相访问,也就是同一个会话。不同的网站集在同一个本地目录。
4)不同应用,不同网站集之间获取数据没有问题
上面的都是我用下面这个用户控件检测出来的结果,代码如下
在下面总结了我找到的关于sharepoint开发知识点的博客链接,我会一直不断的更新,如果博客的主人认为有问题的话,可以联系我,谢谢这些博客的主人为大家做的总结。
本文档会一直更新,添加新的博客链接,希望可以给大家一些帮助。
1、WSS3.0开发-过滤列表内容(2)--一个增强的列表元数据查询webpart(SmartQueryWebPart)
http://www.cnblogs.com/jianyi0115/archive/2008/02/15/1070158.html#1083879
2、WSS3.0开发-过滤列表内容(1)
http://www.cnblogs.com/jianyi0115/archive/2008/02/05/1034505.html
3、这是一篇博客,里面有很多的精彩链接,sql的,设计模式的,反正很多了,就记录了下来
http://www.cnblogs.com/ASPNET2008/archive/2008/12/25/1361167.html
4、一份详尽的IPC$入侵资料
http://www.xfocus.net/articles/200303/493.html
5、开启SharePoint页面的Session功能
http://www.cnblogs.com/zygoses2gether/archive/2006/06/29/438781.html
6、SPSiteDataQuery Samples for WSS v3
http://blog.thekid.me.uk/archive/2007/02/27/spsitedataquery-samples-for-wss-v3.aspx
7、Search results are incomplete when you use a CAML query that uses the SPSiteDataQuery class to search content on a SharePoint Server site or on a Windows SharePoint Services 3.0 site
http://support.microsoft.com/kb/946484/en-us/
8、XML results using SPSiteDataQuery in SharePoint
http://blog.thekid.me.uk/archive/2007/02/25/xml-results-using-spsitedataquery-in-sharepoint.aspx
9、给WSS页面添加访问计数器---太easy,太cool了
http://www.cnblogs.com/jianyi0115/archive/2007/12/18/1005072.html
10、一个非常有用的webpart--文档列表添加文件夹树
http://www.cnblogs.com/jianyi0115/archive/2007/11/19/964848.html
11、moss文档浏览次数统计之兄弟篇--哈哈,列表项的浏览次数统计
http://www.cnblogs.com/jianyi0115/archive/2008/01/08/1029915.html
12、SharePoint 2007中 利用ListViewWebpart 和DataViewWebpart 跨站点 调用列表或者文档库
http://www.cnblogs.com/Jianchidaodi/archive/2008/01/16/1041108.html
13、SharePoint开发中对ListViewWebPart的几个操作
http://www.cnblogs.com/rippleyong/archive/2008/10/28/1321412.html
14、SPGridView 研究笔记 Part 3 - 分组
http://blog.csdn.net/ericfine/
15、用SPGridView显示SharePoint内容
http://blog.joycode.com/erucy/archive/2008/07/30/115207.aspx
16、强大的SPGridView
http://www.cnblogs.com/jianyi0115/archive/2008/04/03/1136816.html
17、SPDataSource Mystery Modes: Webs & ListOfLists
http://solutionizing.net/2008/09/09/spdatasource-mystery-modes-webs-listoflists/
18、Walkthrough:SPDataSource CrossList mode example code in C#
http://www.cnblogs.com/windbell/archive/2008/09/03/1281230.html
19、如何取到MOSS列表中item的链接
http://www.cnblogs.com/carysun/archive/2008/12/04/itemurl.html
20/
Batch Updating List Items in Windows SharePoint Services 3.0
http://msdn.microsoft.com/en-us/library/cc404818.aspx#Mtps_DropDownFilterText
21、Take it easy:Creating SPGridView in WebPart
http://www.cnblogs.com/windbell/archive/2008/08/29/1279085.html
22、SPFieldType Enumeration (Microsoft.SharePoint)
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldtype.aspx
23、SharePoint,如何在WebPart中访问页面上的其他WebPart
http://soft.zdnet.com.cn/software_zone/2007/1031/595664.shtml
24.、在WSS/MOSS中使用SPQuery分页
http://www.cnblogs.com/dotnba/archive/2007/11/19/964004.html
25/、 初学使用sharepoint 2007 用户控件包装器 QuickPart
http://www.cnblogs.com/cxd4321/archive/2007/08/28/873326.html
26 、http://wanghao-3.cnblogs.com/
http://wanghao-3.cnblogs.com/
27、 MenuItemTemplate回发处理
http://www.cnblogs.com/duke008/archive/2009/01/04/1368053.html
28、SharePoint field objects - classname, name and types
http://www.sharepointblogs.com/tonstegeman/archive/2007/07/23/sharepoint-field-objects-classname-name-and-types.aspx
29/ ASP.NET中的resx文件 Localization in ASP.NET 2.0
http://www.ondotnet.com/pub/a/dotnet/2005/08/08/localizingaspnet20.html
30、如何最方便的创建SharePoint解决方案包?
http://blog.podlook.com/blog/blog-joycode-com-MainFeed-aspx/104276-aspx.htm
http://www.cnblogs.com/aivdesign/articles/1298952.html
31、基于AD的用户组织目录树选择工具的解决方案
http://www.cnblogs.com/lickies/archive/2009/01/22/1379734.html
32、Microsoft 官方 【Web 内容管理 】
http://office.microsoft.com/zh-cn/sharepointserver/CH101785902052.aspx
33、[Best Practice]WSPBuilder和QuickPart合作进行Web Partk可视化开发与部署的好方法
http://blog.joycode.com/ipark/archive/2009/01/16/115436.aspx
34、patterns & practices SharePoint Guidance
http://www.codeplex.com/spg
35、[Best Practice]如何在SharePoint团队开发中利用WSPBuilder
http://blog.joycode.com/ipark/archive/2009/01/15/115435.aspx
36、MOSS中文社区
http://www.mosstec.cn/default.htm
37、http://www.colladec.com/
CollaDec,Web部件管理器、事件处理程序管理器、FriendlyQuery类库
38、命令行操作
本主题列出并说明了利用 Stsadm.exe 可执行的操作。有关必选和可选参数以及参数的缩写形式的详细信息,请参阅命令行参数。有关命令行工具使用的详细信息,请参阅“Windows SharePoint Services 管理员指南”中的“Windows SharePoint Services 管理工具简介”。
http://www.suifenhe.gov.cn/_vti_bin/help/2052/sps/html/stsk01.htm#stsk01_createweb
39、Team-Based Development in Microsoft Office SharePoint Server 2007
http://msdn.microsoft.com/en-us/library/bb428899.aspx
41、Microsoft WCM
http://msdn.microsoft.com/en-us/library/aa830815.aspx
Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 3 of 3): Creating and Configuring WCM-Enabled Sites
http://msdn.microsoft.com/en-us/library/aa830817.aspx#Office2007SSBrandingWCMPart3_Conclusion
42、Hide the Sign In link for the anonymous access user in anonymous access enabled site - Bend the Welcome.ascx - SharePoint MOSS
http://blogs.msdn.com/syedi/archive/2008/10/01/hide-the-sign-in-link-for-the-anonymous-access-user-in-anonymous-access-enabled-site-bend-the-welcome-ascx-sharepoint-moss.aspx
43/ 定制内容查询Web部件(Customize Content Query WebPart)系列一:概述
http://www.cnblogs.com/ghner/archive/2008/05/20/1203441.html
44/ Best Practices Resource Center for SharePoint Server 2007
http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx
Classname | Type | TypeAsString | TypeDisplayName | TypeShortDescription |
Microsoft.SharePoint.SPFieldBoolean | Boolean | Boolean | Yes/No | Yes/No (check box) |
Microsoft.SharePoint.SPFieldCalculated | Calculated | Calculated | Calculated | Calculated (calculation based on other columns) |
Microsoft.SharePoint.SPFieldChoice | Choice | Choice | Choice | Choice (menu to choose from) |
Microsoft.SharePoint.SPFieldComputed | Computed | Computed | Computed | Computed |
Microsoft.SharePoint.SPFIeld | ContentTypeId | ContentTypeId | Content Type Id | Content Type Id |
Microsoft.SharePoint.SPFieldCurrency | Currency | Currency | Currency | Currency ($, ¥, €) |
Microsoft.SharePoint.SPFieldDateTime | DateTime | DateTime | Date and Time | Date and Time |
Microsoft.SharePoint.SPFieldFile | File | File | File | File |
Microsoft.SharePoint.SPField | Guid | Guid | Guid | Guid |
Microsoft.SharePoint.SPFieldNumber | Integer | Integer | Integer | Integer |
Microsoft.SharePoint.Portal.WebControls.BusinessDataField | Invalid | BusinessData | Business data | Business data |
Microsoft.SharePoint.Publishing.Fields.ContentTypeIdFieldType | Invalid | ContentTypeIdFieldType | Content Type Id | Content Type Id |
Microsoft.SharePoint.Publishing.Fields.HtmlField | Invalid | HTML | Publishing HTML | Full HTML content with formatting and constraints for publishing |
Microsoft.SharePoint.Publishing.Fields.ImageField | Invalid | Image | Publishing Image | Image with formatting and constraints for publishing |
Microsoft.SharePoint.Publishing.Fields.LayoutVariationsField | Invalid | LayoutVariationsField | Variations | Page Layout Variations |
Microsoft.SharePoint.Publishing.Fields.LinkField | Invalid | Link | Publishing Hyperlink | Hyperlink with formatting and constraints for publishing |
Microsoft.SharePoint.Publishing.Fields.PublishingScheduleEndDateField | Invalid | PublishingScheduleEndDateFieldType | Publishing Schedule End Date | Publishing Schedule End Date |
Microsoft.SharePoint.Publishing.Fields.PublishingScheduleStartDateField | Invalid | PublishingScheduleStartDateFieldType | Publishing Schedule Start Date | Publishing Schedule Start Date |
Microsoft.SharePoint.Publishing.Fields.SummaryLinkField | Invalid | SummaryLinks | SummaryLinks | Summary Links data |
Microsoft.Office.Server.WebControls.FieldTypes.SPFieldTargetTo | Invalid | TargetTo | Audience Targeting | Audience Targeting |
Microsoft.SharePoint.SPFieldLookup | Lookup | Lookup | Lookup | Lookup (information already on this site) |
Microsoft.SharePoint.SPFieldLookup | Lookup | LookupMulti | Lookup | Lookup (information already on this site) |
Microsoft.SharePoint.SPFieldNumber | Number | Number | Number | Number (1, 1.0, 100) |
Microsoft.SharePoint.SPFieldRecurrence | Recurrence | Recurrence | Recurrence | Recurrence |
Microsoft.SharePoint.SPFieldMultiLineText | Note | Note | Multiple lines of text | Multiple lines of text |
Microsoft.SharePoint.SPFieldText | Text | Text | Single line of text | Single line of text |
Microsoft.SharePoint.SPFieldUrl | URL | URL | Hyperlink or Picture | Hyperlink or Picture |
Microsoft.SharePoint.SPFieldUser | User | User | Person or Group | Person or Group |
(一)在页面上添加webpart的时候,webpart内部方法的调用顺序
1、点击添加webpart之后
构造函数
构造函数
OnInit
OnLoad
CreateChildControls
OnPreRender
OnUnload
2、点击退出编辑模式之后
构造函数
OnInit
OnLoad
CreateChildControls
OnPreRender
OnUnload
(二)添加完毕,刷新页面的时候,呈现控件的时候,webpart内部方法的调用顺序
构造函数
OnInit
OnLoad
CreateChildControls
OnPreRender(对子控件操作最后起作用的方法)
OnUnload(对子控件的操作不起作用了)
调用this.EnsureChildControls()之后会判断,子控件是否被创建,如果没有就会调用CreateChildControls()
(三)下面为ListViewWebPart的ListViewXml
ctx = new ContextInfo();
ctx.listBaseType = ]]>
ctx.displayFormUrl = ]]>
ctx.isModerated = true;
ctx.isForceCheckout = true;
ctx.EnableMinorVersions = true;
ctx.verEnabled = 1;
ctx.recursiveView = true;
ctx.WorkflowsAssociated = true;
ctx.ContentTypesEnabled = true;
On Error Resume Next
Set EditDocumentButton = CreateObject("SharePoint.OpenDocuments.3")
If (IsObject(EditDocumentButton)) Then
fNewDoc3 = true
Else
Set EditDocumentButton = CreateObject("SharePoint.OpenDocuments.2")
If (IsObject(EditDocumentButton)) Then
fNewDoc2 = true
Else
Set EditDocumentButton = CreateObject("SharePoint.OpenDocuments.1")
End If
End If
fNewDoc = IsObject(EditDocumentButton)
]]> ]]>
]]> |
]]> |
]]> |
]]> |
]]> |
]]> |
]]>
]]> ]]>
]]>
]]>
"javascript:" OnClick='javascript:SubmitFormPost("]]>
ctx = new ContextInfo();
ctx.listBaseType = ]]>
ctx.displayFormUrl = ]]>
ctx.isModerated = true;
ctx.isForceCheckout = true;
ctx.EnableMinorVersions = true;
ctx.verEnabled = 1;
ctx.recursiveView = true;
ctx.WorkflowsAssociated = true;
ctx.ContentTypesEnabled = true;
]]> |
]]> |
]]> |
]]> |
]]> |
]]> |
搜索结果中显示最近的项目需要花费几分钟时间。 ]]>