We need to import a SSJS library in a database using DXL. For this we have written a Java Agent and its code goes something like this:
import lotus.domino.*;
public class JavaAgent extends AgentBase {
private DxlImporter importer = null;
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
String filename = "C:\\tempssjslib.xml";
Stream stream = session.createStream();
if (stream.open(filename) & (stream.getBytes() > 0)) {
Database importdb = session.getCurrentDatabase();
importer = session.createDxlImporter();
importer.setReplaceDbProperties(true);
importer.setReplicaRequiredForReplaceOrUpdate(false);
importer.setAclImportOption(DxlImporter.DXLIMPORTOPTION_REPLACE_ELSE_IGNORE);
importer.setDesignImportOption(DxlImporter.DXLIMPORTOPTION_REPLACE_ELSE_CREATE);
importer.importDxl(stream, importdb);
}
} catch (Exception e) {
e.printStackTrace();
}
finally {
try {
System.out.println(importer.getLog());
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
The file C:\tempssjslib.xml contains a SSJS library which I created in Domino Designer and then exported using "Tools > DXL Utilities > Exporter" (for testing purpose). But when I run this agent library does not get imported in the database. There is no error in DxlImporter.getLog()
also.
I tried similar procedure with XPages, Form, LotusScript script library and was successfully able to import them. But the same agent is not able to import SSJS library.
Is there something that I have missed in the code? Can we import SSJS library in database using DXL?