关于Office 365中Document ID生成有意思的一个小问题

最近给客户做一个SharePoint Migration项目,发现我们在Migration之前开启Document ID feature, Migration中有些文档的Document ID生成了很奇怪的URL。不但没有使用我们之前定义的前缀,而且显示也不是Document ID的格式,而是一个URL。经过联系微软客服,他们建议在Migration之后再开启Document ID feature并且让站点重新生成Document ID. 

之后我们发现这样生成Document ID就貌似比较稳定了,碰到问题的文件数量减少了很多。但是最后仍然小范围内发现一些文件的Document ID生成不了。经过各种比较,我们发现这些文件貌似有一个共同特点 - 只有0.1版本而且没有check in. 于是我们怀疑是不是这种Document不会生成Document ID.

经过对比测试,总结如下:

如果在开启Document ID feature的情况下,无论Document是否有check in version, 版本如何,只要上传Document的情况下,都会直接生成Document ID.

如果在上传文件的时候Document ID feature没有enable, 上传文件后再去enable feature并且生成Document ID:

  • 对于check in的文件,无论版本如何(测试中使用了0.1和1.0两个版本),都会生成Document ID.
  • 对于没有check in version的文件(0.1版本),这个文件不会生成Document ID.

很难确定这个算是微软就这样设计的还是这是SharePoint的一个小bug. 不过总算是通过测试,对这个问题有了一个结论,可以开心地过周末了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在rapidjson,可以通过以下步骤向一个document添加多个kv,并将document生成string: 1. 创建一个rapidjson::Document对象。 ```c++ rapidjson::Document doc; ``` 2. 向该对象添加多个key-value对,其key可以是一个字符串,也可以是一个整数。 ```c++ doc.SetObject(); // 将doc设为Object类型 rapidjson::Value key1("name", doc.GetAllocator()); // 定义一个key1,类型为字符串 rapidjson::Value value1("John", doc.GetAllocator()); // 定义一个value1,类型为字符串 doc.AddMember(key1, value1, doc.GetAllocator()); // 添加key1-value1对到doc rapidjson::Value key2("age", doc.GetAllocator()); // 定义一个key2,类型为字符串 rapidjson::Value value2(30, doc.GetAllocator()); // 定义一个value2,值为整数 doc.AddMember(key2, value2, doc.GetAllocator()); // 添加key2-value2对到doc ``` 3. 将该document对象转换成string。 ```c++ rapidjson::StringBuffer strbuf; // 定义一个StringBuffer对象 rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf); // 定义一个writer doc.Accept(writer); // 将doc写入buffer std::string str = strbuf.GetString(); // 从buffer获取生成的string ``` 完整代码如下: ```c++ #include <rapidjson/document.h> #include <rapidjson/writer.h> #include <rapidjson/stringbuffer.h> #include <iostream> int main () { rapidjson::Document doc; doc.SetObject(); rapidjson::Value key1("name", doc.GetAllocator()); rapidjson::Value value1("John", doc.GetAllocator()); doc.AddMember(key1, value1, doc.GetAllocator()); rapidjson::Value key2("age", doc.GetAllocator()); rapidjson::Value value2(30, doc.GetAllocator()); doc.AddMember(key2, value2, doc.GetAllocator()); rapidjson::StringBuffer strbuf; rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf); doc.Accept(writer); std::string str = strbuf.GetString(); std::cout << str << std::endl; return 0; } ``` 输出结果为: ```json {"name":"John","age":30} ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值