String path = args[2];
String username = args[3];
try {
Properties properties = org.dbwiki.lib.IO.loadProperties(configFile);
DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(properties);
//TODO #server: Use non-web wiki server for this
WikiServer server = new WikiServerStandalone(properties);
/*
* DatabaseWiki wiki = null;
for (int iWiki = 0; iWiki < server.size(); iWiki++) {
if (server.get(iWiki).name().equalsIgnoreCase(wikiName)) {
wiki = server.get(iWiki);
break;
}
}*/
DatabaseWiki wiki = server.get(wikiName);
// [wiki] should never be null
assert(wiki != null);
Database database = wiki.database();
Connection con = connector.getConnection();
con.setAutoCommit(false);
ImportPresentationFiles p = new ImportPresentationFiles(server, wiki, database, username);
p.loadPresentationFile(path + wikiName + ".css", PresentationFileType.CSS);
p.loadPresentationFile(path + wikiName + ".layout", PresentationFileType.Layout);