我可以从 Sharepoint 站点上的 Silverlight 用户控件访问 WSS 组吗?
我在 MOSS (Sharepoint 2007) 中有一个 Silverlight 控件,我想根据 Sharepoint 中设置的用户角色有条件地启用它。我发现我可以根据
http://<server-url>/_vti_bin/usergroup.asmx
。 aspx" rel="nofollow">MSDN.令我懊恼的是,虽然我可以轻松添加 Web 引用,但我无法找到我必须引用的程序集。有谁知道这是什么集会,以及我是否可以走正确的路线?永远感谢。
编辑 Silverlight 是客户端,所以显然我需要一种从服务器获取 SPUser 和 SPGroup 信息的方法。 WSS 服务似乎没有有用的方法。我现在尝试在 Sharepoint Designer 中创建一个页面并将其用作准 RESTful 服务。这是愚蠢的吗?我希望 Sharepoint 能够提供这项特殊的服务。
编辑 由于 SharePoint 2007 不允许 Silverlight 控件访问服务器端 API 元素(例如 SPUser),因此我提出了一个解决方案,在 InitParameters 中传递标志值。下面发布了。
I have a Silverlight control in MOSS (Sharepoint 2007) which I want to conditionally enable based upon the user roles set in Sharepoint. I found that I may add a Web reference to the UserGroups service with
http://<server-url>/_vti_bin/usergroup.asmx
according to this article on MSDN. To my chagrin, although I can easily add a Web reference, I have not been able to find what assembly I must reference. Does anyone know what assembly this, and whether I may going the correct route? Thanks always.
Edit
Silverlight is client side so apparently I need a way to get the SPUser and SPGroup information from the server. WSS services dont' seem to have a useful method. I'm now trying to make a page in Sharepoint Designer and use it as a quasi RESTful service. Is this folly? I would expect Sharepoint to come with this particular service.
Edit
Since SharePoint 2007 doesn't allow Silverlight Controls to access server side API elements like SPUser, I came up with a solution where I pass flag values in the InitParameters. It is posted below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在 MOSS 中没有太多使用 Silverlight,但是您不能仅引用位于 12Hive/ISAPI 文件夹中的 Microsoft.SharePoint 程序集吗?
然后你可以使用
I haven't played much with Silverlight in MOSS but can you not just reference the Microsoft.SharePoint assembly located at 12Hive/ISAPI folder?
Then you can use
可以使用 silverlight 客户端对象模型。
请参阅 http://msdn.microsoft.com/en-us/library/ee538971。 ASPX
但:
因此这取决于您的设置以及您是否愿意开放跨域策略。
Using the silverlight client side object model is possible.
See http://msdn.microsoft.com/en-us/library/ee538971.aspx
But:
Therefore this depends on your setup and whether you are willing to open up your cross-domain policy..
我发现MOSS(又名SharePoint 2007)没有访问客户端SPUser权限的机制。因此 SilverLight 控件没有直接方法来获取此信息。我的解决方案是修改托管 SilverLight 控件的 WebPart 以包含一个属性,该属性会将该信息作为 InitParams 之一传递给 SilverLight 控件。
目前,Web 上有许多用于托管 SilverLight 控件的 WebPart。这里有几个例子。
代码库
http://silverlightwebpart.codeplex.com/
柯克·埃文斯博客
http:// /blogs.msdn.com/b/kaevans/archive/2008/10/08/hosting-silverlight-in-a-sharepoint-webpart.aspx
有我的 WebPart 和本文中的 WebPart 有明显的相似之处。
http://blogs .msdn.com/b/andreww/archive/2009/03/12/silverlight-web-part-in-sharepoint.aspx
我决定做的是制作 WebPart 本身可配置
接下来在 SilverLight 控件中我使用 Initparameters
SilverLight UserControl 中的字典存在于 App.xaml.cs 中,如下所示
我能说什么呢?有用。
I found that MOSS (a.k.a. SharePoint 2007) has no mechanism for accessing SPUser permission the client. Hence SilverLight controls have no direct means to obtain this information. My solution was to modify the WebPart hosting the SilverLight control to include a property, which would pass that information to the SilverLight control as one of the InitParams.
Currently there are many WebParts for hosting a SilverLight control available on the Web. Here are a few examples.
CodePlex
http://silverlightwebpart.codeplex.com/
Kirk Evans Blog
http://blogs.msdn.com/b/kaevans/archive/2008/10/08/hosting-silverlight-in-a-sharepoint-webpart.aspx
There are noticable similarities with my WebPart and the one in this article.
http://blogs.msdn.com/b/andreww/archive/2009/03/12/silverlight-web-part-in-sharepoint.aspx
What I decided to do is make the WebPart itself configurable
Next in the SilverLight control I use the Initparameters
The Dictionary in the SilverLight UserControl exists in the App.xaml.cs as seen here
What can I say? It works.