WikiDB db = null;
try {
db = new WikiDB(mainDirectory, databaseSubdirectory);
APIWikiModel wikiModel = new APIWikiModel(user, db, locale, "${image}", "${title}", imageDirectory);
DocumentCreator creator = new DocumentCreator(wikiModel, user, listOfTitleStrings);
// create header and CSS information
StringBuilder buf = new StringBuilder();
buf.append(HTMLConstants.HTML_HEADER1);
buf.append(HTMLConstants.CSS_MAIN_STYLE);
buf.append(HTMLConstants.CSS_SCREEN_STYLE);
buf.append(HTMLConstants.HTML_HEADER2);
creator.setHeader(buf.toString());
creator.setFooter(HTMLConstants.HTML_FOOTER);
wikiModel.setUp();
// set up a simple cache for this example. HashMap is not usable for
// production! Use something like http://ehcache.org for production!
Configuration.DEFAULT_CONFIGURATION.setTemplateCallsCache(new HashMap());
creator.renderToFile(generatedHTMLFilename);
System.out.println("Created file: " + generatedHTMLFilename);
return wikiModel.getRedirectLink();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e1) {
e1.printStackTrace();
} finally {