Examples of APIWikiModel


Examples of info.bliki.wiki.impl.APIWikiModel

        user.login();

        Path mainDirectory = Files.createTempDirectory("bliki-" + encodeTitleLocalUrl(title).replace("/", "_"));
        Path imageDirectory = mainDirectory.resolve("WikiImages");

        APIWikiModel wikiModel = new APIWikiModel(user, db,
                locale,
                "${image}",
                "${title}",
                imageDirectory.toString());

        DocumentCreator creator = new DocumentCreator(wikiModel, user, new String[]{title});
        @SuppressWarnings("StringBufferReplaceableByString")
        StringBuilder builder = new StringBuilder();
        builder.append(HTMLConstants.HTML_HEADER1)
           .append(HTMLConstants.CSS_MAIN_STYLE)
           .append(HTMLConstants.CSS_SCREEN_STYLE)
           .append(HTMLConstants.HTML_HEADER2);
        creator.setHeader(builder.toString());
        creator.setFooter(HTMLConstants.HTML_FOOTER);
        wikiModel.setUp();
        Configuration.DEFAULT_CONFIGURATION.setTemplateCallsCache(new HashMap<String, String>());
        Path generatedHTMLFilename = mainDirectory.resolve(encodeTitleLocalUrl(title) + ".html");
        creator.renderToFile(generatedHTMLFilename.toString());
        System.out.println("Created file: " + generatedHTMLFilename);

        assertThat(generatedHTMLFilename.toFile()).isFile();
        assertThat(generatedHTMLFilename.toFile().length()).isGreaterThan(0);

        return new Result(generatedHTMLFilename.toFile(), wikiModel.getRedirectLink());
    }
View Full Code Here

Examples of info.bliki.wiki.model.APIWikiModel

    String databaseSubdirectory = "WikiDB";
    // the following directory must exist for image downloads
    String imageDirectory = "c:/temp/WikiImages";
    try {
      db = new WikiDB(mainDirectory, databaseSubdirectory);
      APIWikiModel myWikiModel = new APIWikiModel(user, db, "${image}", "file:///c:/temp/${title}", imageDirectory);
      DocumentCreator creator = new DocumentCreator(myWikiModel, user, listOfTitleStrings);

      creator.renderPDFToFile(mainDirectory, titleURL + ".pdf", HTMLConstants.CSS_PRINTER_STYLE);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of info.bliki.wiki.model.APIWikiModel

    String imageDirectory = "c:/temp/WikiImages";
    WikiDB db = null;

    try {
      db = new WikiDB(mainDirectory, databaseSubdirectory);
      APIWikiModel wikiModel = new APIWikiModel(user, db, "${image}", "${title}", imageDirectory);
      DocumentCreator creator = new DocumentCreator(wikiModel, user, listOfTitleStrings);
      creator.setHeader(HTMLConstants.HTML_HEADER1 + HTMLConstants.CSS_SCREEN_STYLE + HTMLConstants.HTML_HEADER2);
      creator.setFooter(HTMLConstants.HTML_FOOTER);
      wikiModel.setUp();
      creator.renderToFile(mainDirectory + titleURL + ".html");

    } catch (IOException e) {
      e.printStackTrace();
    } catch (Exception e1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.