Class SiteMap
- java.lang.Object
-
- org.apache.maven.plugins.site.render.SiteMap
-
public class SiteMap extends java.lang.ObjectGenerate a sitemap.- Since:
- 2.1
-
-
Constructor Summary
Constructors Constructor Description SiteMap(java.lang.String encoding, org.codehaus.plexus.i18n.I18N i18n)Constructor sets default values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidextract(org.apache.maven.doxia.site.decoration.DecorationModel decoration, org.apache.maven.doxia.sink.Sink sink, java.util.Locale locale)private static voidextractItems(java.util.List<org.apache.maven.doxia.site.decoration.MenuItem> items, org.apache.maven.doxia.sink.Sink sink)voidgenerate(org.apache.maven.doxia.site.decoration.DecorationModel model, java.io.File targetDir, java.util.Locale locale)Generates a sitemap.xml in targetDir/xdoc/.java.lang.StringgetEncoding()Get the encoding to use when writing the output file.org.codehaus.plexus.i18n.I18NgetI18n()Get the value of i18n.private static java.lang.StringrelativePath(java.lang.String href)voidsetEncoding(java.lang.String enc)Set the encoding to use when writing the output file.voidsetI18n(org.codehaus.plexus.i18n.I18N i18n)Set the value of i18n.
-
-
-
Method Detail
-
getI18n
public org.codehaus.plexus.i18n.I18N getI18n()
Get the value of i18n.- Returns:
- the value of i18n.
-
setI18n
public void setI18n(org.codehaus.plexus.i18n.I18N i18n)
Set the value of i18n.- Parameters:
i18n- new value of i18n.
-
getEncoding
public java.lang.String getEncoding()
Get the encoding to use when writing the output file.- Returns:
- the value of encoding.
-
setEncoding
public void setEncoding(java.lang.String enc)
Set the encoding to use when writing the output file.- Parameters:
enc- new value of encoding.
-
generate
public void generate(org.apache.maven.doxia.site.decoration.DecorationModel model, java.io.File targetDir, java.util.Locale locale) throws java.io.IOExceptionGenerates a sitemap.xml in targetDir/xdoc/. This is a valid xdoc document that can be processed by a Doxia parser. The file lists all the menus and menu items of the DecorationModel in expanded form.- Parameters:
model- the DecorationModel to extract the menus from.targetDir- the target output directory. The file will be created in targetDir/xdoc/.locale- the Locale for the result.- Throws:
java.io.IOException- if the file cannot be ceated.
-
extract
private void extract(org.apache.maven.doxia.site.decoration.DecorationModel decoration, org.apache.maven.doxia.sink.Sink sink, java.util.Locale locale)
-
extractItems
private static void extractItems(java.util.List<org.apache.maven.doxia.site.decoration.MenuItem> items, org.apache.maven.doxia.sink.Sink sink)
-
relativePath
private static java.lang.String relativePath(java.lang.String href)
-
-