Merge branch 'master' of git@github.com:yacy/yacy_search_server.git

pull/122/head
Michael Peter Christen 8 years ago
commit f5ad29edb1

@ -32,14 +32,14 @@
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.7.24.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.6.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.10.1.jar"/>
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
<classpathentry kind="lib" path="lib/xmpcore-5.1.3.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
<classpathentry kind="lib" path="lib/spatial4j-0.5.jar"/>
<classpathentry kind="lib" path="lib/zookeeper-3.4.6.jar"/>
<classpathentry kind="lib" path="lib/org.restlet.jar"/>
<classpathentry kind="lib" path="lib/fontbox-2.0.4.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-2.0.4.jar"/>
<classpathentry kind="lib" path="lib/fontbox-2.0.5.jar"/>
<classpathentry kind="lib" path="lib/pdfbox-2.0.5.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/poi-3.15.jar"/>
@ -64,26 +64,26 @@
<classpathentry kind="lib" path="lib/httpclient-4.5.3.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.3.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.5.3.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.5.4.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.5.4.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-58_2.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>

@ -183,7 +183,7 @@
<pathelement location="${lib}/commons-jxpath-1.3.jar" />
<pathelement location="${lib}/commons-lang-2.6.jar" />
<pathelement location="${lib}/commons-logging-1.2.jar" />
<pathelement location="${lib}/fontbox-2.0.4.jar" />
<pathelement location="${lib}/fontbox-2.0.5.jar" />
<pathelement location="${lib}/guava-18.0.jar" />
<pathelement location="${lib}/htmllexer.jar" />
<pathelement location="${lib}/httpclient-4.5.3.jar" />
@ -222,41 +222,41 @@
<pathelement location="${lib}/jwat-archive-common-1.0.4.jar" />
<pathelement location="${lib}/jwat-warc-1.0.4.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.24.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.5.3.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.5.3.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.5.3.jar" />
<pathelement location="${lib}/lucene-classification-5.5.3.jar" />
<pathelement location="${lib}/lucene-codecs-5.5.3.jar" />
<pathelement location="${lib}/lucene-core-5.5.3.jar" />
<pathelement location="${lib}/lucene-facet-5.5.3.jar" />
<pathelement location="${lib}/lucene-grouping-5.5.3.jar" />
<pathelement location="${lib}/lucene-highlighter-5.5.3.jar" />
<pathelement location="${lib}/lucene-join-5.5.3.jar" />
<pathelement location="${lib}/lucene-memory-5.5.3.jar" />
<pathelement location="${lib}/lucene-misc-5.5.3.jar" />
<pathelement location="${lib}/lucene-queries-5.5.3.jar" />
<pathelement location="${lib}/lucene-queryparser-5.5.3.jar" />
<pathelement location="${lib}/lucene-spatial-5.5.3.jar" />
<pathelement location="${lib}/lucene-suggest-5.5.3.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.5.4.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.5.4.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.5.4.jar" />
<pathelement location="${lib}/lucene-classification-5.5.4.jar" />
<pathelement location="${lib}/lucene-codecs-5.5.4.jar" />
<pathelement location="${lib}/lucene-core-5.5.4.jar" />
<pathelement location="${lib}/lucene-facet-5.5.4.jar" />
<pathelement location="${lib}/lucene-grouping-5.5.4.jar" />
<pathelement location="${lib}/lucene-highlighter-5.5.4.jar" />
<pathelement location="${lib}/lucene-join-5.5.4.jar" />
<pathelement location="${lib}/lucene-memory-5.5.4.jar" />
<pathelement location="${lib}/lucene-misc-5.5.4.jar" />
<pathelement location="${lib}/lucene-queries-5.5.4.jar" />
<pathelement location="${lib}/lucene-queryparser-5.5.4.jar" />
<pathelement location="${lib}/lucene-spatial-5.5.4.jar" />
<pathelement location="${lib}/lucene-suggest-5.5.4.jar" />
<pathelement location="${lib}/jsonic-1.2.0.jar" />
<pathelement location="${lib}/langdetect.jar" />
<pathelement location="${lib}/metadata-extractor-2.10.1.jar" />
<pathelement location="${lib}/noggit-0.5.jar" />
<pathelement location="${lib}/noggit-0.6.jar" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/pdfbox-2.0.4.jar" />
<pathelement location="${lib}/pdfbox-2.0.5.jar" />
<pathelement location="${lib}/poi-3.15.jar" />
<pathelement location="${lib}/poi-scratchpad-3.15.jar" />
<pathelement location="${lib}/slf4j-api-1.7.24.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.24.jar" />
<pathelement location="${lib}/solr-core-5.5.3.jar" />
<pathelement location="${lib}/solr-solrj-5.5.3.jar" />
<pathelement location="${lib}/solr-core-5.5.4.jar" />
<pathelement location="${lib}/solr-solrj-5.5.4.jar" />
<pathelement location="${lib}/spatial4j-0.5.jar" />
<pathelement location="${lib}/stax2-api_3.1.4.jar" />
<pathelement location="${lib}/weupnp-0.1.4.jar" />
<pathelement location="${lib}/woodstox-core-asl-4.4.1.jar" />
<pathelement location="${lib}/xercesImpl.jar" />
<pathelement location="${lib}/xml-apis.jar" />
<pathelement location="${lib}/xmpcore-5.1.2.jar" />
<pathelement location="${lib}/xmpcore-5.1.3.jar" />
<pathelement location="${lib}/zookeeper-3.4.6.jar" />
</path>

@ -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=<iframe src="env/donate.html" width="100%" height="90" border="0" frameborder="0" scrolling="no" hspace="0" vspace="0" name="donate"></iframe><br/><div style="padding:8px;">If you run a YaCy server, feel free to replace our donation plea with your own support message, use the <a href="ConfigPortal.html">Portal Configuration</a> servlet.</div>
about.body=<iframe src="env/donate.html" width="100%" height="90" border="0" frameborder="0" scrolling="no" hspace="0" vspace="0" name="donate"></iframe><br/><div style="padding:8px;">If you run a YaCy server, feel free to replace our donation plea with your own support message, use the <a href="ConfigPortal_p.html">Portal Configuration</a> servlet.</div>
donation.iframesource=http://yacy.net/include/donate.html
donation.iframetarget=env/donate.html

@ -31,7 +31,7 @@
<p>
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 <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can
change the appearance of the search page here.
</p>

@ -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;
}

@ -15,7 +15,8 @@
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 <a href="ConfigAppearance_p.html">Appearance Servlet</a> for different skins and languages.
</p>
<form action="ConfigPortal.html" method="post" enctype="multipart/form-data" id="ConfigPortal" accept-charset="UTF-8">
<form action="ConfigPortal_p.html" method="post" enctype="multipart/form-data" id="ConfigPortal" accept-charset="UTF-8">
<input type="hidden" name="transactionToken" value="#[transactionToken]#"/>
<fieldset>
<dl>
<dt>Greeting Line</dt>

@ -0,0 +1,235 @@
// 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.TransactionManager;
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) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(header, post);
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",""));
}
}
/* Acquire a transaction token for the next POST form submission */
prop.put(TransactionManager.TRANSACTION_TOKEN_PARAM, TransactionManager.getTransactionToken(header));
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;
}
}

@ -17,7 +17,7 @@
<p>
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 <a href="ConfigAppearance_p.html">Appearance</a> menu for different skins.
Other portal settings can be adjusted in <a href="ConfigPortal.html">Generic Search Portal</a> menu.
Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu.
</p>
<h4>Page Template</h4>

@ -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"));

@ -19,12 +19,12 @@
<input name="urlstartone" type="text" value="#[defaulturl]#" size="80" />
<input name="submit" type="submit" class="btn btn-primary" value="Import OAI-PMH source" />
#(import-one)#::
<p><dl>
<dl>
<dt>Source:</dt><dd>#[source]#</dd>
<dt>Processed:</dt><dd>#[count]# records</dd>
<dt>ResumptionToken:</dt><dd>#[rt]#</dd>
</dl></p>
::<p>Import failed: #[error]#</p>
</dl>
::<p class="error">Import failed: #[error]#</p>
#(/import-one)#
</fieldset>
</form>

@ -0,0 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaCy '#[clientname]#': Warc Import</title>
#%env/templates/metas.template%#
#(import)#::<meta http-equiv="REFRESH" content="10;url=IndexImportWarc_p.html" />
<!-- the url= removes http get parameters on refresh, preventing restart of import -->
#(/import)#
</head>
<body id="IndexImportWarc">
#%env/templates/header.template%#
#%env/templates/submenuIndexImport.template%#
<h2>Web Archive File Import</h2>
#(import)#
<p>No import thread is running, you can start a new thread here</p>
<form action="IndexImportWarc_p.html" method="get" accept-charset="UTF-8">
<!-- no post method here, we don't want to transmit the whole file, only the path-->
<fieldset>
<legend>Warc File Selection: select an warc file (which may be gz compressed)</legend>
<p>
You can download warc archives for example here
<a href="https://archive.org/search.php?query=subject%3A%22warcarchives%22&and[]=subject%3A%22warcarchives%22" target="_blank">Internet Archive</a>.
</p>
<div class="input-group">
<span style="display: inline-block">
<input name="file" type="file" value="" size="75" /></span>
<div class="btn-group">
<input name="submit" class="btn btn-primary" type="submit" value="Import Warc File" />
</div>
</div>
</fieldset>
</form>
<br />
::
<form><fieldset><legend>Import Process</legend>
<dl>
<dt>Thread:</dt><dd>#[thread]#</dd>
<dt>Warc File:</dt><dd>#[warcfile]#</dd>
<dt>Processed:</dt><dd>#[count]# Entries</dd>
<dt>Speed:</dt><dd>#[speed]# pages per second</dd>
<dt>Running Time:</dt><dd>#[runningHours]# hours, #[runningMinutes]# minutes</dd>
<dt>Remaining Time:</dt><dd>#[remainingHours]# hours, #[remainingMinutes]# minutes</dd>
</dl>
</fieldset></form>
#(/import)#
#%env/templates/footer.template%#
</body>
</html>

@ -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;
}
}

@ -46,6 +46,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#(showtable)#::
<form action="Table_API_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8" id="apilist">
<input type="hidden" name="transactionToken" value="#[transactionToken]#"/>
<fieldset>
<legend>Recorded Actions</legend>
<br />

@ -35,6 +35,7 @@ import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.TransactionManager;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.blob.Tables;
import net.yacy.kelondro.blob.Tables.Row;
@ -46,7 +47,7 @@ import net.yacy.server.serverSwitch;
public class Table_API_p {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
@ -85,6 +86,10 @@ public class Table_API_p {
current_pk = post.get("current_pk", "");
}
if (post != null && scheduleeventaction && !current_pk.isEmpty()) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(header, post);
try {
Tables.Row row = sb.tables.select(WorkTables.TABLE_API_NAME, current_pk.getBytes());
if (row != null) {
@ -150,6 +155,10 @@ public class Table_API_p {
}
if (post != null && !post.get("deleterows", "").isEmpty()) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(header, post);
for (final Map.Entry<String, String> entry : post.entrySet()) {
if (entry.getValue().startsWith("mark_")) {
try {
@ -162,6 +171,10 @@ public class Table_API_p {
}
if (post != null && !post.get("deleteold", "").isEmpty()) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(header, post);
int days = post.getInt("deleteoldtime", 365);
try {
Iterator<Row> ri = sb.tables.iterator(WorkTables.TABLE_API_NAME);
@ -199,6 +212,10 @@ public class Table_API_p {
}
if (post != null && !post.get("execrows", "").isEmpty()) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(header, post);
// create a time-ordered list of events to execute
final Set<String> pks = new TreeSet<String>();
for (final Map.Entry<String, String> entry : post.entrySet()) {
@ -235,6 +252,11 @@ public class Table_API_p {
prop.put("showtable", 1);
prop.put("showtable_inline", inline ? 1 : 0);
/* Acquire a transaction token for the next POST form submission */
final String nextTransactionToken = TransactionManager.getTransactionToken(header);
prop.put(TransactionManager.TRANSACTION_TOKEN_PARAM, nextTransactionToken);
prop.put("showtable_" + TransactionManager.TRANSACTION_TOKEN_PARAM, nextTransactionToken);
// insert rows
final List<Tables.Row> table = new ArrayList<Tables.Row>(maximumRecords);
int count = 0;
@ -287,7 +309,7 @@ public class Table_API_p {
prop.put("showtable_list_" + count + "_dateLastExec", date_last_exec == null ? "-" : GenericFormatter.FORMAT_SIMPLE.format(date_last_exec));
prop.put("showtable_list_" + count + "_dateNextExec", date_next_exec == null ? "-" : GenericFormatter.FORMAT_SIMPLE.format(date_next_exec));
prop.put("showtable_list_" + count + "_type", row.get(WorkTables.TABLE_API_COL_TYPE));
prop.put("showtable_list_" + count + "_comment", row.get(WorkTables.TABLE_API_COL_COMMENT));
prop.putHTML("showtable_list_" + count + "_comment", row.get(WorkTables.TABLE_API_COL_COMMENT));
// check type & action to link crawl start URLs back to CrawlStartExpert.html
if (prop.get("showtable_list_" + count + "_type", "").equals(WorkTables.TABLE_API_TYPE_CRAWLER)
&& prop.get("showtable_list_" + count + "_comment", "").startsWith("crawl start for")) {

@ -13,6 +13,7 @@
<p>Translate untranslated text of the user interface (current language). The modified translation file is stored in DATA/LOCALE directory.</p>
<form id="Translation" method="post" action="Translator_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
<input type="hidden" name="transactionToken" value="#[transactionToken]#"/>
<fieldset>
<legend>
<label>UI Translation</label>

@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.Map;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.TransactionManager;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
@ -33,7 +34,7 @@ import net.yacy.utils.translation.TranslationManager;
public class Translator_p {
public static servletProperties respond(@SuppressWarnings("unused") final RequestHeader requestHeader, @SuppressWarnings("unused") final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {
public static servletProperties respond(final RequestHeader requestHeader, final serverObjects post, final serverSwitch env) {
try {
final servletProperties prop = new servletProperties();
final Switchboard sb = (Switchboard) env;
@ -112,6 +113,9 @@ public class Translator_p {
}
// handle (modified) input text
if (i == textlistid && post != null) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(requestHeader, post);
if (editapproved) { // switch already translated in edit mode by copying to local translation
// not saved here as not yet modified/approved
localTransMgr.addTranslation(localTrans, filename, sourcetext, targettxt);
@ -138,6 +142,9 @@ public class Translator_p {
changed = true;
}
if (changed) {
/* Check this is a valid transaction */
TransactionManager.checkPostTransaction(requestHeader, post);
localTransMgr.saveAsLngFile(langcfg, locallngfile, localTrans);
// adhoc translate this file
// 1. get/calc the path
@ -150,6 +157,10 @@ public class Translator_p {
localTransMgr.translateFile(sourceFile, destFile, origTextList); // do the translation
}
}
/* Acquire a transaction token for the next POST form submission */
prop.put(TransactionManager.TRANSACTION_TOKEN_PARAM, TransactionManager.getTransactionToken(requestHeader));
prop.put("textlist", i);
return prop;
} catch (IOException ex) {

@ -176,7 +176,7 @@
</ul>
<ul class="nav nav-sidebar menugroup">
<li><h3>Search Portal Integration</h3></li>
<li><a href="ConfigPortal.html" class="MenuItemLink">Portal Configuration</a></li>
<li><a href="ConfigPortal_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Portal Configuration</a></li>
<li><a href="ConfigAppearance_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Portal Design</a></li>
<li><a href="RankingSolr_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Ranking and Heuristics</a></li>
</ul>

@ -13,6 +13,7 @@
<ul class="SubMenu">
<li><a href="Load_RSS_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">RSS Feed Importer</a></li>
<li><a href="IndexImportOAIPMH_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">OAI-PMH Importer</a></li>
<li><a href="IndexImportWarc_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Warc Importer</a></li>
</ul>
</div>

@ -1,7 +1,7 @@
<div class="SubMenu">
<h3>Portal Configuration</h3>
<ul class="SubMenu">
<li><a href="ConfigPortal.html" class="MenuItemLink">Generic Search Portal</a></li>
<li><a href="ConfigPortal_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Generic Search Portal</a></li>
<li><a href="ConfigSearchBox.html" class="MenuItemLink">Search Box Anywhere</a></li>
<li><a href="ConfigProfile_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">User Profile</a></li>
<li><a href="ConfigRobotsTxt_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">Local robots.txt</a></li>

Binary file not shown.

Binary file not shown.

@ -342,8 +342,8 @@ Appearance and Integration==外观界面
You can change the appearance of the YaCy interface with skins.==您可以在这里修改YaCy的外观界面.
#You can change the appearance of YaCy with skins==Sie können hier das Erscheinungsbild von YaCy mit Skins ändern
The selected skin and language also affects the appearance of the search page.==选择的皮肤和语言也会影响到搜索页面的外观.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==如果您<a href="ConfigPortal.html">创建YaCy门户</a>,
change the appearance of the search page here.==那么您能在<a href="ConfigPortal.html">这里</a> 改变搜索页面的外观.
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==如果您<a href="ConfigPortal_p.html">创建YaCy门户</a>,
change the appearance of the search page here.==那么您能在<a href="ConfigPortal_p.html">这里</a> 改变搜索页面的外观.
#and the default icons and links on the search page can be replaced with you own.==und die standard Grafiken und Links auf der Suchseite durch Ihre eigenen ersetzen.
Skin Selection==选择皮肤
Select one of the default skins, download new skins, or create your own skin.==选择一个默认皮肤, 下载新皮肤或者创建属于您自己的皮肤.
@ -619,7 +619,7 @@ enable/disable Parser==Parser 开启 / 关闭
"Submit"=="提交"
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal==搜索门户设置
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.==如果您想将YaCy作为您的网站搜索门户, 您可能需要在这改变搜索页面的图标和信息.

@ -383,8 +383,8 @@ Save User==Benutzer speichern
Appearance and Integration==Erscheinungsbild und Integration
You can change the appearance of the YaCy interface with skins.==Sie können hier das Aussehen der YaCy Oberfläche mit Skins verändern,
The selected skin and language also affects the appearance of the search page.==das ausgewählte Design und die gewählte Sprache wirken sich auch auf das Erscheinungsbild der Suchseite aus.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==Wenn Sie <a href="ConfigPortal.html">ein Such-Portal mit Yacy erstellen möchten</a> können Sie
change the appearance of the search page here.==das Erscheinungsbild der Suchseite <a href="ConfigPortal.html">hier</a> weitgehend ändern und die standard Grafiken und Links auf der Suchseite durch Ihre eigenen ersetzen.
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==Wenn Sie <a href="ConfigPortal_p.html">ein Such-Portal mit Yacy erstellen möchten</a> können Sie
change the appearance of the search page here.==das Erscheinungsbild der Suchseite <a href="ConfigPortal_p.html">hier</a> weitgehend ändern und die standard Grafiken und Links auf der Suchseite durch Ihre eigenen ersetzen.
#and the default icons and links on the search page can be replaced with you own.==und die standard Grafiken und Links auf der Suchseite durch Ihre eigenen ersetzen.
Skin Selection==Skinauswahl
Select one of the default skins, download new skins, or create your own skin.==Wählen Sie einen der mitgelieferten Skins, laden Sie einen neuen herunter oder erstellen Sie selbst einen neuen Skin.
@ -708,7 +708,7 @@ If you want to test a specific parser you can do so using the==Wenn Sie einen be
"Submit"=="Speichern"
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal==Integration eines Suchportals
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.==Wenn Sie YaCy als Suchportal für Ihre Webseiten integrieren wollen, können Sie auch die Icons und Nachrichten auf den Suchseiten verändern.

@ -334,7 +334,7 @@ Set Access Rules==Définir les règles d'accès
Appearance and Integration==Apparence et intégration
You can change the appearance of the YaCy interface with skins.==Vous pouvez personnaliser l'interface YaCy avec des thèmes.
The selected skin and language also affects the appearance of the search page.==Le thème et la langue sélectionnés affectent aussi l'aspect de la page de recherche.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==Si vous utilisez YaCy pour créer un <a href="ConfigPortal.html">portail de recherche</a> vous pouvez alors
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==Si vous utilisez YaCy pour créer un <a href="ConfigPortal_p.html">portail de recherche</a> vous pouvez alors
change the appearance of the search page here.==modifier l'aspect de la page de recherche ici.
Skin Selection==Sélection du thème
Select one of the default skins, download new skins, or create your own skin.==Sélectionnez l'un des thèmes par défaut, téléchargez de nouveaux thèmes ou créez le vôtre.

@ -328,7 +328,7 @@ Appearance and Integration==अप्पेअरेञ्चे और इं
You can change the appearance of the YaCy interface with skins.==Yacy के इंटरफ़ेस और स्किन्स को आप बदल सकते हैं,
#You can change the appearance of YaCy with skins==Yacy के इंटरफ़ेस और स्किन्स को आप बदल सकते हैं,
The selected skin and language also affects the appearance of the search page.==चयनित स्किन्स और भाषा भी सर्च पेज की अपीयरेंस को प्रभावित करता है.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==अगर आप YaCy साथ <a href="ConfigPortal.html">एक सर्च पोर्टल बनाते हैं</a> तो आप
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==अगर आप YaCy साथ <a href="ConfigPortal_p.html">एक सर्च पोर्टल बनाते हैं</a> तो आप
change the appearance of the search page here.==यहाँ सर्च पेज के स्वरूप को बदल सकते हैं.
#and the default icons and links on the search page can be replaced with you own.==और सर्च पेज पर डिफ़ॉल्ट चिह्न और लिंक आप के अनुसार बदला जा सकता है
Skin Selection==स्किन चयन
@ -613,7 +613,7 @@ BMP Image Parser==बीएमपी छवि पार्सर
"Submit"==" सबमिट "
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal== एक खोज पोर्टल की इंटीग्रेशन
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.== यदि आप अपने वेब पृष्ठों के लिए पोर्टल के रूप में याची एकीकृत करना चाहते हैं, तो आप खोज पृष्ठ पर माउस और संदेशों को बदलने के लिए चाह सकते हैं.

@ -403,7 +403,7 @@ Appearance and Integration==外観と統合
You can change the appearance of the YaCy interface with skins.==あなたはスキンによってYaCyのインターフェースの外観を変更する事ができます.
#You can change the appearance of YaCy with skins==あなたはスキンによってYaCyのインターフェースの外観を変更する事ができます
The selected skin and language also affects the appearance of the search page.==選択されたスキンと言語は検索ページの外観にも影響を与えます.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==もしあなたが<a href="ConfigPortal.html">YaCyで検索ポータルを作成</a>するならば
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==もしあなたが<a href="ConfigPortal_p.html">YaCyで検索ポータルを作成</a>するならば
change the appearance of the search page here.==ここで検索ページの外観を変更できます.
#and the default icons and links on the search page can be replaced with you own.==そして検索ページの既定のアイコンとリンクを自分のもので置き換える事ができます.
Skin Selection==スキンの選択
@ -554,7 +554,7 @@ Content Parser Settings==コンテントの構文解析器の構成
"Submit"=="確定"
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal==検索ポータルの統合
#-----------------------------
@ -619,7 +619,7 @@ Search Page<==検索ページ<
>Search Result Page Layout Configuration<==>検索結果のページのレイアウトの構成<
>Appearance<==>外観<
menu for different skins.== 別のスキンの為のメニュー.
Other portal settings can be adjusted in <a href="ConfigPortal.html">Generic Search Portal</a> menu.==他のポータルの設定は<a href="ConfigPortal.html">一般的な検索ポータル</a> メニューで調整できます
Other portal settings can be adjusted in <a href="ConfigPortal_p.html">Generic Search Portal</a> menu.==他のポータルの設定は<a href="ConfigPortal_p.html">一般的な検索ポータル</a> メニューで調整できます
>Page Template<==>ページのテンプレート<
#>Administration<==>管理<
>Web Search<==>ウェブ検索<

@ -948,7 +948,7 @@
<source>The selected skin and language also affects the appearance of the search page.</source>
</trans-unit>
<trans-unit id="234b8c23" xml:space="preserve" approved="no" translate="yes">
<source>If you &lt;a href="ConfigPortal.html"&gt;create a search portal with YaCy&lt;/a&gt; then you can</source>
<source>If you &lt;a href="ConfigPortal_p.html"&gt;create a search portal with YaCy&lt;/a&gt; then you can</source>
</trans-unit>
<trans-unit id="619edb0a" xml:space="preserve" approved="no" translate="yes">
<source>change the appearance of the search page here.</source>
@ -1685,7 +1685,7 @@
</body>
</file>
<file original="ConfigPortal.html" source-language="en" datatype="html">
<file original="ConfigPortal_p.html" source-language="en" datatype="html">
<body>
<trans-unit id="63cce208" xml:space="preserve" approved="no" translate="yes">
<source>Integration of a Search Portal</source>
@ -2659,6 +2659,47 @@
</body>
</file>
<file original="CookieTest_p.html" source-language="en" datatype="html">
<body>
<trans-unit id="Line0004" xml:space="preserve" approved="no" translate="yes">
<source>Cookie - Test Page</source>
</trans-unit>
<trans-unit id="Line0009" xml:space="preserve" approved="no" translate="yes">
<source>Here is a cookie test page.</source>
</trans-unit>
<trans-unit id="Line0014" xml:space="preserve" approved="no" translate="yes">
<source>Just clean it</source>
</trans-unit>
<trans-unit id="Line0022" xml:space="preserve" approved="no" translate="yes">
<source>Name:</source>
</trans-unit>
<trans-unit id="Line0024" xml:space="preserve" approved="no" translate="yes">
<source>Value:</source>
</trans-unit>
<trans-unit id="Line0027" xml:space="preserve" approved="no" translate="yes">
<source>Dear server, set this cookie for me!</source>
</trans-unit>
<trans-unit id="Line0031" xml:space="preserve" approved="no" translate="yes">
<source>Cookies at this browser:</source>
</trans-unit>
<trans-unit id="Line0042" xml:space="preserve" approved="no" translate="yes">
<source>Cookies coming to server:</source>
</trans-unit>
<trans-unit id="Line0051" xml:space="preserve" approved="no" translate="yes">
<source>Cookies server sent:</source>
</trans-unit>
<trans-unit id="Line0057" xml:space="preserve" approved="no" translate="yes">
<source>YaCy is a GPL'ed project</source>
</trans-unit>
<trans-unit id="Line0058" xml:space="preserve" approved="no" translate="yes">
<source>with the target of implementing a P2P-based global search engine.</source>
</trans-unit>
<trans-unit id="Line0059" xml:space="preserve" approved="no" translate="yes">
<source>Architecture (C) by</source>
</trans-unit>
</body>
</file>
<file original="CrawlCheck_p.html" source-language="en" datatype="html">
<body>
<trans-unit id="c3c61b8f" xml:space="preserve" approved="no" translate="yes">
@ -4704,6 +4745,9 @@
<trans-unit id="aa903601" xml:space="preserve" approved="no" translate="yes">
<source>(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/)</source>
</trans-unit>
<trans-unit id="Line0038" xml:space="preserve" approved="no" translate="yes">
<source>(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")</source>
</trans-unit>
<trans-unit id="cd50c4fa" xml:space="preserve" approved="no" translate="yes">
<source>Full URL List:</source>
</trans-unit>
@ -5036,6 +5080,65 @@
</body>
</file>
<file original="IndexImportWarc_p.html" source-language="en" datatype="html">
<body>
<trans-unit id="Line004" xml:space="preserve" approved="no" translate="yes">
<source>Warc Import</source>
</trans-unit>
<trans-unit id="Line013" xml:space="preserve" approved="no" translate="yes">
<source>Web Archive File Import</source>
</trans-unit>
<trans-unit id="Line0016" xml:space="preserve" approved="no" translate="yes">
<source>No import thread is running, you can start a new thread here</source>
</trans-unit>
<trans-unit id="Line0020" xml:space="preserve" approved="no" translate="yes">
<source>Warc File Selection: select an warc file (which may be gz compressed)</source>
</trans-unit>
<trans-unit id="Line0022" xml:space="preserve" approved="no" translate="yes">
<source>You can download warc archives for example here</source>
</trans-unit>
<trans-unit id="Line0023" xml:space="preserve" approved="no" translate="yes">
<source>Internet Archive</source>
</trans-unit>
<trans-unit id="Line0029" xml:space="preserve" approved="no" translate="yes">
<source>Import Warc File</source>
</trans-unit>
<trans-unit id="Line0037" xml:space="preserve" approved="no" translate="yes">
<source>Import Process</source>
</trans-unit>
<trans-unit id="13794b50" xml:space="preserve" approved="no" translate="yes">
<source>Thread:</source>
</trans-unit>
<trans-unit id="Line0040" xml:space="preserve" approved="no" translate="yes">
<source>Warc File:</source>
</trans-unit>
<trans-unit id="8ffbfacc" xml:space="preserve" approved="no" translate="yes">
<source>Processed:</source>
</trans-unit>
<trans-unit id="Line0041" xml:space="preserve" approved="no" translate="yes">
<source>Entries</source>
</trans-unit>
<trans-unit id="93fbf4f3" xml:space="preserve" approved="no" translate="yes">
<source>Speed:</source>
</trans-unit>
<trans-unit id="Line0042" xml:space="preserve" approved="no" translate="yes">
<source>pages per second</source>
</trans-unit>
<trans-unit id="d2dce52c" xml:space="preserve" approved="no" translate="yes">
<source>Running Time:</source>
</trans-unit>
<trans-unit id="b7cb1afd" xml:space="preserve" approved="no" translate="yes">
<source>hours,</source>
</trans-unit>
<trans-unit id="afaa7f3d" xml:space="preserve" approved="no" translate="yes">
<source>minutes&lt;</source>
</trans-unit>
<trans-unit id="5d1ec023" xml:space="preserve" approved="no" translate="yes">
<source>Remaining Time:</source>
</trans-unit>
</body>
</file>
<file original="IndexReIndexMonitor_p.html" source-language="en" datatype="html">
<body>
<trans-unit id="351526d8" xml:space="preserve" approved="no" translate="yes">
@ -8941,6 +9044,9 @@
<trans-unit id="ecd950ae" xml:space="preserve" approved="no" translate="yes">
<source>Save translation</source>
</trans-unit>
<trans-unit id="Line0050" xml:space="preserve" approved="no" translate="yes">
<source>Check for remote translation proposals and/or share your own added translations</source>
</trans-unit>
</body>
</file>

@ -420,7 +420,7 @@ Appearance and Integration==Внешний вид
You can change the appearance of the YaCy interface with skins.==Вы можете изменить внешний вид YaCy используя скины.
#You can change the appearance of YaCy with skins==Вы можете изменить внешний вид YaCy со скинами
The selected skin and language also affects the appearance of the search page.==Выбранный скин и язык, также влияют на внешний вид страницы поиска.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==Если вы <a href="ConfigPortal.html">создадите поиск с Yacy, </a>
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==Если вы <a href="ConfigPortal_p.html">создадите поиск с Yacy, </a>
change the appearance of the search page here.==то изменить внешний вид страницы поиска вы можете здесь.
#and the default icons and links on the search page can be replaced with you own.==и стандартные иконки и ссылки на странице поиска будут заменены на ваши.
Skin Selection==Выбор скина
@ -806,7 +806,7 @@ If you want to test a specific parser you can do so using the==Если вы ж
"Submit"=="Установить"
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal==Интеграция поиска
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.==Если вы хотите интегрировать YaCy как поиск для веб-страниц, то вы можете менять иконки и сообщения на странице поиска.

@ -341,8 +341,8 @@ Appearance and Integration==Зовнішній вигляд та інтегра
You can change the appearance of the YaCy interface with skins.==Ви можете змінити зовнішній вигляд інтерфейсу YaCy з допомогою шкури.
#You can change the appearance of YaCy with skins==Ви можете змінити зовнішній вигляд YaCy зі шкурами
The selected skin and language also affects the appearance of the search page.==Вибрані дизайн і мова також впливають на зовнішній вигляд сторінки пошуку.
If you <a href="ConfigPortal.html">create a search portal with YaCy</a> then you can==Якщо ви <a href="ConfigPortal.html">створюєте пошуковий портал з Yacy</a>, то можете
change the appearance of the search page here.==змінити появу пошукової сторінки <a href="ConfigPortal.html">тут</a>, а також змінити графіку та стиль посилань пошукової сторінки на власні.
If you <a href="ConfigPortal_p.html">create a search portal with YaCy</a> then you can==Якщо ви <a href="ConfigPortal_p.html">створюєте пошуковий портал з Yacy</a>, то можете
change the appearance of the search page here.==змінити появу пошукової сторінки <a href="ConfigPortal_p.html">тут</a>, а також змінити графіку та стиль посилань пошукової сторінки на власні.
#and the default icons and links on the search page can be replaced with you own.==і стандартні іконки та посилання на сторінці пошуку можуть бути замінені на власні.
Skin Selection==Вибір шкурки
Select one of the default skins, download new skins, or create your own skin.==Виберіть один з існуючих скінів, завантажте новий або створіть для себе новий.
@ -655,7 +655,7 @@ enable/disable==ввімкнути/вимкнути
>Extension==>Розширення
#-----------------------------
#File: ConfigPortal.html
#File: ConfigPortal_p.html
#---------------------------
Integration of a Search Portal==Інтегрування пошукового порталу
If you like to integrate YaCy as portal for your web pages, you may want to change icons and messages on the search page.==Якщо ви хочете вбудувати YaCy в якості пошукового порталу у веб-сайт, ви також можете змінити значки та повідомлення на сторінках пошуку.

@ -34,7 +34,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- the Solr version used in dependency section for all related dependencies -->
<solr.version>5.5.3</solr.version>
<solr.version>5.5.4</solr.version>
<!-- the Jetty version used in dependency section for all related dependencies -->
<jetty.version>9.2.21.v20170120</jetty.version>
@ -526,7 +526,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
<type>jar</type>
</dependency>
<dependency>

@ -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 "";
}
}

@ -109,7 +109,7 @@ public class GSAsearchServlet extends HttpServlet {
sb.peers.peerActions.setUserAgent(clientip, userAgent);
// --- handled by Servlet securityHandler
// check if user is allowed to search (can be switched in /ConfigPortal.html)
// check if user is allowed to search (can be switched in /ConfigPortal_p.html)
boolean authenticated = header.isUserInRole(UserDB.AccessRight.ADMIN_RIGHT.toString()); //sb.adminAuthenticated(header) >= 2;
// final boolean searchAllowed = authenticated || sb.getConfigBool(SwitchboardConstants.PUBLIC_SEARCHPAGE, true);
// if (!searchAllowed) return null;

@ -2010,9 +2010,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);

@ -48,6 +48,7 @@ public class NavigatorPlugins {
defaultnavplugins.put("namespace", "Wiki Name Space");
defaultnavplugins.put("year", "Year");
// defaultnavplugins.put("year:dates_in_content_dts:Event","Event");
defaultnavplugins.put("keywords", "Keywords");
return defaultnavplugins;
}
@ -118,6 +119,10 @@ public class NavigatorPlugins {
navigatorPlugins.put("year", new YearNavigator("Year", CollectionSchema.last_modified));
}
}
if (navname.contains("keywords")) {
navigatorPlugins.put("keywords", new TokenizedStringNavigator("Keywords", CollectionSchema.keywords));
}
}
return navigatorPlugins;
}

@ -0,0 +1,77 @@
/**
* TokenizedStringNavigator.java
* (C) 2017 by reger24; https://github.com/reger24
*
* This is a part of YaCy, a peer-to-peer based web search engine
*
* 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, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.search.navigator;
import java.util.Collection;
import java.util.StringTokenizer;
import net.yacy.kelondro.data.meta.URIMetadataNode;
import net.yacy.search.Switchboard;
import net.yacy.search.schema.CollectionSchema;
/**
* Search navigator for string entries based on ScoreMap to count and
* order the result list by counted occurence. The string values are tokenized
* and each word is added (lowercased) to the score map.
*/
public class TokenizedStringNavigator extends StringNavigator implements Navigator {
public TokenizedStringNavigator(String title, CollectionSchema field) {
super(title, field);
}
/**
* Increase the score for the key value contained in the defined field in
* the doc. The value string is tokenized using delimiter " ,;"
* @param doc Solrdocument with field for the key content
*/
@Override
public void incDoc(URIMetadataNode doc) {
if (field != null) {
Object val = doc.getFieldValue(field.getSolrFieldName());
if (val != null) {
if (val instanceof Collection) {
Collection<String> ll = (Collection) val;
for (String s : ll) {
if (!s.isEmpty()) {
StringTokenizer token = new StringTokenizer(s.toLowerCase()," ,;"); // StringTokenizer faster than regex pattern
while (token.hasMoreTokens()) {
String word = token.nextToken();
if (word.length() > 1 && !Switchboard.stopwords.contains(word)) {
this.inc(word);
}
}
}
}
} else {
StringTokenizer token = new StringTokenizer((String) val, " ,;");
while (token.hasMoreTokens()) {
String word = token.nextToken().toLowerCase();
if (word.length() > 1 && !Switchboard.stopwords.contains(word)) {
this.inc(word);
}
}
}
}
}
}
}

@ -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);
}
}
Loading…
Cancel
Save