Search in sources :

Example 1 with DocumentMeta

use of org.apache.maven.doxia.document.DocumentMeta in project maven-plugins by apache.

the class DocumentModelBuilder method getDocumentMeta.

/**
 * Extract meta information from a MavenProject.
 *
 * @param project a MavenProject. May be null.
 * @param date the date to use in meta. May be null.
 *
 * @return a DocumentMeta object. Always non-null.
 */
private static DocumentMeta getDocumentMeta(MavenProject project, Date date) {
    final DocumentMeta meta = new DocumentMeta();
    meta.setAuthors(getAuthors(project));
    meta.setCreationDate(date);
    meta.setCreator(System.getProperty("user.name"));
    meta.setDate(date);
    meta.setDescription(project == null ? null : project.getDescription());
    // meta.setGenerator( generator );
    meta.setInitialCreator(System.getProperty("user.name"));
    // meta.setLanguage( locale == null ? null : locale.getLanguage() );
    // meta.setPageSize( pageSize );
    meta.setSubject(getProjectName(project));
    meta.setTitle(getProjectName(project));
    return meta;
}
Also used : DocumentMeta(org.apache.maven.doxia.document.DocumentMeta)

Example 2 with DocumentMeta

use of org.apache.maven.doxia.document.DocumentMeta in project maven-plugins by apache.

the class DocumentModelBuilderTest method testGetDocumentModel.

/**
 * Test of getDocumentModel method, of class DocumentModelBuilder.
 */
public void testGetDocumentModel() {
    DocumentModel model = new DocumentModelBuilder(new ModelBuilderMavenProjectStub()).getDocumentModel();
    assertEquals("ISO-8859-1", model.getModelEncoding());
    assertEquals("Test ArtifactId", model.getOutputName());
    DocumentCover cover = model.getCover();
    assertEquals("Test Version", cover.getCoverVersion());
    assertEquals("Test Name", cover.getProjectName());
    assertEquals("Test Name", cover.getCoverTitle());
    assertEquals("v. Test Version", cover.getCoverSubTitle());
    assertEquals("Test Organization", cover.getCompanyName());
    assertEquals(2, cover.getAuthors().size());
    assertFirstDocumentAuthor(cover.getAuthors().get(0));
    DocumentMeta meta = model.getMeta();
    assertEquals("Test Description", meta.getDescription());
    assertEquals(2, meta.getAuthors().size());
    assertFirstDocumentAuthor(meta.getAuthors().get(0));
    assertEquals("Test Name", meta.getSubject());
    assertEquals("Test Name", meta.getTitle());
    DocumentTOC toc = model.getToc();
    assertEquals(0, toc.getItems().size());
}
Also used : DocumentTOC(org.apache.maven.doxia.document.DocumentTOC) DocumentCover(org.apache.maven.doxia.document.DocumentCover) DocumentMeta(org.apache.maven.doxia.document.DocumentMeta) ModelBuilderMavenProjectStub(org.apache.maven.plugins.pdf.stubs.ModelBuilderMavenProjectStub) DocumentModel(org.apache.maven.doxia.document.DocumentModel)

Aggregations

DocumentMeta (org.apache.maven.doxia.document.DocumentMeta)2 DocumentCover (org.apache.maven.doxia.document.DocumentCover)1 DocumentModel (org.apache.maven.doxia.document.DocumentModel)1 DocumentTOC (org.apache.maven.doxia.document.DocumentTOC)1 ModelBuilderMavenProjectStub (org.apache.maven.plugins.pdf.stubs.ModelBuilderMavenProjectStub)1