如何使用 DFC 将文件的**所有**版本从 Documentum 中的一个文件夹移动到另一个文件夹

发布于 2024-08-06 05:34:49 字数 1213 浏览 9 评论 0原文

这段代码将文件的所有当前版本从一个文件夹移动到另一个文件夹,但不移动所有旧版本。 (上下文是 DFC 访问 Documentum 的 java 代码。)

 String strObjId = versionColl.getString("r_object_id");
        com.documentum.fc.common.IDfId curObjectID = new DfId(strObjId);
        IDfSysObject curObj = (IDfSysObject)sess.getObject(curObjectID);
        versionlabel = curObj.getAllRepeatingStrings("r_version_label", ",");
        System.out.println("Moving document with Name:" + objName + "  and version:" + versionlabel);
        if (runMode.equals("1")) {
         curObj.unlink(oldpath);
         curObj.link(newpath);
         curObj.setString("a_special_app", curObj.getString("r_modifier"));
         curObj.setTime("a_last_review_date", curObj.getTime("r_modify_date"));
         curObj.setString("a_category","MOVED");
         curObj.save();
         System.out.println("Successfully Moved document with Name:" + objName + " and version:" + versionlabel);
        }

我们在移动旧版本时遇到的错误是“文档不可变”。因此我们添加了这段代码,暂时禁用不可变标志,允许移动文件,然后将不可变标志重置为 true。

curObj.setBoolean("r_immutable_flag", false);

那么问题是这段代码在我们的开发机器(Windows)上完美运行,但在生产(Windows)上崩溃了(给出了链接错误)。任何关于为什么会这样的想法以及解决这个问题的其他代码都会很棒。谢谢。

This piece of code moves all current versions of files from one folder to another but leaves all older versions unmoved. (Context is java code of DFC accessing Documentum.)

 String strObjId = versionColl.getString("r_object_id");
        com.documentum.fc.common.IDfId curObjectID = new DfId(strObjId);
        IDfSysObject curObj = (IDfSysObject)sess.getObject(curObjectID);
        versionlabel = curObj.getAllRepeatingStrings("r_version_label", ",");
        System.out.println("Moving document with Name:" + objName + "  and version:" + versionlabel);
        if (runMode.equals("1")) {
         curObj.unlink(oldpath);
         curObj.link(newpath);
         curObj.setString("a_special_app", curObj.getString("r_modifier"));
         curObj.setTime("a_last_review_date", curObj.getTime("r_modify_date"));
         curObj.setString("a_category","MOVED");
         curObj.save();
         System.out.println("Successfully Moved document with Name:" + objName + " and version:" + versionlabel);
        }

The error we were getting while moving older versions was "document immutable". So we added this piece of code that temporarily disables the immutable flag, allows the file to be moved and then resets the immutable flag to true.

curObj.setBoolean("r_immutable_flag", false);

The problem then was that this code ran perfectly on our dev machine (windows) while it crashed on production(windows) (gave link error). Any ideas as to why this is acting as it is and other codes to solve this issue would be great. Thanks.

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

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

发布评论

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

评论(1

極樂鬼 2024-08-13 05:34:49

根据提供的少量信息,它可能是任何东西,但我的猜测是这是一个权限问题。具体来说,运行此代码的用户没有适当的权限来移动您尝试移动的一个(或多个)文档,或者运行该代码的用户没有足够的权限将对象链接到目标文件夹。

Based on the little info given, it could be just about anything but my guess is that it's a permissions issue. Specifically, the user running this code does not have the proper permissions to move one(or more) of the documents you are trying to move OR the user running the code does not have enough permissions to link objects to the target folder.

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