Hello all,
As my username, I am newer on Documentum and I would like to know,
How do I develop a script or java class to import doc from local file system to Documentum system without use webtop interface?
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
Hi,
1.You can create this class either by using composer or eclipse.
2.It's only a simple program u can execute it like all other java programs.Be sure that u hav included dfc.jar,dfcbase.jar and dctm.jar files in the
build path of eclipse.u need to include dfc.properties file in the project to point ur repository where the file to be imported.
Regards,
karthick s
import com.documentum.com.IDfClientX;import com.documentum.com.DfClientX;import com.documentum.fc.client.IDfClient;import com.documentum.fc.client.IDfSessionManager;import com.documentum.fc.client.IDfSession;import com.documentum.fc.common.IDfLoginInfo;import com.documentum.fc.common.DfException;import com.documentum.fc.common.IDfId;import com.documentum.fc.client.IDfSysObject;
public class ImportDocument{
public static void main(String[] args) { IDfClientX clientx = null; IDfClient client = null; IDfSessionManager sessionManager; IDfSession session=null; IDfLoginInfo loginInfo; String repository = "docbasename"; String userName = "username"; String password = "password"; try{ clientx = new DfClientX(); client = clientx.getLocalClient(); sessionManager = client.newSessionManager(); loginInfo = clientx.getLoginInfo(); loginInfo.setUser(userName); loginInfo.setPassword(password); loginInfo.setDomain(null); sessionManager.setIdentity(repository, loginInfo); session = client.newSession(repository, loginInfo); IDfSysObject sysObject = (IDfSysObject)session.newObject("dm_document"); sysObject.setObjectName("DocumentImported.doc"); // sysObject.setContentType("msw8"); sysObject.setFileEx("c:/DocumentImported1.doc", "msw8", 0, null); sysObject.link("/"+docbasename+"/First Folder"); sysObject.save(); }catch(DfException e){ System.out.println("Exception "+e); } finally{ try{ if(session.isConnected()){ System.out.println("session connected = "+session.isConnected()); session.disconnect(); System.out.println("session connected = "+session.isConnected()); } }catch(DfException ex){ System.out.println(ex); } } }
}
thank you for your quick help. I'll try and make a feedback
I have two stupid questions:
1- Can I create this class with the Composer or should I make it with standard (personnal) eclipse?
2- Where or how could I call this class to execute?
Note: be indulgent towards the newer on DOCUMENTUM