How do you move ** all ** versions of files from one folder to another in Documentum using DFC

This code snippet moves all current versions of files from one folder to another, but leaves all older versions inactive. (The context is the Java DFC code to access 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 when 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 was that this code worked fine on our dev machine (windows), while it crashed on production (windows) (gave a link to the bug). Any ideas as to why this is acting as is and other codes to solve this problem would be great. Thank.

+2


source to share


1 answer


Based on a little information, it could be about anything, but I'm guessing it's a permissions issue. Specifically, the user executing this code does not have the proper permission to move one (or more) of the documents you are trying to move, or the user executing the code does not have sufficient rights to bind objects to the target folder.



+1


source







All Articles