Note that there are some explanatory texts on larger screens.

plurals
  1. POImport SSJS script library using DXL in a database
    text
    copied!<p>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:</p> <pre><code>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) &amp; (stream.getBytes() &gt; 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(); } } } } </code></pre> <p>The file <strong>C:\tempssjslib.xml</strong> 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 <strong>not</strong> get imported in the database. There is no error in <code>DxlImporter.getLog()</code> also.</p> <p>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.</p> <p>Is there something that I have missed in the code? Can we import SSJS library in database using DXL?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload