我们需要使用 DXL 在数据库中导入 SSJS 库。为此,我们编写了一个 Java 代理,其代码如下:
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();
}
}
}
}
文件C:\tempssjslib.xml包含我在 Domino Designer 中创建的 SSJS 库,然后使用“工具 > DXL 实用程序 > 导出器”导出(用于测试目的)。但是当我运行这个代理库时not导入到数据库中。没有错误DxlImporter.getLog()
also.
我尝试使用 XPage、Form、LotusScript 脚本库执行类似的过程,并成功导入它们。但同一个代理无法导入 SSJS 库。
代码中是否有我遗漏的内容?我们可以使用DXL将SSJS库导入数据库吗?
看起来导出器工具(或者甚至 DXLexporter)没有导出所有需要的字段。如果您手动将其添加到 dxl 文件中的 item name='$ServerJavaScriptLibrary'... 行之前,它将成功导入它。
<item name='$Flags'><text>.5834Q</text></item>
<item name='$TITLE'><text>...name of the SSJS library...</text></item>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)