Wednesday, 11 May 2016

Java Sample code to retrieve a custom object in FileNet

//Java Sample code to retrieve a custom object in FileNet

public void FetchCEObjects(Connection conn) {



try {
Domain domain = Factory.Domain.fetchInstance(conn, null, null);
ObjectStore objStore = Factory.ObjectStore.fetchInstance(domain,"OSNAME", null);
String customeObjectPath= "/Test/stuInfo022"; // Full Path of Custome Object

CustomObject myObject= Factory.CustomObject.fetchInstance(objStore,customeObjectPath, null);

 
String TitleName= myObject.get_Name();
System.out.println(TitleName+ " Name is retrieved");
 
com.filenet.api.property.Properties props = myObject.getProperties();
 
   String StuID = props.getStringValue("StuID");
String StuMailID= props.getStringValue("ICCMailUID");
Integer age = props.getInteger32Value("age");
Date dateCreated= props.getDateTimeValue(PropertyNames.DATE_CREATED);
Date JoiningDate= props.getDateTimeValue("JoiningDate");
 
   System.out.println("Student ID: " + StuID );
System.out.println("Student age: " + age);
System.out.println("Mail ID: " + StuMailID);
System.out.println("Date created: " + dateCreated);
System.out.println("Joining Date : " + JoiningDate);

} catch (Exception e) {

e.printStackTrace();
}
}

No comments:

Post a Comment