简体   繁体   English

使用SOAP,Javascript,C#,Webservices,jQuery的Sharepoint 2007 List的Windows Gadget

[英]Windows Gadget for Sharepoint 2007 List using SOAP, Javascript, C#, Webservices, jQuery

I am trying to develop a Gadget for Sharepoint 2007, which will authenticate a user and then fetch him a sharepoint list from a specific URL, 我正在尝试为Sharepoint 2007开发一个Gadget,它将对用户进行身份验证,然后从特定的URL中获取一个sharepoint列表,

For the last 4 days I have been working on it and came across different ways of making it, but because solutions are either half done, dont work or too confusing to get help from or convert into what I want. 在过去的4天里,我一直在研究它,并遇到了不同的制作方法,但是因为解决方案要么完成了一半,要么无法工作,要么太混乱,无法获得帮助或转换成我想要的东西。

Because Windows Gadget uses Scripting + HTML so I have following options to carry on work with to make this gadget, 因为Windows Gadget使用Scripting + HTML所以我有以下选项可以继续使用来制作这个小工具,

  • Create a Visual studio project (dll) which will fetch the list for me using SPLIST/SPWeb of Sharepoint and then I can use JavaScript & Visual Studio "COM" to read that dll ("Classes") and get data in JavaScript + displaying it on HTML. 创建一个Visual Studio项目(dll),它将使用Sharepoint的SPLIST / SPWeb为我提取列表,然后我可以使用JavaScript和Visual Studio“COM”来读取dll(“Classes”)并在JavaScript中获取数据+显示它在HTML上。 Problem with this approach is, I am not sure, If I create a "dll" with Sharepoint SPLIST and put it into the gadget folder, will it work on Clients (that dont have sharepoint installed on there PCs). 这种方法的问题是,我不确定,如果我使用Sharepoint SPLIST创建一个“dll”并将其放入gadget文件夹,它是否适用于客户端(没有在PC上安装sharepoint)。 While trying to find help regarding this approach to problem I find this project that is doing kinda same thing, but not really sure if i make changes to it and it will gonna work with "dll" I was talking about earlier, here's the Link to Gadget, 在尝试寻找有关这种问题解决方案的帮助时,我发现这个项目有点做同样的事情,但不确定我是否对它进行了更改并且它将使用“dll”我之前谈到的,这里是链接到小工具,

Gmail Gadget Using JavaScript to Read Visual studio Dll Gmail小工具使用JavaScript阅读Visual Studio Dll

  • Second Approach to solve the problem can be, If I use Sharepoint webservices, that will get me all the List Items, but then using Webservices in JavaScript isn't that easy, so if i create a Visual Studio Project, get a web reference to sharepoint webservices, and return a list, which I again use JavaScript to read the results out of DLL, and display them on HTML. 解决问题的第二种方法可以是,如果我使用Sharepoint webservices,那将获得所有List Item,但是在JavaScript中使用Webservices并不那么容易,所以如果我创建一个Visual Studio项目,请获取Web引用sharepoint webservices,并返回一个列表,我再次使用JavaScript从DLL中读取结果,并在HTML上显示它们。

This Link is Using Webservices in a Dot Net Project to Update a List Item, but In comments it also tells how to get List data, but then how I gonna authenticate my users 此链接在Dot Net项目中使用Webservices来更新列表项,但是在注释中它还说明了如何获取List数据,但是我将如何验证我的用户

  • Another solution is to use Jquery to get sharepoint List data, like in link before, but again, how can i authenticate my users @ gadget ? 另一个解决方案是使用Jquery来获取sharepoint列表数据,比如之前的链接,但同样,我如何验证我的用户@ gadget?

Using jQuery to fetch List Data 使用jQuery获取列表数据

A gadget that is getting News Feed from a website, its sending an HTTPxml request but then asking for a RSS feed, whereas i dont have Rss feedback in sharepoint site I am working on 从网站获取新闻Feed的小工具,它发送HTTPxml请求但随后要求提供RSS提要,而我在sharepoint网站上没有Rss反馈我正在努力

Cheers for reading this I hope you either gonna increase your knowledge or gonna share it :) 欢呼阅读这个我希望你要么增加你的知识或要分享它:)

EDIT * I meant using Sharepoint MOSS "SPLIST" or "SPWEB" as Client Object Model, AS I am using Moss I can't use Client Object Model Authentication :(. really sorry for wrong Information * 编辑 * 我的意思是使用Sharepoint MOSS“SPLIST”或“SPWEB”作为客户端对象模型,因为我使用Moss我不能使用客户端对象模型身份验证:(。真的很抱歉错误的信息 *

If you can afford deplying a COM component with your Gadget the first approach would work. 如果你能负担得起使用你的小工具的COM组件,第一种方法是可行的。 You wrap your logic in a facade of a CCW .NET class (using the .NET SP Client OM) and register it for COM by regasm. 您将逻辑包装在CCW .NET类的外观中(使用.NET SP Client OM)并通过regasm将其注册到COM。 All pure .NET, your class would be declared (and written) COM-compatible. 所有纯.NET,您的类将被声明(和写入)COM兼容。

You may find the second approach too limiting later; 您可能会发现第二种方法在以后受到限制; SP ClOM supports more functionality that SP WSs. SP ClOM支持SP WSs的更多功能。 Throwing the jQuery in doesn't change it much. 抛出jQuery不会改变它。 (Unfortunately, SP JS ClOM can be used only on SP pages; not in a Gadget.) (不幸的是,SP JS ClOM只能在SP页面上使用;不能在小工具中使用。)

If you go the way of pain (JS ;-) IWA should give you the (Windows) SSO authentication. 如果你采取痛苦的方式(JS ;-) IWA应该给你(Windows)SSO身份验证。 If you call the SP ClOM from the DLL you can either reuse the Windows session token of the current user (SSO) or authenticate explicitly by a form of yours if the user wished it. 如果从DLL调用SP ClOM,则可以重用当前用户(SSO)的Windows会话令牌,或者如果用户希望的话,可以通过您的表单明确进行身份验证。 (You can login to SP UI as a different user than you are in Windows too.) Both is supported . (您也可以以不同于Windows的用户身份登录SP UI。) 两者都受支持

I'd first try the DLL approach. 我首先尝试DLL方法。

Update: Oops, you're on SP 2007, not on 2010 - no SP ClOM. 更新:哎呀,你在SP 2007上,而不是在2010年 - 没有SP ClOM。 I should've noticed earlier, sorry... Still, you could create a .NET DLL that would talk to SP via a WS. 我应该早些时候注意到,抱歉......你仍然可以创建一个可以通过WS与SP对话的.NET DLL。 You can still set DefaultNetworkCredentials to HttpWebRequest.Credentials (REST) or to .Credentials of your WS client class (SOAP) to get SSO authentication. 您仍然可以将DefaultNetworkCredentials设置为HttpWebRequest.Credentials (REST)或WS客户端类(SOAP)的.Credentials以获取SSO身份验证。 Or create your own NetworkCredential with name and password. 或者使用名称和密码创建自己的NetworkCredential

--- Ferda ---费达

You're installing this on a users PC so you can't use the standard SharePoint API (Microsoft.SharePoint.dll) 您正在用户PC上安装它,因此您无法使用标准SharePoint API(Microsoft.SharePoint.dll)

You're using 2007 so you can't use the "Client Object Model" (managed/silverlight or EMCA Script) 您正在使用2007,因此您无法使用“客户端对象模型”(托管/ silverlight或EMCA脚本)

That leaves 离开了

a) The SharePoint Web Services (either JavaScript or JQuery which IS still JavaScript). a)SharePoint Web服务(JavaScript或JQuery仍然是JavaScript)。

This means that your gadget will be authenticating to SharePoint via the same mechanism that someone browsing to your site would - normally Integrated Windows auth. 这意味着您的小工具将通过与浏览您网站的人相同的机制向SharePoint进行身份验证 - 通常是集成Windows身份验证。

The first place to start this is the excellent http://spservices.codeplex.com/ library which allows you to easily call the web services from JQuery). 首先要做的是优秀的http://spservices.codeplex.com/库,它允许您从JQuery轻松调用Web服务。 See the documentation for tips on how to use it. 有关如何使用它的提示,请参阅文档。

For a half done project how about http://sharepointsidebar.codeplex.com/ 对于半完成的项目,请访问http://sharepointsidebar.codeplex.com/

b) Create your own custom web services by deploying a dll on the SharePoint server then call those via JavaScript (perhaps usign JSON or similar rather b)通过在SharePoint服务器上部署dll然后通过JavaScript调用它们来创建自己的自定义Web服务(也许是使用JSON或类似的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM