use of org.apache.maven.doxia.site.decoration.Menu in project maven-plugins by apache.
the class DocumentModelBuilder method getDocumentTOC.
/**
* Extract a DocumentTOC from a DecorationModel.
*
* @param decorationModel a DecorationModel. May be null.
* @return a DocumentTOC, always non-null.
*/
private static DocumentTOC getDocumentTOC(DecorationModel decorationModel) {
final DocumentTOC toc = new DocumentTOC();
if (decorationModel != null && decorationModel.getMenus() != null) {
for (final Menu menu : decorationModel.getMenus()) {
for (final MenuItem item : menu.getItems()) {
final DocumentTOCItem documentTOCItem = new DocumentTOCItem();
documentTOCItem.setName(item.getName());
documentTOCItem.setRef(item.getHref());
toc.addItem(documentTOCItem);
}
}
}
return toc;
}
use of org.apache.maven.doxia.site.decoration.Menu in project maven-plugins by apache.
the class SiteMap method extract.
private void extract(DecorationModel decoration, Sink sink, Locale locale) {
sink.head();
sink.title();
sink.text(i18n.getString("site-plugin", locale, "site.sitemap.title"));
sink.title_();
sink.head_();
sink.body();
sink.section1();
sink.sectionTitle1();
sink.text(i18n.getString("site-plugin", locale, "site.sitemap.section.title"));
sink.sectionTitle1_();
sink.paragraph();
sink.text(i18n.getString("site-plugin", locale, "site.sitemap.description"));
sink.paragraph_();
for (Menu menu : decoration.getMenus()) {
sink.section3();
sink.sectionTitle3();
sink.text(menu.getName());
sink.sectionTitle3_();
sink.horizontalRule();
extractItems(menu.getItems(), sink);
sink.section3_();
}
sink.section1_();
sink.body_();
}
Aggregations