zoukankan      html  css  js  c++  java
  • 使用Web Service重命名一个文件夹

    官方文档已经有详细的说明了,就是有一个问题要注意:

    <Batch OnError="Continue" PreCalc="TRUE" ListVersion="0" ViewName="{EF2F5A21-0FD0-4654-84ED-112B4F5A48F8}">
       <Method ID="1" Cmd="Update">
          <Field Name="ID">3</Field>
          <Field Name="owshiddenversion">1</Field>
          <Field Name="FileRef">
             http://Server/[sites/][Site/]Shared 
             Documents/Folder</Field>
          <Field Name="FSObjType">1</Field>
          <Field Name="BaseName">Name</Field>
       </Method>
    </Batch>
    这里FileRef指的是文件夹修改之前的一个路径,而不是之后的。
    例如,你需要把Test文件夹改名为Test(Updated), 正确的CAML是:
    <Batch OnError="Continue" PreCalc="TRUE" ListVersion="0" ViewName="{EF2F5A21-0FD0-4654-84ED-112B4F5A48F8}">
       <Method ID="1" Cmd="Update">
          <Field Name="ID">3</Field>
          <Field Name="owshiddenversion">1</Field>
          <Field Name="FileRef">
             http://Server/[sites/][Site/]Shared 
             Documents/Test</Field>
          <Field Name="FSObjType">1</Field>
          <Field Name="BaseName">Test(Updated)</Field>
       </Method>
    </Batch>

    否则你会得到这样一个不知所云的错误

    <UpdateListItemsResult><Results><Result ID="1,Update"><ErrorCode>0x81020016</ErrorCode><ErrorText>Item does not exist

    The page you selected contains an item that does not exist.  It may have been deleted by another user.</ErrorText>

    SharePoint居然不仅仅用ID定位,无语了。

  • 相关阅读:
    思念
    Matlab与C++混合编程,添加OpenCV库
    重新启用此博客
    将博客搬至CSDN
    unity探索者之ILRuntime代码热更新
    unity探索者之UGUI圆形图片组件
    unity探索者之UGUI图片描边
    unity探索者之iOS微信登录、分享
    unity探索者之复制内容到剪贴板
    unity探索者之获取设备当前电量
  • 原文地址:https://www.cnblogs.com/lambertqin/p/1970895.html
Copyright © 2011-2022 走看看