从共享点外部托管的网站访问共享点列表 [英] Access sharepoint list from web site hosted externally from sharepoint

查看:53
本文介绍了从共享点外部托管的网站访问共享点列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 sharepoint online 2010 外部开发 Web 应用程序.作为应用程序的一部分,我希望允许用户访问文档库中的文档.理想情况下,用户会点击一个选项,这将查询文档库,并为每个满足查询的对象返回一个 JSON 对象,以便在网页中显示为链接.

I'm developing a web application externally from sharepoint online 2010. As part of the application I would like to allow users to access documents from a document library. Ideally users would click on an option, this would query the library for documents, and return a JSON object for each object satisfying the query for display as links in a webpage.

我一直在寻找一种在共享点 2010 外部托管的网站中执行此操作的方法,但我一直无法找到描述如何加载 ECMA 脚本 API 和连接到共享点站点的资源.有谁知道我在哪里可以找到这些信息?

I've been looking for a way to do this in a website hosted externally from sharepoint 2010, but I have been unable to find resources describing how to load the ECMA script API and connect to a sharepoint site. Does anyone know where I can find this information?

感谢您的帮助!

推荐答案

您有多种方法可以实现这一点.开箱即用的选项将使用查询(来自服务器代码或 ajax)您的列表 SVC.如果您不知道,所有列表都有相关的服务来提取信息.

You have several ways to achieve this. The out of the box option would be using queries (from server code or ajax) your list SVC. In case you don't know, all lists have an associated service to pull information.

  1. http://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx
  2. http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/21/introduction-to-querying-lists-with-rest-and-listdata-svc-in-sharepoint-2010.aspx

codeplex spservices 有一个很棒的 js 库,可以帮助您查询共享点.使用此列表,您可以执行以下操作(示例代码取自 codeplex 示例)

There is a wonderful js library at codeplex, spservices, that helps you to query your sharepoint. With this list you could do something like this (sample code taken from codeplex samples)

<script language="javascript" type="text/javascript">

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        $("#tasksUL").append(liHtml);
      });
    }
  });
});
</script>

更多信息,请访问 http://spservices.codeplex.com/wikipage?title=GetListItems?请记住,如果列表有安全限制,当您在 sharepoint 外部运行此调用时,您会遇到非常有趣"的身份验证问题,并且它不知道到底是谁在进行调用.因此,作为建议,请考虑在 sharepoint 下运行您的页面.

More information at http://spservices.codeplex.com/wikipage?title=GetListItems? Keep in mind if the list has security restrictions you will run into pretty "interesting" authetication issues as you are running this calls outside sharepoint and it will not know who the hell is making the calls. So, just as a suggestion, consider running your pages under sharepoint.

这篇关于从共享点外部托管的网站访问共享点列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆