Examples of BibliographyFactory


Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

        latexBibGenerator = new LatexBibliographyGenerator();
    }
   
    @Test
    public void shouldGenerateBibContent() throws Exception {
        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibsimple.xml"));

        String expectedBib = new Scanner(new File("src/test/resources/bibliography/book.bib"))
                .useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

    }

    @Test
    public void shouldGenerateBibContentWithPublisher() throws Exception {

        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibwithpublisher.xml"));

        String expectedBib = new Scanner(new File(
                "src/test/resources/bibliography/bookwithpublisher.bib")).useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

    }
   
    @Test
    public void shouldGenerateBibWithoutAField() throws Exception {

        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/miscwithoutyear.xml"));

        String expectedBib = new Scanner(new File(
                "src/test/resources/bibliography/miscwithoutyear.bib")).useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

        htmlBibGenerator = new HtmlBibliographyGenerator(cfg);
    }

    @Test
    public void shouldGenerateHtmlBibContent() throws Exception {
        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibsimple.xml"));

        String html = htmlBibGenerator.generateTextOf(bibliography);
        assertTrue(html.contains("Jose da silva"));
        assertTrue(html.contains("Livro legal"));
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

                .generateIntroductionChapters(book.getIntroductionChapters());
    }

    private String generateHtmlBibliography(File outputDir) {
        File bibliographyFile = new File(outputDir, "bib.xml");
        Bibliography bibliography = new BibliographyFactory().build(bibliographyFile);
        String htmlBibliography = new HtmlBibliographyGenerator(freeMarkerConfig)
                .generateTextOf(bibliography);
        return htmlBibliography;
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.BibliographyFactory

    copyResources(directory, book);
  }

  private void writeBibTex(File directory) throws FileNotFoundException, UnsupportedEncodingException {
    File bibliographyFile = new File(directory, "bib.xml");
    Bibliography bibliography = new BibliographyFactory().build(bibliographyFile);
    String latexBibliography = new LatexBibliographyGenerator().generateTextOf(bibliography);
    PrintStream stream = new PrintStream(new File(directory, "book.bib"), "UTF-8");
    stream.append(latexBibliography);
    stream.close();
  }
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.