使用 SharePoint 3 和 SharePoint 移动文档时出现错误 FrontPage 扩展

发布于 2024-07-26 21:16:50 字数 1404 浏览 7 评论 0 原文

首先,一个简单的问题 - 有没有人有过以编程方式重命名/移动 SharePoint 目录结构中的文件夹的经验?

背景:

我继承了一些工作,并且正在努力修复其中的一些缺陷。 大多数情况下一切进展顺利,但有一个问题让我头疼不已。

该应用程序是一个带有 SharePoint 3 文档存储的 ASP.NET Web 应用程序 (C#)。 应用程序在服务器上维护文件夹结构,文件夹的名称取决于应用程序内的数据并且可以更改(实时)。

当前的方法是使用 FrontPage 扩展来处理对 SharePoint 的某些请求,如下所述:http://msdn.microsoft.com/en-us/library/ms443099.aspx

目前,如果文件夹不存在,则文件夹将正确重命名,但如果存在,则会抛出一个错误(逻辑上也是如此)。 在这种情况下,我们希望将文件夹的内容移动到现有文件夹中。 从文档来看,我相信我们的方法应该有效……但事实并非如此,所以我希望有一些可以轻松修改的东西。

代码:

const string renameOption = "findbacklinks";
const string putOption = "overwrite,createdir,migrationsemantics";
string method = "method=move+document%3a12.0.4518.1016&service_name=%2f&oldUrl={0}&newUrl={1}&url_list=[]&rename_option={2}&put_option={3}&docopy={4}";

method = String.Format(method, oldUrl, newUrl, renameOption, putOption, bool.FalseString.ToLower());
// then submit and handle the request

我尝试修改上面的放置选项,并且认为上面的“覆盖”选项会阻止我们收到的错误消息,其核心是:

method=move document:12.0.0.6219
status=131097
osstatus=0
msg=Cannot rename value to value: destination already exists.

我的首选方法是让上面的实现正常工作,而不是使用其他技术进行完全重写(当然,如果上述内容存在根本缺陷,我知道可能需要重写)。

从我所做的研究来看,这是一项有些困难的任务,并且任何方法都存在复杂性?

谢谢 克里斯

Firstly, the simple question - has anyone had any experience programmatically renaming/moving a folder in a directory structure in SharePoint?

The background:

I have inherited some work, and am in the throws of fixing a few defects in it. For the most part things are going well, but there is one issue that I am banging my head against the wall on.

The application is an ASP.NET web application (C#) with a SharePoint 3 document store. The application maintains a folder structure on the server, the names of the folder are dependant on data within the application and can be changed (in real time).

The current approach has been to use the FrontPage extensions to handle some of the requests to SharePoint, as documented here: http://msdn.microsoft.com/en-us/library/ms443099.aspx

Currently a folder will correctly be renamed if the folder does not exist, but if it does exist it will throw an error (and logically so). In this case we want to MOVE the contents of the folder into the existing folder. From the documentation I believe our approach should work...... but it doesn't, so I am hoping there is something that can be easily modified.

The code:

const string renameOption = "findbacklinks";
const string putOption = "overwrite,createdir,migrationsemantics";
string method = "method=move+document%3a12.0.4518.1016&service_name=%2f&oldUrl={0}&newUrl={1}&url_list=[]&rename_option={2}&put_option={3}&docopy={4}";

method = String.Format(method, oldUrl, newUrl, renameOption, putOption, bool.FalseString.ToLower());
// then submit and handle the request

I have tried modifying the above put options, and would have thought the above "overwrite" options would have prevented the error message we recieve, the guts of which is:

method=move document:12.0.0.6219
status=131097
osstatus=0
msg=Cannot rename value to value: destination already exists.

My preferred approach would be to get the above implementation to work, rather then a complete re-write using other techniques (although of course if there is a fundamental flaw in the above I understand a re-write may be needed).

From what research I have done it would appear this is a somewhat difficult task, and there are complexities in any approach?

Thanks
Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪花飘飘的天空 2024-08-02 21:16:51

我相信 move document 方法仅适用于同一列表,不适用于在位置之间移动。 它确实应该被称为重命名文档。 这可以解释为什么您收到“目的地已存在”错误。

HubKey 公司似乎已经开发了一个免费的测试版库,如果您 阅读此帖子的评论

就我个人而言,我会开发一个自定义 Web 服务来执行此操作(事实上,我认为我根本不会使用 RPC 东西)。 这是您的选择吗?

I believe that the move document method only works within the same list and isn't for moving between locations. It should really be called rename document. This would explain why you are receiving the 'destination already exists' error.

It appears that the company HubKey have developed a free beta library available that does this if you read the comments to this post.

Personally, I would develop a custom web service that does this (in fact I don't think I'd use the RPC stuff at all). Is this an option for you?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文