You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2016/02/11 20:33:04 UTC
svn commit: r1729881 - in /maven/doxia/doxia-sitetools/trunk:
doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/
doxia-decoration-model/src/main/mdo/
doxia-decoration-model/src/test/resources/ doxia-doc-renderer/sr...
Author: michaelo
Date: Thu Feb 11 19:33:03 2016
New Revision: 1729881
URL: http://svn.apache.org/viewvc?rev=1729881&view=rev
Log:
[DOXIASITETOOLS-155] Change type of decoration model's body/head element to string
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-unresolved.xml
maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/resources/site/site.xml
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java Thu Feb 11 19:33:03 2016
@@ -211,14 +211,10 @@ public class DefaultDecorationModelInher
pBody = new Body();
}
- if ( cBody.getHead() == null )
+ if ( cBody.getHead() == null && pBody.getHead() != null )
{
cBody.setHead( pBody.getHead() );
}
- else
- {
- cBody.setHead( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) cBody.getHead(), (Xpp3Dom) pBody.getHead() ) );
- }
cBody.setLinks( mergeLinkItemLists( cBody.getLinks(), pBody.getLinks(), urlContainer, false ) );
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo Thu Feb 11 19:33:03 2016
@@ -406,9 +406,9 @@ under the License.
<fields>
<field>
<name>head</name>
- <description>Additional content (like Javascript) to include in the HEAD block of the generated pages.</description>
+ <description>Additional content (like JavaScript) to include in the HEAD block of the generated pages.</description>
<version>1.0.0+</version>
- <type>DOM</type>
+ <type>String</type>
<identifier>true</identifier>
</field>
<field>
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml Thu Feb 11 19:33:03 2016
@@ -48,7 +48,9 @@ under the License.
<body>
<head>
+ <![CDATA[
<meta name="blah" value="blah"/>
+ ]]>
</head>
<links>
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml Thu Feb 11 19:33:03 2016
@@ -48,7 +48,9 @@ under the License.
<body>
<head>
+ <![CDATA[
<meta name="blah" value="blah"/>
+ ]]>
</head>
<links>
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-unresolved.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-unresolved.xml?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-unresolved.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/resources/fully-populated-unresolved.xml Thu Feb 11 19:33:03 2016
@@ -48,7 +48,9 @@ under the License.
<body>
<head>
+ <![CDATA[
<meta name="blah" value="blah"/>
+ ]]>
</head>
<links>
Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/resources/site/site.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/resources/site/site.xml?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/resources/site/site.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/resources/site/site.xml Thu Feb 11 19:33:03 2016
@@ -40,12 +40,14 @@
</skin>
<body>
<head>
+ <![CDATA[
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-140879-1";
urchinTracker();
</script>
+ ]]>
</head>
<links>
Modified: maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java?rev=1729881&r1=1729880&r2=1729881&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java Thu Feb 11 19:33:03 2016
@@ -239,9 +239,6 @@ public class SiteToolTest
assertNotNull( tool );
SiteToolMavenProjectStub project = new SiteToolMavenProjectStub( "site-tool-test" );
- project.setGroupId( "org.apache.maven" );
- project.setArtifactId( "maven-site" );
- project.setVersion( "1.0" );
List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
// model from current local build
@@ -259,7 +256,11 @@ public class SiteToolTest
assertNull( model.getBannerRight().getHref() );
// model from repo: http://repo1.maven.org/maven2/org/apache/maven/maven-site/1.0/maven-site-1.0-site.xml
- project.setBasedir( null );
+ // TODO Enable this test as soon as we haven a site.xml with head content as string
+ /*project.setBasedir( null );
+ project.setGroupId( "org.apache.maven" );
+ project.setArtifactId( "maven-site" );
+ project.setVersion( "1.0" );
DecorationModel modelFromRepo =
tool.getDecorationModel( null, Locale.getDefault(), project, reactorProjects, getLocalRepo(),
project.getRemoteArtifactRepositories() );
@@ -271,7 +272,7 @@ public class SiteToolTest
assertNotNull( modelFromRepo.getBannerRight() );
assertNull( modelFromRepo.getBannerRight().getName() );
assertEquals( "images/maven-logo-2.gif", modelFromRepo.getBannerRight().getSrc() );
- assertNull( modelFromRepo.getBannerRight().getHref() );
+ assertNull( modelFromRepo.getBannerRight().getHref() );*/
}
/**
@@ -336,7 +337,7 @@ public class SiteToolTest
assertFalse( siteDescriptorContent.contains( "${project.name}" ) );
assertTrue( siteDescriptorContent.contains( "Interpolatesite" ) );
}
-
+
// MSHARED-217 -> DOXIATOOLS-34 -> DOXIASITETOOLS-118
public void testDecorationModelInheritanceAndInterpolation()
throws Exception
@@ -349,7 +350,7 @@ public class SiteToolTest
parentProject.setArtifactId( "mshared-217-parent" );
parentProject.setVersion( "1.0-SNAPSHOT" );
parentProject.setName( "MSHARED-217 Parent" );
-
+
SiteToolMavenProjectStub childProject = new SiteToolMavenProjectStub( "interpolation-child-test" );
childProject.setParent( parentProject );
childProject.setGroupId( "org.apache.maven.shared.its" );