use of org.openntf.nsfodp.commons.odp.LotusScriptLibrary in project org.openntf.nsfodp by OpenNTF.
the class ODPCompiler method importLotusScriptLibraries.
private void importLotusScriptLibraries(NDXLImporter importer, NDatabase database) throws Exception {
subTask(Messages.ODPCompiler_importingLotusScript);
List<Integer> noteIds = new ArrayList<>();
for (LotusScriptLibrary lib : odp.getLotusScriptLibraries()) {
Document dxlDoc = lib.getDxl();
String script = lib.getSource();
int chunkSize = 60 * 1024;
for (int startIndex = 0; startIndex < script.length(); startIndex += chunkSize) {
int endIndex = Math.min(startIndex + chunkSize, script.length());
String scriptChunk = script.substring(startIndex, endIndex);
// $NON-NLS-1$
Element el = DXLUtil.writeItemString(dxlDoc, "$ScriptLib", false, scriptChunk);
// $NON-NLS-1$ //$NON-NLS-2$
el.setAttribute("sign", "true");
// $NON-NLS-1$ //$NON-NLS-2$
el.setAttribute("summary", "false");
}
noteIds.addAll(importDxl(importer, NSFODPDomUtil.getXmlString(dxlDoc, null), database, MessageFormat.format(Messages.ODPCompiler_lotusScriptLabel, odp.getBaseDirectory().relativize(lib.getDataFile()))));
}
compileLotusScript(database, noteIds, true);
}
Aggregations