博客地址:http://blog.csdn.net/FoxDave

本篇只讲REST服务中的GetListItemChangesSinceToken这个东西。何谓同步呢,你也可以理解为增量变化,即给定一个时间,我需要获取从那个时间到现在所有发生变化的列表项。

使用GetListItemChangesSinceToken同步SharePoint列表项

如果你想要在SharePoint和你的Add-in或服务之间同步列表项,可以使用GetListItemChangesSinceToken来达到目的,它跟SharePoint Web服务请求中的List.GetListItemChangesSinceToken是对应的。

在POST请求的body中加入SP.ChangeLogItemQuery对象的属性。该请求会返回ADO行集合的XML,包含了符合查询条件的列表项的更改记录。

示例请求如下:

请求的URL

POST http://server/site/_api/web/Lists/GetByTitle('Announcements')/GetListItemChangesSinceToken

请求的Body

{ 'd' : {
'query': {
'__metadata': { 'type': 'SP.ChangeLogItemQuery'},
'ViewName': '',
'Query': '<Where>
<Contains>
<FieldRef Name="Title" />
<Value Type='Text'>Te</Value>
</Contains></Where>',
'QueryOptions': '<QueryOptions>
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
<DateInUtc>False</DateInUtc>
<IncludePermissions>TRUE</IncludePermissions>
<IncludeAttachmentUrls>FALSE</IncludeAttachmentUrls>
<Folder>Shared Documents/Test1</Folder></QueryOptions>',
'ChangeToken':'1;3;eee4c6d5-f88a-42c4-8ce1-685122984870;634397182229400000;3710',
'Contains':'<Contains>
<FieldRef Name="Title"/>
<Value Type="Text">Testing</Value></Contains>' }
}
}

SP.ChangeLogItemQuery对象属性

Property Description
ListName A string that contains either the title or the GUID for the list. When querying the UserInfo table, the string contains UserInfo. Using the GUID results in better performance.
ViewName A string that contains the GUID for the view, which determines the view to use for the default view attributes represented by the  query,  viewFields, and  rowLimit parameters. If this argument is not supplied, the default view is assumed. If it is supplied, the value of the query,  viewFields, or  rowLimit parameter overrides the equivalent setting within the view. For example, if the view specified by the viewFields parameter has a row limit of 100 rows but the rowLimit parameter contains a value of 1000, then 1,000 rows are returned in the response.
Query Query element containing the query that determines which records are returned and in what order.
QueryOptions An XML fragment in the following form that contains separate nodes for the various properties of the  SPQuery object.
ChangeToken A string that contains the change token for the request. For a description of the format that is used in this string, see  Overview of the Change Log. If null is passed, all items in the list are returned.
Contains Contains element that defines custom filtering for the query.
本篇就介绍到这里。

SharePoint REST API - 同步SharePoint列表项的更多相关文章

  1. SharePoint 2013 自定义翻页显示列表项

    项目需求:自定义开发一个能分页显示列表项的小部件,允许左右翻页,能根据用户权限来显示管理链接等. 效果如下: 技术要求:使用sharepoint rest API 来获取列表项,这样性能高,能够快速响 ...

  2. How to Call SharePoint 2013 API Service to Query The Lists

    How to Call SharePoint 2013 API In SharePoint 2013, we can query the list by it owner service, then ...

  3. SharePoint REST API - 列表和列表项

    博客地址:http://blog.csdn.net/FoxDave 本篇主要讲述如何用SharePoint REST操作列表和列表项.阅读本篇时请先了解前面讲述的REST介绍和基本操作. 废话不多 ...

  4. 复制SharePoint列表项(SPListItem)到另一个列表

    从理论上讲,有一个简单到难以置信的解决办法:SPListItem提供了一个CopyTo(destinationUrl)方法(可参考MSDN).不幸的是,这个方法似乎用不了.至少对我的情况(一个带附件的 ...

  5. 每日学习心得:SharePoint 2013 自定义列表项添加Callout菜单项、文档关注、SharePoint服务端对象模型查询

    前言: 前一段时间一直都比较忙,没有什么时间进行总结,刚好节前项目上线,同时趁着放假可以好好的对之前遇到的一些问题进行总结.主要内容有使用SharePoint服务端对象模型进行查询.为SharePoi ...

  6. 好神奇的代码,可以让匿名用户对特定SharePoint 列表拥用添加列表项的权限哦

    如果你不使用代码,很难从界面上去设置列表的匿名用户(如果可以请告诉我,我会自动删除这个博文)拥有列表项的添加权限. 其实这种需求是非常必要的,比如: 1.允许新用户去提交一个注册申请, 2.在召集临时 ...

  7. SharePoint 2010 列表项事件接收器 ItemAdded 的使用方法

    列表项事件处理器是继承于Microsoft.SharePoint.SPItemEventReceiver的类,Microsoft.SharePoint.SPItemEventReceiver类提供了许 ...

  8. [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表

    写在前面 最近对文档库的知识点进行了整理,也就有了这篇文章,当时查找这些接口,并用在实践中,确实废了一些功夫,也为了让更多的人走更少的弯路. 系列文章 sharepoint环境安装过程中几点需要注意的 ...

  9. SharePoint 列表项通过自定义WebService读取

    简述:给其他系统提供集成,发现SharePoint自带的WebService各种不好使,索性就自己写一点,也当做自己学习的记录了.当然内容比较简单,希望大侠们不要介意,也不要骂我啊.好了,进入正题吧. ...

随机推荐

  1. tensorflow输出

    在Session对象上调用run()函数,执行流图,即可得到输出, 可获取单个输出,也可获取多个输出 import tensorflow as tf import numpy as np consta ...

  2. MSG结构体和WndProc窗口过程详解

    MSG结构体和WndProc窗口过程对于Windows编程非常重要,如果不了解它们,可以说就没有学会Windows编程. MSG结构体 MSG 结构体用来表示一条消息,各个字段的含义如下: typed ...

  3. javax.el.PropertyNotFoundException: Property 'know_id' not found on type java.lang.String

    今天通过Servlet明明查出来了结果,在跳转到页面时报这个异常.根据经验仔细核对了字段书写时,未发现错误. 耐心仔细检查之后发现el表达式的List集合写错了 <c:forEach items ...

  4. 使用shiro框架,注销问题的解决

    在使用shiro框架的时候,有时候会因为登录问题找不到注销的controller.所以会报404的错误,下面是解决办法: 1.首先写一个类SystemLogoutFilter继承LogoutFilte ...

  5. GoldenGate使用SQLEXEC和GETVAL实现码表关联

    使用OGG中的SQLEXEC参数,可以执行SQL语句或存储过程,再加上@GETVAL函数,可以在目标端获取源表没有的字段值.比如,源端有一个事实表和一个代码表COUNTRY_CODES,代码表中有两个 ...

  6. MySQL条件检索_WHERE

    MySQL使用WHERE命令来限定数据查询条件. 语法:SELECT 属性1,属性2 FROM 表名 WHERE 条件1 OR 条件2 AND 条件3 说明:WHERE同样适用于UPDATE.DELE ...

  7. 算法(第四版)C# 习题题解——1.2

    写在前面 整个项目都托管在了 Github 上:https://github.com/ikesnowy/Algorithms-4th-Edition-in-Csharp 这一节内容可能会用到的库文件有 ...

  8. Bugku-CTF之网站被黑(这个题没技术含量但是实战中经常遇到)

    Day11   网站被黑   http://123.206.87.240:8002/webshell/    

  9. ARM基础

    ARM汇编:(APCS过程调用标准) 汇编:用助记符(如$ # .)代替操作码,用地址符号或标签代替地址码的编程语言 特点: 优点:可以直接访问硬件,目标代码简短,执行速度快(CPU启动时需要直接操作 ...

  10. 单元测试系列之一:如何使用JUnit、JaCoCo和EclEmma提高单元测试覆盖率

    更多原创测试技术文章同步更新到微信公众号 :三国测,敬请扫码关注个人的微信号,感谢!   原文链接:http://www.cnblogs.com/zishi/p/6726664.html -----如 ...