江湖路
专注AJAX和Moss
posts - 20,comments - 23,trackbacks - 0

在PowerShell中注册SharePoint程序集

Add-PSSnapin Microsoft.SharePoint.PowerShell

获取所有在PowerShell中注册的程序集:

Get-PSSnapin –Registered
posted @ 2011-03-07 17:14 wengnet 阅读(147) 评论(0) 编辑
Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | format-table name > C:\SP2010_PowerShell_Commands.txt

 


Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | select name, definition | format-list > C:\SP2010_PowerShell_Commands.txt
posted @ 2011-03-07 16:25 wengnet 阅读(48) 评论(0) 编辑
public static Web CreateSite(ClientContext clientCtx, string title, string url, string description)
{
try
{
WebCreationInformation webCreateInfo
= new WebCreationInformation();
webCreateInfo.Description
= description;
webCreateInfo.Language
= 1033;
webCreateInfo.Title
= title;
webCreateInfo.Url
= url;
webCreateInfo.UseSamePermissionsAsParentSite
= true;
webCreateInfo.WebTemplate
= "STS#1";

Web oNewWebsite
= clientCtx.Web.Webs.Add(webCreateInfo);

clientCtx.Load(oNewWebsite);

clientCtx.ExecuteQuery();

return oNewWebsite;
}
catch (ServerUnauthorizedAccessException suaex)
{
Console.WriteLine(suaex.Message);
}
catch (ServerException sex)
{
Console.WriteLine(sex.Message);
}

return null;
}

public static WebTemplate GetTemplate(ClientContext clientCtx, string title)
{
WebTemplateCollection templates
= clientCtx.Web.GetAvailableWebTemplates(1033, true);

IEnumerable
<WebTemplate> filteredTemplates = clientCtx.LoadQuery(templates.Where(t => t.Title == title));

clientCtx.ExecuteQuery();

if (filteredTemplates != null && filteredTemplates.Count() > 0)
return filteredTemplates.First();
else
return null;
}

注意:其中“STS#1”为空白站点模板,“STS#0”为团队站点模板

posted @ 2011-01-21 14:20 wengnet 阅读(132) 评论(0) 编辑

在开发环境中,SharePoint2010和数据库是分开装的,当使用SharePoint Designer创建外部内容类型的时候,出现了此错误"The Business Data Connectivity Metadata Store is currently unavailable";

搜遍互联网,找到如下答案:

WCF Fix for SharePoint 2010

Windows Server 2008/Vista:

http://go.microsoft.com/fwlink/?linkID=160770

Windows Server 2008 R2/Windows 7:

http://go.microsoft.com/fwlink/?LinkID=166231

 

除了这两个补丁,还需要在管理中心à应用程序管理à服务应用程序à管理服务应用程序里面新建一个"Business Data Connectivity Service "应用程序,

此时 SharePoint Designer里面的外部内容类型才可以使用。

posted @ 2010-07-21 16:27 wengnet 阅读(194) 评论(0) 编辑

 

SPWebService.ContentService.DeveloperDashboardSettings.DisplayLevel = SPDeveloperDashboardLevel.On;
SPWebService.ContentService.DeveloperDashboardSettings.Update();

 

posted @ 2010-03-01 14:42 wengnet 阅读(526) 评论(0) 编辑

先看代码:

代码
 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <title></title>
 5 
 6     <script type="text/javascript">
 7         function test() {
 8             var s = document.getElementById("select1");
 9             s.setAttribute("onchange""show('"+s.value+"');");      
10         }
11         function show(m) {
12             alert(m);
13         }
14     </script>
15 
16 </head>
17 <body onload="test()">
18     <select id="select1">
19         <option value="a">a</option>
20         <option value="b">b</option>
21         <option value="c">c</option>
22     </select>
23 </body>
24 </html>

 

一个普通的ASPX的页面,运行没有任何问题,但是放到WebPart中,你试试,change事件不激发了?

解决的办法有两个:

  1. 在SharePoint的母板页中的最上面加上如下:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     

  2. 修改JavaScript代码,如下:
    代码
            function test() {
                
    var s = document.getElementById("select1");
                s.onchange 
    = show;
            }
            
    function show() {
                
    var s = window.event.srcElement;
           
                alert(s.value);
            }

     

    原因大家仔细想一想,为什么?

 

posted @ 2009-12-04 10:27 wengnet 阅读(1154) 评论(2) 编辑
摘要: 接上回,开始安装SharePoint2010,第一步当然是输入密钥了:接受许可协议:选择安装类型:我们选择服务器场安装:选择了完整安装,然后开始了漫长的安装过程:安装完成,开始配置了:配置向导第一步,和SharePoint2007差不多:配置第二步,我们选择创建新的服务器场:输入相关信息:和SharePoint2007不同,多了一个服务器的安全密码:设定端口号:确认一下相关信息:又是一个漫长的配置...阅读全文
posted @ 2009-11-30 09:48 wengnet 阅读(7860) 评论(8) 编辑
摘要: 首先准备一台安装完系统和SQLServer2008的机器,操作系统要求Windows Server 2008 SP2 ,SQLServer2008要求SP1,并将系统和SQL的相应补丁打全;准备好机器后开始安装。首先安装系统必备软件,如果机器可以连接互联网,将会自动下载这些软件,不能连接互联网就只能自己手工下载了,具体需要下载的软件,请参考如下连接:http://blogs.msdn.com/ji...阅读全文
posted @ 2009-11-23 17:06 wengnet 阅读(4631) 评论(5) 编辑
摘要: 这几天忙着给一个项目做演示准备,其中需要做SharePoint和Reporting Services整合,这里用的是SQL SERVER2005的外接程序做的整合,配置好之后发现,报表查看器的样式折行列,如下:真不知道MS是怎么做的这个东西,还是自己DIY一下吧,改好的效果如下:需要修改的样式表路径为:C:\Program Files\Common Files\Microsoft Shared\w...阅读全文
posted @ 2009-11-08 18:04 wengnet 阅读(337) 评论(0) 编辑
摘要: [代码]阅读全文
posted @ 2009-08-16 18:47 wengnet 阅读(220) 评论(0) 编辑