From f66438442ecbb1d1ec29839780c4e19ecc36f923 Mon Sep 17 00:00:00 2001
From: luccioman
Date: Fri, 14 Apr 2017 14:32:44 +0200
Subject: [PATCH] Extended Mediawiki dump import to remote URLs.
When using a public HTTP URL in /IndexImportMediawiki_p.html, the remote
file now is directly streamed and processed, allowing import of several
GB dumps even with a low memory remote peer, and without need to
manually download the dump file first.
---
bin/importmediawiki.sh | 2 +-
htroot/IndexImportMediawiki_p.html | 20 +++--
htroot/IndexImportMediawiki_p.java | 82 ++++++++++++++-----
.../cora/document/id/MultiProtocolURL.java | 19 ++++-
.../yacy/crawler/retrieval/FileLoader.java | 2 +-
.../net/yacy/crawler/retrieval/SMBLoader.java | 2 +-
.../document/importer/MediawikiImporter.java | 71 ++++++++++------
.../net/yacy/document/parser/htmlParser.java | 16 +++-
.../net/yacy/repository/LoaderDispatcher.java | 2 +-
.../net/yacy/search/index/DocumentIndex.java | 13 ++-
10 files changed, 165 insertions(+), 64 deletions(-)
diff --git a/bin/importmediawiki.sh b/bin/importmediawiki.sh
index b520dc321..df1b4c7ae 100755
--- a/bin/importmediawiki.sh
+++ b/bin/importmediawiki.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
cd "`dirname $0`"
-./apicall.sh /IndexImportMediawiki_p.html?file=$1 > /dev/null
+./protectedPostApiCall.sh "IndexImportMediawiki_p.html" "file=$1"
diff --git a/htroot/IndexImportMediawiki_p.html b/htroot/IndexImportMediawiki_p.html
index 1959ed091..d3379e858 100644
--- a/htroot/IndexImportMediawiki_p.html
+++ b/htroot/IndexImportMediawiki_p.html
@@ -13,29 +13,33 @@
MediaWiki Dump Import
#(import)#
+ #(prevStatus)#
+ ::
Error on last import : #[message]#
+ #(/prevStatus)#
#(status)#
No import thread is running, you can start a new thread here
- ::Error : file argument must be a path to a document in the local file system
+ ::Error : dump
URL is malformed.
::Error : file not found "#[sourceFile]#"
::Error : can not read file "#[sourceFile]#"
::Error : you selected a directory ("#[sourceFile]#")
#(/status)#