cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1297995 - /cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
Date Wed, 07 Mar 2012 15:39:26 GMT
Author: dkulp
Date: Wed Mar  7 15:39:26 2012
New Revision: 1297995

URL: http://svn.apache.org/viewvc?rev=1297995&view=rev
Log:
Fix issues with links to user pages and images not being resolvable

Modified:
    cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java?rev=1297995&r1=1297994&r2=1297995&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/ConfluenceCleanupWriter.java Wed Mar  7 15:39:26
2012
@@ -77,8 +77,12 @@ public class ConfluenceCleanupWriter ext
                     if (p != null) {
                         newAtts.addMapping("href", p.createFileName() + params);
                     } else {
-                        System.out.println("Could not find page for " + href 
-                                           + " linked from " + page.getTitle());
+                        if (href.indexOf('~') == -1) {
+                            //link to a user page is OK, don't warn about it
+                            System.out.println("Could not find page for " + href 
+                                               + " linked from " + page.getTitle());
+                        }
+                        newAtts.addMapping("href", SiteExporter.ROOT + href);
                     }
                 } catch (Exception e) {
                     throw new SAXException(e);
@@ -122,9 +126,11 @@ public class ConfluenceCleanupWriter ext
             if ("absmiddle".equalsIgnoreCase(atts.getValue("align"))) {
                 newAtts.addMapping("align", "middle");
             }
+            String cls = atts.getValue("class");
             if (href != null && href.startsWith("/confluence/images/")) {
                 newAtts.addMapping("src", SiteExporter.HOST + href);
-            } else if (href != null && href.startsWith("/confluence/download/attachments"))
{
+            } else if (href != null && href.startsWith("/confluence/download/attachments")
+                && (cls == null || !cls.contains("userLogo"))) {
                 href = href.substring(0, href.lastIndexOf('?'));
                 href = href.substring(href.lastIndexOf('/'));
                 String dirName = page.createFileName();
@@ -146,6 +152,8 @@ public class ConfluenceCleanupWriter ext
                 dirName = dirName.substring(0, dirName.lastIndexOf(".")) + ".thumbs";
 
                 newAtts.addMapping("src", dirName + href);
+            } else if (href != null && href.startsWith("/confluence")) {
+                newAtts.addMapping("src", SiteExporter.HOST + href);
             }
         } else if ("th".equals(localName.toLowerCase())
             || "th".equals(qName.toLowerCase())) {



Mime
View raw message