Sie sind auf Seite 1von 7

Assignment 6 (4-5-2007)

Date:4-5-2007
Subject:
Examples

1)Creating Virtual Document:

import com.documentum.com.*;
import com.documentum.fc.client.*;
import com.documentum.fc.common.*;
import com.documentum.operations.*;

public class CancelCheckout


{
public static void main(String args[])
{
try
{
IDfClient client=new DfClient().getLocalClient();
IDfClientX clientx=new DfClientX();
IDfLoginInfo logininfo=clientx.getLoginInfo();
IDfSessionManager smanager=client.newSessionManager();
logininfo.setUser("Murali");
logininfo.setPassword("murali1");
smanager.setIdentity("goldeneye",logininfo);
IDfSession session=smanager.getSession("goldeneye");
//IDfCheckoutOperation IOP=clientx.getCheckoutOperation();

IDfSysObject sys=(IDfSysObject)session.getObjectByPath("/MuraliT4/sri");

IDfSysObject Ch1 =
(IDfSysObject)session.getObjectByPath("/MuraliT4/mmm");
System.out.println(sys);
if(sys.isVirtualDocument())
{

if(sys == null)
{
System.out.println("no specified object");
}
System.out.println(sys);
if(Ch1==null)
{
System.out.println("no object specified");
}

//System.out.println("virtual document found");


}
else
{
System.out.println("it is not a virtual document");
}

IDfVirtualDocument VD=sys.asVirtualDocument("CURRENT",false);
System.out.println(VD);
IDfVirtualDocumentNode VDC=VD.getRootNode();
//VDC.getAssemblyParent()
sys.checkout();

System.out.println(VD.getRootNode());
// System.out.println(VDC.getParent());
//System.out.println(VDC.getAssemblyParent());
boolean followAssembly = false;
boolean overrideLateBindingValue = false;
IDfVirtualDocumentNode nodeChild =
VD.addNode(VDC,null,Ch1.getChronicleId(),"CURRENT",followAssembly,overri
deLateBindingValue);
sys.save();

//sys.checkout();
// sys.getObjectName();
//VD.addNode(VDC,sys);
//sys.save();
//System.out.println("virtual Document was Created");
}
catch(Exception e)
{
e.printStackTrace();
}

}
2)Creating Cancel Checkout operation:

import com.documentum.com.*;
import com.documentum.fc.client.*;
import com.documentum.fc.common.*;
import com.documentum.operations.*;

public class CancelCheckout


{
public static void main(String args[])
{
try
{
IDfClient client=new DfClient().getLocalClient();
IDfClientX clientx=new DfClientX();
IDfLoginInfo logininfo=clientx.getLoginInfo();
IDfSessionManager
smanager=client.newSessionManager();
logininfo.setUser("Murali");
logininfo.setPassword("murali1");
smanager.setIdentity("goldeneye",logininfo);
IDfSession session=smanager.getSession("goldeneye");
IDfCancelCheckoutOperation
ICC=clientx.getCancelCheckoutOperation();
IDfSysObject
sys=(IDfSysObject)session.getObjectByPath("/MuraliT4/Xml/s
amplechild");
ICC.add(sys);
ICC.execute();
catch(Exception e)
{
e.printStackTrace();
}

3) Check in and check out of particular virtual document.

import com.documentum.com.*;
import com.documentum.fc.client.*;
import com.documentum.fc.common.*;
import com.documentum.operations.*;

public class ChekinCheckout


{
public static void main(String args[])
{
try
{
IDfClient client=new DfClient().getLocalClient();
IDfClientX clientx=new DfClientX();
IDfLoginInfo logininfo=clientx.getLoginInfo();
IDfSessionManager smanager=client.newSessionManager();
logininfo.setUser("Murali");
logininfo.setPassword("murali1");
smanager.setIdentity("goldeneye",logininfo);
IDfSession session=smanager.getSession("goldeneye");

IDfCheckinOperation operation = clientx.getCheckinOperation();


IDfCheckoutOperation op=clientx.getCheckoutOperation();
IDfSysObject
sys=(IDfSysObject)session.getObjectByPath("/MuraliT4/ch1");

if( sys == null )


{
System.out.println("Object can not be found.");

if (sys.isCheckedOut() == false)
{
System.out.println("Object is not checked out.");
op.add(sys);
op.execute();
System.out.println("object Checked out Successfully");
}
else
{
System.out.println("object is checked out");
operation.add(sys);
operation.execute();
System.out.println("object checkin successfully");
}
/* IDfCheckinNode node;
if( sys.isVirtualDocument() )
{
IDfVirtualDocument vDoc =
sys.asVirtualDocument( "CURRENT", false );

System.out.println("object is Virtual Document");


node = (IDfCheckinNode)operation.add(vDoc);

}
else
{
System.out.println("object is not Virtual Document");
node = (IDfCheckinNode)operation.add(sys);
}

System.out.println(node);*/
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

4)Difference between SessionManager and Session

Session SessionManager
Session is an object that SessionManager is an object
implements the IDfSession that implements the
interface IDfSessionManager interface
A session gives a specific user A session manager running
to specific docbase with an application,manages
session with one or more
docbases.
A session is used to maintain Use the new sessionManager
a client state across series of method of IDfClient to obtain
request from the same user a sessionmanager.
over some period of time
Using the Session we can A session manager associated
associate cabinet, folder, with DMCL connection
Document by pooling capablity
getObjectBypath method

5).Packages,Interfaces,Classes,Methods.
Packages Interfaces Classes Methods
Com.documentum.com IDfClientX DfClientX getLocalclient
Com.documentum.fc.client IDfClinet,IDfSession,IDfSessionManager DfClient newSessionMa
newSession,set
Com.documentum.fc.common IDfLoginInfo setUser,setPas

Com.documentum.operations IDfCheckoutOperation,
CheckinOperation,Importoperation
Exportoperation,checkoutnode,
Checkinnode,importnode,exportnode