try
{
IDfSessionManager sessionMgr = null;
IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
sessionMgr = client.newSessionManager();
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser("asdadad");
loginInfoObj.setPassword("dsadasdsa");
sessionMgr.setIdentity("XXX", loginInfoObj);
IDfSessionManager sesMgr = sessionMgr;
IDfSession session = sesMgr.getSession("XXX");
System.out.println("Session Created");
IDfExportOperation eo = clientx.getExportOperation();
IDfQuery query=clientx.getQuery();
IDfXmlQuery xmlQuery=clientx.getXmlQuery();
query.setDQL("SELECT * FROM doc_type where r_object_id='XXXXXXXXXX'");
IDfCollection collection=query.execute(session,IDfQuery.DF_READ_QUERY);
while(collection.next())
{
String docId=collection.getString("r_object_id");
IDfId idObj = clientx.getId(docId);
IDfDocument myObj = (IDfDocument)session.getObject(idObj);
IDfExportNode node = (IDfExportNode)eo.add(myObj);
node.setFilePath("D:/XXX/"+ myObj.getObjectName() + "."+myObj.getContentType());
if (eo.execute()) {
System.out
.println("Export operation successful.");
} else {
System.out.println("Export operation failed.");
}
xmlQuery.includeMetaData(true);
xmlQuery.setDql("select * from doc_type where r_object_id='"+docId+"'");
xmlQuery.includeContent(false);
xmlQuery.execute(IDfQuery.DF_READ_QUERY,session);
FileOutputStream fos = new FileOutputStream("D:/XXX/"+myObj.getObjectName()+".xml");
xmlQuery.getXMLString(fos);
fos.flush();
fos.close();
}
}catch(DfException e)
{
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
{
IDfSessionManager sessionMgr = null;
IDfClientX clientx = new DfClientX();
IDfClient client = clientx.getLocalClient();
sessionMgr = client.newSessionManager();
IDfLoginInfo loginInfoObj = clientx.getLoginInfo();
loginInfoObj.setUser("asdadad");
loginInfoObj.setPassword("dsadasdsa");
sessionMgr.setIdentity("XXX", loginInfoObj);
IDfSessionManager sesMgr = sessionMgr;
IDfSession session = sesMgr.getSession("XXX");
System.out.println("Session Created");
IDfExportOperation eo = clientx.getExportOperation();
IDfQuery query=clientx.getQuery();
IDfXmlQuery xmlQuery=clientx.getXmlQuery();
query.setDQL("SELECT * FROM doc_type where r_object_id='XXXXXXXXXX'");
IDfCollection collection=query.execute(session,IDfQuery.DF_READ_QUERY);
while(collection.next())
{
String docId=collection.getString("r_object_id");
IDfId idObj = clientx.getId(docId);
IDfDocument myObj = (IDfDocument)session.getObject(idObj);
IDfExportNode node = (IDfExportNode)eo.add(myObj);
node.setFilePath("D:/XXX/"+ myObj.getObjectName() + "."+myObj.getContentType());
if (eo.execute()) {
System.out
.println("Export operation successful.");
} else {
System.out.println("Export operation failed.");
}
xmlQuery.includeMetaData(true);
xmlQuery.setDql("select * from doc_type where r_object_id='"+docId+"'");
xmlQuery.includeContent(false);
xmlQuery.execute(IDfQuery.DF_READ_QUERY,session);
FileOutputStream fos = new FileOutputStream("D:/XXX/"+myObj.getObjectName()+".xml");
xmlQuery.getXMLString(fos);
fos.flush();
fos.close();
}
}catch(DfException e)
{
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}