IBM Content Manager on Demand (CMOD) is a Enterprise Content Management system which enables to archive resource files and retrieve them whenever required. It has two different methods to access the resources.
As part of my work I had to retrieve Default values of Fields specified in each Application Group in their respective Folder so that any external application can make use of the Default Values.
After some googling and trial and error I found out that it can be done using the ODCriteria.getSearchValues() method which would return a String array of Default values per field. The following code does the required.
- A Set of Executable Files (.EXE or .OUT) which can be used to manage the resources.
- On Demand Web Enable Kit (ODWEK) which is an API which can be used by any external application.
As part of my work I had to retrieve Default values of Fields specified in each Application Group in their respective Folder so that any external application can make use of the Default Values.
After some googling and trial and error I found out that it can be done using the ODCriteria.getSearchValues() method which would return a String array of Default values per field. The following code does the required.
import java.util.Enumeration;
import com.ibm.edms.od.ODConfig;
import com.ibm.edms.od.ODCriteria;
import com.ibm.edms.od.ODFolder;
import com.ibm.edms.od.ODServer;
/**
* ODWEK Testing Class
*
* @author Shazin Sadakath
*
*/
public class ODWEKTest {
public static void main(String[] args) {
ODConfig odConfig = new ODConfig();
ODServer server = new ODServer(odConfig);
server.setUserId("administrator");
server.setPassword("1234567");
server.setPort(12238);
server.setServerName("localhost");
try {
server.initialize("ODPing");
server.logon();
Enumeration<ODFolder> folders = server.getFolders();
if(folders != null) {
while(folders.hasMoreElements()) {
ODFolder folder = folders.nextElement();
try {
folder.open();
} catch(Exception e) {
continue;
}
System.out.println("Folder : "+folder.getName());
Enumeration<ODCriteria> fields = folder.getCriteria();
while(fields.hasMoreElements()) {
ODCriteria field = fields.nextElement();
System.out.println("\tField : "+field.getName());
String[] fixedValues = field.getSearchValues();
if(fixedValues != null) {
for(String dv:fixedValues) {
System.out.println("\t\tDefault Value : "+dv);
}
}
}
folder.close();
}
}
} catch(Exception e) {
e.printStackTrace();
} finally {
try {
server.logoff();
} catch (Exception e) {
e.printStackTrace();
}
server.terminate();
}
}
}
Thank you so significantly for your personal decent suggestion.I am going to give it a have a go with.document management systems
ReplyDelete