use of org.openntf.domino.design.impl.OnDiskProject in project org.openntf.domino by OpenNTF.
the class DesignClassTest method testDesignClass.
// @Test
public void testDesignClass() throws IOException {
Session sess = Factory.getSession(SessionType.CURRENT);
// Database db = sess.getDatabase("D:/Daten/notesdaten_9/localdb/empty.ns9");
// Database db = sess.getDatabase("D:/Daten/notesdaten_9/empty2.nsf");
// Database db = sess.getDatabase("D:/Daten/notesdaten_9/localdb/proglib4work2.nsf");
Database db = sess.getDatabase("srv-01-ndev2!!entwicklung/alex/proglib4work22.nsf");
testDb(db);
DatabaseDesign design = db.getDesign();
// -X = no AgentData
DesignCollection<DesignBase> elems = design.getDesignElements(//
"!@Contains($Flags;{X}) & !($TITLE={WEB-INF/classes/plugin/Activator.class}:{$BEProfileR7}) " + "");
// + "& @IsAvailable($ACLDigest) ");
// + "& @contains($TITLE;{gadproxy}) ");
System.out.println("Count: " + elems.getCount());
Path root = Paths.get("D:/daten/temp/ods3");
OnDiskProject odp = new OnDiskProject(root);
// PrintWriter pw = new PrintWriter(oFile);
for (DesignBase elem : elems) {
// + elem.getDocument().getItemValueString("$FLAGS"));
try {
odp.export(elem);
// //elem.getDxlString(null)
// String odp = elem.getOnDiskPath();
// if (StringUtil.isEmpty(odp)) {
// odp = elem.getNoteID() + ".note";
// }
// File odsFile = new File(root, odp);
// System.out.println(elem.getClass().getName() + "\t\t\t" + odsFile);
// odsFile.getParentFile().mkdirs(); // ensure the path exists
// elem.writeOnDiskFile(odsFile);
// if (elem instanceof HasMetadata) {
// File meta = new File(odsFile.getAbsolutePath() + ".metadata");
// ((HasMetadata) elem).writeOnDiskMeta(meta);
// }
} catch (Exception ne) {
ne.printStackTrace();
}
// String path = "./" + elem.getOnDiskPath();
// String ext = elem.getOnDiskExtension();
// if (path != null && ext != null && !path.endsWith(ext))
// path = path + ext;
// pw.println(path + "\t'" + elem.getClass().getSimpleName() + "\t" + elem.getNoteID() + "\t" + elem.getName() + "\t"
// + elem.getDocument().getItemValueString("$FLAGS"));
// if (elem instanceof HasMetadata) {
// pw.println(path + ".metadata");
// }
// if (elem instanceof CustomControl) {
// pw.println(path + "-config");
// }
}
}
Aggregations