Hi friends
While Programmatically checkin as virtual document, the document is not checking in. And its not showing any error also
And the virtual document have 2 child.How to checkin the virtual document with 2 child
Pl solve my issue
Regards
Mani
My code
public class PCreateMinorVersion implements IActionExecution{public String [] getRequiredParams(){System.out.println("this is getRequiredParams method..");return new String[] { "objectId" };}
public boolean execute(String strAction, IConfigElement config, ArgumentList args, Context context, Component component, Map completionArgs){ try { System.out.println("this is execute method.."); String strObjectId = args.get("objectId"); System.out.println("object id is .."+strObjectId); IDfSession dfsession =component.getDfSession(); System.out.println("Created Sysobject"); IDfDocument doc =(IDfDocument) dfsession.getObject(new DfId(strObjectId)); IDfClientX clientx = new DfClientX(); IDfCheckoutOperation coOp = clientx.getCheckoutOperation(); coOp.setDestinationDirectory("C:\\"); IDfCheckoutNode node; if(doc.isVirtualDocument() ) { IDfVirtualDocument vDoc = doc.asVirtualDocument( "CURRENT", false ); IDfCheckoutNode coNode = (IDfCheckoutNode)coOp.add(doc); } if (coOp.execute()) { System.out.println("Successfully checked out file ID: " +strObjectId); } else { System.out.println("Checkout failed."); } System.out.println("Checkout the document .."); IDfClientX clientx1 = new DfClientX(); IDfCheckinOperation cio = clientx1.getCheckinOperation(); cio.setCheckinVersion(1); cio.setKeepLocalFile(false); cio.setRetainLock(false);
IDfCheckinNode node=null;
if( doc.isVirtualDocument() ) {
IDfVirtualDocument vDoc = doc.asVirtualDocument( "CURRENT", false );
node = (IDfCheckinNode)cio.add(vDoc);
}
else
{
node = (IDfCheckinNode)cio.add(doc);
if (doc.isCheckedOut() == true) { boolean ret = cio.execute(); System.out.println("entered into checkout operation"+ret); if (ret) System.out.println("Checkin Suceeded"); else System.out.println("Checkin Failed"); } System.out.println("Checkin the document .."); IDfId newId=node.getNewObjectId(); System.out.println("NewId"+newId); IDfSysObject sysObj =(IDfSysObject)dfsession.getObject(newId); IDfId folderId=sysObj.getFolderId(0); String folderPath=FolderUtil.getFullFolderPathFromIds(folderId.toString()); sysObj.unlink(folderPath); sysObj.link("/Cabinetname/Folder"); sysObj.save(); System.out.println("Linked to Draft Folder"); } catch(Exception ex) { System.out.println("Exception"+ex); } return true; } }
Pl solve my problem,, VD is checkout fine but not checkin.... No error also
@mani.esakky Hi There.. were u able to resolve the above mentioned issue? We are facing a similar one