Author: alessio.soldano(a)jboss.com
Date: 2010-10-27 15:00:53 -0400 (Wed, 27 Oct 2010)
New Revision: 13197
Added:
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/AS6JBossWSDocLinkFilter.java
Modified:
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/Magnolia2DocBook.java
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/XHTMLPage.java
Log:
Adding filter used for JBoss AS6 doc
Added:
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/AS6JBossWSDocLinkFilter.java
===================================================================
---
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/AS6JBossWSDocLinkFilter.java
(rev 0)
+++
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/AS6JBossWSDocLinkFilter.java 2010-10-27
19:00:53 UTC (rev 13197)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.util.magnolia2docbook;
+
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+public class AS6JBossWSDocLinkFilter implements LinkFilter
+{
+ private static final List<String> allowedPages = new
LinkedList<String>();
+ static
+ {
+ allowedPages.add("JBossWS-WebServices".toLowerCase());
+ allowedPages.add("JBossWS-Fromconceptstotechnology".toLowerCase());
+ allowedPages.add("JBossWS-QuickStart".toLowerCase());
+ allowedPages.add("JBossWS-UserGuide".toLowerCase());
+ allowedPages.add("JBossWS-StackCXFUserGuide".toLowerCase());
+ allowedPages.add("JBossWS-JAX-WSTools".toLowerCase());
+ allowedPages.add("JBossWS-wsconsume".toLowerCase());
+ allowedPages.add("JBossWS-wsprovide".toLowerCase());
+ allowedPages.add("JBossWS-wsrunclient".toLowerCase());
+ allowedPages.add("JBossWS-Authentication".toLowerCase());
+ allowedPages.add("JBossWS-Securetransport".toLowerCase());
+ allowedPages.add("JBossWS-Endpointmanagement".toLowerCase());
+ allowedPages.add("JBossWS-Recordsmanagement".toLowerCase());
+ allowedPages.add("JBossWS-CXFWS-Addressingtutorial".toLowerCase());
+
allowedPages.add("JBossWS-CXFWS-ReliableMessagingtutorial".toLowerCase());
+ allowedPages.add("JBossWS-CXFJMStransporttutorial".toLowerCase());
+ allowedPages.add("JBossWS-Articlesandspecs".toLowerCase());
+ allowedPages.add("JBossWS-JAX-WSAnnotations".toLowerCase());
+ }
+
+ @Override
+ public boolean accept(URL url)
+ {
+ String path = url.getPath() != null ? url.getPath().toLowerCase() : "";
+ for (String p : allowedPages)
+ {
+ if (path.contains(p))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
Modified:
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/Magnolia2DocBook.java
===================================================================
---
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/Magnolia2DocBook.java 2010-10-27
16:28:55 UTC (rev 13196)
+++
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/Magnolia2DocBook.java 2010-10-27
19:00:53 UTC (rev 13197)
@@ -37,7 +37,8 @@
public static void main(String[] args) throws Exception
{
String startPage = args[0];
- LinkFilter filter = new JBossWSLinkFilter(); //TODO read from args
+ //LinkFilter filter = new JBossWSLinkFilter(); //TODO read from args
+ LinkFilter filter = new AS6JBossWSDocLinkFilter();
Magnolia2DocBook m2d = new Magnolia2DocBook();
m2d.run(new URL(startPage), false, "output", filter);
Modified: projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/XHTMLPage.java
===================================================================
---
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/XHTMLPage.java 2010-10-27
16:28:55 UTC (rev 13196)
+++
projects/magnolia2docbook/src/org/jboss/util/magnolia2docbook/XHTMLPage.java 2010-10-27
19:00:53 UTC (rev 13197)
@@ -548,4 +548,10 @@
return name + ".xhtml";
}
+ @Override
+ public String toString()
+ {
+ return "[" + name + "], " + super.toString();
+ }
+
}