Author: brett
Date: Thu Dec 22 20:40:23 2005
New Revision: 358699
URL: http://svn.apache.org/viewcvs?rev=358699&view=rev
Log:
PR: MSITE-44
resolve paths in the decoration model relative to different base URLs and add
unit tests for inheritence
Added:
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/translate/
maven/doxia/trunk/doxia-decoration-model/src/test/
maven/doxia/trunk/doxia-decoration-model/src/test/java/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/
maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml
(with props)
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
(with props)
Modified:
maven/doxia/trunk/doxia-decoration-model/pom.xml
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
Modified: maven/doxia/trunk/doxia-decoration-model/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/pom.xml?rev=358699&r1=358698&r2=358699&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/pom.xml (original)
+++ maven/doxia/trunk/doxia-decoration-model/pom.xml Thu Dec 22 20:40:23 2005
@@ -32,6 +32,12 @@
</build>
<dependencies>
<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.0.4</version>
Modified:
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java?rev=358699&r1=358698&r2=358699&view=diff
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
(original)
+++
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
Thu Dec 22 20:40:23 2005
@@ -27,5 +27,6 @@
{
String ROLE = DecorationModelInheritanceAssembler.class.getName();
- void assembleModelInheritance( DecorationModel child, DecorationModel
parent );
+ void assembleModelInheritance( DecorationModel child, DecorationModel
parent, String childBaseUrl,
+ String parentBaseUrl );
}
Modified:
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java?rev=358699&r1=358698&r2=358699&view=diff
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
(original)
+++
maven/doxia/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
Thu Dec 22 20:40:23 2005
@@ -16,15 +16,20 @@
*
*/
+import org.apache.maven.doxia.site.decoration.Banner;
import org.apache.maven.doxia.site.decoration.Body;
import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.maven.doxia.site.decoration.LinkItem;
+import org.apache.maven.doxia.site.decoration.Logo;
import org.apache.maven.doxia.site.decoration.Menu;
+import org.apache.maven.doxia.site.decoration.MenuItem;
+import org.codehaus.plexus.util.PathTool;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.StringTokenizer;
/**
* Manage inheritance of the decoration model.
@@ -35,9 +40,10 @@
public class DefaultDecorationModelInheritanceAssembler
implements DecorationModelInheritanceAssembler
{
- public void assembleModelInheritance( DecorationModel child,
DecorationModel parent )
+ public void assembleModelInheritance( DecorationModel child,
DecorationModel parent, String childBaseUrl,
+ String parentBaseUrl )
{
- // TODO: align hrefs to the base URL of the project
+ String prefix = getParentPrefix( parentBaseUrl, childBaseUrl );
// cannot inherit from null parent.
if ( parent != null )
@@ -45,11 +51,15 @@
if ( child.getBannerLeft() == null )
{
child.setBannerLeft( parent.getBannerLeft() );
+
+ resolveBannerPaths( child.getBannerLeft(), prefix );
}
if ( child.getBannerRight() == null )
{
child.setBannerRight( parent.getBannerRight() );
+
+ resolveBannerPaths( child.getBannerRight(), prefix );
}
if ( child.getPublishDate() == null )
@@ -57,14 +67,33 @@
child.setPublishDate( parent.getPublishDate() );
}
- child.setPoweredBy( mergeLinkItemLists( child.getPoweredBy(),
parent.getPoweredBy() ) );
+ child.setPoweredBy( mergePoweredByLists( child.getPoweredBy(),
parent.getPoweredBy(), prefix ) );
- assembleBodyInheritance( child, parent );
+ assembleBodyInheritance( child, parent, prefix );
assembleCustomInheritance( child, parent );
}
}
+ private void resolveBannerPaths( Banner banner, String prefix )
+ {
+ if ( banner != null )
+ {
+ banner.setHref( resolvePath( banner.getHref(), prefix ) );
+ banner.setSrc( resolvePath( banner.getSrc(), prefix ) );
+ }
+ }
+
+ private String resolvePath( String href, String prefix )
+ {
+ String relativePath = href;
+ if ( relativePath.startsWith( "/" ) )
+ {
+ relativePath = relativePath.substring( 1 );
+ }
+ return PathTool.calculateLink( relativePath, prefix );
+ }
+
private void assembleCustomInheritance( DecorationModel child,
DecorationModel parent )
{
if ( child.getCustom() == null )
@@ -77,16 +106,18 @@
}
}
- private void assembleBodyInheritance( DecorationModel child,
DecorationModel parent )
+ private void assembleBodyInheritance( DecorationModel child,
DecorationModel parent, String prefix )
{
Body cBody = child.getBody();
Body pBody = parent.getBody();
- if ( cBody == null )
+ if ( cBody == null && pBody != null )
{
- child.setBody( pBody );
+ cBody = new Body();
+ child.setBody( cBody );
}
- else if ( pBody != null )
+
+ if ( pBody != null )
{
if ( cBody.getHead() == null )
{
@@ -97,14 +128,14 @@
cBody.setHead( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom)
cBody.getHead(), (Xpp3Dom) pBody.getHead() ) );
}
- cBody.setLinks( mergeLinkItemLists( cBody.getLinks(),
pBody.getLinks() ) );
- cBody.setBreadcrumbs( mergeLinkItemLists( cBody.getBreadcrumbs(),
pBody.getBreadcrumbs() ) );
+ cBody.setLinks( mergeLinkItemLists( cBody.getLinks(),
pBody.getLinks(), prefix ) );
+ cBody.setBreadcrumbs( mergeLinkItemLists( cBody.getBreadcrumbs(),
pBody.getBreadcrumbs(), prefix ) );
- cBody.setMenus( mergeMenus( cBody.getMenus(), pBody.getMenus() ) );
+ cBody.setMenus( mergeMenus( cBody.getMenus(), pBody.getMenus(),
prefix ) );
}
}
- private List mergeMenus( List dominant, List recessive )
+ private List mergeMenus( List dominant, List recessive, String prefix )
{
List menus = new ArrayList();
@@ -115,24 +146,51 @@
menus.add( menu );
}
+ int topCounter = 0;
for ( Iterator it = recessive.iterator(); it.hasNext(); )
{
Menu menu = (Menu) it.next();
if ( "top".equals( menu.getInherit() ) )
{
- menus.add( 0, menu );
+ menus.add( topCounter, menu );
+ topCounter++;
+
+ resolveMenuPaths( menu.getItems(), prefix );
}
else if ( "bottom".equals( menu.getInherit() ) )
{
menus.add( menu );
+
+ resolveMenuPaths( menu.getItems(), prefix );
}
}
return menus;
}
- private List mergeLinkItemLists( List dominant, List recessive )
+ private void resolveMenuPaths( List items, String prefix )
+ {
+ for ( Iterator i = items.iterator(); i.hasNext(); )
+ {
+ MenuItem item = (MenuItem) i.next();
+ resolveLinkItemPaths( item, prefix );
+ resolveMenuPaths( item.getItems(), prefix );
+ }
+ }
+
+ private void resolveLinkItemPaths( LinkItem item, String prefix )
+ {
+ item.setHref( resolvePath( item.getHref(), prefix ) );
+ }
+
+ private void resolveLogoPaths( Logo logo, String prefix )
+ {
+ logo.setImg( resolvePath( logo.getImg(), prefix ) );
+ resolveLinkItemPaths( logo, prefix );
+ }
+
+ private List mergeLinkItemLists( List dominant, List recessive, String
prefix )
{
List items = new ArrayList();
@@ -150,9 +208,78 @@
if ( !items.contains( item ) )
{
items.add( item );
+
+ resolveLinkItemPaths( item, prefix );
}
}
return items;
+ }
+
+ private List mergePoweredByLists( List dominant, List recessive, String
prefix )
+ {
+ List logos = new ArrayList();
+
+ for ( Iterator it = dominant.iterator(); it.hasNext(); )
+ {
+ Logo logo = (Logo) it.next();
+
+ logos.add( logo );
+ }
+
+ for ( Iterator it = recessive.iterator(); it.hasNext(); )
+ {
+ Logo logo = (Logo) it.next();
+
+ if ( !logos.contains( logo ) )
+ {
+ logos.add( logo );
+
+ resolveLogoPaths( logo, prefix );
+ }
+ }
+
+ return logos;
+ }
+
+ private static String getParentPrefix( String parentUrl, String childUrl )
+ {
+ String prefix = parentUrl;
+ if ( childUrl.startsWith( parentUrl ) )
+ {
+ prefix = getRelativePath( childUrl, parentUrl );
+
+ String parentPath = "";
+ for ( StringTokenizer tok = new StringTokenizer( prefix, "/" );
tok.hasMoreTokens(); tok.nextToken() )
+ {
+ parentPath += "../";
+ }
+ prefix = parentPath;
+ }
+ else if ( parentUrl.startsWith( childUrl ) )
+ {
+ prefix = getRelativePath( parentUrl, childUrl );
+ }
+
+ if ( !prefix.endsWith( "/" ) )
+ {
+ prefix += "/";
+ }
+
+ return prefix;
+ }
+
+ private static String getRelativePath( String childUrl, String parentUrl )
+ {
+ String relative = childUrl.substring( parentUrl.length() );
+ if ( relative.startsWith( "/" ) )
+ {
+ relative = relative.substring( 1 );
+ }
+ if ( !relative.endsWith( "/" ) )
+ {
+ relative += "/";
+ }
+ return relative;
}
}
Modified: maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo?rev=358699&r1=358698&r2=358699&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
(original)
+++ maven/doxia/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo Thu
Dec 22 20:40:23 2005
@@ -20,6 +20,7 @@
<name>name</name>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field>
<name>bannerLeft</name>
@@ -28,6 +29,7 @@
<association>
<type>Banner</type>
</association>
+ <identifier>true</identifier>
</field>
<field>
<name>bannerRight</name>
@@ -36,6 +38,7 @@
<association>
<type>Banner</type>
</association>
+ <identifier>true</identifier>
</field>
<field>
<name>publishDate</name>
@@ -44,6 +47,7 @@
<association>
<type>PublishDate</type>
</association>
+ <identifier>true</identifier>
</field>
<field xml.associationTagName="logo">
<name>poweredBy</name>
@@ -53,6 +57,7 @@
<type>Logo</type>
<multiplicity>*</multiplicity>
</association>
+ <identifier>true</identifier>
</field>
<field>
<name>body</name>
@@ -61,12 +66,14 @@
<association>
<type>Body</type>
</association>
+ <identifier>true</identifier>
</field>
<field>
<name>custom</name>
<description>Custom configuration for use with customised velocity
templates.</description>
<version>1.0.0</version>
<type>DOM</type>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -80,24 +87,28 @@
<version>1.0.0</version>
<description>Description of the banner.</description>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field>
<name>src</name>
<version>1.0.0</version>
<description>The href of an image for the banner</description>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field>
<name>alt</name>
<version>1.0.0</version>
<description>Alt description for the banner image.</description>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field>
<name>href</name>
<version>1.0.0</version>
<description>The href of a link to use for the banner</description>
<type>String</type>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -112,12 +123,14 @@
bottom).</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field xml.attribute="true">
<name>format</name>
<description>Date format to use. The default is
MM/dd/yyyy.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -132,6 +145,7 @@
<description>Logo image href.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -145,6 +159,7 @@
<description>Additional content to include in the HEAD block of the
generated pages.</description>
<version>1.0.0</version>
<type>DOM</type>
+ <identifier>true</identifier>
</field>
<field xml.associationTagName="item">
<name>links</name>
@@ -154,6 +169,7 @@
<type>LinkItem</type>
<multiplicity>*</multiplicity>
</association>
+ <identifier>true</identifier>
</field>
<field xml.associationTagName="item">
<name>breadcrumbs</name>
@@ -162,7 +178,9 @@
<association>
<type>LinkItem</type>
<multiplicity>*</multiplicity>
+ <identifier>true</identifier>
</association>
+ <identifier>true</identifier>
</field>
<field xml.listStyle="flat">
<name>menus</name>
@@ -172,6 +190,7 @@
<type>Menu</type>
<multiplicity>*</multiplicity>
</association>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -185,12 +204,14 @@
<description>The name to use for the link.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field xml.attribute="true">
<name>href</name>
<description>The href to use for the link.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -204,12 +225,14 @@
<description>The name to use for the menu.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field xml.attribute="true">
<name>inherit</name>
<description>The way in which the menu is inherited.</description>
<version>1.0.0</version>
<type>String</type>
+ <identifier>true</identifier>
</field>
<field xml.listStyle="flat">
<name>items</name>
@@ -219,6 +242,7 @@
<type>MenuItem</type>
<multiplicity>*</multiplicity>
</association>
+ <identifier>true</identifier>
</field>
</fields>
</class>
@@ -233,6 +257,7 @@
<description>Whether the item is collapsed by default when it has
children elements.</description>
<version>1.0.0</version>
<type>boolean</type>
+ <identifier>true</identifier>
</field>
<field xml.listStyle="flat">
<name>items</name>
@@ -242,6 +267,7 @@
<type>MenuItem</type>
<multiplicity>*</multiplicity>
</association>
+ <identifier>true</identifier>
</field>
</fields>
</class>
Added:
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java?rev=358699&view=auto
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
(added)
+++
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
Thu Dec 22 20:40:23 2005
@@ -0,0 +1,291 @@
+package org.apache.maven.doxia.site.decoration.inheritance;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import junit.framework.TestCase;
+import org.apache.maven.doxia.site.decoration.DecorationModel;
+import org.apache.maven.doxia.site.decoration.LinkItem;
+import org.apache.maven.doxia.site.decoration.Logo;
+import org.apache.maven.doxia.site.decoration.Menu;
+import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * Test the inheritance assembler.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
+ */
+public class DecorationModelInheritenceAssemblerTest
+ extends TestCase
+{
+ private DecorationModelInheritanceAssembler assembler = new
DefaultDecorationModelInheritanceAssembler();
+
+ public void testInheritence()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel childModel = readModel( "child.xml" );
+ DecorationModel parentModel = readModel( "parent.xml" );
+
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ DecorationModel mergedModel = readModel( "merged.xml" );
+ assertEquals( "Check result", mergedModel, childModel );
+ }
+
+ public void testPathsResolvedWhenEmpty()
+ throws IOException, XmlPullParserException
+ {
+ // Test an empty model avoids NPEs
+ DecorationModel childModel = readModel( "empty.xml" );
+ DecorationModel parentModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ DecorationModel mergedModel = readModel( "empty.xml" );
+ assertEquals( "Check result", mergedModel, childModel );
+ }
+
+ public void testPathsNotResolvedForExternalUrls()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "external-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ assertEquals( "check left banner href", "http://jakarta.apache.org/",
childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image",
"http://jakarta.apache.org/images/jakarta-logo.gif",
+ childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href",
"http://jakarta.apache.org/commons/sandbox",
+ childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"http://jakarta.apache.org/commons/images/logo.png",
+ childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href",
"http://tomcat.apache.org/", poweredBy.getHref() );
+ assertEquals( "check powered by logo image",
"http://tomcat.apache.org/logo.gif", poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href", "http://www.apache.org/",
breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href", "http://www.bouncycastle.org",
link.getHref() );
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href",
"http://www.apache.org/special/", menuItem.getHref() );
+ }
+
+ public void testPathsResolvedForRelativeUrls()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "relative-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia/",
+ "http://maven.apache.org" );
+
+ assertEquals( "check left banner href", "../banner/left",
childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image", "../images/jakarta-logo.gif",
childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href", "../banner/right/",
childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"../commons/images/logo.png", childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href", "../tomcat",
poweredBy.getHref() );
+ assertEquals( "check powered by logo image", "../tomcat/logo.gif",
poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href", "../apache",
breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href", "../bouncycastle/", link.getHref() );
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href", "../special/",
menuItem.getHref() );
+ }
+
+ public void testPathsResolvedForRelativeUrlsDepthOfTwo()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "relative-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia/core",
+ "http://maven.apache.org" );
+
+ assertEquals( "check left banner href", "../../banner/left",
childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image",
"../../images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href", "../../banner/right/",
childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"../../commons/images/logo.png",
+ childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href", "../../tomcat",
poweredBy.getHref() );
+ assertEquals( "check powered by logo image", "../../tomcat/logo.gif",
poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href", "../../apache",
breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href", "../../bouncycastle/", link.getHref()
);
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href", "../../special/",
menuItem.getHref() );
+ }
+
+ public void testPathsResolvedForReverseRelativeUrls()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "relative-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/",
+ "http://maven.apache.org/doxia/" );
+
+ assertEquals( "check left banner href", "doxia/banner/left",
childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image",
"doxia/images/jakarta-logo.gif", childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href", "doxia/banner/right/",
childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"doxia/commons/images/logo.png",
+ childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href", "doxia/tomcat",
poweredBy.getHref() );
+ assertEquals( "check powered by logo image", "doxia/tomcat/logo.gif",
poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href", "doxia/apache",
breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href", "doxia/bouncycastle/", link.getHref()
);
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href", "doxia/special/",
menuItem.getHref() );
+ }
+
+ public void testPathsResolvedForReverseRelativeUrlsDepthOfTwo()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "relative-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/",
+
"http://maven.apache.org/doxia/core/" );
+
+ assertEquals( "check left banner href", "doxia/core/banner/left",
childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image",
"doxia/core/images/jakarta-logo.gif",
+ childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href", "doxia/core/banner/right/",
childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"doxia/core/commons/images/logo.png",
+ childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href", "doxia/core/tomcat",
poweredBy.getHref() );
+ assertEquals( "check powered by logo image",
"doxia/core/tomcat/logo.gif", poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href", "doxia/core/apache",
breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href", "doxia/core/bouncycastle/",
link.getHref() );
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href", "doxia/core/special/",
menuItem.getHref() );
+ }
+
+ public void testPathsResolvedForUnrelatedRelativeUrls()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel parentModel = readModel( "relative-urls.xml" );
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org",
+ "http://jakarta.apache.org" );
+
+ assertEquals( "check left banner href",
"http://jakarta.apache.org/banner/left",
+ childModel.getBannerLeft().getHref() );
+ assertEquals( "check left banner image",
"http://jakarta.apache.org/images/jakarta-logo.gif",
+ childModel.getBannerLeft().getSrc() );
+
+ assertEquals( "check right banner href",
"http://jakarta.apache.org/banner/right/",
+ childModel.getBannerRight().getHref() );
+ assertEquals( "check right banner image",
"http://jakarta.apache.org/commons/images/logo.png",
+ childModel.getBannerRight().getSrc() );
+
+ Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+ assertEquals( "check powered by logo href",
"http://jakarta.apache.org/tomcat", poweredBy.getHref() );
+ assertEquals( "check powered by logo image",
"http://jakarta.apache.org/tomcat/logo.gif", poweredBy.getImg() );
+
+ LinkItem breadcrumb = (LinkItem)
childModel.getBody().getBreadcrumbs().get( 0 );
+ assertEquals( "check breadcrumb href",
"http://jakarta.apache.org/apache", breadcrumb.getHref() );
+
+ LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+ assertEquals( "check link href",
"http://jakarta.apache.org/bouncycastle/", link.getHref() );
+
+ Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
+ LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+ assertEquals( "check menu item href",
"http://jakarta.apache.org/special/", menuItem.getHref() );
+ }
+
+ public void testNullParent()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel childModel = readModel( "empty.xml" );
+ assembler.assembleModelInheritance( childModel, null,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ DecorationModel mergedModel = readModel( "empty.xml" );
+ assertEquals( "Check result", mergedModel, childModel );
+ }
+
+ public void testFullyPopulatedChild()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel childModel = readModel( "fully-populated-child.xml" );
+ DecorationModel parentModel = readModel( "fully-populated-child.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ DecorationModel mergedModel = readModel( "fully-populated-child.xml" );
+ assertEquals( "Check result", mergedModel, childModel );
+ }
+
+ public void testFullyPopulatedParentAndEmptyChild()
+ throws IOException, XmlPullParserException
+ {
+ DecorationModel childModel = readModel( "empty.xml" );
+ DecorationModel parentModel = readModel( "fully-populated-child.xml" );
+ assembler.assembleModelInheritance( childModel, parentModel,
"http://maven.apache.org/doxia",
+ "http://maven.apache.org" );
+
+ DecorationModel mergedModel = readModel( "fully-populated-merged.xml"
);
+ assertEquals( "Check result", mergedModel, childModel );
+ }
+
+ private DecorationModel readModel( String name )
+ throws IOException, XmlPullParserException
+ {
+ return new DecorationXpp3Reader().read( new InputStreamReader(
getClass().getResourceAsStream( "/" + name ) ) );
+ }
+}
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml?rev=358699&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml
(added)
+++ maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml Thu
Dec 22 20:40:23 2005
@@ -0,0 +1,29 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Child">
+ <body>
+ <links>
+ <item name="Bouncy Castle" href="http://www.bouncycastle.org"/>
+ </links>
+
+ <menu name="Subproject menu">
+ <item name="Introduction" href="/index.html"/>
+ <item name="Usage" href="/usage.html"/>
+ </menu>
+
+ </body>
+</project>
\ No newline at end of file
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/child.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml?rev=358699&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml
(added)
+++ maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml Thu
Dec 22 20:40:23 2005
@@ -0,0 +1,18 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Empty">
+</project>
\ No newline at end of file
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/empty.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml?rev=358699&view=auto
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
(added)
+++
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
Thu Dec 22 20:40:23 2005
@@ -0,0 +1,46 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Parent Name">
+ <bannerLeft>
+ <name>The Jakarta Project</name>
+ <src>http://jakarta.apache.org/images/jakarta-logo.gif</src>
+ <href>http://jakarta.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>Jakarta Commons Sandbox</name>
+ <src>http://jakarta.apache.org/commons/images/logo.png</src>
+ <href>http://jakarta.apache.org/commons/sandbox</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo name="Tomcat" href="http://tomcat.apache.org/"
img="http://tomcat.apache.org/logo.gif"/>
+ </poweredBy>
+
+ <body>
+ <breadcrumbs>
+ <item name="Apache" href="http://www.apache.org/"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="Bouncy Castle" href="http://www.bouncycastle.org"/>
+ </links>
+
+ <menu name="Special" inherit="top">
+ <item name="Special" href="http://www.apache.org/special/"/>
+ </menu>
+ </body>
+</project>
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/external-urls.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml?rev=358699&view=auto
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
(added)
+++
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
Thu Dec 22 20:40:23 2005
@@ -0,0 +1,53 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Child">
+ <bannerLeft>
+ <name>name</name>
+ <src>src</src>
+ <href>href</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>name</name>
+ <src>src</src>
+ <href>href</href>
+ </bannerRight>
+
+ <publishDate format="fmt" position="top"/>
+
+ <poweredBy>
+ <logo name="Maven" href="http://maven.apache.org"
img="http://maven.apache.org/images/maven-feather.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="Bouncy Castle" href="http://www.bouncycastle.org"/>
+ </links>
+
+ <head>
+ <meta name="blah" value="blah"/>
+ </head>
+
+ <menu name="Subproject menu">
+ <item name="Introduction" href="/index.html"/>
+ <item name="Usage" href="/usage.html"/>
+ </menu>
+ </body>
+
+ <custom>
+ <junk>junk</junk>
+ </custom>
+</project>
\ No newline at end of file
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-child.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml?rev=358699&view=auto
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
(added)
+++
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
Thu Dec 22 20:40:23 2005
@@ -0,0 +1,49 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Empty">
+ <bannerLeft>
+ <name>name</name>
+ <src>../src</src>
+ <href>../href</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>name</name>
+ <src>../src</src>
+ <href>../href</href>
+ </bannerRight>
+
+ <publishDate format="fmt" position="top"/>
+
+ <poweredBy>
+ <logo name="Maven" href="http://maven.apache.org"
img="http://maven.apache.org/images/maven-feather.png"/>
+ </poweredBy>
+
+ <body>
+ <links>
+ <item name="Bouncy Castle" href="http://www.bouncycastle.org"/>
+ </links>
+
+ <head>
+ <meta name="blah" value="blah"/>
+ </head>
+
+ </body>
+
+ <custom>
+ <junk>junk</junk>
+ </custom>
+</project>
\ No newline at end of file
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/fully-populated-merged.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml?rev=358699&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml
(added)
+++ maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml Thu
Dec 22 20:40:23 2005
@@ -0,0 +1,56 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Child">
+ <bannerLeft>
+ <name>The Jakarta Project</name>
+ <src>http://jakarta.apache.org/images/jakarta-logo.gif</src>
+ <href>http://jakarta.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>Jakarta Commons Sandbox</name>
+ <src>http://jakarta.apache.org/commons/images/logo.png</src>
+ <href>http://jakarta.apache.org/commons/sandbox</href>
+ </bannerRight>
+ <poweredBy>
+ <logo name="Maven" href="http://maven.apache.org"
img="../images/maven-feather.png"/>
+ </poweredBy>
+ <body>
+ <breadcrumbs>
+ <item name="Apache" href="http://www.apache.org/"/>
+ <item name="Jakarta Commons" href="http://jakarta.apache.org/commons/"/>
+ <item name="Sandbox" href="http://jakarta.apache.org/commons/sandbox/"/>
+ </breadcrumbs>
+ <links>
+ <item name="Bouncy Castle" href="http://www.bouncycastle.org"/>
+ </links>
+
+ <menu name="Top Menu" inherit="top">
+ <item name="Introduction" href="/index.html"/>
+ <item name="Usage" href="/usage.html"/>
+ </menu>
+ <menu name="empty menu" inherit="top">
+
+ </menu>
+ <menu name="Subproject menu">
+ <item name="Introduction" href="/index.html"/>
+ <item name="Usage" href="/usage.html"/>
+ </menu>
+ <menu name="Other Links" inherit="bottom">
+ <item name="Copyright" href="/copyright.html"/>
+ </menu>
+ </body>
+</project>
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/merged.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml?rev=358699&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml
(added)
+++ maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml Thu
Dec 22 20:40:23 2005
@@ -0,0 +1,52 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Parent Name">
+ <bannerLeft>
+ <name>The Jakarta Project</name>
+ <src>http://jakarta.apache.org/images/jakarta-logo.gif</src>
+ <href>http://jakarta.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>Jakarta Commons Sandbox</name>
+ <src>http://jakarta.apache.org/commons/images/logo.png</src>
+ <href>http://jakarta.apache.org/commons/sandbox</href>
+ </bannerRight>
+ <poweredBy>
+ <logo name="Maven" href="http://maven.apache.org"
img="images/maven-feather.png"/>
+ </poweredBy>
+ <body>
+ <breadcrumbs>
+ <item name="Apache" href="http://www.apache.org/"/>
+ <item name="Jakarta Commons" href="http://jakarta.apache.org/commons/"/>
+ <item name="Sandbox" href="http://jakarta.apache.org/commons/sandbox/"/>
+ </breadcrumbs>
+
+ <menu name="Top Menu" inherit="top">
+ <item name="Introduction" href="/index.html"/>
+ <item name="Usage" href="/usage.html"/>
+ </menu>
+ <menu name="empty menu" inherit="top">
+
+ </menu>
+ <menu name="Special" inherit="off">
+ <item name="Special" href="/special.html"/>
+ </menu>
+ <menu name="Other Links" inherit="bottom">
+ <item name="Copyright" href="/copyright.html"/>
+ </menu>
+ </body>
+</project>
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/parent.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
URL:
http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml?rev=358699&view=auto
==============================================================================
---
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
(added)
+++
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
Thu Dec 22 20:40:23 2005
@@ -0,0 +1,46 @@
+<!--
+ ~ Copyright 2004-2005 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<project name="Parent Name">
+ <bannerLeft>
+ <name>The Jakarta Project</name>
+ <src>/images/jakarta-logo.gif</src>
+ <href>banner/left</href>
+ </bannerLeft>
+ <bannerRight>
+ <name>Jakarta Commons Sandbox</name>
+ <src>commons/images/logo.png</src>
+ <href>/banner/right/</href>
+ </bannerRight>
+
+ <poweredBy>
+ <logo name="Tomcat" href="tomcat" img="tomcat/logo.gif"/>
+ </poweredBy>
+
+ <body>
+ <breadcrumbs>
+ <item name="Apache" href="/apache"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="Bouncy Castle" href="/bouncycastle/"/>
+ </links>
+
+ <menu name="Special" inherit="top">
+ <item name="Special" href="/special/"/>
+ </menu>
+ </body>
+</project>
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/doxia/trunk/doxia-decoration-model/src/test/resources/relative-urls.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision