ViewAttributes递归范围不工作SharePoint 2013 CAML查询以递归方式从文档库中提取所有文件 [英] ViewAttributes Recursive Scope not working SharePoint 2013 CAML Query to fetch all files from document library recursively

查看:146
本文介绍了ViewAttributes递归范围不工作SharePoint 2013 CAML查询以递归方式从文档库中提取所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a document library SP 2013 and want to get all the documents from all folders and sub folders. I don't want any folders but I do want to get all the files from each folder.

Using SP 2010 U2U CAML Builder, I have made below query:

<pre lang="xml">
<query>
<QueryOptions>
        <ViewAttributes Scope="Recursive" />
    </QueryOptions> 
</query>





此查询适用于SP 2010中的库,但它不适用于SP 2013



以下是从SP 2013库中获取数据的代码





This query is working fine with libraries in SP 2010, but it is not working with SP 2013

Below is the code for fetching data from SP 2013 library

CAMLQuery = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>\
  <soapenv:Body>\
    <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\
      <listName>My Document Library</listName>\
<query>\
<QueryOptions>\
        <ViewAttributes Scope="Recursive" />\
    </QueryOptions> \
</query>\
    </GetListItems>\
  </soapenv:Body>\
</soapenv:Envelope>";

$.ajax({
    url: "https://<server>/teams/<siteName>/_vti_bin/lists.asmx",
    type: "POST",
    dataType: "xml",
    data: CAMLQuery,
    complete: getGrid,
    contentType: "text/xml; charset=\"utf-8\""
});





getGrid在完成时是回调函数



请帮帮我。



getGrid is callback function on completion

Please help me with this.

推荐答案

.ajax({
url:https://< server> / teams /< ; siteName> / _ vti_bin / lists.asmx,
类型:POST,
dataType:xml,
数据:CAMLQuery,
完成:getGrid,
contentType:text / xml; charset = \utf-8 \
});
.ajax({ url: "https://<server>/teams/<siteName>/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: CAMLQuery, complete: getGrid, contentType: "text/xml; charset=\"utf-8\"" });





getGrid是完成后的回调函数



请帮帮我。



getGrid is callback function on completion

Please help me with this.


这篇关于ViewAttributes递归范围不工作SharePoint 2013 CAML查询以递归方式从文档库中提取所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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