Browse Source

- fix wiki download ant scripts

Normen Hansen 10 years ago
parent
commit
001396958a

+ 9 - 9
ant-jme/src/com/jme/ant/FixWikiLinks.java

@@ -31,16 +31,16 @@ public class FixWikiLinks extends Task {
             String line = rdr.readLine();
             while (line != null) {
                 //internal links
-                line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html");
-                line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html");
-                line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html");
-                line = line.replaceAll("wiki/doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html");
+                line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html");
+                line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html");
+                line = line.replaceAll("doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html");
+                line = line.replaceAll("doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html");
                 //images
-                line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\"");
-                line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\"");
-                line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\"");
-                line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\"");
-//                line = line.replaceAll("/wiki/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_");
+                line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\"");
+                line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\"");
+                line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\"");
+                line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\"");
+//                line = line.replaceAll("/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_");
 
                 line = line.replaceAll("<a href=([^>]*)><img src=\"([^\"]*)\"([^>]*)></a>", "<img src=\"$2\">");
                 line = line.replaceAll("<img src=\"([^>]*)\\?([^>]*)\">", "<img src=\"$1\">");

+ 5 - 4
ant-jme/src/com/jme/ant/LoadWikiImages.java

@@ -37,11 +37,12 @@ public class LoadWikiImages extends Task {
                     int endIdx = line.indexOf("\"", idx + 10);
                     if (endIdx >= 0) {
                         String link = line.substring(idx + 10, endIdx);
-                        int wikidx = link.indexOf("/wiki/lib/exe/fetch.php/");
-                        //int extidx = link.indexOf("/wiki/lib/exe/fetch.php?");
+                        link = link.replace("&amp;", "&");
+                        int wikidx = link.indexOf("/lib/exe/fetch.php/");
+                        //int extidx = link.indexOf("/lib/exe/fetch.php?");
                         int extidx = -1;
                         if (wikidx >= 0) {
-                            String name = link.replaceAll("/wiki/lib/exe/fetch\\.php/", "");
+                            String name = link.replaceAll("/lib/exe/fetch\\.php/", "");
                             int markIdx = name.indexOf("?");
                             if (markIdx >= 0) {
                                 name = name.substring(0, markIdx);
@@ -75,7 +76,7 @@ public class LoadWikiImages extends Task {
                                 }
                             }
                         } else if (extidx >= 0) {
-                            String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
+                            String name = link.replaceAll("/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", "");
                             int markIdx = name.indexOf("?");
                             if (markIdx >= 0) {
                                 name = name.substring(0, markIdx);

BIN
ant-lib/ant-jme.jar