SharePoint REST API - 同步SharePoint列表项
博客地址: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 | A 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 | A Contains element that defines custom filtering for the query. |
SharePoint REST API - 同步SharePoint列表项的更多相关文章
- SharePoint 2013 自定义翻页显示列表项
项目需求:自定义开发一个能分页显示列表项的小部件,允许左右翻页,能根据用户权限来显示管理链接等. 效果如下: 技术要求:使用sharepoint rest API 来获取列表项,这样性能高,能够快速响 ...
- 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 ...
- SharePoint REST API - 列表和列表项
博客地址:http://blog.csdn.net/FoxDave 本篇主要讲述如何用SharePoint REST操作列表和列表项.阅读本篇时请先了解前面讲述的REST介绍和基本操作. 废话不多 ...
- 复制SharePoint列表项(SPListItem)到另一个列表
从理论上讲,有一个简单到难以置信的解决办法:SPListItem提供了一个CopyTo(destinationUrl)方法(可参考MSDN).不幸的是,这个方法似乎用不了.至少对我的情况(一个带附件的 ...
- 每日学习心得:SharePoint 2013 自定义列表项添加Callout菜单项、文档关注、SharePoint服务端对象模型查询
前言: 前一段时间一直都比较忙,没有什么时间进行总结,刚好节前项目上线,同时趁着放假可以好好的对之前遇到的一些问题进行总结.主要内容有使用SharePoint服务端对象模型进行查询.为SharePoi ...
- 好神奇的代码,可以让匿名用户对特定SharePoint 列表拥用添加列表项的权限哦
如果你不使用代码,很难从界面上去设置列表的匿名用户(如果可以请告诉我,我会自动删除这个博文)拥有列表项的添加权限. 其实这种需求是非常必要的,比如: 1.允许新用户去提交一个注册申请, 2.在召集临时 ...
- SharePoint 2010 列表项事件接收器 ItemAdded 的使用方法
列表项事件处理器是继承于Microsoft.SharePoint.SPItemEventReceiver的类,Microsoft.SharePoint.SPItemEventReceiver类提供了许 ...
- [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表
写在前面 最近对文档库的知识点进行了整理,也就有了这篇文章,当时查找这些接口,并用在实践中,确实废了一些功夫,也为了让更多的人走更少的弯路. 系列文章 sharepoint环境安装过程中几点需要注意的 ...
- SharePoint 列表项通过自定义WebService读取
简述:给其他系统提供集成,发现SharePoint自带的WebService各种不好使,索性就自己写一点,也当做自己学习的记录了.当然内容比较简单,希望大侠们不要介意,也不要骂我啊.好了,进入正题吧. ...
随机推荐
- Windbg程序调试系列1-常用命令说明&示例
Windbg程序调试是.Net高级开发需要掌握的必备技能,分析内存泄露.分析高CPU.分析线程阻塞.分析内存对象.分析线程堆栈.Live Dedugging.这个领域可以说一个技能+场景化应用的结合, ...
- webform-AJAX
AJAX = 异步 JavaScript和XML(标准通用标记语言的子集).AJAX 是一种用于创建快速动态网页的技术. 通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新.这意味着 ...
- flask_mail发送163邮件,报553错误的原因
最近在练习用flask_mail发送163邮件时报错: reply: '553 authentication is required,163 smtp9,DcCowAD3eEQZ561caRiaBA- ...
- yaf
一.yaf使用自定义的类 Yaf的library和model的文件命名规则和调用:https://www.cnblogs.com/leedom/p/9396138.html 安装参考: https:/ ...
- 剑指offer(52)正则表达式的匹配
题目描述 请实现一个函数用来匹配包括'.'和'*'的正则表达式.模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次). 在本题中,匹配是指字符串的所有字符匹配整个模式 ...
- 结构体(struct)
结构体 结构体是将不同类型的数据按照一定的功能需求进行整体封装,封装的数据类型与大小均可以由用户指定. 1 结构体的声明.定义及初始化 1.1 声明结构体类型 struct 结构体名 { 成员列表: ...
- Python实战:网络爬虫都能干什么?
整站下载器:siteSucker https://blog.csdn.net/l_215851356/article/details/54377582 http://python.jobbole.co ...
- Jenkins安装及配置
Jenkins 简介 Jenkins 是一个开源项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能.它的功能包括: 1.持续的 ...
- k-mean 拐点
n = 100g = 6 set.seed(g)d <- data.frame(x = unlist(lapply(1:g, function(i) rnorm(n/g, runif(1)*i^ ...
- 用docker-compose部署postgres+ postgis
20190411更新.之前写的太啰嗦,也不删了,重新来.小坑还是有的 psql 命令行客户端 因为postgres用docker镜像安装,所以host不需要安装pg,只需要安装客户端 sudo apt ...