DFC 6.5 SP2 - checkout / checkin and replace content
Based on one of our process requirements, we need to create a major version of an object and replace the content with another object.
I know it's possible using the combination of the following methods / classes
IDfCheckOut and IDfCheckIn operations and use IDFSysObject's getContent and setContent methods.
Before I jump into it, I wanted to check with all the experts out there, is there an efficient / better way of doing this ? is there a way to replace the next major version an object with another object ? (both in documentum) or something completely different ??
E.g
object A - version 1.0
object B - version 1.0
after the "magic" process
object A - version 2.0 (with the content of object - doesn't matter what happens to object B, if its still a separate object.
Thanks a lot in advance.
Comments
-
Hi Fenil,
The procedure you have mentioned in standard process. Please see the below api for CheckIn:
checkin
IDfId checkin(boolean keepLock, String versionLabels) throws DfException
- Creates a new version of this object and removes the lock from the previous version. To use the
checkin
method, the following conditions must be met:- The object must have been retrieved from the repository with a checkout method.
- The user must have at least Version permission on the object.
- The user must have at least Write permission on the cabinet or folder in which the object is stored if the repository is running with folder security.
checkin
method unlocks an object and saves any changes you may have made to either its attributes or its content. (Note that to make changes to the content, you must issue explicit methods, such asgetFile
andsetFile
, to get and set the content after youcheckout
the object and before you issue thecheckin
).Executing this method clears the object's r_lock_machine, r_lock_owner, and r_lock_date attributes and sets the a_archive attribute to FALSE. Additionally, if the object is a policy object, the method sets the r_definition_state to DRAFT for the new version and clones the following attributes:- entry_criteria_id
- user_criteria_id
- action_object_id
- user_action_id
- type_override_id
The following code example demonstrates how to checkin an object using the default version labels, and to not retain a lock on the newly created version:IDfSysObject sysObj = (IDfSysObject)sess.getObject(new DfId("0900d5bb8001fd49")); if (sysObj.isCheckedOut()) { sysObj.setFile(sysObj.getObjectName()); IDfId newSysObjId = sysObj.checkin(false, ""); }
- Parameters:
keepLock
- set totrue
to place a lock on the newly created version.versionLabels
- defines the version label for the new version. You can specify more than one label. If you do not define a label, the server automatically gives the new version an implicit version label and the symbolic label "CURRENT".- Returns:
- the object id of the new version of the object.
- Throws:
<a _jive_internal="true" href="/com/documentum/fc/common/DfException.html" title="class in com.documentum.fc.common">DfException</a>
- if a server error occurs.
Thanks and Regards,
Amit G
0 - Creates a new version of this object and removes the lock from the previous version.
-
You can use IDfSysobject.bindFile if your sysobjects have same content-type
0 -
PanfilovAB wrote:
You can use IDfSysobject.bindFile if your sysobjects have same content-typePanfilovAB - Just for my info. What will happen to object A's content if you update (check-in with new content) content of objects B, which are bind? Will it then split the content in to two separate physical content? or it will change the content of second object as well with the same content and keeps only single physical content at all times?
0 -
This link may answer your question
EMC Documentum Platform Essentials: How to set the same content on multiple objects
0 -
Ahmad Sakhi wrote:
What will happen to object A's content if you update (check-in with new content) content of objects B, which are bind?Nothing
0 -
Content Server always creates a new dmr_content object (even if you checkin as same version) and never overwrites files on the file system. So if two objects share a dmr_content file, after changing one of them, the latter will point to a new dmr_content object and file. So there are no issues here.
In other words, bindfile is just an technical optimisation and doesn't have any functional impact.
0 -
Thanks for the info, Hacham. So, even the two objects have now two separate dmr_content. Now the underlying actual physical content (Document) on the filestore as well duplicated (one for each object?), correct? If yes, then my question was is this 'copy' of content happens when you bind? or when you do a 'check-in' of one of the two objects with new content?
0 -
So I did a few test myself and this is what I observed.
1)
object 1 = TestA (Doc1.pdf)
object 2 = TestB (Doc2.pdf)
2)
did a bindfile of the two objects TestA as target. Now
object 1 = TestA (Doc2.pdf)
object 2 = TestB (Doc2.pdf)
3)
Now I did a checkout of TestB (with content Doc3.pdf), and result
object 1 = TestA (Doc2.pdf)
object 2 = TestB (Doc3.pdf)
4)
Now I did a check out of TestA (with content Doc4.pdf), and result
object 1 = TestA (Doc4.pdf)
object 2 = TestB (Doc3.pdf)
So, it seems that when bind happens, both objects have the same content, but when any one of the objects is checked in with new content, they no longer have the same content. Exactly what you two suggested. Thanks guys.
But one thing is still not clear to me. In step 2) when we do bindfile, does the content server create a copy of the physical document (Doc2.pdf) in the filestore? or the same document is referenced by both objects?
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories