|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SiteTool
Tool to play with Doxia objects
like DecorationModel
.
Field Summary | |
---|---|
static Locale |
DEFAULT_LOCALE
The locale by default for all default bundles |
static String |
ROLE
Plexus Role |
Method Summary | |
---|---|
Locale |
codeToLocale(String localeCode)
Converts a locale code like "en", "en_US" or "en_US_win" to a java.util.Locale
object. |
List<Locale> |
getAvailableLocales(String locales)
Init the localesList variable. |
org.apache.maven.doxia.site.decoration.DecorationModel |
getDecorationModel(org.apache.maven.project.MavenProject project,
List<org.apache.maven.project.MavenProject> reactorProjects,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
String siteDirectory,
Locale locale,
String inputEncoding,
String outputEncoding)
Get a decoration model for a project. |
org.apache.maven.artifact.Artifact |
getDefaultSkinArtifact(org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.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,
String inputEncoding,
String outputEncoding)
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,
org.apache.maven.artifact.repository.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 |
getSiteDescriptorFromBasedir(String siteDirectory,
File basedir,
Locale locale)
Get a site descriptor from the project's base directory. |
File |
getSiteDescriptorFromRepository(org.apache.maven.project.MavenProject project,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
Locale locale)
Get a site descriptor from one of the repositories. |
org.apache.maven.artifact.Artifact |
getSkinArtifactFromRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories,
org.apache.maven.doxia.site.decoration.DecorationModel decoration)
Get a skin artifact from one of the repositories. |
void |
populateModules(org.apache.maven.project.MavenProject project,
List<org.apache.maven.project.MavenProject> reactorProjects,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
Locale locale,
boolean keepInheritedRefs)
Deprecated. Please use populateModulesMenu(MavenProject, List, ArtifactRepository, DecorationModel, Locale, boolean)
instead |
void |
populateModulesMenu(org.apache.maven.project.MavenProject project,
List<org.apache.maven.project.MavenProject> reactorProjects,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
Locale locale,
boolean keepInheritedRefs)
Populate the modules menu part of the decoration model. |
void |
populateParentMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
Locale locale,
org.apache.maven.project.MavenProject project,
org.apache.maven.project.MavenProject parentProject,
boolean keepInheritedRefs)
Populate the parent menu part of the decoration model. |
void |
populateProjectParentMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
Locale locale,
org.apache.maven.project.MavenProject project,
org.apache.maven.project.MavenProject parentProject,
boolean keepInheritedRefs)
Deprecated. Please use populateParentMenu(DecorationModel, Locale, MavenProject, MavenProject, boolean) instead |
void |
populateReportsMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
Locale locale,
Map<String,List<org.apache.maven.reporting.MavenReport>> categories)
Populate the reports menu part of the decoration model. |
Field Detail |
---|
static final String ROLE
static final Locale DEFAULT_LOCALE
Locale.ENGLISH
Method Detail |
---|
org.apache.maven.artifact.Artifact getSkinArtifactFromRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories, org.apache.maven.doxia.site.decoration.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 repository
SiteToolException
- if anyorg.apache.maven.artifact.Artifact getDefaultSkinArtifact(org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.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 repository
SiteToolException
- if anySkin.getDefaultSkin()
,
getSkinArtifactFromRepository(ArtifactRepository, List, DecorationModel)
String getRelativePath(String to, String from)
to
- the to
url of file as stringfrom
- the from
url of file as string
from
to to
.File getSiteDescriptorFromBasedir(String siteDirectory, File basedir, Locale locale)
siteDirectory
- The path to the directory containing the site.xml
file, relative to the
project base directory. If null, using by default "src/site".basedir
- not null.locale
- the locale wanted for the site descriptor. If not null, searching for
site_localeLanguage.xml
, otherwise searching for site.xml
.
src/site/site.xml
, depending on parameter values.File getSiteDescriptorFromRepository(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, Locale locale) throws SiteToolException
project
- the Maven project, not null.localRepository
- the Maven local repository, not null.repositories
- the Maven remote repositories, not null.locale
- the locale wanted for the site descriptor. If not null, searching for
site_localeLanguage.xml
, otherwise searching for site.xml
.
SiteToolException
- if anyorg.apache.maven.doxia.site.decoration.DecorationModel getDecorationModel(org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, String siteDirectory, Locale locale, String inputEncoding, String outputEncoding) throws SiteToolException
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.siteDirectory
- The path to the directory containing the site.xml
file, relative to the
project base directory. If null, using by default "src/site".locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.inputEncoding
- the input encoding of the site descriptor, not null.outputEncoding
- the output encoding wanted, not null.
DecorationModel
object corresponding to the site.xml
file with some
interpolations.
SiteToolException
- if anyvoid populateReportsMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, Map<String,List<org.apache.maven.reporting.MavenReport>> categories)
decorationModel
- the Doxia DecorationModel, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.categories
- a map to put on the decoration model, not null.String getInterpolatedSiteDescriptorContent(Map<String,String> props, org.apache.maven.project.MavenProject aProject, String siteDescriptorContent, String inputEncoding, String outputEncoding) 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.inputEncoding
- the input encoding of the site descriptor, not null.outputEncoding
- the output encoding wanted, not null.siteDescriptorContent
- the site descriptor file, not null.
site.xml
file with interpolated strings.
SiteToolException
- if errors happened during the interpolation.org.apache.maven.project.MavenProject getParentProject(org.apache.maven.project.MavenProject aProject, List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository)
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.
TODO: once bug is fixed in Maven proper, remove this.
aProject
- a Maven project, not null.reactorProjects
- the Maven reactor projects, not null.localRepository
- the Maven local repository, not null.
void populateParentMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProject parentProject, boolean keepInheritedRefs)
decorationModel
- the Doxia DecorationModel, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.project
- a Maven project, not null.parentProject
- a Maven parent project, not null.keepInheritedRefs
- used for inherited references.void populateProjectParentMenu(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProject parentProject, boolean keepInheritedRefs)
populateParentMenu(DecorationModel, Locale, MavenProject, MavenProject, boolean)
instead
decorationModel
- the Doxia DecorationModel, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.project
- a Maven project, not null.parentProject
- a Maven parent project, not null.keepInheritedRefs
- used for inherited references.void populateModules(org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, boolean keepInheritedRefs) throws SiteToolException
populateModulesMenu(MavenProject, List, ArtifactRepository, DecorationModel, Locale, boolean)
instead
project
- a Maven project, not null.reactorProjects
- the Maven reactor projects, not null.localRepository
- the Maven local repository, not null.decorationModel
- the Doxia site descriptor model, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.keepInheritedRefs
- used for inherited references.
SiteToolException
- if anyvoid populateModulesMenu(org.apache.maven.project.MavenProject project, List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, Locale locale, boolean keepInheritedRefs) throws SiteToolException
project
- a Maven project, not null.reactorProjects
- the Maven reactor projects, not null.localRepository
- the Maven local repository, not null.decorationModel
- the Doxia site descriptor model, not null.locale
- the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.keepInheritedRefs
- used for inherited references.
SiteToolException
- if anyList<Locale> getAvailableLocales(String locales)
localesList
variable.
If the locales
variable is available, the first valid token will be the
defaultLocale
for this instance of the Java Virtual Machine.
locales
- A comma separated list of locales supported by Maven. The first valid token will be the
default Locale for this instance of the Java Virtual Machine.
Locale
Locale codeToLocale(String localeCode)
java.util.Locale
object.
If localeCode = default
, return the current value of the default locale for this instance
of the Java Virtual Machine.
localeCode
- the locale code string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |