From ba339a2a454fb31d6527bd53f3652d75bc7674b4 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 2 Apr 2017 03:32:21 +0200 Subject: [PATCH 01/11] Add servlet to import warc file from filesystem IndexImportWarc_p.html. Apply Importer interface to WarcImporter --- htroot/IndexImportWarc_p.html | 51 +++++++++ htroot/IndexImportWarc_p.java | 76 +++++++++++++ .../env/templates/submenuIndexImport.template | 1 + .../yacy/document/importer/WarcImporter.java | 103 +++++++++++++++++- source/net/yacy/search/Switchboard.java | 10 +- 5 files changed, 234 insertions(+), 7 deletions(-) create mode 100644 htroot/IndexImportWarc_p.html create mode 100644 htroot/IndexImportWarc_p.java diff --git a/htroot/IndexImportWarc_p.html b/htroot/IndexImportWarc_p.html new file mode 100644 index 000000000..d6003bc9e --- /dev/null +++ b/htroot/IndexImportWarc_p.html @@ -0,0 +1,51 @@ + + + + YaCy '#[clientname]#': Warc Import + #%env/templates/metas.template%# + #(import)#:: + + #(/import)# + + + #%env/templates/header.template%# + #%env/templates/submenuIndexImport.template%# +

Web Archive File Import

+ + #(import)# +

No import thread is running, you can start a new thread here

+
+ +
+ Warc File Selection: select an warc file (which may be gz compressed) +

+ You can download warc archives for example here + Internet Archive. +

+
+ + +
+ +
+
+
+
+ +
+ :: +
Import Process +
+
Thread:
#[thread]#
+
Warc File:
#[warcfile]#
+
Processed:
#[count]# Entries
+
Speed:
#[speed]# pages per second
+
Running Time:
#[runningHours]# hours, #[runningMinutes]# minutes
+
Remaining Time:
#[remainingHours]# hours, #[remainingMinutes]# minutes
+
+
+ #(/import)# + + #%env/templates/footer.template%# + + \ No newline at end of file diff --git a/htroot/IndexImportWarc_p.java b/htroot/IndexImportWarc_p.java new file mode 100644 index 000000000..f503fe98b --- /dev/null +++ b/htroot/IndexImportWarc_p.java @@ -0,0 +1,76 @@ +// IndexImportWarc_p.java +// ------------------------- +// (c) 2017 by reger24; https://github.com/reger24 +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import java.io.File; +import java.io.FileNotFoundException; + +import net.yacy.cora.protocol.RequestHeader; +import net.yacy.document.importer.WarcImporter; +import net.yacy.search.Switchboard; +import net.yacy.server.serverObjects; +import net.yacy.server.serverSwitch; + +public class IndexImportWarc_p { + + public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) { + final serverObjects prop = new serverObjects(); + final Switchboard sb = (Switchboard) env; + + if (WarcImporter.job != null && WarcImporter.job.isAlive()) { + // one import is running, no option to insert anything + prop.put("import", 1); + prop.put("import_thread", "running"); + prop.put("import_warcfile", WarcImporter.job.source()); + prop.put("import_count", WarcImporter.job.count()); + prop.put("import_speed", WarcImporter.job.speed()); + prop.put("import_runningHours", (WarcImporter.job.runningTime() / 60) / 60); + prop.put("import_runningMinutes", (WarcImporter.job.runningTime() / 60) % 60); + prop.put("import_remainingHours", (WarcImporter.job.remainingTime() / 60) / 60); + prop.put("import_remainingMinutes", (WarcImporter.job.remainingTime() / 60) % 60); + } else { + prop.put("import", 0); + if (post != null) { + if (post.containsKey("file")) { + String file = post.get("file"); + final File sourcefile = new File(file); + if (sourcefile.exists()) { + try { + WarcImporter wi = new WarcImporter(sourcefile); + wi.start(); + prop.put("import_thread", "started"); + } catch (FileNotFoundException ex) { + prop.put("import_thread", "Error: file not found [" + file + "]"); + } + prop.put("import_warcfile", file); + } else { + prop.put("import_warcfile", ""); + prop.put("import_thread", "Error: file not found [" + file + "]"); + } + prop.put("import", 1); + prop.put("import_count", 0); + prop.put("import_speed", 0); + prop.put("import_runningHours", 0); + prop.put("import_runningMinutes", 0); + prop.put("import_remainingHours", 0); + prop.put("import_remainingMinutes", 0); + } + } + } + return prop; + } +} diff --git a/htroot/env/templates/submenuIndexImport.template b/htroot/env/templates/submenuIndexImport.template index b44d9d95a..d85b313c2 100644 --- a/htroot/env/templates/submenuIndexImport.template +++ b/htroot/env/templates/submenuIndexImport.template @@ -13,6 +13,7 @@ diff --git a/source/net/yacy/document/importer/WarcImporter.java b/source/net/yacy/document/importer/WarcImporter.java index e3463a02c..e921765ce 100644 --- a/source/net/yacy/document/importer/WarcImporter.java +++ b/source/net/yacy/document/importer/WarcImporter.java @@ -22,6 +22,9 @@ */ package net.yacy.document.importer; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import net.yacy.cora.document.id.DigestURL; @@ -52,7 +55,29 @@ import org.jwat.warc.WarcRecord; * http://archive-access.sourceforge.net/warc/warc_file_format-0.9.html * http://archive-access.sourceforge.net/warc/ */ -public class WarcImporter { +public class WarcImporter extends Thread implements Importer { + + static public Importer job; // static object to assure only one importer is running (if started from a servlet, this object is used to store the thread) + + private final InputStream source; // current input warc archive + private String name; // file name of input source + + private int recordCnt; // number of responses indexed (for statistic) + private long startTime; // (for statistic) + private final long sourceSize; // length of the input source (for statistic) + private long consumed; // bytes consumed from input source (for statistic) + + public WarcImporter(InputStream f) { + source = f; + recordCnt = 0; + sourceSize = -1; + } + + public WarcImporter(File f) throws FileNotFoundException{ + name = f.getName(); + sourceSize = f.length(); + source = new FileInputStream(f); + } /** * Reads a Warc file and adds all contained responses to the index. @@ -64,7 +89,8 @@ public class WarcImporter { public void indexWarcRecords(InputStream f) throws IOException { byte[] content; - int cnt = 0; + job = this; + startTime = System.currentTimeMillis(); WarcReader localwarcReader = WarcReaderFactory.getReader(f); WarcRecord wrec = localwarcReader.getNextRecord(); @@ -126,13 +152,82 @@ public class WarcImporter { ); Switchboard.getSwitchboard().toIndexer(response); - cnt++; + recordCnt++; } } } + this.consumed = localwarcReader.getConsumed(); wrec = localwarcReader.getNextRecord(); } localwarcReader.close(); - ConcurrentLog.info("WarcImporter", "Indexed " + cnt + " documents"); + ConcurrentLog.info("WarcImporter", "Indexed " + recordCnt + " documents"); + job = null; + } + + @Override + public void run() { + try { + this.indexWarcRecords(this.source); + } catch (IOException ex) { + ConcurrentLog.info("WarcImporter", ex.getMessage()); + } + } + + /** + * Filename of the input source + * @return + */ + @Override + public String source() { + return this.name; + } + + /** + * Number of responses (pages) indexed + * @return + */ + @Override + public int count() { + return this.recordCnt; + } + + /** + * Indexed responses per second + * @return + */ + @Override + public int speed() { + if (this.recordCnt == 0) return 0; + return (int) (this.recordCnt / Math.max(0L, runningTime() )); + } + + /** + * Duration in seconds running, working on the current import source + * @return duration in seconds + */ + @Override + public long runningTime() { + return (System.currentTimeMillis() - this.startTime) / 1000L; } + + /** + * Estimate on time remaining calculated from length of input source and + * processed bytes. + * @return duration in seconds + */ + @Override + public long remainingTime() { + if (this.consumed == 0) { + return 0; + } else { + long speed = this.consumed / runningTime(); + return (this.sourceSize - this.consumed) / speed; + } + } + + @Override + public String status() { + return ""; + } + } diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 68a9294e9..2a85da0fa 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2005,9 +2005,13 @@ public final class Switchboard extends serverSwitch { return moved; } else if (s.endsWith(".warc") || s.endsWith(".warc.gz")) { try { - InputStream is = new BufferedInputStream(new FileInputStream(infile)); - WarcImporter wri = new WarcImporter(); - wri.indexWarcRecords(is); + WarcImporter wri = new WarcImporter(infile); + wri.start(); + try { + wri.join(); + } catch (InterruptedException ex) { + return moved; + } moved = infile.renameTo(outfile); } catch (IOException ex) { log.warn("IO Error processing warc file " + infile); From 777cb5b812033ab2829f83ce80fe8bf7fe0315cd Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 2 Apr 2017 03:59:37 +0200 Subject: [PATCH 02/11] remove test case for Standard_MemoryControl which will always fail see https://github.com/yacy/yacy_search_server/pull/114 --- .../yacy/kelondro/util/MemoryControlTest.java | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 test/java/net/yacy/kelondro/util/MemoryControlTest.java diff --git a/test/java/net/yacy/kelondro/util/MemoryControlTest.java b/test/java/net/yacy/kelondro/util/MemoryControlTest.java deleted file mode 100644 index 5c8666436..000000000 --- a/test/java/net/yacy/kelondro/util/MemoryControlTest.java +++ /dev/null @@ -1,43 +0,0 @@ - -package net.yacy.kelondro.util; - -import static org.junit.Assert.assertTrue; -import org.junit.Test; - - -public class MemoryControlTest { - - final int onemb = 1024 * 1024; - - /** - * Test of request method, of class MemoryControl. - */ - @Test - public void testRequest_StandardStrategy() { - MemoryControl.setStandardStrategy(true); - MemoryControl.setProperMbyte(24); - - int memblock = onemb * 13; // memsize to allocate - - int iterations = (int) MemoryControl.available() / memblock; - int arraysize = (int) MemoryControl.maxMemory() / memblock + 10; - - byte[][] x = new byte[arraysize][]; - - int i = 0; - - while (i < arraysize && MemoryControl.request(memblock, false)) { - x[i] = new byte[memblock]; - // for realistic test produce some memory avail to GC - if (MemoryControl.request(memblock, false)) { - x[i] = new byte[memblock]; - } - - i++; - } - System.out.println("allocated " + i + " * " + memblock/onemb + " MB = " + i*memblock/onemb + " MB"); - - assertTrue(i >= iterations); - } - -} From 9339a6a4c5bc6053bddd823b859b297b82eed462 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 2 Apr 2017 20:36:22 +0200 Subject: [PATCH 03/11] use css error class for error msg in IndexImportOAIPMH_p.html, adjust to xhtml

usage rule --- htroot/IndexImportOAIPMH_p.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htroot/IndexImportOAIPMH_p.html b/htroot/IndexImportOAIPMH_p.html index 671d3acdd..84c9da15f 100644 --- a/htroot/IndexImportOAIPMH_p.html +++ b/htroot/IndexImportOAIPMH_p.html @@ -19,12 +19,12 @@ #(import-one)#:: -

+
Source:
#[source]#
Processed:
#[count]# records
ResumptionToken:
#[rt]#
-

- ::

Import failed: #[error]#

+
+ ::

Import failed: #[error]#

#(/import-one)# From c19d60f06b90ad7fddcc70913c249d377d37007d Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 2 Apr 2017 22:30:23 +0200 Subject: [PATCH 04/11] update master.lng with recent text changes to IndexExport_p.html, IndexImportWarc_p.html --- locales/master.lng.xlf | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index f1c6d09cc..4626d854c 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -4704,6 +4704,9 @@ (Rich and full-text Solr data, one document per line in one large xml file, can be processed with shell tools, can be imported with DATA/SURROGATE/in/) + + (Rich and full-text Elasticsearch data, one document per line in one flat JSON file, can be bulk-imported to elasticsearch with the command "curl -XPOST localhost:9200/collection1/yacy/_bulk --data-binary @yacy_dump_XXX.flatjson") + Full URL List: @@ -5036,6 +5039,65 @@ + + + + Warc Import + + + Web Archive File Import + + + No import thread is running, you can start a new thread here + + + Warc File Selection: select an warc file (which may be gz compressed) + + + You can download warc archives for example here + + + Internet Archive + + + Import Warc File + + + Import Process + + + Thread: + + + Warc File: + + + Processed: + + + Entries + + + Speed: + + + pages per second + + + Running Time: + + + hours, + + + minutes< + + + Remaining Time: + + + + From 09e72eb0a40138ca377f458f975970ab3454c576 Mon Sep 17 00:00:00 2001 From: luccioman Date: Mon, 3 Apr 2017 11:34:49 +0200 Subject: [PATCH 05/11] Set Config Portal as a private administration page. Consistently with its required action from submission credentials, and because external unauthenticated users do not need to access these settings. --- defaults/yacy.init | 2 +- htroot/ConfigAppearance_p.html | 2 +- htroot/ConfigPortal.java | 204 +--------------- ...{ConfigPortal.html => ConfigPortal_p.html} | 2 +- htroot/ConfigPortal_p.java | 228 ++++++++++++++++++ htroot/ConfigSearchPage_p.html | 2 +- htroot/ConfigSearchPage_p.java | 3 +- htroot/env/templates/header.template | 2 +- .../submenuPortalConfiguration.template | 2 +- locales/cn.lng | 6 +- locales/de.lng | 6 +- locales/fr.lng | 2 +- locales/hi.lng | 4 +- locales/ja.lng | 6 +- locales/master.lng.xlf | 4 +- locales/ru.lng | 4 +- locales/uk.lng | 6 +- .../yacy/http/servlets/GSAsearchServlet.java | 2 +- 18 files changed, 263 insertions(+), 224 deletions(-) rename htroot/{ConfigPortal.html => ConfigPortal_p.html} (99%) create mode 100644 htroot/ConfigPortal_p.java diff --git a/defaults/yacy.init b/defaults/yacy.init index 357dd83ca..479626e61 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -1169,7 +1169,7 @@ content.phpbb3.dumpfile = # search engine teaser: an about box in search results # this is only shown, if the about.body is filled about.headline=Please support YaCy! -about.body=
If you run a YaCy server, feel free to replace our donation plea with your own support message, use the Portal Configuration servlet.
+about.body=
If you run a YaCy server, feel free to replace our donation plea with your own support message, use the Portal Configuration servlet.
donation.iframesource=http://yacy.net/include/donate.html donation.iframetarget=env/donate.html diff --git a/htroot/ConfigAppearance_p.html b/htroot/ConfigAppearance_p.html index c79d626c0..65f4e5f88 100644 --- a/htroot/ConfigAppearance_p.html +++ b/htroot/ConfigAppearance_p.html @@ -31,7 +31,7 @@

You can change the appearance of the YaCy interface with skins. The selected skin and language also affects the appearance of the search page. - If you create a search portal with YaCy then you can + If you create a search portal with YaCy then you can change the appearance of the search page here.

diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java index 9362d20f6..adeb9ab7c 100644 --- a/htroot/ConfigPortal.java +++ b/htroot/ConfigPortal.java @@ -25,210 +25,22 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Properties; - -import net.yacy.cora.document.id.DigestURL; import net.yacy.cora.protocol.RequestHeader; -import net.yacy.cora.util.ConcurrentLog; -import net.yacy.data.WorkTables; -import net.yacy.http.servlets.YaCyDefaultServlet; -import net.yacy.search.Switchboard; -import net.yacy.search.SwitchboardConstants; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; -import net.yacy.server.http.HTTPDFileHandler; +/** + * @deprecated use now {@link ConfigPortal_p} + */ +@Deprecated public class ConfigPortal { - public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { + @SuppressWarnings("unused") + public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { final serverObjects prop = new serverObjects(); - final Switchboard sb = (Switchboard) env; - - if (post != null) { - // AUTHENTICATE - if (!sb.verifyAuthentication(header)) { - // force log-in - prop.authenticationRequired(); - return prop; - } - - if (post.containsKey("popup")) { - final String popup = post.get("popup", "status"); - if ("front".equals(popup)) { - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"); - } else if ("search".equals(popup)) { - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html"); - } else if ("interactive".equals(popup)) { - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html"); - } else { - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html"); - } - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html")); - HTTPDFileHandler.initDefaultPath(); - } - if (post.containsKey("searchpage_set")) { - final String newGreeting = post.get(SwitchboardConstants.GREETING, ""); - // store this call as api call - sb.tables.recordAPICall(post, "ConfigPortal.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting); - - sb.setConfig(SwitchboardConstants.GREETING, newGreeting); - sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, post.get(SwitchboardConstants.GREETING_HOMEPAGE, "")); - sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, post.get(SwitchboardConstants.GREETING_LARGE_IMAGE, "")); - sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); - sb.setConfig(SwitchboardConstants.GREETING_IMAGE_ALT, post.get(SwitchboardConstants.GREETING_IMAGE_ALT, "")); - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, post.get("target", "_self")); - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, post.get("target_special", "_self")); - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, post.get("target_special_pattern", "_self")); - sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10)); - sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, "")); - HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, ""); - sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu")); - sb.setConfig(SwitchboardConstants.PUBLIC_SEARCHPAGE, !post.containsKey(SwitchboardConstants.PUBLIC_SEARCHPAGE) || post.getBoolean(SwitchboardConstants.PUBLIC_SEARCHPAGE)); - sb.setConfig("search.options", post.getBoolean("search.options")); - - sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, post.getBoolean(SwitchboardConstants.GREEDYLEARNING_ACTIVE)); - - final boolean storeresult = post.getBoolean(SwitchboardConstants.REMOTESEARCH_RESULT_STORE); - sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, storeresult); - sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, post.getLong(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, -1)); - - sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist")); - sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete")); - - sb.setConfig("about.headline", post.get("about.headline", "")); - sb.setConfig("about.body", post.get("about.body", "")); - - String excludehosts = post.get("search.excludehosts", ""); - sb.setConfig("search.excludehosts", excludehosts); - try { - sb.setConfig("search.excludehosth", DigestURL.hosthashes(excludehosts)); - } catch (MalformedURLException e) { - ConcurrentLog.logException(e); - sb.setConfig("search.excludehosth", ""); - } - } - if (post.containsKey("searchpage_default")) { - // load defaults from defaults/yacy.init file - final Properties config = new Properties(); - final String mes = "ConfigPortal"; - FileInputStream fis = null; - try { - fis = new FileInputStream(new File(sb.appPath, "defaults/yacy.init")); - config.load(fis); - } catch (final FileNotFoundException e) { - ConcurrentLog.severe(mes, "could not find configuration file."); - return prop; - } catch (final IOException e) { - ConcurrentLog.severe(mes, "could not read configuration file."); - return prop; - } finally { - if (fis != null) { - try { - fis.close(); - } catch (final IOException e) { - ConcurrentLog.logException(e); - } - } - } - sb.setConfig(SwitchboardConstants.GREETING, config.getProperty(SwitchboardConstants.GREETING,"P2P Web Search")); - sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, config.getProperty(SwitchboardConstants.GREETING_HOMEPAGE,"http://yacy.net")); - sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, config.getProperty(SwitchboardConstants.GREETING_LARGE_IMAGE,"env/grafics/YaCyLogo_120ppi.png")); - sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, config.getProperty(SwitchboardConstants.GREETING_SMALL_IMAGE,"env/grafics/YaCyLogo_60ppi.png")); - sb.setConfig(SwitchboardConstants.GREETING_IMAGE_ALT, config.getProperty(SwitchboardConstants.GREETING_IMAGE_ALT,"YaCy project web site")); - sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, config.getProperty(SwitchboardConstants.BROWSER_POP_UP_PAGE,"Status.html")); - sb.setConfig(SwitchboardConstants.INDEX_FORWARD, config.getProperty(SwitchboardConstants.INDEX_FORWARD,"")); - HTTPDFileHandler.indexForward = ""; - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, config.getProperty(SwitchboardConstants.SEARCH_TARGET_DEFAULT,"_self")); - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, config.getProperty(SwitchboardConstants.SEARCH_TARGET_SPECIAL,"_self")); - sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, config.getProperty(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN,"")); - sb.setConfig("publicTopmenu", config.getProperty("publicTopmenu","true")); - sb.setConfig(SwitchboardConstants.PUBLIC_SEARCHPAGE, config.getProperty(SwitchboardConstants.PUBLIC_SEARCHPAGE,"true")); - sb.setConfig("search.navigation", config.getProperty("search.navigation","hosts,authors,namespace,topics")); - sb.setConfig("search.options", config.getProperty("search.options","true")); - sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, config.getProperty(SwitchboardConstants.GREEDYLEARNING_ACTIVE)); - sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, config.getProperty(SwitchboardConstants.REMOTESEARCH_RESULT_STORE)); - sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, config.getProperty(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE)); - sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, config.getProperty(SwitchboardConstants.SEARCH_VERIFY,"iffresh")); - sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, config.getProperty(SwitchboardConstants.SEARCH_VERIFY_DELETE,"true")); - sb.setConfig("about.headline", config.getProperty("about.headline","")); - sb.setConfig("about.body", config.getProperty("about.body","")); - sb.setConfig("search.excludehosts", config.getProperty("search.excludehosts","")); - sb.setConfig("search.excludehosth", config.getProperty("search.excludehosth","")); - } - } - - prop.putHTML(SwitchboardConstants.GREETING, sb.getConfig(SwitchboardConstants.GREETING, "")); - prop.putHTML(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, "")); - prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "")); - prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); - prop.putHTML(SwitchboardConstants.GREETING_IMAGE_ALT, sb.getConfig(SwitchboardConstants.GREETING_IMAGE_ALT, "")); - prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "")); - prop.put("publicTopmenu", sb.getConfigBool("publicTopmenu", false) ? 1 : 0); - prop.put(SwitchboardConstants.PUBLIC_SEARCHPAGE, sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, false) ? 1 : 0); - prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0); - - prop.put(SwitchboardConstants.GREEDYLEARNING_ACTIVE, sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) ? 1 : 0); - prop.put(SwitchboardConstants.GREEDYLEARNING_LIMIT_DOCCOUNT, sb.getConfig(SwitchboardConstants.GREEDYLEARNING_LIMIT_DOCCOUNT, "0")); - - prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, sb.getConfigBool(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, true) ? 1 : 0); - long resultStoredMaxSize = sb.getConfigLong(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, -1); - if(resultStoredMaxSize > 0) { - prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, resultStoredMaxSize); - } else { - prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, ""); - } - - prop.put("search.verify.nocache", sb.getConfig("search.verify", "").equals("nocache") ? 1 : 0); - prop.put("search.verify.iffresh", sb.getConfig("search.verify", "").equals("iffresh") ? 1 : 0); - prop.put("search.verify.ifexist", sb.getConfig("search.verify", "").equals("ifexist") ? 1 : 0); - prop.put("search.verify.cacheonly", sb.getConfig("search.verify", "").equals("cacheonly") ? 1 : 0); - prop.put("search.verify.false", sb.getConfig("search.verify", "").equals("false") ? 1 : 0); - prop.put("search.verify.delete", sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true) ? 1 : 0); - - prop.put("about.headline", sb.getConfig("about.headline", "")); - prop.put("about.body", sb.getConfig("about.body", "")); - - prop.put("search.excludehosts", sb.getConfig("search.excludehosts", "")); - prop.put("search.excludehosth", sb.getConfig("search.excludehosth", "")); - - final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html"); - prop.put("popupFront", 0); - prop.put("popupSearch", 0); - prop.put("popupInteractive", 0); - prop.put("popupStatus", 0); - if (browserPopUpPage.startsWith("index")) { - prop.put("popupFront", 1); - } else if (browserPopUpPage.startsWith("yacysearch")) { - prop.put("popupSearch", 1); - } else if (browserPopUpPage.startsWith("yacyinteractive")) { - prop.put("popupInteractive", 1); - } else { - prop.put("popupStatus", 1); - } - - prop.put("maximumRecords", sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10)); - - final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self"); - prop.put("target_selected_blank", "_blank".equals(target) ? 1 : 0); - prop.put("target_selected_self", "_self".equals(target) ? 1 : 0); - prop.put("target_selected_parent", "_parent".equals(target) ? 1 : 0); - prop.put("target_selected_top", "_top".equals(target) ? 1 : 0); - prop.put("target_selected_searchresult", "searchresult".equals(target) ? 1 : 0); - - final String target_special = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self"); - prop.put("target_selected_special_blank", "_blank".equals(target_special) ? 1 : 0); - prop.put("target_selected_special_self", "_self".equals(target_special) ? 1 : 0); - prop.put("target_selected_special_parent", "_parent".equals(target_special) ? 1 : 0); - prop.put("target_selected_special_top", "_top".equals(target_special) ? 1 : 0); - prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0); - prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "")); - prop.put("myContext", YaCyDefaultServlet.getContext(header, sb)); + /* Redirect to ConfigPortal_p */ + prop.put(serverObjects.ACTION_LOCATION, "ConfigPortal_p.html"); return prop; } diff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal_p.html similarity index 99% rename from htroot/ConfigPortal.html rename to htroot/ConfigPortal_p.html index 0938a4767..205ed4a3e 100644 --- a/htroot/ConfigPortal.html +++ b/htroot/ConfigPortal_p.html @@ -15,7 +15,7 @@ and a link to a home page that is reached when the 'corporate identity'-images are clicked. To change also colours and styles use the Appearance Servlet for different skins and languages.

-
+
Greeting Line
diff --git a/htroot/ConfigPortal_p.java b/htroot/ConfigPortal_p.java new file mode 100644 index 000000000..8c30af0bd --- /dev/null +++ b/htroot/ConfigPortal_p.java @@ -0,0 +1,228 @@ +// ConfigPortal_p.java +// ----------------------- +// part of YaCy +// (C) by Michael Peter Christen; mc@yacy.net +// first published on http://yacy.net +// Frankfurt, Germany, 4.7.2008 +// +//$LastChangedDate$ +//$LastChangedRevision$ +//$LastChangedBy$ +// +// LICENSE +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Properties; + +import net.yacy.cora.document.id.DigestURL; +import net.yacy.cora.protocol.RequestHeader; +import net.yacy.cora.util.ConcurrentLog; +import net.yacy.data.WorkTables; +import net.yacy.http.servlets.YaCyDefaultServlet; +import net.yacy.search.Switchboard; +import net.yacy.search.SwitchboardConstants; +import net.yacy.server.serverObjects; +import net.yacy.server.serverSwitch; +import net.yacy.server.http.HTTPDFileHandler; + +public class ConfigPortal_p { + + public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { + final serverObjects prop = new serverObjects(); + final Switchboard sb = (Switchboard) env; + + if (post != null) { + if (post.containsKey("popup")) { + final String popup = post.get("popup", "status"); + if ("front".equals(popup)) { + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"); + } else if ("search".equals(popup)) { + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html"); + } else if ("interactive".equals(popup)) { + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html"); + } else { + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html"); + } + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html")); + HTTPDFileHandler.initDefaultPath(); + } + if (post.containsKey("searchpage_set")) { + final String newGreeting = post.get(SwitchboardConstants.GREETING, ""); + // store this call as api call + sb.tables.recordAPICall(post, "ConfigPortal_p.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting); + + sb.setConfig(SwitchboardConstants.GREETING, newGreeting); + sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, post.get(SwitchboardConstants.GREETING_HOMEPAGE, "")); + sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, post.get(SwitchboardConstants.GREETING_LARGE_IMAGE, "")); + sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); + sb.setConfig(SwitchboardConstants.GREETING_IMAGE_ALT, post.get(SwitchboardConstants.GREETING_IMAGE_ALT, "")); + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, post.get("target", "_self")); + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, post.get("target_special", "_self")); + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, post.get("target_special_pattern", "_self")); + sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10)); + sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, "")); + HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, ""); + sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu")); + sb.setConfig(SwitchboardConstants.PUBLIC_SEARCHPAGE, !post.containsKey(SwitchboardConstants.PUBLIC_SEARCHPAGE) || post.getBoolean(SwitchboardConstants.PUBLIC_SEARCHPAGE)); + sb.setConfig("search.options", post.getBoolean("search.options")); + + sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, post.getBoolean(SwitchboardConstants.GREEDYLEARNING_ACTIVE)); + + final boolean storeresult = post.getBoolean(SwitchboardConstants.REMOTESEARCH_RESULT_STORE); + sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, storeresult); + sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, post.getLong(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, -1)); + + sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist")); + sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete")); + + sb.setConfig("about.headline", post.get("about.headline", "")); + sb.setConfig("about.body", post.get("about.body", "")); + + String excludehosts = post.get("search.excludehosts", ""); + sb.setConfig("search.excludehosts", excludehosts); + try { + sb.setConfig("search.excludehosth", DigestURL.hosthashes(excludehosts)); + } catch (MalformedURLException e) { + ConcurrentLog.logException(e); + sb.setConfig("search.excludehosth", ""); + } + } + if (post.containsKey("searchpage_default")) { + // load defaults from defaults/yacy.init file + final Properties config = new Properties(); + final String mes = "ConfigPortal"; + FileInputStream fis = null; + try { + fis = new FileInputStream(new File(sb.appPath, "defaults/yacy.init")); + config.load(fis); + } catch (final FileNotFoundException e) { + ConcurrentLog.severe(mes, "could not find configuration file."); + return prop; + } catch (final IOException e) { + ConcurrentLog.severe(mes, "could not read configuration file."); + return prop; + } finally { + if (fis != null) { + try { + fis.close(); + } catch (final IOException e) { + ConcurrentLog.logException(e); + } + } + } + sb.setConfig(SwitchboardConstants.GREETING, config.getProperty(SwitchboardConstants.GREETING,"P2P Web Search")); + sb.setConfig(SwitchboardConstants.GREETING_HOMEPAGE, config.getProperty(SwitchboardConstants.GREETING_HOMEPAGE,"http://yacy.net")); + sb.setConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, config.getProperty(SwitchboardConstants.GREETING_LARGE_IMAGE,"env/grafics/YaCyLogo_120ppi.png")); + sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, config.getProperty(SwitchboardConstants.GREETING_SMALL_IMAGE,"env/grafics/YaCyLogo_60ppi.png")); + sb.setConfig(SwitchboardConstants.GREETING_IMAGE_ALT, config.getProperty(SwitchboardConstants.GREETING_IMAGE_ALT,"YaCy project web site")); + sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, config.getProperty(SwitchboardConstants.BROWSER_POP_UP_PAGE,"Status.html")); + sb.setConfig(SwitchboardConstants.INDEX_FORWARD, config.getProperty(SwitchboardConstants.INDEX_FORWARD,"")); + HTTPDFileHandler.indexForward = ""; + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, config.getProperty(SwitchboardConstants.SEARCH_TARGET_DEFAULT,"_self")); + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, config.getProperty(SwitchboardConstants.SEARCH_TARGET_SPECIAL,"_self")); + sb.setConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, config.getProperty(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN,"")); + sb.setConfig("publicTopmenu", config.getProperty("publicTopmenu","true")); + sb.setConfig(SwitchboardConstants.PUBLIC_SEARCHPAGE, config.getProperty(SwitchboardConstants.PUBLIC_SEARCHPAGE,"true")); + sb.setConfig("search.navigation", config.getProperty("search.navigation","hosts,authors,namespace,topics")); + sb.setConfig("search.options", config.getProperty("search.options","true")); + sb.setConfig(SwitchboardConstants.GREEDYLEARNING_ACTIVE, config.getProperty(SwitchboardConstants.GREEDYLEARNING_ACTIVE)); + sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, config.getProperty(SwitchboardConstants.REMOTESEARCH_RESULT_STORE)); + sb.setConfig(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, config.getProperty(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE)); + sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, config.getProperty(SwitchboardConstants.SEARCH_VERIFY,"iffresh")); + sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, config.getProperty(SwitchboardConstants.SEARCH_VERIFY_DELETE,"true")); + sb.setConfig("about.headline", config.getProperty("about.headline","")); + sb.setConfig("about.body", config.getProperty("about.body","")); + sb.setConfig("search.excludehosts", config.getProperty("search.excludehosts","")); + sb.setConfig("search.excludehosth", config.getProperty("search.excludehosth","")); + } + } + + prop.putHTML(SwitchboardConstants.GREETING, sb.getConfig(SwitchboardConstants.GREETING, "")); + prop.putHTML(SwitchboardConstants.GREETING_HOMEPAGE, sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, "")); + prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "")); + prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); + prop.putHTML(SwitchboardConstants.GREETING_IMAGE_ALT, sb.getConfig(SwitchboardConstants.GREETING_IMAGE_ALT, "")); + prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "")); + prop.put("publicTopmenu", sb.getConfigBool("publicTopmenu", false) ? 1 : 0); + prop.put(SwitchboardConstants.PUBLIC_SEARCHPAGE, sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, false) ? 1 : 0); + prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0); + + prop.put(SwitchboardConstants.GREEDYLEARNING_ACTIVE, sb.getConfigBool(SwitchboardConstants.GREEDYLEARNING_ACTIVE, false) ? 1 : 0); + prop.put(SwitchboardConstants.GREEDYLEARNING_LIMIT_DOCCOUNT, sb.getConfig(SwitchboardConstants.GREEDYLEARNING_LIMIT_DOCCOUNT, "0")); + + prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, sb.getConfigBool(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, true) ? 1 : 0); + long resultStoredMaxSize = sb.getConfigLong(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, -1); + if(resultStoredMaxSize > 0) { + prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, resultStoredMaxSize); + } else { + prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE_MAXSIZE, ""); + } + + prop.put("search.verify.nocache", sb.getConfig("search.verify", "").equals("nocache") ? 1 : 0); + prop.put("search.verify.iffresh", sb.getConfig("search.verify", "").equals("iffresh") ? 1 : 0); + prop.put("search.verify.ifexist", sb.getConfig("search.verify", "").equals("ifexist") ? 1 : 0); + prop.put("search.verify.cacheonly", sb.getConfig("search.verify", "").equals("cacheonly") ? 1 : 0); + prop.put("search.verify.false", sb.getConfig("search.verify", "").equals("false") ? 1 : 0); + prop.put("search.verify.delete", sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true) ? 1 : 0); + + prop.put("about.headline", sb.getConfig("about.headline", "")); + prop.put("about.body", sb.getConfig("about.body", "")); + + prop.put("search.excludehosts", sb.getConfig("search.excludehosts", "")); + prop.put("search.excludehosth", sb.getConfig("search.excludehosth", "")); + + final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html"); + prop.put("popupFront", 0); + prop.put("popupSearch", 0); + prop.put("popupInteractive", 0); + prop.put("popupStatus", 0); + if (browserPopUpPage.startsWith("index")) { + prop.put("popupFront", 1); + } else if (browserPopUpPage.startsWith("yacysearch")) { + prop.put("popupSearch", 1); + } else if (browserPopUpPage.startsWith("yacyinteractive")) { + prop.put("popupInteractive", 1); + } else { + prop.put("popupStatus", 1); + } + + prop.put("maximumRecords", sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10)); + + final String target = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_DEFAULT, "_self"); + prop.put("target_selected_blank", "_blank".equals(target) ? 1 : 0); + prop.put("target_selected_self", "_self".equals(target) ? 1 : 0); + prop.put("target_selected_parent", "_parent".equals(target) ? 1 : 0); + prop.put("target_selected_top", "_top".equals(target) ? 1 : 0); + prop.put("target_selected_searchresult", "searchresult".equals(target) ? 1 : 0); + + final String target_special = sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL, "_self"); + prop.put("target_selected_special_blank", "_blank".equals(target_special) ? 1 : 0); + prop.put("target_selected_special_self", "_self".equals(target_special) ? 1 : 0); + prop.put("target_selected_special_parent", "_parent".equals(target_special) ? 1 : 0); + prop.put("target_selected_special_top", "_top".equals(target_special) ? 1 : 0); + prop.put("target_selected_special_searchresult", "searchresult".equals(target_special) ? 1 : 0); + prop.put("target_special_pattern", sb.getConfig(SwitchboardConstants.SEARCH_TARGET_SPECIAL_PATTERN, "")); + + prop.put("myContext", YaCyDefaultServlet.getContext(header, sb)); + return prop; + } + +} diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html index 9a576f440..fa133af3b 100644 --- a/htroot/ConfigSearchPage_p.html +++ b/htroot/ConfigSearchPage_p.html @@ -17,7 +17,7 @@

Below is a generic template of the search result page. Mark the check boxes for features you would like to be displayed. To change colors and styles use the Appearance menu for different skins. - Other portal settings can be adjusted in Generic Search Portal menu. + Other portal settings can be adjusted in Generic Search Portal menu.

Page Template

diff --git a/htroot/ConfigSearchPage_p.java b/htroot/ConfigSearchPage_p.java index c46ac9d93..54dc08d2a 100644 --- a/htroot/ConfigSearchPage_p.java +++ b/htroot/ConfigSearchPage_p.java @@ -32,7 +32,6 @@ import java.io.IOException; import java.sql.Date; import java.util.Map; import java.util.Properties; -import java.util.TreeMap; import net.yacy.cora.date.GenericFormatter; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.util.ConcurrentLog; @@ -62,7 +61,7 @@ public class ConfigSearchPage_p { if (post.containsKey("searchpage_set")) { final String newGreeting = post.get(SwitchboardConstants.GREETING, ""); // store this call as api call - sb.tables.recordAPICall(post, "ConfigPortal.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting); + sb.tables.recordAPICall(post, "ConfigPortal_p.html", WorkTables.TABLE_API_TYPE_CONFIGURATION, "new portal design. greeting: " + newGreeting); sb.setConfig("publicTopmenu", post.getBoolean("publicTopmenu")); sb.setConfig("search.options", post.getBoolean("search.options")); diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 9b684a293..32e70cc59 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -176,7 +176,7 @@ diff --git a/htroot/env/templates/submenuPortalConfiguration.template b/htroot/env/templates/submenuPortalConfiguration.template index 896f9b592..21b177ab7 100644 --- a/htroot/env/templates/submenuPortalConfiguration.template +++ b/htroot/env/templates/submenuPortalConfiguration.template @@ -1,7 +1,7 @@