Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixes
orbiter176e334aa4d4
diff --git a/htroot/CrawlResults.html b/htroot/CrawlResults.htmlindex d544f0cb8..0b52228b3 100644--- a/htroot/CrawlResults.html+++ b/htroot/CrawlResults.html@@ -75,7 +75,7 @@::<h2>(7) Results from surrogates import</h2><p>These records had been imported from surrogate files in DATA/SURROGATES/in</p>- <p><em>Use Case:</em> place files with dublin core metadata content into DATA/SURROGATES/in or use an index import method (i.e. wikimedia import, OAI-PMH retrieval)</p>+ <p><em>Use Case:</em> place files with dublin core metadata content into DATA/SURROGATES/in or use an index import method (i.e. <a href="/IndexImportWikimedia_p.html">wikimedia import</a>, <a href="/IndexImportOAIPMH_p.html">OAI-PMH retrieval</a>)</p>#(/process)#diff --git a/htroot/IndexImportOAIPMH_p.html b/htroot/IndexImportOAIPMH_p.htmlindex e99da0dcb..5970ab592 100644--- a/htroot/IndexImportOAIPMH_p.html+++ b/htroot/IndexImportOAIPMH_p.html@@ -9,11 +9,12 @@#%env/templates/header.template%##%env/templates/submenuContentIntegration.template%#<h2>OAI-PMH Import</h2>+ <p>Results from the import can be monitored in the <a href="/CrawlResults.html?process=7">indexing results for surrogates</a></p><form action="IndexImportOAIPMH_p.html" method="get"><fieldset><legend>Single request import</legend>- This will submit only a single request as given here to a OAI-PMH server and imports records into the index+ This will submit only a single request as given here to a OAI-PMH server and imports records into the index<br /><input name="urlstartone" type="text" value="#[defaulturl]#" size="100" /><input name="submit" type="submit" value="Import OAI-PMH source" /></fieldset>@@ -36,7 +37,7 @@<form action="IndexImportOAIPMH_p.html" method="get"><fieldset><legend>Import all Records from a server</legend>- Import all records that follow acording to resumption elements into index+ Import all records that follow acording to resumption elements into index<br /><input name="urlstartall" type="text" value="" size="100" /><input name="submit" type="submit" value="Import OAI-PMH source" /></fieldset>@@ -46,7 +47,7 @@<dl><dt>Thread:</dt><dd>#[thread]#</dd><dt>Source:</dt><dd>#[source]#</dd>- <dt>Processed Chunks:</dt><dd>#[chunkCount]# records</dd>+ <dt>Processed Chunks:</dt><dd>#[chunkCount]#</dd><dt>Imported Records:</dt><dd>#[recordsCount]# records</dd><dt>Speed:</dt><dd>#[speed]# records per second</dd></dl>diff --git a/htroot/IndexImportOAIPMH_p.java b/htroot/IndexImportOAIPMH_p.javaindex 136d4a76c..30fb61df4 100644--- a/htroot/IndexImportOAIPMH_p.java+++ b/htroot/IndexImportOAIPMH_p.java@@ -73,6 +73,7 @@ public class IndexImportOAIPMH_p {if (post != null) {if (post.containsKey("urlstartone")) {String oaipmhurl = post.get("urlstartone");+ if (oaipmhurl.indexOf("?") < 0) oaipmhurl = oaipmhurl + "?verb=ListRecords&metadataPrefix=oai_dc";DigestURI url = null;try {url = new DigestURI(oaipmhurl, null);diff --git a/source/net/yacy/document/importer/OAIPMHReader.java b/source/net/yacy/document/importer/OAIPMHReader.javaindex 2c28251dc..0b3b85678 100644--- a/source/net/yacy/document/importer/OAIPMHReader.java+++ b/source/net/yacy/document/importer/OAIPMHReader.java@@ -59,7 +59,7 @@ public class OAIPMHReader {response = loader.load(source, false, true, CrawlProfile.CACHE_STRATEGY_NOCACHE);byte[] b = response.getContent();this.resumptionToken = new ResumptionToken(new ByteArrayInputStream(b));- String file = filePrefix + "_" + this.source.getHost() + "_" + DateFormatter.formatShortMilliSecond(new Date());+ String file = filePrefix + "." + filename4source(source) + "." + DateFormatter.formatShortMilliSecond(new Date());File f0 = new File(targetDir, file + ".tmp");File f1 = new File(targetDir, file + ".xml");@@ -81,6 +81,15 @@ public class OAIPMHReader {*/}+ public static final String filename4source(DigestURI source) {+ String s = ResumptionToken.truncatedURL(source);+ if (s.endsWith("?")) s = s.substring(0, s.length() - 1);+ if (s.endsWith("/")) s = s.substring(0, s.length() - 1);+ if (s.startsWith("https://")) s = s.substring(8);+ if (s.startsWith("http://")) s = s.substring(7);+ return s.replace('.', '_').replace('/', '_').replace(':', '_');+ }+public ResumptionToken getResumptionToken() {return this.resumptionToken;}diff --git a/source/net/yacy/document/importer/ResumptionToken.java b/source/net/yacy/document/importer/ResumptionToken.javaindex 0bd5ac670..198b5aba1 100644--- a/source/net/yacy/document/importer/ResumptionToken.java+++ b/source/net/yacy/document/importer/ResumptionToken.java@@ -135,11 +135,9 @@ public class ResumptionToken extends TreeMap<String, String> {if (expiration != null) {if (expiration.before(new Date())) throw new IOException("the resumption is expired at " + DateFormatter.formatISO8601(expiration) + " (now: " + DateFormatter.formatISO8601(new Date()));// the resumption token is still fresh- return new DigestURI(url + "verb=ListRecords&resumptionToken=" + token, null);}-- // may still be an encoded state- return new DigestURI(url + "verb=ListRecords&" + token, null);++ return new DigestURI(url + "verb=ListRecords&resumptionToken=" + token, null);}/**