Hi
I’m trying to import some DXL into a notes database using a java agent. Basically I have a database that contains documents. I export the documents to a file and then want to import them. I want to be able to change the contents in the file and re-import the dxl data with the changes
The trouble is the DxlImporter.DXLIMPORTOPTION_UPDATE_ELSE_CREATE is not working as exptected. When running the agent on my client I keep on getting the following stack trace:
NotesException: DXL importer operation failed
at lotus.domino.local.DxlImporter.NimportDxlString(Native Method)
at lotus.domino.local.DxlImporter.importDxl(Unknown Source)
at JavaAgent.NotesMain(JavaAgent.java:36)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(NotesThread.java:208)
Not much to go on as you can see. When I remove the DXLIMPORTOPTION_UPDATE_ELSE_CREATE code the agent works fine, but creates a new document in the database which isn’t what I wanted. I’ve tried to fiddle around with the DXL and have more or less removed all of the exported nodes, but still it won’t import with the flag set. Am I missing something here?
This is the agent I’ve created:
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
FileInputStream input = new FileInputStream(“c:/dxl.xml”);
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = reader.readLine()) != null) {
buffer.append(line);
}
reader.close();
input.close();
DxlImporter importer = session.createDxlImporter();
importer.setDocumentImportOption(DxlImporter.DxlImporter.DXLIMPORTOPTION_UPDATE_ELSE_CREATE);
importer.importDxl(buffer.toString(), db);
session.recycle();
Any ideas?