- fix wiki download ant scripts

experimental
Normen Hansen 10 years ago
parent 011b1ce942
commit 3f3ef5566c
  1. 18
      sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java
  2. 9
      sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java
  3. BIN
      sdk/ant-lib/ant-jme.jar

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

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

Binary file not shown.
Loading…
Cancel
Save