Skip to content

Commit

Permalink
Renames
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Apr 2, 2023
1 parent e27ac13 commit 1cfabdd
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 120 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ under the License.
<!-- for dependencies -->
<jettyVersion>9.4.50.v20221201</jettyVersion>
<doxiaVersion>2.0.0-M6</doxiaVersion>
<doxiaSitetoolsVersion>2.0.0-M6</doxiaSitetoolsVersion>
<doxiaSitetoolsVersion>2.0.0-M7</doxiaSitetoolsVersion>
<wagonVersion>3.5.3</wagonVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<!-- for ITs -->
Expand All @@ -209,7 +209,7 @@ under the License.
<projectInfoReportsPluginVersion>3.4.2</projectInfoReportsPluginVersion>
<surefirePluginVersion>3.0.0</surefirePluginVersion>
<mavenPluginPluginVersion>3.8.1</mavenPluginPluginVersion>
<mavenReportingImplVersion>4.0.0-M5</mavenReportingImplVersion>
<mavenReportingImplVersion>4.0.0-M6</mavenReportingImplVersion>
<fluidoSkinVersion>2.0.0-M3</fluidoSkinVersion>
<surefire.version>3.0.0</surefire.version>
<project.build.outputTimestamp>2023-03-20T07:40:44Z</project.build.outputTimestamp>
Expand All @@ -225,7 +225,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-exec</artifactId>
<version>2.0.0-M5</version>
<version>2.0.0-M6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand Down Expand Up @@ -370,7 +370,7 @@ under the License.
<!-- Doxia Sitetools -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-decoration-model</artifactId>
<artifactId>doxia-site-model</artifactId>
<version>${doxiaSitetoolsVersion}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion src/it/projects/MSITE-159/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ under the License.
<artifactId>maven-site-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<relativizeDecorationLinks>false</relativizeDecorationLinks>
<relativizeSiteLinks>false</relativizeSiteLinks>
</configuration>
</plugin>
</plugins>
Expand Down
36 changes: 18 additions & 18 deletions src/it/projects/doxia-formats/src/site/apt/velocity-context.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,33 @@ Doxia Site Renderer Velocity Context
*-----------------------+-------------------------------------------------------+-----+
#foreach( $key in $sorter.sort( $context.keys ) )
#set( $value = $context.get($key) )
| <<<$key>>> | <<<#if ($value)$value.class.name#else?#end>>> | #if ($key != "decoration" && $key != "link")#if ($value)<<<$StringUtils.replace($value, '\' , '\\')>>>#end#end|
| <<<$key>>> | <<<#if ($value)$value.class.name#else?#end>>> | #if ($key != "decoration" && $key != "site" && $key != "link")#if ($value)<<<$StringUtils.replace($value, '\' , '\\')>>>#end#end|
*-----------------------+-------------------------------------------------------+-----+
#end

Handwritten classification:

* Document Variables

*-----------------------*-------------------------------------------------------*
|| variable || examples ||
*-----------------------+-------------------------------------------------------+
| <<<alignedFileName>>> | = <<<$alignedFileName>>>
*-----------------------+-------------------------------------------------------+
| <<<decoration>>> | <<<decoration.name>>> = <<<$decoration.name>>>
*-----------------------+-------------------------------------------------------+
| <<<currentFileName>>> | = <<<$currentFileName>>>
*-----------------------+-------------------------------------------------------+
*------------------------*-------------------------------------------------------*
|| variable || examples ||
*------------------------+-------------------------------------------------------+
| <<<alignedFileName>>> | = <<<$alignedFileName>>>
*------------------------+-------------------------------------------------------+
| <<<site>>> | <<<site.name>>> = <<<$site.name>>>
*------------------------+-------------------------------------------------------+
| <<<currentFileName>>> | = <<<$currentFileName>>>
*------------------------+-------------------------------------------------------+
| <<<doxiaSiteRendererVersion>>> | = <<<$doxiaSiteRendererVersion>>>
*-----------------------+-------------------------------------------------------+
| <<<locale>>> | = <<<$locale>>>
*-----------------------+-------------------------------------------------------+
| <<<publishDate>>> | = <<<$publishDate>>>
*-----------------------+-------------------------------------------------------+
| <<<relativePath>>> | = <<<$relativePath>>>
*-----------------------+-------------------------------------------------------+
*------------------------+-------------------------------------------------------+
| <<<locale>>> | = <<<$locale>>>
*------------------------+-------------------------------------------------------+
| <<<publishDate>>> | = <<<$publishDate>>>
*------------------------+-------------------------------------------------------+
| <<<relativePath>>> | = <<<$relativePath>>>
*------------------------+-------------------------------------------------------+
| <<<supportedLocales>>> | = <<<$supportedLocales>>>
*-----------------------+-------------------------------------------------------+
*------------------------+-------------------------------------------------------+

* Tools

Expand Down
6 changes: 3 additions & 3 deletions src/it/projects/full-reporting/src/site/apt/index.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

Velocity processing

See doxia-siterendering: site decoration and documents with file names ending in <<<.vm>>> are processed by Velocity.
See doxia-siterendering: site and documents with file names ending in <<<.vm>>> are processed by Velocity.

The velocity context defines some variables:

Expand All @@ -45,8 +45,6 @@ Velocity processing
*---------------------------------+--------------------+-------------------------------+
| <<<bodyContent>>> | <<<String>>> | $bodyContent |
*---------------------------------+--------------------+-------------------------------+
| <<<decoration>>> | {{{../doxia-decoration-model/apidocs/org/apache/maven/doxia/site/decoration/DecorationModel.html}<<<DecorationModel>>>}} | $decoration.name |
*---------------------------------+--------------------+-------------------------------+
| <<<dateCreation>>> | <<<String>>> | $dateCreation |
*---------------------------------+--------------------+-------------------------------+
| <<<dateRevision>>> | <<<String>>> | $dateRevision |
Expand All @@ -63,6 +61,8 @@ Velocity processing
*---------------------------------+--------------------+-------------------------------+
| <<<supportedLocales>>> | <<<List\<Locale\>>>> | $supportedLocales |
*---------------------------------+--------------------+-------------------------------+
| <<<site>>> | {{{../doxia-site-model/apidocs/org/apache/maven/doxia/site/SiteModel.html}<<<SiteModel>>>}} | $site.name |
*---------------------------------+--------------------+-------------------------------+
| <template properties> | | Properties defined by caller: see below for properties defined by <<<maven-site-plugin>>> |
*---------------------------------+--------------------+-------------------------------+
| <<<PathTool>>> | {{{http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/PathTool.html}<<<PathTool>>>}} | $PathTool |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-----
POMs and Site Decoration Model Inheritance and Interpolation
POMs and Site Model Inheritance and Interpolation
-----
Hervé Boutemy
-----
Expand All @@ -26,8 +26,8 @@
~~ NOTE: For help with the syntax of this file, see:
~~ http://maven.apache.org/doxia/references/apt-format.html

POMs and Site Decoration Model Inheritance and Interpolation
POMs and Site Model Inheritance and Interpolation

* {{{./pom.html} POM Inheritance and Interpolation}}
* Site Decoration Model Inheritance and Interpolation: see this page

* Site Model Inheritance and Interpolation: see this page
2 changes: 1 addition & 1 deletion src/it/projects/inheritance-interpolation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ under the License.
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>POM and Site Decoration Model inheritance and interpolation tests</name>
<name>POM and Site Model inheritance and interpolation tests</name>
<description>
this POM is reactor linking to reactor-accessible poms: child and reactor-parent
relative-parent is not expected to be in reactor, but accessible from relative path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-----
Site Decoration Model Inheritance and Interpolation
Site Model Inheritance and Interpolation
-----
Hervé Boutemy
-----
Expand All @@ -26,7 +26,7 @@
~~ NOTE: For help with the syntax of this file, see:
~~ http://maven.apache.org/doxia/references/apt-format.html

Site Decoration Model Inheritance and Interpolation
Site Model Inheritance and Interpolation

Site name inherited from repo-parent then interpolated: once interpolated,
expression from repo-parent should match current artifactId.
2 changes: 1 addition & 1 deletion src/it/projects/inheritance-interpolation/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ assert content.contains( '<<<http://maven.apache.org/${property}/relative-parent
assert content.contains( '<<<http://maven.apache.org/prop-value-from-reactor-parent/relative-parent/reactor-parent>>>' ); // reactor-parent
assert content.contains( '<<<http://maven.apache.org/prop-value-from-child/relative-parent/reactor-parent/child>>>' ); // child

// Site Decoration Model inheritance+interpolation
// Site Model inheritance+interpolation
childContent = new File( basedir, 'child/target/site/index.html' ).text;

assert childContent.contains( 'project.artifactId = child' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ locale=$locale
publishDate=$publishDate
relativePath=$relativePath
supportedLocales=$supportedLocales
decoration=$decoration
site=$site
</pre>

<h3>tools</h3>
Expand Down Expand Up @@ -88,4 +88,4 @@ project=$project
</pre>

</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Set;

import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.doxia.site.decoration.inheritance.URIPathDescriptor;
import org.apache.maven.doxia.site.inheritance.URIPathDescriptor;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.DistributionManagement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import java.util.List;
import java.util.Locale;

import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler;
import org.apache.maven.doxia.site.SiteModel;
import org.apache.maven.doxia.site.inheritance.SiteModelInheritanceAssembler;
import org.apache.maven.doxia.tools.SiteToolException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
Expand All @@ -34,16 +34,16 @@
import org.eclipse.aether.repository.RemoteRepository;

/**
* Abstract class to compute effective site decoration model for site descriptors.
* Abstract class to compute effective site model for site descriptors.
*
* @since 3.5
*/
public abstract class AbstractSiteDescriptorMojo extends AbstractSiteMojo {
/**
* The component for assembling site decoration model inheritance.
* The component for assembling site model inheritance.
*/
@Component
private DecorationModelInheritanceAssembler assembler;
private SiteModelInheritanceAssembler assembler;

/**
* The reactor projects.
Expand Down Expand Up @@ -82,23 +82,23 @@ public abstract class AbstractSiteDescriptorMojo extends AbstractSiteMojo {
*
* @since 2.3
*/
@Parameter(property = "relativizeDecorationLinks", defaultValue = "true")
private boolean relativizeDecorationLinks;
@Parameter(property = "relativizeSiteLinks", defaultValue = "true")
private boolean relativizeSiteLinks;

protected DecorationModel prepareDecorationModel(Locale locale) throws MojoExecutionException {
DecorationModel decorationModel;
protected SiteModel prepareSiteModel(Locale locale) throws MojoExecutionException {
SiteModel siteModel;
try {
decorationModel = siteTool.getDecorationModel(
siteModel = siteTool.getSiteModel(
siteDirectory, locale, project, reactorProjects, repoSession, remoteProjectRepositories);
} catch (SiteToolException e) {
throw new MojoExecutionException("SiteToolException: " + e.getMessage(), e);
}

if (relativizeDecorationLinks) {
if (relativizeSiteLinks) {
final String url = project.getUrl();

if (url == null) {
getLog().warn("No project URL defined - decoration links will not be relativized!");
getLog().warn("No project URL defined - site links will not be relativized!");
} else {
List<Locale> localesList = getLocales();

Expand All @@ -108,11 +108,11 @@ protected DecorationModel prepareDecorationModel(Locale locale) throws MojoExecu
// MSITE-658
final String localeUrl = locale.equals(defaultLocale) ? url : append(url, locale.toString());

getLog().info("Relativizing decoration links with respect to localized project URL: " + localeUrl);
assembler.resolvePaths(decorationModel, localeUrl);
getLog().info("Relativizing site links with respect to localized project URL: " + localeUrl);
assembler.resolvePaths(siteModel, localeUrl);
}
}
return decorationModel;
return siteModel;
}

private String append(String url, String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import java.io.StringWriter;
import java.io.Writer;

import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Writer;
import org.apache.maven.doxia.site.SiteModel;
import org.apache.maven.doxia.site.io.xpp3.SiteXpp3Writer;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
Expand Down Expand Up @@ -58,18 +58,15 @@ public class EffectiveSiteMojo extends AbstractSiteDescriptorMojo {
* {@inheritDoc}
*/
public void execute() throws MojoExecutionException, MojoFailureException {
DecorationModel decorationModel = prepareDecorationModel(getLocales().get(0));
SiteModel siteModel = prepareSiteModel(getLocales().get(0));

StringWriter w = new StringWriter();
XMLWriter writer = new PrettyPrintXMLWriter(
w,
StringUtils.repeat(" ", XmlWriterUtil.DEFAULT_INDENTATION_SIZE),
decorationModel.getModelEncoding(),
null);
w, StringUtils.repeat(" ", XmlWriterUtil.DEFAULT_INDENTATION_SIZE), siteModel.getModelEncoding(), null);

writeHeader(writer);

writeEffectiveSite(decorationModel, writer);
writeEffectiveSite(siteModel, writer);

String effectiveSite = w.toString();

Expand Down Expand Up @@ -128,13 +125,13 @@ protected static void writeComment(XMLWriter writer, String comment) {
XmlWriterUtil.writeLineBreak(writer);
}

private void writeEffectiveSite(DecorationModel decorationModel, XMLWriter writer) throws MojoExecutionException {
private void writeEffectiveSite(SiteModel siteModel, XMLWriter writer) throws MojoExecutionException {
String effectiveSite;

StringWriter sWriter = new StringWriter();
DecorationXpp3Writer siteWriter = new DecorationXpp3Writer();
SiteXpp3Writer siteWriter = new SiteXpp3Writer();
try {
siteWriter.write(sWriter, decorationModel);
siteWriter.write(sWriter, siteModel);
} catch (IOException e) {
throw new MojoExecutionException("Cannot serialize site descriptor to XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException;
import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Writer;
import org.apache.maven.doxia.site.SiteModel;
import org.apache.maven.doxia.site.io.xpp3.SiteXpp3Writer;
import org.codehaus.plexus.util.WriterFactory;

/**
Expand All @@ -38,15 +38,15 @@
*
*/
public class SiteDescriptorArtifactMetadata extends AbstractArtifactMetadata {
private final DecorationModel decoration;
private final SiteModel siteModel;

private final File file;

public SiteDescriptorArtifactMetadata(Artifact artifact, DecorationModel decoration, File file) {
public SiteDescriptorArtifactMetadata(Artifact artifact, SiteModel siteModel, File file) {
super(artifact);

this.file = file;
this.decoration = decoration;
this.siteModel = siteModel;
}

public String getRemoteFilename() {
Expand All @@ -69,7 +69,7 @@ public void storeInLocalRepository(ArtifactRepository localRepository, ArtifactR
destination.getParentFile().mkdirs();

try (Writer writer = WriterFactory.newXmlWriter(destination)) {
new DecorationXpp3Writer().write(writer, decoration);
new SiteXpp3Writer().write(writer, siteModel);
} catch (IOException e) {
throw new RepositoryMetadataStoreException("Error saving in local repository", e);
}
Expand Down

0 comments on commit 1cfabdd

Please sign in to comment.