geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1424343 - in /geronimo/site/trunk/wiki-export: pom.xml src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java src/main/java/org/apache/cxf/cwiki/SiteExporter.java src/main/java/org/apache/cxf/cwiki/Space.java
Date Thu, 20 Dec 2012 06:53:32 GMT
Author: gawor
Date: Thu Dec 20 06:53:31 2012
New Revision: 1424343

URL: http://svn.apache.org/viewvc?rev=1424343&view=rev
Log:
make direct spaces link work

Modified:
    geronimo/site/trunk/wiki-export/pom.xml
    geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
    geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
    geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/Space.java

Modified: geronimo/site/trunk/wiki-export/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/site/trunk/wiki-export/pom.xml?rev=1424343&r1=1424342&r2=1424343&view=diff
==============================================================================
--- geronimo/site/trunk/wiki-export/pom.xml (original)
+++ geronimo/site/trunk/wiki-export/pom.xml Thu Dec 20 06:53:31 2012
@@ -93,8 +93,28 @@
                             <argument>${svn.arg1}</argument>
                             <argument>${svn.arg2}</argument>
                             <!--argument>-force</argument-->
+                            <argument>${basedir}/conf/GMOxSITE.cfg</argument>
                             <argument>${basedir}/conf/GMOxDEV.cfg</argument>
-<!--                            <argument>${basedir}/conf/GMOxDOC30.cfg</argument>-->
+
+                            <argument>${basedir}/conf/geronimo.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC10.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC11.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC12.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC20.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC20es.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC20ja.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC21.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC22.cfg</argument>
+                            <argument>${basedir}/conf/GMOxDOC30.cfg</argument>
+
+                            <argument>${basedir}/conf/GMOxKB.cfg</argument>
+                            <argument>${basedir}/conf/GMOxPMGT.cfg</argument>
+                            <argument>${basedir}/conf/GMOxSAMPLES.cfg</argument>
+                            <argument>${basedir}/conf/xbean.cfg</argument>
+                            <argument>${basedir}/conf/yoko.cfg</argument>
+                            <argument>${basedir}/conf/gshell.cfg</argument>
+
+                            <argument>${basedir}/conf/GMOxSBOX.cfg</argument>
                         </arguments>
                     </configuration>
                 </plugin>

Modified: geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
URL: http://svn.apache.org/viewvc/geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java?rev=1424343&r1=1424342&r2=1424343&view=diff
==============================================================================
--- geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
(original)
+++ geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
Thu Dec 20 06:53:31 2012
@@ -53,6 +53,33 @@ public class ConfluenceCleanupWriter ext
         this.divCls = divCls;
     }
 
+    private String findPageWithURL(String url) throws Exception {
+        Page p = exporter.findPageByURL(url);
+        if (p != null) {
+            return p.createFileName();
+        }
+        for (SiteExporter siteExporter : SiteExporter.siteExporters) {
+            if (exporter == siteExporter) {
+                continue;
+            }
+            if (siteExporter.getSpace().getURL().endsWith(url)) {
+                String prefix = getRelativePath(SiteExporter.rootOutputDir, exporter.outputDir,
siteExporter.outputDir);
+                String location = prefix + "index.html";;
+                System.out.println("Cross space link to " + location);
+                return location;
+            } else {
+                p = siteExporter.findPageByURL(url);
+                if (p != null) {
+                    String prefix = getRelativePath(SiteExporter.rootOutputDir, exporter.outputDir,
siteExporter.outputDir);
+                    String location = prefix + p.createFileName();
+                    System.out.println("Cross space link to " + location);
+                    return location;
+                }
+            }
+        }
+        return null;
+    }
+    
     //CHECKSTYLE:OFF
     public void startElement(String uri, String localName, String qName, final Attributes
atts)
         throws SAXException {
@@ -77,13 +104,9 @@ public class ConfluenceCleanupWriter ext
                     href = href.substring(0, href.indexOf('?'));
                 }
                 try {
-                    final Page p = SiteExporter.findPageWithURL(href);                  
 
+                    String p = findPageWithURL(href);
                     if (p != null) {
-                        String prefix = getRelativePath(SiteExporter.rootOutputDir, page.getExporter().outputDir,
p.getExporter().outputDir);
-                        if (prefix.length() != 0) {
-                            System.out.println(prefix);
-                        }
-                        newAtts.addMapping("href", prefix + p.createFileName() + params);
+                        newAtts.addMapping("href", p + params);
                     } else {
                         if (href.indexOf('~') == -1) {
                             //link to a user page is OK, don't warn about it

Modified: geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
URL: http://svn.apache.org/viewvc/geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/SiteExporter.java?rev=1424343&r1=1424342&r2=1424343&view=diff
==============================================================================
--- geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/SiteExporter.java (original)
+++ geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/SiteExporter.java Thu
Dec 20 06:53:31 2012
@@ -115,7 +115,8 @@ public class SiteExporter implements Run
     Map<String, Page> pages = new ConcurrentHashMap<String, Page>();
     Collection<Page> modifiedPages = new ConcurrentLinkedQueue<Page>();
     Set<String> globalPages = new CopyOnWriteArraySet<String>();
-    Map<String, Space> spaces = new ConcurrentHashMap<String, Space>();
+    
+    static Map<String, Space> spaces = new ConcurrentHashMap<String, Space>();
 
     String spaceKey = "CXF";
     String pageCacheFile = "pagesConfig.obj";
@@ -127,6 +128,7 @@ public class SiteExporter implements Run
     File outputDir = rootOutputDir;
 
     Template template;
+    Space space;
     
     static List<SiteExporter> siteExporters;
 
@@ -245,10 +247,9 @@ public class SiteExporter implements Run
             System.out.println("(" + spaceKey + ") No changes detected from RSS");
             return false;
         }
-        
-        doLogin();
 
-        Space space = getSpace(spaceKey);
+        doLogin();
+        getSpace();
         breadCrumbRoot = space.getName();
 
         loadPages();
@@ -752,10 +753,12 @@ public class SiteExporter implements Run
         }
     }
     
-    public Space getSpace(String key) { 
+    public static Space getSpace(String key) { 
         Space space = spaces.get(key);
         if (space == null) {
             try {
+                doLogin();
+                
                 Document doc = XMLUtils.newDocument();
                 Element el = doc.createElementNS(SOAPNS, "ns1:getSpace");
                 Element el2 = doc.createElement("in0");
@@ -954,17 +957,15 @@ public class SiteExporter implements Run
         return page.getLink();
     }
 
+    public Space getSpace() {
+        if (space == null) {
+            space = getSpace(spaceKey);
+        }
+        return space;
+    }
+    
     private static void setSiteExporters(List<SiteExporter> exporters) {
         siteExporters = exporters;
     }
     
-    public static Page findPageWithURL(String url) throws Exception {
-        for (SiteExporter exporter : siteExporters) {
-            Page p = exporter.findPageByURL(url);
-            if (p != null) {
-                return p;
-            }
-        }
-        return null;
-    }
 }

Modified: geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/Space.java
URL: http://svn.apache.org/viewvc/geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/Space.java?rev=1424343&r1=1424342&r2=1424343&view=diff
==============================================================================
--- geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/Space.java (original)
+++ geronimo/site/trunk/wiki-export/src/main/java/org/apache/cxf/cwiki/Space.java Thu Dec
20 06:53:31 2012
@@ -46,7 +46,7 @@ public class Space {
     public String getName() {
         return name;
     }
-    public String getTitle() {
+    public String getURL() {
         return url;
     }
 



Mime
View raw message