svn commit: r780965 - /maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 08:31:28 2009
New Revision: 780965

URL: http://svn.apache.org/viewvc?rev=780965&view=rev
Log:
Update test cases

Modified:

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java?rev=780965&r1=780964&r2=780965&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
 Tue Jun  2 08:31:28 2009
@@ -95,6 +95,7 @@
 author.setCountry( "country" + i );
 author.setEmail( "email" + i );
 author.setFaxNumber( "faxNumber" + i );
+author.setName( "name" + i );
 author.setFirstName( "firstName" + i );
 author.setInitials( "initials" + i );
 author.setLastName( "lastName" + i );
@@ -115,6 +116,7 @@
 assertEquals( "country" + i, documentAuthor.getCountry() );
 assertEquals( "email" + i, documentAuthor.getEmail() );
 assertEquals( "faxNumber" + i, documentAuthor.getFaxNumber() );
+assertEquals( "name" + i, documentAuthor.getName() );
 assertEquals( "firstName" + i, documentAuthor.getFirstName() );
 assertEquals( "initials" + i, documentAuthor.getInitials() );
 assertEquals( "lastName" + i, documentAuthor.getLastName() );
@@ -236,7 +238,8 @@
 meta.setGenerator( "generator" );
 meta.setHyperlinkBehaviour( getDocumentHyperlinkBehaviour() );
 meta.setInitialCreator( "initialCreator" );
-meta.setKeywords( "keywords" );
+meta.addKeyWord( "keyword1" );
+meta.addKeyWord( "keyword2" );
 meta.setLanguage( "language" );
 meta.setPageSize( "pageSize" );
 meta.setPrintDate( new Date( 4L ) );
@@ -267,7 +270,7 @@
 assertEquals( "generator", meta.getGenerator() );
 verifyDocumentHyperlinkBehaviour( meta.getHyperlinkBehaviour() );
 assertEquals( "initialCreator", meta.getInitialCreator() );
-assertEquals( "keywords", meta.getKeywords() );
+assertEquals( "keyword1, keyword2", meta.getAllKeyWords() );
 assertEquals( "language", meta.getLanguage() );
 assertEquals( "pageSize", meta.getPageSize() );
 assertEquals( 4L, meta.getPrintDate().getTime() );




svn commit: r780966 - in /maven/doxia/doxia/trunk/doxia-core/src: main/java/org/apache/maven/doxia/util/DoxiaUtils.java test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 08:33:19 2009
New Revision: 780966

URL: http://svn.apache.org/viewvc?rev=780966&view=rev
Log:
Add a common method for parsing dates

Modified:

maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java?rev=780966&r1=780965&r2=780966&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
 Tue Jun  2 08:33:19 2009
@@ -20,6 +20,12 @@
  */
 
 import java.io.UnsupportedEncodingException;
+
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+
+import java.util.Date;
 import java.util.Locale;
 
 /**
@@ -281,6 +287,61 @@
 return true;
 }
 
+private static final SimpleDateFormat DATE_PARSER = new SimpleDateFormat();
+private static final ParsePosition DATE_PARSE_POSITION = new 
ParsePosition( 0 );
+private static final String[] DATE_PATTERNS = new String[]
+{
+"-MM-dd", "/MM/dd", "MMdd", "", "dd.MM.", "dd MMM 
",
+"dd MMM. ", " ", "MMM. dd, ", "MMM. ", " dd, 
",
+"MMM d, ''yy", "MMM. ''yy", " ''yy"
+};
+
+/**
+ * Parses a string representing a date by trying different date 
patterns.
+ *
+ * The following date patterns are tried (in the given order):
+ *
+ * "-MM-dd", "/MM/dd", "MMdd", "", "dd.MM.", "dd 
MMM ",
+ *  "dd MMM. ", " ", "MMM. dd, ", "MMM. ", " dd, 
",
+ *  "MMM d, ''yy", "MMM. ''yy", " ''yy"
+ *
+ * A parse is only sucessful if it parses the whole of the input string.
+ * If no parse patterns match, a ParseException is thrown.
+ *
+ * As a special case, the strings "today" and 
"now"
+ * (ignoring case) return the current date.
+ *
+ * @param str the date to parse, not null.
+ * @return the parsed date, or the current date if the input String 
(ignoring case) was
+ *  "today" or "now".
+ * @throws ParseException if no pattern matches.
+ *
+ * @since 1.1.1.
+ */
+public static Date parseDate( String str )
+throws ParseException
+{
+if ( "today".equals( str.toLowerCase( Locale.ENGLISH ) )
+|| "now".equals( str.toLowerCase( Locale.ENGLISH ) ) )
+{
+return new Date();
+}
+
+for ( int i = 0; i < DATE_PATTERNS.length; i++ )
+{
+DATE_PARSER.applyPattern( DATE_PATTERNS[i] );
+DATE_PARSE_POSITION.setIndex( 0 );
+final Date date = DATE_PARSER.parse( str, DATE_PARSE_POSITION );
+
+if ( date != null && DATE_PARSE_POSITION.getIndex() == 
str.length() )
+{
+return date;
+}
+}
+
+throw new ParseException( "Unable to parse date: " + str, -1 );
+}
+
   //
  // private
 //

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java?rev=780966&r1=780965&r2=780966&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
 Tue Jun  2 08:33:19 2009
@@ -19,6 +19,11 @@
  * under the License.
  */
 
+import java.text.ParseException;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+
 import org.codehaus.plexus.PlexusTestCase;
 
 /**
@@ -184,4 +189,54 @@
 assertTrue( DoxiaUtils.isValidId( "index.html" ) );
 assertFalse( DoxiaUtils.isValidId( "Theußl" ) );
 }
+
+/**
+ * Verify the expected results.
+ */
+public void testParseDate()
+{
+final int year = 1973;
+final int month = 1;
+final int day = 27;
+
+try
+{
+final Date feb27 = new GregorianCalendar( year, month, day 
).getTime();
+assertEquals( feb27, DoxiaUtils.parseDate( "27.02.1973" ) );
+assertEquals( feb27, DoxiaUtils.parseDate( "27. 02. 1973" ) );
+assertEquals( feb27, DoxiaUtils.parseDate( "1973-02-27" ) );
+assertEquals( feb27, DoxiaUtils.parseDate

svn commit: r780986 - in /maven/doxia/doxia/trunk/doxia-core/src: main/java/org/apache/maven/doxia/document/ main/java/org/apache/maven/doxia/document/DocumentModelSink.java test/java/org/apache/maven

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 09:43:33 2009
New Revision: 780986

URL: http://svn.apache.org/viewvc?rev=780986&view=rev
Log:
Add a DocumentModelSink to extract meta information from documents.

Added:

maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/

maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/DocumentModelSink.java
   (with props)

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelSinkTest.java
   (with props)

Added: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/DocumentModelSink.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/DocumentModelSink.java?rev=780986&view=auto
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/DocumentModelSink.java
 (added)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/DocumentModelSink.java
 Tue Jun  2 09:43:33 2009
@@ -0,0 +1,328 @@
+package org.apache.maven.doxia.document;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.text.ParseException;
+
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Locale;
+
+import javax.swing.text.html.HTML.Attribute;
+
+import org.apache.maven.doxia.sink.SinkAdapter;
+import org.apache.maven.doxia.sink.SinkEventAttributes;
+import org.apache.maven.doxia.util.DoxiaUtils;
+
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * A Sink that collects meta-information emitted by a parser and stores it in 
a DocumentModel.
+ *
+ * Use like:
+ *
+ * 
+ * DocumentModelSink sink = new DocumentModelSink();
+ * parser.parse( reader, sink );
+ * DocumentModel model = sink.getModel();
+ * 
+ *
+ * The sink only collects information from the title(), 
author
+ * and date events, as well as meta-information emitted via 
unknown(),
+ * all other events are ignored.
+ *
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.1.1.
+ */
+
+public class DocumentModelSink
+extends SinkAdapter
+{
+private final DocumentModel model;
+
+private StringBuffer buffer;
+private DocumentAuthor author;
+
+/**
+ * Create a DocumentModelSink.
+ */
+public DocumentModelSink()
+{
+this.model = new DocumentModel();
+model.setMeta( new DocumentMeta() );
+}
+
+/**
+ * Retrieve the DocumentModel created by this Sink.
+ *
+ * @return the DocumentModel.
+ */
+public DocumentModel getModel()
+{
+return model;
+}
+
+/** Start recording a title. */
+public void title()
+{
+title( null );
+}
+
+/**
+ * Start recording a title. Only text events within a title event are 
recorded.
+ *
+ * @param attributes ignored.
+ */
+public void title( SinkEventAttributes attributes )
+{
+this.buffer = new StringBuffer();
+}
+
+/** End recording a title. */
+public void title_()
+{
+String title = buffer.toString();
+
+if ( StringUtils.isNotEmpty( title ) )
+{
+getModel().getMeta().setTitle( buffer.toString() );
+}
+
+this.buffer = null;
+}
+
+/** Start recording an author. */
+public void author()
+{
+author( null );
+}
+
+/**
+ * Start recording an author. Only text events within an author event are 
recorded.
+ *
+ * @param attributes only email attribute is recognized.
+ */
+public void author( SinkEventAttributes attributes )
+{
+this.buffer = new StringBuffer();
+this.author = new DocumentAuthor();
+
+if ( attributes != null )
+{
+for ( Enumeration e = attributes.getAttributeNames() ; 
e.hasMoreElements() ; )
+{
+String name = e.nextElement().toString();
+
+if ( name.equals( SinkEventAttributes.EMAIL ) )
+{
+author.setEmail( attributes.getAttribute( name 
).toString() );
+}
+els

svn commit: r780998 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 10:20:10 2009
New Revision: 780998

URL: http://svn.apache.org/viewvc?rev=780998&view=rev
Log:
Extract a method to convert with a given FoUserAgent.

Modified:

maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java?rev=780998&r1=780997&r2=780998&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
 Tue Jun  2 10:20:10 2009
@@ -69,8 +69,7 @@
 public static void convertFO2PDF( File fo, File pdf, String resourceDir, 
DocumentModel documentModel )
 throws TransformerException
 {
-FOUserAgent foUserAgent = FOP_FACTORY.newFOUserAgent();
-foUserAgent.setBaseURL( getBaseURL( fo, resourceDir ) );
+FOUserAgent foUserAgent = getDefaultUserAgent( fo, resourceDir );
 
 if ( documentModel != null && documentModel.getMeta() != null )
 {
@@ -109,6 +108,26 @@
 foUserAgent.setCreationDate( new Date() );
 }
 
+convertFO2PDF( fo, pdf, resourceDir, foUserAgent );
+}
+
+/**
+ * Converts an FO file to a PDF file using FOP.
+ *
+ * @param fo the FO file, not null.
+ * @param pdf the target PDF file, not null.
+ * @param resourceDir The base directory for relative path resolution, 
could be null.
+ * If null, defaults to the parent directory of fo.
+ * @param foUserAgent the FOUserAgent to use.
+ *  May be null, in which case a default user agent will be used.
+ * @throws javax.xml.transform.TransformerException In case of a 
conversion problem.
+ * @see 1.1.1
+ */
+public static void convertFO2PDF( File fo, File pdf, String resourceDir, 
FOUserAgent foUserAgent )
+throws TransformerException
+{
+FOUserAgent userAgent = ( foUserAgent == null ? getDefaultUserAgent( 
fo, resourceDir ) : foUserAgent );
+
 OutputStream out = null;
 try
 {
@@ -124,7 +143,7 @@
 Result res = null;
 try
 {
-Fop fop = FOP_FACTORY.newFop( MimeConstants.MIME_PDF, 
foUserAgent, out );
+Fop fop = FOP_FACTORY.newFop( MimeConstants.MIME_PDF, 
userAgent, out );
 res = new SAXResult( fop.getDefaultHandler() );
 }
 catch ( FOPException e )
@@ -164,7 +183,7 @@
 public static void convertFO2PDF( File fo, File pdf, String resourceDir )
 throws TransformerException
 {
-convertFO2PDF( fo, pdf, resourceDir, null );
+convertFO2PDF( fo, pdf, resourceDir, (DocumentModel) null );
 }
 
 /**
@@ -190,6 +209,14 @@
 return url;
 }
 
+private static FOUserAgent getDefaultUserAgent( File fo, String 
resourceDir )
+{
+FOUserAgent foUserAgent = FOP_FACTORY.newFOUserAgent();
+foUserAgent.setBaseURL( getBaseURL( fo, resourceDir ) );
+
+return foUserAgent;
+}
+
 private FoUtils()
 {
 // Utility class




svn commit: r781000 - in /maven/doxia/site/src/site: pdf.xml xdoc/references/xdoc-format.xml

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 10:49:53 2009
New Revision: 781000

URL: http://svn.apache.org/viewvc?rev=781000&view=rev
Log:
Fix some links

Modified:
maven/doxia/site/src/site/pdf.xml
maven/doxia/site/src/site/xdoc/references/xdoc-format.xml

Modified: maven/doxia/site/src/site/pdf.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/site/src/site/pdf.xml?rev=781000&r1=780999&r2=781000&view=diff
==
--- maven/doxia/site/src/site/pdf.xml (original)
+++ maven/doxia/site/src/site/pdf.xml Tue Jun  2 10:49:53 2009
@@ -52,6 +52,8 @@
 
 
 
+  
+  
 
   
 

Modified: maven/doxia/site/src/site/xdoc/references/xdoc-format.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/site/src/site/xdoc/references/xdoc-format.xml?rev=781000&r1=780999&r2=781000&view=diff
==
--- maven/doxia/site/src/site/xdoc/references/xdoc-format.xml (original)
+++ maven/doxia/site/src/site/xdoc/references/xdoc-format.xml Tue Jun  2 
10:49:53 2009
@@ -31,6 +31,7 @@
   
 
 
+  
   
 
 
@@ -38,6 +39,8 @@
 
 
 
+  
+  
   
 
   An 'xdoc' is an XML document conforming to a small and simple set of 
tags.
@@ -57,12 +60,14 @@
 
   
 
-  
+  
+  
 
   The full documentation is available here.
 
   
 
+  
   
 
   The following is a sample XDoc document:
@@ -113,6 +118,7 @@
 
   
 
+  
   
 
  tags are special.
@@ -124,6 +130,7 @@
 foo]]>
   
 
+  
   
 
   Doxia will produce 

and @@ -143,6 +150,7 @@ A subsubsection + The core doxia modules do not construct anchors from @@ -203,6 +211,7 @@ + Doxia is able to validate your xdoc files as described here. @@ -212,6 +221,7 @@ Here is a list of common mistakes to be aware of: + Wrong: @@ -247,6 +257,7 @@ + Wrong: @@ -272,6 +283,7 @@ + @@ -281,6 +293,7 @@ + Wrong:


svn commit: r781021 - in /maven/doxia/doxia/trunk/doxia-core/src: main/java/org/apache/maven/doxia/document/ test/java/org/apache/maven/doxia/document/DocumentModelSinkTest.java

2009-06-02 Thread ltheussl
Author: ltheussl
Date: Tue Jun  2 12:44:20 2009
New Revision: 781021

URL: http://svn.apache.org/viewvc?rev=781021&view=rev
Log:
Move the DocumentModelSink into the sandbox. Add a dedicated project for code 
to review.

Removed:

maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/document/

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelSinkTest.java



svn commit: r781030 - /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java

2009-06-02 Thread vsiveton
Author: vsiveton
Date: Tue Jun  2 13:21:54 2009
New Revision: 781030

URL: http://svn.apache.org/viewvc?rev=781030&view=rev
Log:
o fixed build

Modified:

maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java?rev=781030&r1=781029&r2=781030&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
 Tue Jun  2 13:21:54 2009
@@ -287,7 +287,7 @@
 return true;
 }
 
-private static final SimpleDateFormat DATE_PARSER = new SimpleDateFormat();
+private static final SimpleDateFormat DATE_PARSER = new SimpleDateFormat( 
"", Locale.ENGLISH );
 private static final ParsePosition DATE_PARSE_POSITION = new 
ParsePosition( 0 );
 private static final String[] DATE_PATTERNS = new String[]
 {




svn commit: r781180 - /maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java

2009-06-02 Thread vsiveton
Author: vsiveton
Date: Tue Jun  2 21:40:15 2009
New Revision: 781180

URL: http://svn.apache.org/viewvc?rev=781180&view=rev
Log:
o switch to unicode

Modified:

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java?rev=781180&r1=781179&r2=781180&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
 Tue Jun  2 21:40:15 2009
@@ -160,10 +160,10 @@
 assertEquals( DoxiaUtils.encodeId( "   anchor" ), "anchor" );
 assertEquals( DoxiaUtils.encodeId( "myAnchor" ), "myAnchor" );
 assertEquals( DoxiaUtils.encodeId( "my&Anchor" ), "my%26Anchor" );
-assertEquals( DoxiaUtils.encodeId( "HÃ¥kon" ), "H%c3%a5kon" );
-assertEquals( DoxiaUtils.encodeId( "HÃ¥kon", true ), "Hkon" );
-assertEquals( DoxiaUtils.encodeId( "Theußl" ), "Theu%c3%9fl" );
-assertEquals( DoxiaUtils.encodeId( "Theußl", true ), "Theul" );
+assertEquals( DoxiaUtils.encodeId( "H\u00E5kon" ), "H%c3%a5kon" );
+assertEquals( DoxiaUtils.encodeId( "H\u00E5kon", true ), "Hkon" );
+assertEquals( DoxiaUtils.encodeId( "Theu\u00DFl" ), "Theu%c3%9fl" );
+assertEquals( DoxiaUtils.encodeId( "Theu\u00DFl", true ), "Theul" );
 }
 
 /**
@@ -187,7 +187,7 @@
 assertTrue( DoxiaUtils.isValidId( "a:" ) );
 assertTrue( DoxiaUtils.isValidId( "a." ) );
 assertTrue( DoxiaUtils.isValidId( "index.html" ) );
-assertFalse( DoxiaUtils.isValidId( "Theußl" ) );
+assertFalse( DoxiaUtils.isValidId( "Theu\u00DFl" ) );
 }
 
 /**




svn commit: r781185 - in /maven/doxia/doxia/trunk: doxia-core/src/main/mdo/ doxia-core/src/test/java/org/apache/maven/doxia/document/ doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia

2009-06-02 Thread vsiveton
Author: vsiveton
Date: Tue Jun  2 21:58:41 2009
New Revision: 781185

URL: http://svn.apache.org/viewvc?rev=781185&view=rev
Log:
o added new string fields for date
o updated code

Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo

maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java

maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo?rev=781185&r1=781184&r2=781185&view=diff
==
--- maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo Tue Jun  2 
21:58:41 2009
@@ -234,6 +234,16 @@
   true
 
 
+  creationdate
+  1.0.1+
+  
+  String
+  true
+
+
   date
   1.0.0+
   
+  String
+  true
+
+
   printDate
   1.0.0+
   
+  String
+  true
+
+
   template
   1.0.0+
   
+  String
+  true
+
   
 
 
@@ -905,10 +945,10 @@
   true
 
 
-  date
+  coverdate
   
   1.0.1+
   String
@@ -932,7 +972,7 @@
   
   1.0.1+
   String

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java?rev=781185&r1=781184&r2=781185&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
 Tue Jun  2 21:58:41 2009
@@ -136,7 +136,7 @@
 cover.setCompanyLogo( "companyLogo" );
 cover.setCompanyName( "companyName" );
 cover.setCoverDate( new Date( 0L ) );
-cover.setDate( "coverDate" );
+cover.setCoverdate( "coverDate" );
 cover.setCoverSubTitle( "coverSubTitle" );
 cover.setCoverTitle( "coverTitle" );
 cover.setCoverType( "coverType" );
@@ -157,7 +157,7 @@
 assertEquals( "companyLogo", cover.getCompanyLogo() );
 assertEquals( "companyName", cover.getCompanyName() );
 assertEquals( 0L, cover.getCoverDate().getTime() );
-assertEquals( "coverDate", cover.getDate() );
+assertEquals( "coverDate", cover.getCoverdate() );
 assertEquals( "coverSubTitle", cover.getCoverSubTitle() );
 assertEquals( "coverTitle", cover.getCoverTitle() );
 assertEquals( "coverType", cover.getCoverType() );

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java?rev=781185&r1=781184&r2=781185&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
 Tue Jun  2 21:58:41 2009
@@ -951,10 +951,10 @@
 subtitle = cover.getCoverSubTitle();
 version = cover.getCoverVersion();
 type = cover.getCoverType();
-date = cover.getDate();
+date = cover.getCoverdate();
 if ( date == null && cover.getCoverDate() != null )
 {
-date = ISO_8601_FORMAT.format( cover.getCoverDate() );
+date = ISO_8601_FORMAT.format( cover.getCoverdate() );
 }
 //author = cover.getAuthor();
 //projName = cover.getProjectName();