Skip Ribbon Commands
Skip to main content

Documentum Resources

:

Code Samples: DFC - checkin to the next major version

Documentum Resources
public static void doCheckin( String strPath, IDfSession session ) throws DfException {
    IDfClientX clientx = new DfClientX();
IDfCheckinOperation operation = clientx.getCheckinOperation();

IDfSysObject sysObj = (IDfSysObject) session.getObjectByPath( strPath );
if( sysObj == null ) {
System.out.println("Object " + strPath + " can not be found.");
return;
}

if (sysObj.isCheckedOut() == false) {
System.out.println("Object " + strPath + " is not checked out.");
return;
}

IDfCheckinNode node;
if( sysObj.isVirtualDocument() ) {
IDfVirtualDocument vDoc = sysObj.asVirtualDocument( "CURRENT", false );
node = (IDfCheckinNode)operation.add(vDoc);
} else {
node = (IDfCheckinNode)operation.add(sysObj);
}

//Other options for setCheckinVersion: VERSION_NOT_SET, NEXT_MAJOR,
// NEXT_MINOR, BRANCH_VERSION
operation.setCheckinVersion(IDfCheckinOperation.NEXT_MAJOR);
operation.execute();

}​