Friday, April 30, 2021

Connect to FileNet and get Object Store

Sample Code for connecting to FileNet and get domain, Object Store : 

 * Anything written in <> is has to be replaced with original value 

 String cpeURl = ":/****/>" 
 String username = "
 String password = "
 Connection conn = Factory.Connection.getConnection(cpeURl); 
 Subject subject = UserContext.createSubject(conn, username, password, ""); 
 uc = UserContext.get(); 
 uc.pushSubject(subject); 

 // domain 

 Configuration cfg; 

 String domainName = cfg.getDomain(); 
 Domain domain = Factory.Domain.fetchInstance(ceConnection, null, null); 

 // Object Store. 

 String objectStoreName = cfg.getObjStore(); 

 ObjectStore objectStore = Factory.ObjectStore.fetchInstance(domain, objectStoreName, null); 

 Thanks