You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/01/16 01:43:07 UTC

svn commit: r496552 - in /maven/sandbox/doxia/doxia-book/src: main/java/org/apache/maven/doxia/book/context/ main/java/org/apache/maven/doxia/book/services/indexer/ main/java/org/apache/maven/doxia/book/services/renderer/ main/java/org/apache/maven/dox...

Author: vsiveton
Date: Mon Jan 15 16:43:05 2007
New Revision: 496552

URL: http://svn.apache.org/viewvc?view=rev&rev=496552
Log:
DOXIA-40: Request for a TOC-like feature

o added a new TOC macro to handle that (i.e. in an apt file %{toc|section=2|fromDepth=2|toDepth=2} )
o used some classes from doxia-book to do that
o updated doxia-book with new references from core
o modified the apt and xdoc parsers to add a second parsing way (maybe to be optimized)
o finally, added test cases

Removed:
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/IndexEntry.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexingSink.java
    maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/context/IndexEntryTest.java
Modified:
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
    maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
    maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java Mon Jan 15 16:43:05 2007
@@ -1,4 +1,24 @@
 package org.apache.maven.doxia.book.context;
+/*
+ * 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 org.apache.maven.doxia.index.IndexEntry;
 
 /**
  * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugst&oslash;l</a>

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java Mon Jan 15 16:43:05 2007
@@ -1,21 +1,41 @@
 package org.apache.maven.doxia.book.services.indexer;
 
+/*
+ * 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.io.FileNotFoundException;
+import java.io.FileReader;
+import java.util.Iterator;
+
+import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.BookDoxiaException;
 import org.apache.maven.doxia.book.context.BookContext;
-import org.apache.maven.doxia.book.context.IndexEntry;
 import org.apache.maven.doxia.book.context.BookIndex;
 import org.apache.maven.doxia.book.model.BookModel;
 import org.apache.maven.doxia.book.model.Chapter;
 import org.apache.maven.doxia.book.model.Section;
-import org.apache.maven.doxia.book.BookDoxiaException;
-import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.index.IndexEntry;
+import org.apache.maven.doxia.index.IndexingSink;
 import org.apache.maven.doxia.parser.ParseException;
-import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
-import java.util.Iterator;
-import java.io.FileReader;
-import java.io.FileNotFoundException;
-
 /**
  * @plexus.component
  *
@@ -85,7 +105,7 @@
 
         IndexEntry sectionEntry = new IndexEntry( chapterEntry, section.getId() );
 
-        BookIndexingSink sink = new BookIndexingSink( sectionEntry );
+        IndexingSink sink = new IndexingSink( sectionEntry );
 
         try
         {

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java Mon Jan 15 16:43:05 2007
@@ -1,19 +1,22 @@
 package org.apache.maven.doxia.book.services.renderer;
 
 /*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
  *
- * 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
  *
- *      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.
+ * 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.io.File;
@@ -29,7 +32,6 @@
 import org.apache.maven.doxia.Doxia;
 import org.apache.maven.doxia.book.BookDoxiaException;
 import org.apache.maven.doxia.book.context.BookContext;
-import org.apache.maven.doxia.book.context.IndexEntry;
 import org.apache.maven.doxia.book.model.BookModel;
 import org.apache.maven.doxia.book.model.Chapter;
 import org.apache.maven.doxia.book.model.Section;
@@ -37,6 +39,7 @@
 import org.apache.maven.doxia.book.services.renderer.xdoc.IndexXdocBookSink;
 import org.apache.maven.doxia.book.services.renderer.xdoc.SectionXdocBookSink;
 import org.apache.maven.doxia.editor.io.PipelineSink;
+import org.apache.maven.doxia.index.IndexEntry;
 import org.apache.maven.doxia.module.HtmlTools;
 import org.apache.maven.doxia.module.xdoc.XdocSink;
 import org.apache.maven.doxia.parser.ParseException;

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java Mon Jan 15 16:43:05 2007
@@ -1,25 +1,28 @@
 package org.apache.maven.doxia.book.services.renderer.xdoc;
 
 /*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
  *
- * 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
  *
- *      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.
+ * 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 org.apache.maven.doxia.book.context.IndexEntry;
-import org.codehaus.plexus.i18n.I18N;
-
 import java.io.Writer;
+
+import org.apache.maven.doxia.index.IndexEntry;
+import org.codehaus.plexus.i18n.I18N;
 
 /**
  * A <code>XdocSink</code> implementation for chapter in a book

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java Mon Jan 15 16:43:05 2007
@@ -1,24 +1,27 @@
 package org.apache.maven.doxia.book.services.renderer.xdoc;
 
 /*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
  *
- * 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
  *
- *      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.
+ * 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.io.Writer;
 
-import org.apache.maven.doxia.book.context.IndexEntry;
+import org.apache.maven.doxia.index.IndexEntry;
 import org.codehaus.plexus.i18n.I18N;
 
 /**

Modified: maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java (original)
+++ maven/sandbox/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java Mon Jan 15 16:43:05 2007
@@ -1,25 +1,28 @@
 package org.apache.maven.doxia.book.services.renderer.xdoc;
 
 /*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
  *
- * 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
  *
- *      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.
+ * 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 org.apache.maven.doxia.book.context.IndexEntry;
-import org.codehaus.plexus.i18n.I18N;
-
 import java.io.Writer;
+
+import org.apache.maven.doxia.index.IndexEntry;
+import org.codehaus.plexus.i18n.I18N;
 
 /**
  * A <code>XdocSink</code> implementation for section in a book

Modified: maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java?view=diff&rev=496552&r1=496551&r2=496552
==============================================================================
--- maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java (original)
+++ maven/sandbox/doxia/doxia-book/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java Mon Jan 15 16:43:05 2007
@@ -1,28 +1,31 @@
 package org.apache.maven.doxia.book.services.indexer;
 
 /*
- * Copyright 2006 The Apache Software Foundation.
+ * 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
  *
- * 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
  *
- *      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.
+ * 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 org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.util.FileUtils;
-import org.apache.maven.doxia.book.services.io.BookIo;
-import org.apache.maven.doxia.book.model.BookModel;
 import org.apache.maven.doxia.book.context.BookContext;
-import org.apache.maven.doxia.book.context.IndexEntry;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.services.io.BookIo;
+import org.apache.maven.doxia.index.IndexEntry;
 import org.apache.maven.doxia.module.HtmlTools;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
 
 /**
  * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugst&oslash;l</a>