cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1552331 - /cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java
Date Thu, 19 Dec 2013 16:19:52 GMT
Author: dkulp
Date: Thu Dec 19 16:19:52 2013
New Revision: 1552331

URL: http://svn.apache.org/r1552331
Log:
Add flag to only print warning once, detect the inline unmigrated stuff as well

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

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java?rev=1552331&r1=1552330&r2=1552331&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java Thu Dec 19 16:19:52 2013
@@ -168,7 +168,7 @@ public class Page extends AbstractPage i
     
     private void checkContentV2(final String c) {
         try {
-            //if ("JAX-WS Dispatch API".equals(title)) {
+            //if ("Content Based Router".equals(title)) {
             //    System.out.println(c);
             //}
             
@@ -466,6 +466,7 @@ public class Page extends AbstractPage i
         private State state = State.NONE;
         private Map<String, String> params = new HashMap<String, String>();
         private String paramName;
+        private boolean unmigrated;
 
         V2ContentHandler(Page pg) {
             page = pg;
@@ -500,15 +501,20 @@ public class Page extends AbstractPage i
                     state = State.CODE;
                 } else if ("snippet".equals(s)) {
                     state = State.CODE;
-                } else if ("unmigrated-wiki-markup".equals(s)) {
-                    System.out.println("WARNING: Page " + page.title + " has unmigrated wiki
content.");
-                    //no idea what is in there, lets just turn on the code highlighting
-                    if (page.codeTypes == null) {
-                        page.codeTypes = new CopyOnWriteArraySet<String>();
+                } else if ("unmigrated-wiki-markup".equals(s)
+                    || "unmigrated-inline-wiki-markup".equals(s)) {
+                    if (!unmigrated) {
+                        System.out.println("WARNING: Page \"" + page.title + "\" (" 
+                            + page.spaceKey + ") has unmigrated wiki content.");
+                        unmigrated = true;
+                        //no idea what is in there, lets just turn on the code highlighting
+                        if (page.codeTypes == null) {
+                            page.codeTypes = new CopyOnWriteArraySet<String>();
+                        }
+                        page.codeTypes.add("java");
+                        page.codeTypes.add("xml");
+                        page.codeTypes.add("plain");
                     }
-                    page.codeTypes.add("java");
-                    page.codeTypes.add("xml");
-                    page.codeTypes.add("plain");
                 } else {
                     //System.out.println("Unknown macro: " + s);
                 }



Mime
View raw message