public interface SiteTool
DecorationModel
.Modifier and Type | Field and Description |
---|---|
static Locale |
DEFAULT_LOCALE
The locale by default for a Maven Site
|
static String |
ROLE
Plexus Role
|
Modifier and Type | Method and Description |
---|---|
DecorationModel |
getDecorationModel(File siteDirectory,
Locale locale,
org.apache.maven.project.MavenProject project,
List<org.apache.maven.project.MavenProject> reactorProjects,
ArtifactRepository localRepository,
List<ArtifactRepository> repositories)
Get a decoration model for a project.
|
Artifact |
getDefaultSkinArtifact(ArtifactRepository localRepository,
List<ArtifactRepository> remoteArtifactRepositories)
Get the default skin artifact for a project from one of the repositories.
|
String |
getInterpolatedSiteDescriptorContent(Map<String,String> props,
org.apache.maven.project.MavenProject aProject,
String siteDescriptorContent)
Interpolating several expressions in the site descriptor content.
|
org.apache.maven.project.MavenProject |
getParentProject(org.apache.maven.project.MavenProject aProject,
List<org.apache.maven.project.MavenProject> reactorProjects,
ArtifactRepository localRepository)
Returns the parent POM with interpolated URLs.
|
String |
getRelativePath(String to,
String from)
Calculate the relative path between two URLs or between two files.
|
File |
getSiteDescriptor(File siteDirectory,
Locale locale)
Get a site descriptor from the project's site directory.
|
List<Locale> |
getSiteLocales(String locales)
Extracts from a comma-separated list the locales that are available in
site-tool
resource bundle. |
Artifact |
getSkinArtifactFromRepository(ArtifactRepository localRepository,
List<ArtifactRepository> remoteArtifactRepositories,
DecorationModel decoration)
Get a skin artifact from one of the repositories.
|
void |
populateReportsMenu(DecorationModel decorationModel,
Locale locale,
Map<String,List<MavenReport>> reportsPerCategory)
Populate the pre-defined
reports menu of the decoration model,
if used through <menu ref="reports"/> . |
static final String ROLE
static final Locale DEFAULT_LOCALE
Locale.ENGLISH
Artifact getSkinArtifactFromRepository(ArtifactRepository localRepository, List<ArtifactRepository> remoteArtifactRepositories, DecorationModel decoration) throws SiteToolException
localRepository
- the Maven local repository, not null.remoteArtifactRepositories
- the Maven remote repositories, not null.decoration
- the Doxia site descriptor model, not null.Skin
artifact defined in a DecorationModel
from a given project and a
local repositorySiteToolException
- if anyArtifact getDefaultSkinArtifact(ArtifactRepository localRepository, List<ArtifactRepository> remoteArtifactRepositories) throws SiteToolException
localRepository
- the Maven local repository, not null.remoteArtifactRepositories
- the Maven remote repositories, not null.Skin
artifact from a given project and a local repositorySiteToolException
- if anySkin.getDefaultSkin()
,
getSkinArtifactFromRepository(ArtifactRepository, List, DecorationModel)
File getSiteDescriptor(File siteDirectory, Locale locale)
siteDirectory
- the site directory, not nulllocale
- the locale wanted for the site descriptor. If not null, searching for
site_localeLanguage.xml
, otherwise searching for site.xml
.String getInterpolatedSiteDescriptorContent(Map<String,String> props, org.apache.maven.project.MavenProject aProject, String siteDescriptorContent) throws SiteToolException
encoding
.
For instance:
<project>
<name>myProjectName</name>
</project>
<properties>
<my.value>hello</my.value>
</properties>
props
- a map used for interpolation, not null.aProject
- a Maven project, not null.siteDescriptorContent
- the site descriptor file, not null.SiteToolException
- if errors happened during the interpolation.DecorationModel getDecorationModel(File siteDirectory, Locale locale, org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, ArtifactRepository localRepository, List<ArtifactRepository> repositories) throws SiteToolException
siteDirectory
- the site directory, may be null if project from repositorylocale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.project
- the Maven project, not null.reactorProjects
- the Maven reactor projects, not null.localRepository
- the Maven local repository, not null.repositories
- the Maven remote repositories, not null.DecorationModel
object corresponding to the site.xml
file with some
interpolations.SiteToolException
- if anyvoid populateReportsMenu(DecorationModel decorationModel, Locale locale, Map<String,List<MavenReport>> reportsPerCategory)
reports
menu of the decoration model,
if used through <menu ref="reports"/>
. Notice this menu reference is translated into
2 separate menus: "Project Information" and "Project Reports".decorationModel
- the Doxia Sitetools DecorationModel, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.reportsPerCategory
- reports per category to put in "Reports" or "Information" menus, not null.MavenReport.CATEGORY_PROJECT_INFORMATION
,
MavenReport.CATEGORY_PROJECT_REPORTS
List<Locale> getSiteLocales(String locales)
site-tool
resource bundle. Notice that default
value will be changed to the default locale of
the JVM.locales
- A comma separated list of localesLocale
, which at least contains the Maven default locale which is englishString getRelativePath(String to, String from)
dav:https://dav.codehaus.org/
or
scm:svn:https://svn.apache.org/repos/asf
.to
- the to
url of file as stringfrom
- the from
url of file as stringfrom
to to
.org.apache.maven.project.MavenProject getParentProject(org.apache.maven.project.MavenProject aProject, List<org.apache.maven.project.MavenProject> reactorProjects, ArtifactRepository localRepository)
project.getParent()
, which is already
interpolated. But when called from Maven 2, attempts to source this value from the
reactorProjects
parameters if available (reactor env model attributes
are interpolated), or if the reactor is unavailable (-N) resorts to the
project.getParent().getUrl()
value which will NOT have been interpolated.aProject
- a Maven project, not null.reactorProjects
- the Maven reactor projects, not null.localRepository
- the Maven local repository, not null.Copyright © 2005–2016 The Apache Software Foundation. All rights reserved.