Interface SiteTool
- All Known Implementing Classes:
DefaultSiteTool
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetInterpolatedSiteDescriptorContent(Map<String, String> props, org.apache.maven.project.MavenProject aProject, String siteDescriptorContent) Interpolating several expressions in the site descriptor content.getRelativePath(String to, String from) Calculate the relative path between two URLs or between two files.getSiteDescriptor(File siteDirectory, Locale locale) Get a site descriptor from the project's site directory.getSiteLocales(String locales) Extracts from a comma-separated list the locales that are available insite-toolresource bundle.org.apache.maven.doxia.site.SiteModelgetSiteModel(File siteDirectory, Locale locale, org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, org.eclipse.aether.RepositorySystemSession repoSession, List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories) Get a site model for a project.org.apache.maven.artifact.ArtifactgetSkinArtifactFromRepository(org.eclipse.aether.RepositorySystemSession repoSession, List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories, org.apache.maven.doxia.site.Skin skin) Get a skin artifact from one of the repositories.voidpopulateReportsMenu(org.apache.maven.doxia.site.SiteModel siteModel, Locale locale, Map<String, List<org.apache.maven.reporting.MavenReport>> reportsPerCategory) Populate the pre-definedreportsmenu of the site model, if used through<menu ref="reports"/>.
-
Field Details
-
DEFAULT_LOCALE
-
-
Method Details
-
getSkinArtifactFromRepository
org.apache.maven.artifact.Artifact getSkinArtifactFromRepository(org.eclipse.aether.RepositorySystemSession repoSession, List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories, org.apache.maven.doxia.site.Skin skin) throws SiteToolException Get a skin artifact from one of the repositories.- Parameters:
repoSession- the repository system session, not null.remoteProjectRepositories- the Maven remote project repositories, not null.skin- the Skin model, not null.- Returns:
- the
Skinartifact defined in aSiteModelfrom a given project - Throws:
SiteToolException- if any
-
getSiteDescriptor
Get a site descriptor from the project's site directory.- Parameters:
siteDirectory- the site directory, not nulllocale- the locale wanted for the site descriptor, not null. Most specific to least specific lookup fromsite_language_country_variant.xml,site_language_country.xml,site_language.xml}, tosite.xmlas last resort forLocale.ROOT, if provided locale defines a variant and/or a country and/or a language.- Returns:
- the most specific site descriptor file for the given locale
-
getInterpolatedSiteDescriptorContent
String getInterpolatedSiteDescriptorContent(Map<String, String> props, org.apache.maven.project.MavenProject aProject, String siteDescriptorContent) throws SiteToolExceptionInterpolating several expressions in the site descriptor content. Actually, the expressions can be in the project, the environment variables and the specific properties likeencoding.For instance:
- ${project.name}
- The value from the POM of:
<project>
<name>myProjectName</name>
</project> - ${my.value}
- The value from the POM of:
<properties>
<my.value>hello</my.value>
</properties> - ${JAVA_HOME}
- The value of JAVA_HOME in the environment variables
- Parameters:
props- a map used for interpolation, not null.aProject- a Maven project, not null.siteDescriptorContent- the site descriptor file, not null.- Returns:
- the interpolated site descriptor content.
- Throws:
SiteToolException- if errors happened during the interpolation.
-
getSiteModel
org.apache.maven.doxia.site.SiteModel getSiteModel(File siteDirectory, Locale locale, org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, org.eclipse.aether.RepositorySystemSession repoSession, List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories) throws SiteToolException Get a site model for a project.- Parameters:
siteDirectory- the site directory, may be null if project from repositorylocale- the locale used for the i18n in SiteModel, not null. SeegetSiteDescriptor(File, Locale)for details.project- the Maven project, not null.reactorProjects- the Maven reactor projects, not null.repoSession- the repository system session, not null.remoteProjectRepositories- the Maven remote project repositories, not null.- Returns:
- the
SiteModelobject corresponding to thesite.xmlfile with some interpolations. - Throws:
SiteToolException- if any- Since:
- 1.7, was previously with other parameter types and order
-
populateReportsMenu
void populateReportsMenu(org.apache.maven.doxia.site.SiteModel siteModel, Locale locale, Map<String, List<org.apache.maven.reporting.MavenReport>> reportsPerCategory) Populate the pre-definedreportsmenu of the site model, if used through<menu ref="reports"/>. Notice this menu reference is translated into 2 separate menus: "Project Information" and "Project Reports".- Parameters:
siteModel- the Doxia Sitetools SiteModel, not null.locale- the locale used for the i18n in SiteModel, not null. SeegetSiteDescriptor(File, Locale)for details.reportsPerCategory- reports per category to put in "Reports" or "Information" menus, not null.- See Also:
-
getSiteLocales
-
getRelativePath
Calculate the relative path between two URLs or between two files. For example:- to = "http://maven.apache.org" and from = "http://maven.apache.org"
- return ""
- to = "http://maven.apache.org" and from = "http://maven.apache.org/plugins/maven-site-plugin/"
- return "../.."
- to = "http://maven.apache.org/plugins/maven-site-plugin/" and from = "http://maven.apache.org"
- return "plugins/maven-site-plugin"
- to = "/myproject/myproject-module1" and from = "/myproject/myproject"
- return "../myproject-module1"
dav:https://dav.codehaus.org/orscm:svn:https://svn.apache.org/repos/asf.- Parameters:
to- thetourl of file as stringfrom- thefromurl of file as string- Returns:
- a relative path from
fromtoto.
-