随笔分类 - SharePoint
摘要:1)首先利用Visual Studio创建一个 Web Service,开发完成后结构如下:2)然后将bin文件夹下的dll文件部署到SharePoint Server的GAC 中,即复制到C:\Windows\assembly\文件夹下。3)将Web Service的 *.asmx 文件用记事本打开,将其中的代码<%@ WebService Language="C#" CodeBehind="ClassName.asmx.cs" Class="YourNameSpace.YourClass" %>改为如下代码<%@
阅读全文
摘要:Ribbon is a great new feature introduced by SharePoint 2010.It provides many actions for different users,but sometimes,we don't want to see it.So I'll introducehow to hide the ribbon for users with different privilegesin the following paragraph.First,open the site by SharePoint Designer,find
阅读全文
摘要:今天将一个在测试环境中测试通过的WSP解决方案部署到生产环境时出现如下错误:Event code: 3005 Event message: 发生了未处理的异常。 Event time: 2012/3/5 15:11:36 Event time (UTC): 2012/3/5 7:11:36 Event ID: 53e61463a2404804abd431d6c573ebd7 Event sequence: 75 Event occurrence: 1 Event detail code: 0 Application information: Application domain: /...
阅读全文
摘要:We can using the following code to elevate permissions to modify user profile: 1 try 2 { 3 SPSecurity.RunWithElevatedPrivileges(delegate() 4 { 5 HttpContext curcon = HttpContext.Current; 6 using (SPSite mySite = new SPSite("http://YourSiteURL")) 7 { 8 SPSe...
阅读全文
摘要:今天在部署一个WSP解决方案的时候出现了如下的错误:中文:SharePoint 管理框架中的对象“SPSolutionLanguagePack Name=0”依赖其他不存在的对象。请确保已创建所有对象依赖项,然后重试此操作。English:An object in the SharePoint administrative framework, "SPSolutionLanguagePack Name=0 ", depends on other objects which do not exist.Ensure that all of the objects depende
阅读全文
摘要:Sometimes we need to change the UIVersion of sharepoint site on sharepoint 2010 for it looks like sharepoint 2007 site,there are two ways to achieve.First one ,we can use SharePoint 2010 Management Shell tool,just put the following command:View Code 1 $myWeb = Get-SPWeb http://YourSiteURL2 $myWeb.UI
阅读全文
摘要:In SharePoint 2010 there are a number of object models that can be used by developers to access the server. The Client Object Model (Client OM) is a unified model which uses the same or similar programming concepts as the Server Object Model (Server OM).We can use it like this:Get all list item from
阅读全文
摘要:We often use modal dialog to display list item or other infomation in sharepoint.we can use the following code to create a modal dialog:View Code 1 <script type="text/javascript"> 2 function ShowInfo() { 3 var options = SP.UI.$create_DialogOptions(); 4 5 options.title = "ModalD.
阅读全文
摘要:As we all know,if we change display form of a list item to infopath form,there can't find the print previewbutton on the ribbon:If we want to print this form, we need to add a print button,but how to do it,just follow the following steps:First,trun back to the list,on the ribbon area,click "
阅读全文
摘要:Today,I'd deployed a solution to a SharePoint Farm,but I got the following error:"Object reference not set to an instance of an object",in chinese is "未将对象引用设置到对象的实例".The user I used to run this command isn't a farm administrator account,and also it doesn't have fullc
阅读全文
摘要:如果一个列表中有一个字段类型为用户或用户组,并且设置为用户,允许多值的话,那么用代码进行更新的时候就必须将这个字段的值赋成SPFieldUserValueCollection类型,以下代码即为从PeopleEditor控件中取出多个用户并返回一个SPFieldUserValueCollection类型的值: 1 /// <summary> 2 /// 从人员选取器中获取多用户并返回SPFieldUserValueCollection类型 3 /// </summary> 4 /// <param name="pe">人员选取器</.
阅读全文
摘要:主要代码如下: 1 /// <summary> 2 /// 提升权限创建用户组 3 /// </summary> 4 /// <param name="groupname">用户组的名字</param> 5 public void CreateGroup(string groupname) 6 { 7 SPSecurity.RunWithElevatedPrivileges(delegate() 8 { 9 try10 ...
阅读全文
摘要:前段时间开发Web Part用到了Ajax控件,但是第一次部署过程相当曲折,特意做一个笔记,首先在下载AjaxControlToolKit控件的时候要注意版本,因为SharePoint 2010是基于.Net Framework 3.5的,所以我第一次下载了AjaxControlToolKit 3.5,但是在下载页里面看到了一条注意事项:Pages using controls from AJAX Control Tookit .NET 3.5 must use the ToolkitScriptManager, rather than the ASP.NET ScriptManager.也就
阅读全文
摘要:SharePoint和AD可以通过User Profile相互同步用户信息,其之间的属性对应关系如下表: 用户配置文件显示名称用户配置文件属性AD DS 属性AD中中文名称可分辨名称SPS-DistinguishedNamedn分辨名SIDSIDobjectSid对象安全ID经理Managermanager经理名称PreferredNamedisplayName显示名称名字FirstNamegivenName名姓氏LastNamesn姓拼音显示姓名SPS-PhoneticDisplayNamemsDS-PhoneticDisplayName拼音显示姓名拼音名SPS-PhoneticFirs..
阅读全文
摘要:给SharePoint列表更新列表项的做法很多,最常用的就是调用Microsoft.SharePoint.dll中的对象,但是这样的程序只能在MOSS服务器上运行,如果在客户端呢,只能用Lists.UpdateListItems方法,但是这个方法如果里面你给的参数设置不多,则不会更新成功,关于各种类型的参数详见下表: 类型参数实例文本(String)字符串AAA选项(Choise)选项的值A整数(Number)数字123货币(Currency)金额123日期时间(DateTime)日期和时间2011-12-24T13:54:43Z是/否(Boolean)true或falsetrue用户(Us.
阅读全文
摘要:在很多实际的业务场景中,需要让SharePoint的列表或表单库的标题唯一并且还具有可读性,唯一的话最好的方法就是使用该列表或表单库的ID,至于可读性就可以使用一些比较可读的字符然后再连上ID就可以了,在这里主要讲一下如何使用ID做标题,以下以列表为例,表单库其实也一样。首先建立一个名为“UseIDAsTitle”的列表,不为其建立其它栏,只留默认的栏,下面就要分析一下,大家都知道,不管是列表还是表单库的“ID”都是要在保存之后才生成的,那么保存了之后我们再如何把“ID”赋给已经保存的项呢?这里有两种做法,第一种,就是我们可以把当前已经保存了的项目做一下修改,然后让其标题等于“ID”;还有一种
阅读全文
摘要:由于业务的需要,需要在用户操作菜单的位置增加一个操作菜单,具体做法如下:首先我建立一个名为“LeoPersonalAction.xml”的XML文档,这个文档用于定义操作菜单,代码如下: 1 <?xml version="1.0" encoding="utf-8" ?> 2 <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> 3 <!-- Document Library Toolbar New Menu Dropdown -->
阅读全文
摘要:在之前的文档之中已经详细说明了如何在InfoPath中利用SharePoint的Lists Web Service向列表提交数据,做了一个新建项目的Demo,文章链接如下:在InfoPath中利用SharePoint的Lists Web Service向列表提交数据但是在现实的业务流程中,还会有修改和删除的需求,那么这些该如何操作呢?下面将会一一讲解。首先先说一下修改,修改顾名思义是在已有的记录上进行修改,那么第一步就应该取到待修改记录,得有一个Key来关联,一般来说都用ID做Key,弄清楚这个以后我们就可以来建立修改的XML文件了,我的列表还是用之前的两个列表,所以我用记事本建立了一个名为“
阅读全文
摘要:在开发管理User Profile的Web Part时,需要读取和写入User Profile的属性值,但是我们往往都只知道某一属性的“显示名称”,如果要知道该属性的“名称”的话,往往还需要去管理中心点击属性的编辑按钮进去看,实在是很不方便,那么能有其他方便的方法查看到User Profile中属性的名称吗?其实只需要一段很短的代码,具体如下:首先这段代码需要用到3个DLL,分别是Microsoft.SharePoint.dll; Microsoft.Office.Server.UserProfiles.dll; Microsoft.Office.Server.dll;然后在代码中将其引用:1
阅读全文
摘要:在SharePoint的使用上,User Profile有着很强大的功能,除了可以保存一些用户的基本信息外,另外还可以自定义一些属性保存用户其他的一些信息,但是在添加属性的时候需要注意几个地方:一、“名称”即为该属性在User Profile中的属性名,而“显示名称”是显示给用户所看到的名称,另外类型一定要设置为需要的类型,如果为字符串,还需注意其长度设置二、策略和编辑设置,其中策略设置上设不设必需从使用的角度上来说差别并不是很大,但是隐私设置很重要,如果设置为只有我,那么就只有本人和系统管理员才能看到该属性的值,其他人都看不到,如果用使用自定义Web Part来管理User Profile的
阅读全文