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

pull/38/head
Michael Peter Christen 9 years ago
commit 7274e50d7f

@ -93,13 +93,13 @@
<classpathentry kind="lib" path="lib/jsoup-1.8.3.jar"/>
<classpathentry kind="lib" path="lib/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/weupnp-0.1.3.jar"/>
<classpathentry kind="lib" path="lib/common-image-3.2.jar"/>
<classpathentry kind="lib" path="lib/common-io-3.2.jar"/>
<classpathentry kind="lib" path="lib/common-lang-3.2.jar"/>
<classpathentry kind="lib" path="lib/imageio-core-3.2.jar"/>
<classpathentry kind="lib" path="lib/imageio-metadata-3.2.jar"/>
<classpathentry kind="lib" path="lib/imageio-tiff-3.2.jar"/>
<classpathentry kind="lib" path="lib/imageio-bmp-3.2.jar"/>
<classpathentry kind="lib" path="lib/common-image-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-io-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/common-lang-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/imageio-core-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/imageio-metadata-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/imageio-tiff-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/imageio-bmp-3.2.1.jar"/>
<classpathentry kind="lib" path="lib/jsonic-1.2.0.jar"/>
<classpathentry kind="lib" path="lib/langdetect.jar"/>
<classpathentry kind="output" path="gen"/>

@ -165,9 +165,9 @@
<pathelement location="${lib}/bcmail-jdk15-1.46.jar" />
<pathelement location="${lib}/bcprov-jdk15-1.46.jar" />
<pathelement location="${lib}/chardet.jar" />
<pathelement location="${lib}/common-image-3.2.jar" />
<pathelement location="${lib}/common-io-3.2.jar" />
<pathelement location="${lib}/common-lang-3.2.jar" />
<pathelement location="${lib}/common-image-3.2.1.jar" />
<pathelement location="${lib}/common-io-3.2.1.jar" />
<pathelement location="${lib}/common-lang-3.2.1.jar" />
<pathelement location="${lib}/commons-codec-1.10.jar" />
<pathelement location="${lib}/commons-compress-1.10.jar" />
<pathelement location="${lib}/commons-fileupload-1.3.1.jar" />
@ -182,10 +182,10 @@
<pathelement location="${lib}/httpcore-4.4.4.jar" />
<pathelement location="${lib}/httpmime-4.5.1.jar" />
<pathelement location="${lib}/icu4j-56_1.jar" />
<pathelement location="${lib}/imageio-bmp-3.2.jar" />
<pathelement location="${lib}/imageio-core-3.2.jar" />
<pathelement location="${lib}/imageio-metadata-3.2.jar" />
<pathelement location="${lib}/imageio-tiff-3.2.jar" />
<pathelement location="${lib}/imageio-bmp-3.2.1.jar" />
<pathelement location="${lib}/imageio-core-3.2.1.jar" />
<pathelement location="${lib}/imageio-metadata-3.2.1.jar" />
<pathelement location="${lib}/imageio-tiff-3.2.1.jar" />
<pathelement location="${lib}/J7Zip-modified.jar" />
<pathelement location="${lib}/jakarta-oro-2.0.8.jar" />
<pathelement location="${lib}/jaudiotagger-2.0.4-20111207.115108-15.jar" />

@ -23,8 +23,9 @@ csv = text/csv
db = application/octet-stream
dll = application/octet-stream
doc = application/msword
docx = application/msword
docx = application/vnd.openxmlformats-officedocument.wordprocessingml.document
dot = application/msword
dotx = application/vnd.openxmlformats-officedocument.wordprocessingml.template
dvi = application/x-dvi
eps = application/postscript
exe = application/octet-stream
@ -82,9 +83,11 @@ phtml = application/x-httpd-php
pl = text/plain
png = image/png
pot = application/mspowerpoint
potx = application/vnd.openxmlformats-officedocument.presentationml.template
pps = application/mspowerpoint
ppsx = application/vnd.openxmlformats-officedocument.presentationml.slideshow
ppt = application/mspowerpoint
pptx = application/mspowerpoint
pptx = application/vnd.openxmlformats-officedocument.presentationml.presentation
ppz = application/mspowerpoint
ps = application/postscript
py = text/html
@ -128,7 +131,8 @@ wmv = video/x-ms-wmv
xhtml = text/xhtml+xml
xla = application/msexcel
xls = application/msexcel
xlsx = application/msexcel
xlsx = application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xltx = application/vnd.openxmlformats-officedocument.spreadsheetml.template
xpi = application/x-xpinstall
xsl = text/xml
xml = text/xml

@ -178,13 +178,13 @@ linksnofollowcount_i
inboundlinkscount_i
## number of outgoing inbound (to same domain) links with nofollow tag, int
inboundlinksnofollowcount_i
#inboundlinksnofollowcount_i
## number of outgoing outbound (to other domain) links, including outboundlinksnofollowcount_i, int
outboundlinkscount_i
## number of outgoing outbound (to other domain) links with nofollow tag, int
outboundlinksnofollowcount_i
#outboundlinksnofollowcount_i
## number of images, int
imagescount_i

@ -56,8 +56,7 @@
</dd>
</dl>
<input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/>
<dl><dt></dt><dd><input type="submit" name="urlproxySettings" value="Submit" class="btn btn-primary"/></dd></dl>
</fieldset>
</form>

@ -21,7 +21,7 @@
<input type="checkbox" name="allowRegex" #(checked)#:: checked="checked"#(/checked)# />
Allow regular expressions in host part of blacklist entries.
<br /><br />
<input type="submit" name="list" value="Check" />
<input type="submit" name="list" class="btn btn-primary" value="Check" />
</div>::
<p class="error">The blacklist-cleaner only works for the following blacklist-engines up to now:</p>
<ul>#{engines}#
@ -58,7 +58,7 @@
<dd><input type="text" name="entry#[entry]#" value="#[entry]#" size="50" /></dd>#{/entries}#
<dt>&nbsp;</dt>
<dd>
<input type="submit" name="alter" value="Change Selected" /> <input type="submit" name="delete" value="Delete Selected" />
<input type="submit" name="alter" class="btn btn-primary" value="Change Selected" /> <input type="submit" name="delete" class="btn btn-danger" value="Delete Selected" />
</dd>
</dl>::#(/disabled)#
</fieldset>

@ -23,7 +23,7 @@
<option value="#[hash]#">#[name]#</option>
#{/otherHosts}#
</select>
<input type="submit" value="Load new blacklist items" />
<input type="submit" class="btn btn-primary" value="Load new blacklist items" />
</fieldset>
</form>
@ -33,7 +33,7 @@
<legend>URL:</legend>
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="text" name="url" />
<input type="submit" value="Load new blacklist items" />
<input type="submit" class="btn btn-primary" value="Load new blacklist items" />
</fieldset>
</form>
@ -45,7 +45,7 @@
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="hidden" name="type" value="plaintext" />
<input type="file" name="file" />
<input type="submit" value="Load new blacklist items" />
<input type="submit" class="btn btn-primary" value="Load new blacklist items" />
</fieldset>
</form>
@ -57,7 +57,7 @@
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="hidden" name="type" value="xml" />
<input type="file" name="file" />
<input type="submit" value="Load new blacklist items" />
<input type="submit" class="btn btn-primary" value="Load new blacklist items" />
</fieldset>
</form>
</fieldset>::#(/disabled)#
@ -76,7 +76,7 @@
#{/blackListNames}#
<option value="">all</option>
</select>
<input type="submit" value="Export list as XML" />
<input type="submit" class="btn btn-primary" value="Export list as XML" />
</fieldset>
</form>
@ -92,7 +92,7 @@
<option value="">all</option>
</select>
<input type="hidden" name="col" value="black" />
<input type="submit" value="Export list as text" />
<input type="submit" class="btn btn-primary" value="Export list as text" />
</fieldset>
</form>

@ -15,7 +15,7 @@
<fieldset>
<legend>Test list:</legend>
<input type="text" name="testurl" size="50" value="#[url]#" />
<input type="submit" name="testList" value="Test" />
<input type="submit" name="testList" class="btn btn-primary" value="Test" />
#(testlist)#::
<br /><br />

@ -42,7 +42,7 @@
#{/blackLists}#
</select>
<input type="hidden" name="selectList" value="select" />
<input type="submit" />
<input type="submit" class="btn btn-primary" />
</fieldset></form>
::
#(/disabled)#
@ -60,7 +60,7 @@
#(/error)#
<form action="Blacklist_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8"><fieldset>
<input type="text" id="newListName" size ="50" name="newListName" />
<input type="submit" name="createNewList" value="create" />
<input type="submit" name="createNewList" class="btn btn-primary" value="create" />
</fieldset></form>
</fieldset>
<br /><br />
@ -75,7 +75,7 @@
<div>
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="text" name="newEntry" size="50" />
<input type="submit" name="addBlacklistEntry" value="Add URL pattern" />
<input type="submit" name="addBlacklistEntry" class="btn btn-primary" value="Add URL pattern" />
</div>
<p>The right '*', after the '/', can be replaced by a <a href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html" target="_blank">regular expression</a>.</p>
<ul>
@ -119,7 +119,7 @@
#{/blackListsMove}#
</select>
&nbsp;
<input type="submit" />
<input type="submit" class="btn btn-primary" />
</div>
</form>
@ -129,18 +129,18 @@
<p>Show entries:
<table><tr>
#{subListOffset}#
<td style="padding: 5px;"><button type="submit" name="offset" style="padding:3px" value="#[fvalue]#" #(selected)#:: disabled="true"#(/selected)# />#[fvalue]# - #[tvalue]#</button></td>
<td style="padding: 5px;"><button type="submit" name="offset" class="btn btn-sm btn-default" style="padding:3px" value="#[fvalue]#" #(selected)#:: disabled="true"#(/selected)# />#[fvalue]# - #[tvalue]#</button></td>
#{/subListOffset}#
</tr></table>
&nbsp;
Entries per page:
<select name="size" size="1" onchange="document.selectRange.submit();">
<select name="size" size="1" onchange="submit();">
#{subListSize}#
<option value="#[value]#" #(selected)#::selected="selected"#(/selected)#>#[text]#</option>
#{/subListSize}#
</select>
&nbsp;
<input type="submit" value="set" />
<input type="submit" class="btn btn-sm btn-default" value="set" />
</p>
</fieldset></form>
@ -155,7 +155,7 @@
<input type="hidden" name="selectedBlacklistEntry.#[count]#" value="#[item]#"/>
#{/editList}#
<br /><br />
<input type="submit" value="Save URL pattern(s)" />
<input type="submit" class="btn btn-primary" value="Save URL pattern(s)" />
</div>
</form>
#(/edit)#
@ -167,8 +167,8 @@
<form action="Blacklist_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<div>
<input type="hidden" name="selectedListName" value="#[currentBlacklist]#" />
<input type="submit" name="shareList" value="Share/don't share this list" />
<input type="submit" name="deleteList" value="Delete this list" />
<input type="submit" name="shareList" class="btn btn-default" value="Share/don't share this list" />
<input type="submit" name="deleteList" class="btn btn-danger" value="Delete this list" />
</div>
</form>
<form action="Blacklist_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
@ -183,23 +183,11 @@
#{/currentActiveFor}#
</dl>
<input type="hidden" name="selectedListName" value="#[currentBlacklist]#" />
<input type="submit" name="activateList" value="Save" />
<dl><dt></dt><dd><input type="submit" name="activateList" class="btn btn-primary" value="Save" /></dd></dl>
</fieldset>
</form>
</fieldset>
::#(/disabled)#
<!--
<div>
<p>
#(status)#
::
<strong>#[item]#</strong> was removed from blacklist
::
<strong>#[item]#</strong> was added to the blacklist
#(/status)#
</p>
</div>
-->
#%env/templates/footer.template%#
</body>
</html>

@ -77,9 +77,9 @@
</dd>
</dl>
<input type="hidden" name="page" value="#[pageid]#" />
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
<input type="submit" name="discard" value="Discard" />
<input type="submit" name="submit" class="btn btn-primary" value="Submit" />
<input type="submit" name="preview" class="btn btn-default" value="Preview" />
<input type="submit" name="discard" class="btn btn-danger" value="Discard" />
</fieldset>
</form>
::
@ -121,9 +121,9 @@
</dd>
</dl>
<input type="hidden" name="page" value="#[pageid]#" />
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
<input type="submit" name="discard" value="Discard" />
<input type="submit" name="submit" class="btn btn-primary" value="Submit" />
<input type="submit" name="preview" class="btn btn-default" value="Preview" />
<input type="submit" name="discard" class="btn btn-danger" value="Discard" />
</fieldset>
</form>
::
@ -138,10 +138,10 @@
<form action="Blog.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<input type="hidden" name="delete" value="sure" />
<input type="hidden" name="page" value="#[pageid]#" />
<input type="submit" value="Yes, delete it." />
<input type="submit" class="btn btn-danger" value="Yes, delete it." />
</form>
<form action="Blog.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<input type="submit" value="No, leave it." />
<input type="submit" class="btn btn-primary" value="No, leave it." />
</form>
</fieldset>
::
@ -157,7 +157,7 @@
<form action="Blog.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<input type="file" size="50" name="xmlfile" />
<input type="submit" name="importxml" value="Import" />
<input type="submit" name="importxml" class="btn btn-primary" value="Import" />
</fieldset>
</form>
#(/mode)#

@ -70,9 +70,9 @@
</dd>
</dl>
<input type="hidden" name="page" value="#[pageid]#" />
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
<input type="submit" name="view" value="Discard" />
<input type="submit" name="submit" class="btn btn-primary" value="Submit" />
<input type="submit" name="preview" class="btn btn-default" value="Preview" />
<input type="submit" name="view" class="btn btn-danger" value="Discard" />
</fieldset>
</form>
#(/allow)#
@ -109,9 +109,9 @@
</dl>
<input type="hidden" name="page" value="#[pageid]#" />
<!-- <input type="text" name="page" value="#[pageid]#" /> -->
<input type="submit" name="submit" value="Submit" />
<input type="submit" name="preview" value="Preview" />
<input type="submit" name="view" value="Discard" />
<input type="submit" name="submit" class="btn btn-primary" value="Submit" />
<input type="submit" name="preview" class="btn btn-default" value="Preview" />
<input type="submit" name="view" class="btn btn-danger" value="Discard" />
</fieldset>
</form>

@ -76,6 +76,9 @@ public class Bookmarks {
final static boolean TAGS = false;
final static boolean FOLDERS = true;
final static float TAGCLOUD_FONTSIZE_MIN = 0.75f; // min font-size in em
final static float TAGCLOUD_FONTSIZE_MAX = 2.0f; // max font-size in em
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
int max_count = 10;
@ -455,7 +458,7 @@ public class Bookmarks {
}
} else {
// font-size is pseudo-rounded to 2 decimals
prop.put("display_"+id+"_"+count+"_size", Math.round((1.1f+Math.log(tag.size())/4f)*100.0f)/100.0f);
prop.put("display_"+id+"_"+count+"_size", Math.min(TAGCLOUD_FONTSIZE_MAX, Math.round((TAGCLOUD_FONTSIZE_MIN + Math.log(tag.size())/4f)*100.0f)/100.0f));
}
count++;
}

@ -78,7 +78,7 @@
</dd>
<dt>Default maximum number of results per page</dt>
<dd><input type="text" name="maximumRecords" value="#[maximumRecords]#" size="3" /></dd>
<dd><input type="text" name="maximumRecords" value="#[maximumRecords]#" size="3" /> <small>max = 100 (with CACHEONLY=5000)</small></dd>
<dt>Default index.html Page (by forwarder)</dt>
<dd><input type="text" name="indexForward" value="#[indexForward]#" size="60" /></dd>

@ -171,12 +171,6 @@ public class ConfigPortal {
prop.put(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, sb.getConfigBool(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, true) ? 1 : 0);
prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0);
prop.put("search.navigation.authors", sb.getConfig("search.navigation", "").indexOf("authors",0) >= 0 ? 1 : 0);
prop.put("search.navigation.collections", sb.getConfig("search.navigation", "").indexOf("collections",0) >= 0 ? 1 : 0);
prop.put("search.navigation.namespace", sb.getConfig("search.navigation", "").indexOf("namespace",0) >= 0 ? 1 : 0);
prop.put("search.navigation.topics", sb.getConfig("search.navigation", "").indexOf("topics",0) >= 0 ? 1 : 0);
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);

@ -28,8 +28,8 @@
<option #(selected)#::selected="selected"#(/selected)# value="#[url]#">#[name]# #(signatures)#(unsigned)::(signed)#(/signatures)#</option>
#{/availreleases}#
</select>
&nbsp;&nbsp;<input type="submit" name="downloadRelease" value="Download Release"/>
&nbsp;&nbsp;<input type="submit" name="checkRelease" value="Check for new Release"/>
&nbsp;&nbsp;<input type="submit" name="downloadRelease" class="btn btn-primary" value="Download Release"/>
&nbsp;&nbsp;<input type="submit" name="checkRelease" class="btn btn-default" value="Check for new Release"/>
</p></form></dd>
<dt><br />Downloaded Releases</dt>
<dd><form action="ConfigUpdate_p.html" method="get" accept-charset="UTF-8"><p>
@ -43,14 +43,14 @@
#{/downloadedreleases}#
#(downloadsAvailable)#::</select>#(/downloadsAvailable)#
#(deployenabled)#::no&nbsp;automated installation on development environments::
&nbsp;&nbsp;<input type="submit" name="update" value="Install Release" #(buttonsActive)#disabled="disabled"::#(/buttonsActive)#/>
&nbsp;&nbsp;<input type="submit" name="deleteRelease" value="Delete Release" #(buttonsActive)#disabled="disabled"::#(/buttonsActive)#/>
&nbsp;&nbsp;<input type="submit" name="update" class="btn btn-primary" value="Install Release" #(buttonsActive)#disabled="disabled"::#(/buttonsActive)#/>
&nbsp;&nbsp;<input type="submit" name="deleteRelease" class="btn btn-danger" value="Delete Release" #(buttonsActive)#disabled="disabled"::#(/buttonsActive)#/>
#(/deployenabled)#
</p></form></dd>
<dt><br />Automatic Update</dt>
<dd><form action="ConfigUpdate_p.html" method="get" accept-charset="UTF-8"><p>
&nbsp;check for new releases, download if available and restart with downloaded release<br />
&nbsp;&nbsp;<input type="submit" name="autoUpdate" value="Check + Download + Install Release Now" /><br />
&nbsp;&nbsp;<input type="submit" name="autoUpdate" class="btn btn-primary" value="Check + Download + Install Release Now" /><br />
#(autoUpdate)#::
<div class="commit">Download of release #[downloadedRelease]# finished. Restart Initiated.</div>::
<div class="error">No more recent release found.</div>::
@ -99,7 +99,7 @@
<input type="checkbox" name="onlySignedFiles" value="true" #(onlySignedFiles)#::checked="checked" #(/onlySignedFiles)#/>
only accept signed files
</dd>
<dt><input type="submit" name="configSubmit" value="Submit" /></dt>
<dt><input type="submit" name="configSubmit" class="btn btn-primary" value="Submit" /></dt>
<dd>#(configCommit)#&nbsp;::<div class="commit">Accepted Changes.</div>#(/configCommit)#</dd>
</dl>
</fieldset>

@ -28,8 +28,8 @@
</dd>
<dt style="width:260px"></dt>
<dd style="width:360px; float:left; display:inline;">
<input type="submit" name="EnterDoublecheck" value="Set" />
<input type="submit" name="ResetDoublecheck" value="Re-Set to default" />
<input type="submit" name="EnterDoublecheck" class="btn btn-primary" value="Set" />
<input type="submit" name="ResetDoublecheck" class="btn btn-primary" value="Re-Set to default" />
</dd>
</dl>
</fieldset>

@ -69,7 +69,7 @@
<fieldset>
<dl>
<dt><b>Import a database dump</b>,<br /></dt>
<dd><input type="text" name="content.phpbb3.dumpfile" value="#[content.phpbb3.dumpfile]#" size="60" /></dd>
<dd><input type="file" name="content.phpbb3.dumpfile" value="#[content.phpbb3.dumpfile]#" size="60" /></dd>
<dt>&nbsp;</dt>
<dd>
<input type="submit" name="import" value="Import Dump" class="btn btn-primary" style="width:240px"/>

@ -377,7 +377,7 @@ public class Crawler_p {
try {
scraper = sb.loader.loadDocument(sitelistURL, CacheStrategy.IFFRESH, BlacklistType.CRAWLER, agent);
// get links and generate filter
for (DigestURL u: scraper.getAnchors()) {
for (DigestURL u: scraper.getHyperlinks().keySet()) {
newRootURLs.add(u);
}
} catch (final IOException e) {

@ -34,11 +34,11 @@
<dd>#(geon0Status)#<div class="info">not loaded</div>::<div class="commit">loaded</div>::deactivated#(/geon0Status)#</dd>
<dt>Action</dt>
<dd>#(geon0Status)#
<input type="submit" name="geon0Load" value="Load" />::
<input type="submit" name="geon0Deactivate" value="Deactivate" />
<input type="submit" name="geon0Remove" value="Remove" />::
<input type="submit" name="geon0Activate" value="Activate" />
<input type="submit" name="geon0Remove" value="Remove" />
<input type="submit" name="geon0Load" class="btn btn-sm btn-primary" value="Load" />::
<input type="submit" name="geon0Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />
<input type="submit" name="geon0Remove" class="btn btn-sm btn-danger" value="Remove" />::
<input type="submit" name="geon0Activate" class="btn btn-sm btn-primary" value="Activate" />
<input type="submit" name="geon0Remove" class="btn btn-sm btn-danger" value="Remove" />
#(/geon0Status)#</dd>
#(geon0ActionLoaded)#::
<dt>Result</dt><dd><div class="commit">loaded and activated dictionary file</div></dd>::
@ -68,11 +68,11 @@
<dd>#(geon1Status)#<div class="info">not loaded</div>::<div class="commit">loaded</div>::deactivated#(/geon1Status)#</dd>
<dt>Action</dt>
<dd>#(geon1Status)#
<input type="submit" name="geon1Load" value="Load" />::
<input type="submit" name="geon1Deactivate" value="Deactivate" />
<input type="submit" name="geon1Remove" value="Remove" />::
<input type="submit" name="geon1Activate" value="Activate" />
<input type="submit" name="geon1Remove" value="Remove" />
<input type="submit" name="geon1Load" class="btn btn-sm btn-primary" value="Load" />::
<input type="submit" name="geon1Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />
<input type="submit" name="geon1Remove" class="btn btn-sm btn-danger" value="Remove" />::
<input type="submit" name="geon1Activate" class="btn btn-sm btn-primary" value="Activate" />
<input type="submit" name="geon1Remove" class="btn btn-sm btn-danger" value="Remove" />
#(/geon1Status)#</dd>
#(geon1ActionLoaded)#::
<dt>Result</dt><dd><div class="commit">loaded and activated dictionary file</div></dd>::
@ -102,11 +102,11 @@
<dd>#(geon2Status)#<div class="info">not loaded</div>::<div class="commit">loaded</div>::deactivated#(/geon2Status)#</dd>
<dt>Action</dt>
<dd>#(geon2Status)#
<input type="submit" name="geon2Load" value="Load" />::
<input type="submit" name="geon2Deactivate" value="Deactivate" />
<input type="submit" name="geon2Remove" value="Remove" />::
<input type="submit" name="geon2Activate" value="Activate" />
<input type="submit" name="geon2Remove" value="Remove" />
<input type="submit" name="geon2Load" class="btn btn-sm btn-primary" value="Load" />::
<input type="submit" name="geon2Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />
<input type="submit" name="geon2Remove" class="btn btn-sm btn-danger" value="Remove" />::
<input type="submit" name="geon2Activate" class="btn btn-sm btn-primary" value="Activate" />
<input type="submit" name="geon2Remove" class="btn btn-sm btn-danger" value="Remove" />
#(/geon2Status)#</dd>
#(geon2ActionLoaded)#::
<dt>Result</dt><dd><div class="commit">loaded and activated dictionary file</div></dd>::
@ -138,11 +138,11 @@
<dd>#(geo1Status)#<div class="info">not loaded</div>::<div class="commit">loaded</div>::deactivated#(/geo1Status)#</dd>
<dt>Action</dt>
<dd>#(geo1Status)#
<input type="submit" name="geo1Load" value="Load" />::
<input type="submit" name="geo1Deactivate" value="Deactivate" />
<input type="submit" name="geo1Remove" value="Remove" />::
<input type="submit" name="geo1Activate" value="Activate" />
<input type="submit" name="geo1Remove" value="Remove" />
<input type="submit" name="geo1Load" class="btn btn-sm btn-primary" value="Load" />::
<input type="submit" name="geo1Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />
<input type="submit" name="geo1Remove" class="btn btn-sm btn-danger" value="Remove" />::
<input type="submit" name="geo1Activate" class="btn btn-sm btn-primary" value="Activate" />
<input type="submit" name="geo1Remove" class="btn btn-sm btn-danger" value="Remove" />
#(/geo1Status)#</dd>
#(geo1ActionLoaded)#::
<dt>Result</dt><dd><div class="commit">loaded and activated dictionary file</div></dd>::
@ -181,11 +181,11 @@
<dd>#(drw0Status)#<div class="info">not loaded</div>::<div class="commit">loaded</div>::deactivated#(/drw0Status)#</dd>
<dt>Action</dt>
<dd>#(drw0Status)#
<input type="submit" name="drw0Load" value="Load" />::
<input type="submit" name="drw0Deactivate" value="Deactivate" />
<input type="submit" name="drw0Remove" value="Remove" />::
<input type="submit" name="drw0Activate" value="Activate" />
<input type="submit" name="drw0Remove" value="Remove" />
<input type="submit" name="drw0Load" class="btn btn-sm btn-primary" value="Load" />::
<input type="submit" name="drw0Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />
<input type="submit" name="drw0Remove" class="btn btn-sm btn-danger" value="Remove" />::
<input type="submit" name="drw0Activate" class="btn btn-sm btn-primary" value="Activate" />
<input type="submit" name="drw0Remove" class="btn btn-sm btn-danger" value="Remove" />
#(/drw0Status)#</dd>
#(drw0ActionLoaded)#::
<dt>Result</dt><dd><div class="commit">loaded and activated dictionary file</div></dd>::
@ -219,7 +219,7 @@
<dt><label>Status</label></dt>
<dd>#(syn0Status)#<div class="info">Deactivated</div>::<div class="commit">Activated</div>#(/syn0Status)#</dd>
<dt>Action</dt>
<dd>#(syn0Status)#<input type="submit" name="syn0Activate" value="Activate" />::<input type="submit" name="syn0Deactivate" value="Deactivate" />#(/syn0Status)#</dd>
<dd>#(syn0Status)#<input type="submit" name="syn0Activate" class="btn btn-sm btn-primary" value="Activate" />::<input type="submit" name="syn0Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />#(/syn0Status)#</dd>
</dl>
<h4><a href="http://icon.shef.ac.uk/Moby/" target="_blank">Moby Lexicon - English Thesaurus from http://icon.shef.ac.uk/Moby/</a></h4>
@ -229,7 +229,7 @@
<dt><label>Status</label></dt>
<dd>#(syn1Status)#<div class="info">Deactivated</div>::<div class="commit">Activated</div>#(/syn1Status)#</dd>
<dt>Action</dt>
<dd>#(syn1Status)#<input type="submit" name="syn1Activate" value="Activate" />::<input type="submit" name="syn1Deactivate" value="Deactivate" />#(/syn1Status)#</dd>
<dd>#(syn1Status)#<input type="submit" name="syn1Activate" class="btn btn-sm btn-primary" value="Activate" />::<input type="submit" name="syn1Deactivate" class="btn btn-sm btn-primary" value="Deactivate" />#(/syn1Status)#</dd>
</dl>
</fieldset>
</form>

@ -659,8 +659,6 @@ public class IndexControlRWIs_p {
sb.index,
sb.getRanking(),
"",//userAgent
false,
false,
0.0d, 0.0d, 0.0d,
new String[0]);
final SearchEvent theSearch = SearchEventCache.getEvent(query, sb.peers, sb.tables, null, false, sb.loader, Integer.MAX_VALUE, Long.MAX_VALUE);
@ -671,8 +669,7 @@ public class IndexControlRWIs_p {
} else {
prop.put("searchresult", 3);
prop.put("searchresult_allurl", theSearch.local_rwi_available.get());
prop
.put("searchresult_description", theSearch.flagCount()[WordReferenceRow.flag_app_dc_description]);
prop.put("searchresult_description", theSearch.flagCount()[WordReferenceRow.flag_app_dc_description]);
prop.put("searchresult_title", theSearch.flagCount()[WordReferenceRow.flag_app_dc_title]);
prop.put("searchresult_creator", theSearch.flagCount()[WordReferenceRow.flag_app_dc_creator]);
prop.put("searchresult_subject", theSearch.flagCount()[WordReferenceRow.flag_app_dc_subject]);

@ -19,9 +19,9 @@
<p>Showing latest #[num]# entries.</p>
<fieldset>
<input type="hidden" name="showRejected" value="#[newnum]#" />
<input type="submit" name="moreRejected" value="show more" />&nbsp;
<input type="submit" name="moreRejected" class="btn btn-success" value="show more" />&nbsp;
#(/only-latest)#
<input type="submit" name="clearRejected" value="clear list" />
<input type="submit" name="clearRejected" class="btn btn-danger" value="clear list" />
</fieldset>
</form>
<p>There are #[num]# entries in the rejected-queue:</p>

@ -74,7 +74,7 @@
<dt class="TableCellDark"></dt>
<dd><input type="checkbox" name="solr.indexing.solrremote.writeenabled" id="solr_indexing_solrremote_writeenabled" #(solr.indexing.solrremote.writeenabled.checked)#:: checked="checked"#(/solr.indexing.solrremote.writeenabled.checked)#/> write-enabled (if unchecked, the remote server(s) will only be used as search peers)</dd>
<dt><input type="submit" name="setsolr" value="Set" /></dt><dd></dd>
<dt><input type="submit" name="setsolr" class="btn btn-primary" value="Set" /></dt><dd></dd>
</dd>
</dl>
@ -95,7 +95,7 @@
<dt><input type="checkbox" name="core.service.webgraph.tmp" id="core_service_webgraph" #(core.service.webgraph.tmp.checked)#:: checked="checked"#(/core.service.webgraph.tmp.checked)# /></dt>
<dd>use webgraph search index (rich information in second Solr core)</dd>
<dt><input type="submit" name="setcitation" value="Set" /></dt><dd></dd>
<dt><input type="submit" name="setcitation" class="btn btn-primary" value="Set" /></dt><dd></dd>
</dl>
</fieldset>
</form>
@ -111,7 +111,7 @@
<dt><input type="checkbox" name="core.service.rwi" id="core_service_rwi" #(core.service.rwi.checked)#:: checked="checked"#(/core.service.rwi.checked)# /></dt>
<dd>support peer-to-peer index transmission (DHT RWI index)</dd>
<dt><input type="submit" name="setrwi" value="Set" /></dt><dd></dd>
<dt><input type="submit" name="setrwi" class="btn btn-primary" value="Set" /></dt><dd></dd>
</dl>
</fieldset>
</form>

@ -24,8 +24,13 @@
<br />
Dumps must be stored in the local file system in XML format and may be compressed in gz or bz2.
<br />
<input name="file" type="text" value="" size="80" />
<input name="submit" type="submit" value="Import MediaWiki Dump" />
<div class="input-group">
<span style="display: inline-block">
<input name="file" style="" type="file" value="" size="75" /></span>
<div class="btn-group">
<input name="submit" class="btn btn-primary" type="submit" value="Import MediaWiki Dump" />
</div>
</div>
</fieldset>
</form>
<p>

@ -25,7 +25,7 @@
<form action="IndexImportOAIPMH_p.html" target="_top" method="post" enctype="multipart/form-data" accept-charset="UTF-8" id="oaipmhimport">
<p>
<input type="hidden" name="num" value="#[num]#" />
<input type="submit" name="loadrows" value="Load Selected Sources" />
<input type="submit" name="loadrows" class="btn btn-primary" value="Load Selected Sources" />
</p>
<!-- Making the following table sortable could really consume some CPU if the list is huge - remove the class="sortable" if that is not desired ! -->
<table class="sortable" >
@ -41,7 +41,7 @@
#{/table}#
</table>
<p>
<input type="submit" name="loadrows" value="Load Selected Sources" />
<input type="submit" name="loadrows" class="btn btn-primary" value="Load Selected Sources" />
</p>
</form>
#(/source)#

@ -17,7 +17,7 @@
<legend>Single request import</legend>
This will submit only a single request as given here to a OAI-PMH server and imports records into the index<br />
<input name="urlstartone" type="text" value="#[defaulturl]#" size="80" />
<input name="submit" type="submit" value="Import OAI-PMH source" />
<input name="submit" type="submit" class="btn btn-primary" value="Import OAI-PMH source" />
#(import-one)#::
<p><dl>
<dt>Source:</dt><dd>#[source]#</dd>
@ -35,8 +35,8 @@
<legend>Import all Records from a server</legend>
Import all records that follow according to resumption elements into index<br />
<input name="urlstart" type="text" value="" size="80" />
<input name="importroot" type="submit" value="import this source" />
#(optiongetlist)#::or&nbsp;<input name="getlist" type="submit" value="import from a list" />#(/optiongetlist)#
<input name="importroot" type="submit" class="btn btn-primary" value="import this source" />
#(optiongetlist)#::or&nbsp;<input name="getlist" type="submit" class="btn btn-primary" value="import from a list" />#(/optiongetlist)#
#(status)#::<p>Import started!</p>::<p>Bad input data: #[message]# </p>#(/status)#
</fieldset>
</form>

@ -54,8 +54,8 @@
</div>
</fieldset>
<div>
<input type="submit" name="set" value="Set" />
<input style="float:right" type="submit" name="resetselectiontodefault" value="reset selection to default" />
<input type="submit" name="set" class="btn btn-primary" value="Set" />
<input style="float:right" type="submit" name="resetselectiontodefault" class="btn btn-primary" value="reset selection to default" />
</div>
</form>
<p><br /></p>
@ -66,7 +66,7 @@
To physically remove them from the index you need to reindex the documents.
Here you can reindex all documents with inactive fields.</p>
<div style="text-align:center ">
<input type="submit" name="reindexSolr" value="reindex Solr" />
<input type="submit" name="reindexSolr" class="btn btn-primary" value="reindex Solr" />
<input type="hidden" name="reindexnow"/>
</div>
<p>You may monitor progress (or stop the job) under <a href="IndexReIndexMonitor_p.html">IndexReIndexMonitor_p.html</a></p>

@ -30,10 +30,10 @@
<input type="hidden" name="crawlingMode" id="url" value="url" checked="checked" />
<input type="hidden" name="createBookmark" value="off" />
<input type="hidden" name="crawlingDepth" value="8" />
<input type="hidden" name="mustmatch" value=".*" />
<input type="hidden" name="mustnotmatch" value="(.*Recentchangeslinked.*)|(.*Whatlinkshere.*)|(.*MediaWiki.*)" />
<input type="hidden" name="range" value="subpath" />
<input type="hidden" name="crawlingIfOlderCheck" value="on"/>
<input type="hidden" name="mustmatch" value=".*" />
<input type="hidden" name="mustnotmatch" value="(.*Recentchangeslinked.*)|(.*Whatlinkshere.*)|(.*MediaWiki.*)" />
<input type="hidden" name="range" value="subpath" />
<input type="hidden" name="crawlingIfOlderCheck" value="on"/>
<input type="hidden" name="crawlingIfOlderNumber" value="1" />
<input type="hidden" name="crawlingIfOlderUnit" value="day" />
<input type="hidden" name="crawlingDomFilterCheck" value="off" />
@ -51,7 +51,7 @@
<input type="hidden" name="xpstopw" value="off" />
</dd>
<dt>&nbsp;</dt>
<dd><input type="submit" name="crawlingstart" value="Get content of Wiki: crawl wiki pages" /></dd>
<dd><input type="submit" name="crawlingstart" class="btn btn-primary" value="Get content of Wiki: crawl wiki pages" /></dd>
</dl>
</fieldset>

@ -35,7 +35,7 @@
<dd><input type="text" name="crawlingURL" value="#[starturl]#" size="60" maxlength="256" onkeypress="changed()" onfocus="check('url')" /></dd>
<dt>&nbsp;</dt>
<dd><input type="submit" name="crawlingstart" value="Get content of phpBB3: crawl forum pages" /></dd>
<dd><input type="submit" name="crawlingstart" class="btn btn-primary" value="Get content of phpBB3: crawl forum pages" /></dd>
</dl>

@ -32,7 +32,7 @@
<dt><b>URL of the RSS feed</b></dt>
<dd><input type="text" name="url" value="#[url]#" size="60" maxlength="256"/></dd>
<dt>Preview</dt>
<dd><input type="submit" name="showrss" value="Show RSS Items" /></dd>
<dd><input type="submit" name="showrss" class="btn btn-default" value="Show RSS Items" /></dd>
<dt>Indexing</dt>
<dd>#(showload)#<input type="hidden" name="collection" id="collection" value="#[collection]#" />Available after successful loading of rss feed in preview::
<dl>
@ -57,7 +57,7 @@
<dt>collection</dt>
<dd><input name="collection" id="collection" type="text" size="60" maxlength="100" value="#[collection]#" #(collectionEnabled)#disabled="disabled"::#(/collectionEnabled)# /></dd>
</dl>
<input type="submit" name="indexAllItemContent" value="Add All Items to Index (full content of url)" />
<input type="submit" name="indexAllItemContent" class="btn btn-primary" value="Add All Items to Index (full content of url)" />
#(/showload)#</dd>
#(showerrmsg)#::<dd class="error">#[msgtxt]#</dd>#(/showerrmsg)#
</dl>
@ -95,8 +95,8 @@
</table>
<p>
<input type="hidden" name="num" value="#[num]#" />
<input type="submit" name="removeSelectedFeedsScheduler" value="Remove Selected Feeds from Scheduler" />
<input type="submit" name="removeAllFeedsScheduler" value="Remove All Feeds from Scheduler" />
<input type="submit" name="removeSelectedFeedsScheduler" class="btn btn-danger" value="Remove Selected Feeds from Scheduler" />
<input type="submit" name="removeAllFeedsScheduler" class="btn btn-danger" value="Remove All Feeds from Scheduler" />
</p>
</fieldset></form>
#(/showscheduledfeeds)#
@ -122,9 +122,9 @@
</table>
<p>
<input type="hidden" name="num" value="#[num]#" />
<input type="submit" name="removeSelectedFeedsNewList" value="Remove Selected Feeds from Feed List" />
<input type="submit" name="removeAllFeedsNewList" value="Remove All Feeds from Feed List" />
<input type="submit" name="addSelectedFeedScheduler" value="Add Selected Feeds to Scheduler" />
<input type="submit" name="removeSelectedFeedsNewList" class="btn btn-danger" value="Remove Selected Feeds from Feed List" />
<input type="submit" name="removeAllFeedsNewList" class="btn btn-danger" value="Remove All Feeds from Feed List" />
<input type="submit" name="addSelectedFeedScheduler" class="btn btn-primary" value="Add Selected Feeds to Scheduler" />
</p>
</fieldset></form>
#(/shownewfeeds)#
@ -168,7 +168,7 @@
<p>
<input type="hidden" name="num" value="#[num]#" />
<input type="hidden" name="url" value="#[rss]#" />
<input type="submit" name="indexSelectedItemContent" value="Add Selected Items to Index (full content of url)" />
<input type="submit" name="indexSelectedItemContent" class="btn btn-primary" value="Add Selected Items to Index (full content of url)" />
</p>
</fieldset></form>
#(/showitems)#

@ -17,7 +17,7 @@
<select id="peers" name="hash">#{peers}#
<option value="#[hash]#">#[name]#</option>#{/peers}#
</select>
<input type="submit" name="submit" value="Compose" />
<input type="submit" name="submit" class="btn btn-primary" value="Compose" />
</dd>
</dl>
</fieldset></form>

@ -102,7 +102,7 @@ document.getElementById("apilink").setAttribute("href", "Network.xml?" + window.
<label for="match">Search for a peername (RegExp allowed)</label>:
<input type="text" id="match" name="match" value="#[searchpattern]#" />
<input type="hidden" name="page" value="#[page]#" />
<input type="submit" name="search" value="Search" />
<input type="submit" name="search" class="btn btn-default" value="Search" />
</fieldset>
</form>
<table class="sortable" border="0">
@ -354,7 +354,7 @@ document.getElementById("apilink").setAttribute("href", "Network.xml?" + window.
</tr>
<tr>
<td>&nbsp;<input name="page" type="hidden" value="4" /></td>
<td><input type="submit" name="addPeer" value="add Peer" /></td>
<td><input type="submit" name="addPeer" class="btn btn-primary" value="add Peer" /></td>
</tr>
</table>
</form>

@ -158,6 +158,7 @@
</tr>
</table>
<!-- this cache table wasn't used for years
<p><strong>Object Read Caches:</strong></p>
<table border="0">
<tr class="TableHeader" valign="bottom">
@ -184,7 +185,7 @@
<td>Write Unique</td>
<td>Write Double</td>
<td>Deletes</td>
<!-- <td>Flushes</td> -->
<td>Flushes</td>
</tr>
#{ObjectList}#
<tr class="TableCellLight">
@ -206,13 +207,13 @@
<td align="right">#[objectMissCacheWriteUnique]#</td>
<td align="right">#[objectMissCacheWriteDouble]#</td>
<td align="right">#[objectMissCacheDeletes]#</td>
<!-- <td align="right">#[objectMissCacheFlushes]#</td> -->
<td align="right">#[objectMissCacheFlushes]#</td>
</tr>
#{/ObjectList}#
<tr class="TableCellDark">
<td colspan="19">Total Mem: #[objectHitCacheTotalMem]# MB (hit), #[objectMissCacheTotalMem]# MB (miss); Stop Grow when less than #[objectCacheStopGrow]# MB available left; Start Shrink when less than #[objectCacheStartShrink]# MB availabe left</td>
</tr>
</table>
</table> -->
<!-- other cache sizes -->
<p><strong>Other Caching Structures:</strong></p>
@ -225,32 +226,6 @@
<td>Insert</td>
<td>Delete</td>
</tr>
<!-- CachedSolrConnector was replaced by ConcurrentUpdateSolrConnector
<tr class="TableCellLight">
<td>Solr-Cache/Hit</td>
<td>#[solrcacheHit.size]#</td>
<td>#[solrcacheHit.Hit]#</td>
<td>#[solrcacheHit.Miss]#</td>
<td>#[solrcacheHit.Insert]#</td>
<td>(ARC)</td>
</tr>
<tr class="TableCellLight">
<td>Solr-Cache/Miss</td>
<td>#[solrcacheMiss.size]#</td>
<td>#[solrcacheMiss.Hit]#</td>
<td>#[solrcacheMiss.Miss]#</td>
<td>#[solrcacheMiss.Insert]#</td>
<td>(ARC)</td>
</tr>
<tr class="TableCellLight">
<td>Solr-Cache/Document</td>
<td>#[solrcacheDocument.size]#</td>
<td>#[solrcacheDocument.Hit]#</td>
<td>#[solrcacheDocument.Miss]#</td>
<td>#[solrcacheDocument.Insert]#</td>
<td>(ARC)</td>
</tr>
-->
<tr class="TableCellLight">
<td>DNSCache/Hit</td>
<td>#[namecacheHit.size]#</td>

@ -36,7 +36,6 @@ import org.apache.solr.search.SolrCache;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.kelondro.index.Cache;
import net.yacy.kelondro.index.RAMIndex;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.Formatter;
@ -183,67 +182,51 @@ public class PerformanceMemory_p {
prop.put("indexcache", c);
prop.putNum("indexcacheTotalMem", totalhitmem / (1024d * 1024d));
// write object cache table
i = Cache.filenames();
c = 0;
long missmem, totalmissmem = 0;
totalhitmem = 0;
Map<Cache.StatKeys, String> mapy;
while (i.hasNext()) {
filename = i.next();
mapy = Cache.memoryStats(filename);
prop.put("ObjectList_" + c + "_objectCachePath", ((p = filename.indexOf("DATA",0)) < 0) ? filename : filename.substring(p));
// hit cache
hitmem = Long.parseLong(mapy.get(Cache.StatKeys.objectHitMem));
totalhitmem += hitmem;
prop.put("ObjectList_" + c + "_objectHitChunkSize", mapy.get(Cache.StatKeys.objectHitChunkSize));
prop.putNum("ObjectList_" + c + "_objectHitCacheCount", mapy.get(Cache.StatKeys.objectHitCacheCount));
prop.put("ObjectList_" + c + "_objectHitCacheMem", Formatter.bytesToString(hitmem));
prop.putNum("ObjectList_" + c + "_objectHitCacheReadHit", mapy.get(Cache.StatKeys.objectHitCacheReadHit));
prop.putNum("ObjectList_" + c + "_objectHitCacheReadMiss", mapy.get(Cache.StatKeys.objectHitCacheReadMiss));
prop.putNum("ObjectList_" + c + "_objectHitCacheWriteUnique", mapy.get(Cache.StatKeys.objectHitCacheWriteUnique));
prop.putNum("ObjectList_" + c + "_objectHitCacheWriteDouble", mapy.get(Cache.StatKeys.objectHitCacheWriteDouble));
prop.putNum("ObjectList_" + c + "_objectHitCacheDeletes", mapy.get(Cache.StatKeys.objectHitCacheDeletes));
prop.putNum("ObjectList_" + c + "_objectHitCacheFlushes", mapy.get(Cache.StatKeys.objectHitCacheFlushes));
// miss cache
missmem = Long.parseLong(mapy.get(Cache.StatKeys.objectMissMem));
totalmissmem += missmem;
prop.put("ObjectList_" + c + "_objectMissChunkSize", mapy.get(Cache.StatKeys.objectMissChunkSize));
prop.putNum("ObjectList_" + c + "_objectMissCacheCount", mapy.get(Cache.StatKeys.objectMissCacheCount));
prop.putHTML("ObjectList_" + c + "_objectMissCacheMem", Formatter.bytesToString(missmem));
prop.putNum("ObjectList_" + c + "_objectMissCacheReadHit", mapy.get(Cache.StatKeys.objectMissCacheReadHit));
prop.putNum("ObjectList_" + c + "_objectMissCacheReadMiss", mapy.get(Cache.StatKeys.objectMissCacheReadMiss));
prop.putNum("ObjectList_" + c + "_objectMissCacheWriteUnique", mapy.get(Cache.StatKeys.objectMissCacheWriteUnique));
prop.putNum("ObjectList_" + c + "_objectMissCacheWriteDouble", mapy.get(Cache.StatKeys.objectMissCacheWriteDouble));
prop.putNum("ObjectList_" + c + "_objectMissCacheDeletes", mapy.get(Cache.StatKeys.objectMissCacheDeletes));
//prop.put("ObjectList_" + c + "_objectMissCacheFlushes", mapy.get(Cache.StatKeys.objectMissCacheFlushes));
c++;
}
prop.put("ObjectList", c);
prop.putNum("objectCacheStopGrow", Cache.getMemStopGrow() / (1024d * 1024d));
prop.putNum("objectCacheStartShrink", Cache.getMemStartShrink() / (1024d * 1024d));
prop.putNum("objectHitCacheTotalMem", totalhitmem / (1024d * 1024d));
prop.putNum("objectMissCacheTotalMem", totalmissmem / (1024d * 1024d));
// other caching structures
// final CachedSolrConnector solr = (CachedSolrConnector) Switchboard.getSwitchboard().index.fulltext().getDefaultConnector();
// prop.putNum("solrcacheHit.size", solr.nameCacheHitSize());
// prop.putNum("solrcacheHit.Hit", solr.hitCache_Hit);
// prop.putNum("solrcacheHit.Miss", solr.hitCache_Miss);
// prop.putNum("solrcacheHit.Insert", solr.hitCache_Insert);
// this cache table wasn't used for years
// // write object cache table
// i = Cache.filenames();
// c = 0;
// long missmem, totalmissmem = 0;
// totalhitmem = 0;
// Map<Cache.StatKeys, String> mapy;
// while (i.hasNext()) {
// filename = i.next();
// mapy = Cache.memoryStats(filename);
// prop.put("ObjectList_" + c + "_objectCachePath", ((p = filename.indexOf("DATA",0)) < 0) ? filename : filename.substring(p));
//
// // hit cache
// hitmem = Long.parseLong(mapy.get(Cache.StatKeys.objectHitMem));
// totalhitmem += hitmem;
// prop.put("ObjectList_" + c + "_objectHitChunkSize", mapy.get(Cache.StatKeys.objectHitChunkSize));
// prop.putNum("ObjectList_" + c + "_objectHitCacheCount", mapy.get(Cache.StatKeys.objectHitCacheCount));
// prop.put("ObjectList_" + c + "_objectHitCacheMem", Formatter.bytesToString(hitmem));
// prop.putNum("ObjectList_" + c + "_objectHitCacheReadHit", mapy.get(Cache.StatKeys.objectHitCacheReadHit));
// prop.putNum("ObjectList_" + c + "_objectHitCacheReadMiss", mapy.get(Cache.StatKeys.objectHitCacheReadMiss));
// prop.putNum("ObjectList_" + c + "_objectHitCacheWriteUnique", mapy.get(Cache.StatKeys.objectHitCacheWriteUnique));
// prop.putNum("ObjectList_" + c + "_objectHitCacheWriteDouble", mapy.get(Cache.StatKeys.objectHitCacheWriteDouble));
// prop.putNum("ObjectList_" + c + "_objectHitCacheDeletes", mapy.get(Cache.StatKeys.objectHitCacheDeletes));
// prop.putNum("ObjectList_" + c + "_objectHitCacheFlushes", mapy.get(Cache.StatKeys.objectHitCacheFlushes));
//
// prop.putNum("solrcacheMiss.size", solr.nameCacheMissSize());
// prop.putNum("solrcacheMiss.Hit", solr.missCache_Hit);
// prop.putNum("solrcacheMiss.Miss", solr.missCache_Miss);
// prop.putNum("solrcacheMiss.Insert", solr.missCache_Insert);
// // miss cache
// missmem = Long.parseLong(mapy.get(Cache.StatKeys.objectMissMem));
// totalmissmem += missmem;
// prop.put("ObjectList_" + c + "_objectMissChunkSize", mapy.get(Cache.StatKeys.objectMissChunkSize));
// prop.putNum("ObjectList_" + c + "_objectMissCacheCount", mapy.get(Cache.StatKeys.objectMissCacheCount));
// prop.putHTML("ObjectList_" + c + "_objectMissCacheMem", Formatter.bytesToString(missmem));
// prop.putNum("ObjectList_" + c + "_objectMissCacheReadHit", mapy.get(Cache.StatKeys.objectMissCacheReadHit));
// prop.putNum("ObjectList_" + c + "_objectMissCacheReadMiss", mapy.get(Cache.StatKeys.objectMissCacheReadMiss));
// prop.putNum("ObjectList_" + c + "_objectMissCacheWriteUnique", mapy.get(Cache.StatKeys.objectMissCacheWriteUnique));
// prop.putNum("ObjectList_" + c + "_objectMissCacheWriteDouble", mapy.get(Cache.StatKeys.objectMissCacheWriteDouble));
// prop.putNum("ObjectList_" + c + "_objectMissCacheDeletes", mapy.get(Cache.StatKeys.objectMissCacheDeletes));
// //prop.put("ObjectList_" + c + "_objectMissCacheFlushes", mapy.get(Cache.StatKeys.objectMissCacheFlushes));
//
// prop.putNum("solrcacheDocument.size", solr.nameCacheDocumentSize());
// prop.putNum("solrcacheDocument.Hit", solr.documentCache_Hit);
// prop.putNum("solrcacheDocument.Miss", solr.documentCache_Miss);
// prop.putNum("solrcacheDocument.Insert", solr.documentCache_Insert);
// c++;
// }
// prop.put("ObjectList", c);
// prop.putNum("objectCacheStopGrow", Cache.getMemStopGrow() / (1024d * 1024d));
// prop.putNum("objectCacheStartShrink", Cache.getMemStartShrink() / (1024d * 1024d));
// prop.putNum("objectHitCacheTotalMem", totalhitmem / (1024d * 1024d));
// prop.putNum("objectMissCacheTotalMem", totalmissmem / (1024d * 1024d));
prop.putNum("namecacheHit.size", Domains.nameCacheHitSize());
prop.putNum("namecacheHit.Hit", Domains.cacheHit_Hit);

@ -60,8 +60,8 @@
#{/table}#
<tr class="TableCellLight">
<td align="left" colspan="19">
<input type="submit" name="submitdelay" value="Submit New Delay Values" />
<input type="submit" name="submitdefault" value="Re-set to default" />
<input type="submit" name="submitdelay" class="btn btn-sm btn-primary" value="Submit New Delay Values" />
<input type="submit" name="submitdefault" class="btn btn-sm btn-primary" value="Re-set to default" />
Changes take effect immediately<br/>
</td>
</tr>
@ -121,7 +121,7 @@
</tr>
<tr valign="top" class="TableCellLight">
<td colspan="4">
<input type="submit" name="cacheSizeSubmit" value="Enter New Cache Size" />
<input type="submit" name="cacheSizeSubmit" class="btn btn-sm btn-primary" value="Enter New Cache Size" />
Changes take effect immediately</td>
</tr>
</table>
@ -145,7 +145,7 @@
#{/pool}#
<tr class="TableCellLight">
<td align="left" colspan="7">
<input type="submit" name="poolConfig" value="Enter new Threadpool Configuration" />
<input type="submit" name="poolConfig" class="btn btn-sm btn-primary" value="Enter new Threadpool Configuration" />
Changes take effect immediately</td>
</tr>
</table>

@ -28,7 +28,7 @@
<dl>
<dt><label for="Xmx">Memory reserved for JVM</label></dt>
<dd><input name="Xmx" id="Xmx" type="text" size="5" maxlength="5" value="#[Xmx]#" /> MByte&nbsp;
<input type="submit" name="setStartup" value="Set" />&nbsp;
<input type="submit" class="btn btn-primary" name="setStartup" value="Set" />&nbsp;
#(setStartupCommit)#::<div class="commit">Accepted change. This will take effect after <strong>restart</strong> of YaCy. <br/><a href="Steering.html?restart=" onclick="return confirm('Confirm Restart')">restart now</a></div>::<div class="error"></div>#(/setStartupCommit)#
</dd>
</dl>
@ -47,7 +47,7 @@
<dt><label for="memoryAcceptDHT">RAM</label></dt>
<dd>disable DHT-in below <input name="memoryAcceptDHT" id="memoryAcceptDHT" type="text" size="4" value="#[memoryAcceptDHT]#" /> MiB free space</dd>
<dt>&nbsp;</dt>
<dd><input type="submit" name="setObserver" value="Save" /></dd>
<dd><input type="submit" class="btn btn-primary" name="setObserver" value="Save" /></dd>
</dl>
</fieldset>
</form>
@ -79,7 +79,7 @@
<td align="right"><input id="crawlPauseRemotesearch" name="crawlPauseRemotesearch" type="text" size="20" maxlength="100" value="#[crawlPauseRemotesearch]#" /></td>
</tr>
<tr class="TableCellLight">
<td align="left" colspan="2"><input type="submit" name="onlineCautionSubmit" value="Enter New Parameters" />
<td align="left" colspan="2"><input type="submit" class="btn btn-sm btn-primary"name="onlineCautionSubmit" value="Enter New Parameters" />
Changes take effect immediately</td>
</tr>
</table>

@ -95,7 +95,7 @@
<tr valign="top" class="TableCellDark">
<td colspan="1">&nbsp;</td>
<td colspan="2"><input type="submit" name="proxyprofileset" value="Set proxy profile" /></td>
<td colspan="2"><input type="submit" name="proxyprofileset" class="btn btn-primary" value="Set proxy profile" /></td>
</tr>
</table>
</form>

@ -60,8 +60,8 @@
</dl>
</fieldset>
<fieldset>
<input type="submit" name="EnterRanking" value="Set as Default Ranking" />
<input type="submit" name="ResetRanking" value="Re-Set to Built-In Ranking" />
<input type="submit" name="EnterRanking" class="btn btn-primary" value="Set as Default Ranking" />
<input type="submit" name="ResetRanking" class="btn btn-primary" value="Re-Set to Built-In Ranking" />
</fieldset>
</form>

@ -33,8 +33,8 @@
</dd>
<dt style="width:260px;margin:0;padding:0;height:1.8em;"></dt>
<dd style="width:360px;margin:0;padding:0;height:1.8em;float:left;display:inline;">
<input type="submit" name="EnterBF" value="Set Boost Function" />
<input type="submit" name="ResetBF" value="Re-Set to default" />
<input type="submit" name="EnterBF" class="btn btn-primary" value="Set Boost Function" />
<input type="submit" name="ResetBF" class="btn btn-primary" value="Re-Set to default" />
</dd>
</dl><br/>
#(boosthint)#::You can boost with vocabularies, use the occurrence counters #[vocabulariesvoccount]# and #[vocabulariesvoclogcount]#.#(/boosthint)#
@ -54,8 +54,8 @@
</dd>
<dt style="width:260px;margin:0;padding:0;height:1.8em;"></dt>
<dd style="width:360px;margin:0;padding:0;height:1.8em;float:left;display:inline;">
<input type="submit" name="EnterBQ" value="Set Boost Query" />
<input type="submit" name="ResetBQ" value="Re-Set to default" />
<input type="submit" name="EnterBQ" class="btn btn-primary" value="Set Boost Query" />
<input type="submit" name="ResetBQ" class="btn btn-primary" value="Re-Set to default" />
</dd>
</dl><br/>
#(boosthint)#::
@ -91,8 +91,8 @@
</dd>
<dt style="width:260px;margin:0;padding:0;height:1.8em;"></dt>
<dd style="width:360px;margin:0;padding:0;height:1.8em;float:left;display:inline;">
<input type="submit" name="EnterFQ" value="Set Filter Query" />
<input type="submit" name="ResetFQ" value="Re-Set to default" />
<input type="submit" name="EnterFQ" class="btn btn-primary" value="Set Filter Query" />
<input type="submit" name="ResetFQ" class="btn btn-primary" value="Re-Set to default" />
</dd>
</dl>
</fieldset>
@ -113,8 +113,8 @@
</dd>#{/boosts}#
<dt style="width:260px;margin:0;padding:0;height:1.8em;"></dt>
<dd style="width:360px;margin:0;padding:0;height:1.8em;float:left;display:inline;">
<input type="submit" name="EnterBoosts" value="Set Field Boosts" />
<input type="submit" name="ResetBoosts" value="Re-Set to default" />
<input type="submit" name="EnterBoosts" class="btn btn-primary" value="Set Field Boosts" />
<input type="submit" name="ResetBoosts" class="btn btn-primary" value="Re-Set to default" />
</dd>
</dl>
</fieldset>

@ -30,7 +30,7 @@
#(match)#<dd><img src="env/grafics/nok.png"> no match</dd>::<dd><img src="env/grafics/ok.png"> match</dd>::<dd><img src="env/grafics/bad.png"> error in expression: #[error]#</dd>#(/match)#
<dt></dt>
<dd>
<input name="submit" id="submit" type="submit" />
<input name="submit" id="submit" type="submit" class="btn btn-primary" />
</dd>
</dl>
</form>

@ -49,7 +49,7 @@
#(edit)#::
<p>
<input type="hidden" name="num" value="#[num]#" />
<input type="submit" name="crawl" value="Add Selected Servers to Crawler" />
<input type="submit" name="crawl" class="btn btn-primary" value="Add Selected Servers to Crawler" />
</p>
#(/edit)#
</fieldset></form>

@ -44,7 +44,7 @@
<tr valign="top">
<td>&nbsp;</td>
<td><input type="submit" name="crawlerSettings" value="Submit" /></td>
<td><input type="submit" name="crawlerSettings" class="btn btn-primary" value="Submit" /></td>
<td><em>Changes will take effect immediately.</em></td>
</tr>
</table>

@ -24,7 +24,7 @@
</td>
</tr>
<tr valign="top">
<td colspan="3"><input type="submit" name="msgForwarding" value="Submit" /> <em>Changes will take effect immediately.</em></td>
<td colspan="3"><input type="submit" name="msgForwarding" class="btn btn-primary" value="Submit" /> <em>Changes will take effect immediately.</em></td>
</tr>
</table>
</fieldset>

@ -51,7 +51,7 @@
<!-- submit button -->
<tr valign="top">
<td colspan="4"><input type="submit" name="proxysettings" value="Submit" /> <em>Changes will take effect immediately.</em></td>
<td colspan="4"><input type="submit" name="proxysettings" class="btn btn-primary" value="Submit" /> <em>Changes will take effect immediately.</em></td>
</tr>
</table>
</fieldset>

@ -19,7 +19,7 @@
<option value="#[name]#"#(selected)#:: selected="selected"#(/selected)#>#[name]#</option>
#{/seedUploadMethods}#
</select>
<input type="submit" name="seedSettings" value="Submit" />
<input type="submit" name="seedSettings" class="btn btn-primary" value="Submit" />
</td>
<td><em>Here you can specify which upload method should be used. Select 'none' to deactivate uploading.</em></td>
</tr>
@ -34,7 +34,7 @@
</td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="seedUploadRetry" value="Retry Uploading" /></td>
<td colspan="3"><input type="submit" name="seedUploadRetry" class="btn btn-primary" value="Retry Uploading" /></td>
</tr>
</table>
</form>

@ -5,11 +5,11 @@
<table border="0" cellspacing="5">
<tr valign="top">
<td><label for="fs_path">File Location</label>:</td>
<td><input name="seedFilePath" type="text" id="fs_path" size="40" value="#[seedFilePath]#" /></td>
<td><input name="seedFilePath" type="file" id="fs_path" size="40" value="#[seedFilePath]#" /></td>
<td><i>Here you can specify the path within the filesystem where the seed-list file should be stored.</i></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="seedFileSettings" value="Submit" /></td>
<td colspan="3"><input type="submit" name="seedFileSettings" class="btn btn-primary" value="Submit" /></td>
</tr>
</table>
</form>

@ -31,7 +31,7 @@
<td><i>The password</i></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="seedFtpSettings" value="Submit" /></td>
<td colspan="3"><input type="submit" name="seedFtpSettings" class="btn btn-primary" value="Submit" /></td>
</tr>
</table>
</form>

@ -31,7 +31,7 @@
<td><i>The password</i></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="seedScpSettings" value="Submit" /></td>
<td colspan="3"><input type="submit" name="seedScpSettings" class="btn btn-primary" value="Submit" /></td>
</tr>
</table>
</form>

@ -55,7 +55,7 @@
for the preconfigured value 'localpeer', the URL is: http://localpeer/.</td>
</tr>
<tr valign="top">
<td colspan="3"><input type="submit" name="serveraccount" value="Submit" /></td>
<td colspan="3"><input type="submit" name="serveraccount" class="btn btn-primary" value="Submit" /></td>
</tr>
</table>
</fieldset>

@ -127,11 +127,7 @@
<dd class="hint">Latest public version is v#[latestVersion]#.
You can download a more recent version of YaCy. Click here to install this update and restart YaCy:
<form action="Status.html" method="get" class="PeerControl" accept-charset="UTF-8">
<!-- Is this line here on purpose or by accident?
<form action="Table_API_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8" name="apilist">
-->
<button type="submit" name="aquirerelease" value="Update YaCy">
<button type="submit" name="aquirerelease" class="btn btn-primary" value="Update YaCy">
<img src="env/grafics/lock.gif" alt="lock icon"/>
Install YaCy v#[latestVersion]#
</button>

@ -171,7 +171,7 @@ XDtoU7vQ/wIAAP//AwBb7ktEXQ4nqQAAAABJRU5ErkJggg==" width="128" height="64" alt="K
<p>Application will terminate after working off all scheduled tasks.</p>
<h2>Please send us feed-back!</h2>
<p>We don't track YaCy users, YaCy does not send 'home-pings', we do not even know how many people use YaCy as their private search engine.<br/>
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is is possible that we change a bit to suit your needs?</p>
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is it possible that we change a bit to suit your needs?</p>
<p>Please send us feed-back about your experience with an<br/>
<a href="http://sayat.me/YaCy" target="_blank">anonymous message</a><br/>
or a<br/>

@ -55,11 +55,11 @@
</p>
<form action="Surftips.html" method="get" class="PeerControl" accept-charset="UTF-8"><div>
<button type="submit" name="publicPage" value="0">
<button type="submit" name="publicPage" class="btn btn-primary" value="0">
<img src="env/grafics/lock.gif" alt="authentication required" />
Hide surftips for users without autorization
</button>
<button type="submit" name="publicPage" value="1">
<button type="submit" name="publicPage" class="btn btn-primary" value="1">
<img src="env/grafics/lock.gif" alt="authentication required" />
Show surftips to everyone
</button>

@ -60,7 +60,7 @@ document.write("<div id=\"api\"><a href=\"/Tables_p.xml" + window.location.searc
<dt>reverse:</dt>
<dd><input type="checkbox" name="reverse" #(reverse)#::checked="check"#(/reverse)# onchange='this.form.submit()'></dd>
<dt>search rows for</dt>
<dd><input type="text" name="search" value="#[pattern]#" /><input type="submit" name="edittable" value="Search" /></dd>
<dd><input type="text" name="search" value="#[pattern]#" /> <input type="submit" name="edittable" class="btn btn-default" value="Search" /></dd>
</dl>
</fieldset>
</form>
@ -90,10 +90,10 @@ document.write("<div id=\"api\"><a href=\"/Tables_p.xml" + window.location.searc
<p>
<input type="hidden" name="table" value="#[table]#" />
<input type="hidden" name="num" value="#[num]#" />
<input type="submit" name="editrow" value="Edit Selected Row" />
<input type="submit" name="addrow" value="Add a new Row" />&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="deleterows" value="Delete Selected Rows" />
<input type="submit" name="deletetable" value="Delete Table" />
<input type="submit" name="editrow" class="btn btn-primary" value="Edit Selected Row" />
<input type="submit" name="addrow" class="btn btn-primary" value="Add a new Row" />&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="deleterows" class="btn btn-danger" value="Delete Selected Rows" />
<input type="submit" name="deletetable" class="btn btn-danger" value="Delete Table" />
</p>
</fieldset>
</form>

@ -12,14 +12,14 @@
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td><form action="Threaddump_p.html" method="get" accept-charset="UTF-8">
<fieldset>
<input type="submit" name="singleThreaddump" value="Single Threaddump" />
<input type="submit" name="singleThreaddump" class="btn btn-primary" value="Single Threaddump" />
</fieldset>
</form></td>
<td><form action="Threaddump_p.html" method="get" accept-charset="UTF-8">
<fieldset>
<input type="text" name="count" value="#[count]#" size="4" maxlength="4" />
<input type="submit" name="multipleThreaddump" value="Multiple Dump Statistic" />
<input type="submit" name="multipleThreaddump" class="btn btn-primary" value="Multiple Dump Statistic" />
</fieldset>
</form></td>
</tr></table>

@ -14,7 +14,7 @@
<input type="hidden" name="returnto" value="#[returnto]#" />
Username: <input type="text" name="username" value="#[username]#" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" value="login" />
<input type="submit" class="btn btn-primary" value="login" />
</form>
</p>
::
@ -22,7 +22,7 @@
You are currently logged in as #[username]#.<br />
(Identified by #(identified-by)#IP::Username/Password::Cookie#(/identified-by)#)<br />
<form action="User.html" accept-charset="UTF-8">
<input type="submit" name="logout" value="logout">
<input type="submit" name="logout" class="btn btn-primary" value="logout">
</form>
#(limit)#::
#{percent}#<img src="env/grafics/red-block.png" alt="red bar" />#{/percent}##{percent2}#<img src="env/grafics/green-block.png" alt="green bar" />#{/percent2}#
@ -45,14 +45,14 @@
<td><input type="password" name="newpass2" id="newpass2" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="changepass" value="Change" /></td>
<td colspan="2"><input type="submit" name="changepass" class="btn btn-primary" value="Change" /></td>
</tr>
</table>
</form>
::
You are currently logged in as admin.<br />
<form action="User.html" accept-charset="UTF-8">
<input type="submit" name="logout" value="logout">
<input type="submit" name="logout" class="btn btn-primary" value="logout">
</form>
<br />
<p>(after logout you will be prompted for your password again. simply click "cancel")</p>

@ -82,15 +82,15 @@ function updatepage(str) {
<dt>URL:</dt>
<dd>
<input type="text" size="60" name="url" id="url" value="#[url]#" />
<input type="submit" name="show" value="Show Metadata" />
#(moar)#::<input type="button" value="Browse Host" onClick="location.href='/HostBrowser.html?path=' + document.getElementById('url').value" />#(/moar)#
<input type="submit" name="show" class="btn btn-primary" value="Show Metadata" />
#(moar)#::<input type="button" value="Browse Host" class="btn btn-default" onClick="location.href='/HostBrowser.html?path=' + document.getElementById('url').value" />#(/moar)#
<div id="searchresults"></div>
</dd>
#(moar)#::
<dt>Search in Document:</dt>
<dd>
<input type="text" size="60" name="search" id="search" value="#[search]#" />
<input type="submit" name="show" value="Show Snippet" />
<input type="submit" name="show" class="btn btn-primary" value="Show Snippet" />
</dd>
#(/moar)#
</dl>
@ -124,7 +124,7 @@ function updatepage(str) {
<option value="links"#(vMode-links)#:: selected="selected"#(/vMode-links)#>Link List</option>
<option value="iframeCitations"#(vMode-iframeCitations)#:: selected="selected"#(/vMode-iframeCitations)#>Citation Report</option>
</select>
<noscript><input type="submit" name="show" value="Show" /></noscript>
<noscript><input type="submit" name="show" class="btn btn-primary" value="Show" /></noscript>
</dd>
</dl>
<input type="hidden" name="words" value="#[words]#" />

@ -325,6 +325,24 @@ public class ViewFile {
prop.put("viewMode", VIEW_MODE_AS_LINKLIST);
boolean dark = true;
int i = 0;
if (document.getEmaillinks() != null) {
Iterator<AnchorURL> emailit = document.getEmaillinks().iterator();
while (emailit.hasNext()) {
AnchorURL eentry = emailit.next();
prop.put("viewMode_links_" + i + "_nr", i);
prop.put("viewMode_links_" + i + "_dark", dark ? "1" : "0");
prop.put("viewMode_links_" + i + "_type", "email");
prop.put("viewMode_links_" + i + "_text", (eentry.getTextProperty().isEmpty()) ? "&nbsp;" : eentry.getTextProperty());
prop.put("viewMode_links_" + i + "_url", "#");
prop.put("viewMode_links_" + i + "_link", eentry.toNormalform(true));
prop.put("viewMode_links_" + i + "_rel", "");
prop.put("viewMode_links_" + i + "_name", eentry.getNameProperty());
dark = !dark;
i++;
}
}
i += putMediaInfo(prop, wordArray, i, document.getVideolinks(), "video", (i % 2 == 0));
i += putMediaInfo(prop, wordArray, i, document.getAudiolinks(), "audio", (i % 2 == 0));
dark = (i % 2 == 0);

@ -30,6 +30,7 @@ import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
@ -49,6 +50,7 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.storage.ConcurrentARC;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.data.URLLicense;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.workflow.WorkflowProcessor;
import net.yacy.peers.graphics.EncodedImage;
@ -60,8 +62,11 @@ import net.yacy.server.serverSwitch;
public class ViewImage {
private static Map<String, Image> iconcache = new ConcurrentARC<String, Image>(1000,
Math.max(10, Math.min(32, WorkflowProcessor.availableCPU * 2)));
private static Map<String, Image> iconcache = new ConcurrentARC<String, Image>(1000,
Math.max(10, Math.min(32, WorkflowProcessor.availableCPU * 2)));
private static String defaulticon = "htroot/env/grafics/dfltfvcn.ico";
private static byte[] defaulticonb = null;
/**
* Try parsing image from post "url" parameter or from "code" parameter.
@ -132,7 +137,7 @@ public class ViewImage {
ImageInputStream imageInStream = null;
InputStream inStream = null;
try {
String urlExt = MultiProtocolURL.getFileExtension(url.getFileName());
String urlExt = MultiProtocolURL.getFileExtension(url.getFileName());
if (ext != null && ext.equalsIgnoreCase(urlExt) && isBrowserRendered(urlExt)) {
return openInputStream(post, sb.loader, auth, url);
}
@ -149,10 +154,23 @@ public class ViewImage {
// read image
encodedImage = parseAndScale(post, auth, urlString, ext, imageInStream);
} catch(Exception e) {
/* Exceptions are not propagated here : many error causes are possible, network errors,
* incorrect or unsupported format, bad ImageIO plugin...
* Instead return an empty EncodedImage. Caller is responsible for handling this correctly (500 status code response) */
encodedImage = new EncodedImage(new byte[0], ext, post.getBoolean("isStatic"));
/* Exceptions are not propagated here : many error causes are possible, network errors,
* incorrect or unsupported format, bad ImageIO plugin...
* Instead return an empty EncodedImage. Caller is responsible for handling this correctly (500 status code response) */
if ("favicon.ico".equalsIgnoreCase(url.getFileName())) { // but on missing favicon just present a default (occures frequently by call from searchitem.html)
// currently yacysearchitem assigns "hosturl/favicon.ico" (to look for the filename should not much interfere with other situatios)
if (defaulticonb == null) { // load the default icon once
try {
defaulticonb = FileUtils.read(new File(sb.getAppPath(), defaulticon));
} catch (final IOException initicon) {
defaulticonb = new byte[0];
}
}
encodedImage = new EncodedImage(defaulticonb, ext, post.getBoolean("isStatic"));
} else {
encodedImage = new EncodedImage(new byte[0], ext, post.getBoolean("isStatic"));
}
} finally {
/*
* imageInStream.close() method doesn't close source input

@ -94,7 +94,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#{/vocabularyset}#
</select>
</dd>
<dt></dt><dd><input type="submit" name="view" value="View" /></dd>
<dt></dt><dd><input type="submit" class="btn btn-primary" name="view" value="View" /></dd>
</dl>
</fieldset>
</form>
@ -144,7 +144,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<dd><select name="charset">#{charset}#<option value="#[name]#" #(selected)#::selected="selected"#(/selected)#>#[name]#</option>#{/charset}#</select></dd>
</dl>
</dd>
<dt></dt><dd><input type="submit" name="create" value="Create" /></dd>
<dt></dt><dd><input type="submit" class="btn btn-primary" name="create" value="Create" /></dd>
</dl>
</fieldset>
</form>
@ -198,7 +198,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#(/editable)#
</table>
<input type="hidden" name="vocabulary" value="#[name]#" />
<input type="submit" name="set" value="Submit" />
<input type="submit" class="btn btn-primary" name="set" value="Submit" />
</fieldset>
</form>
#(/edit)#

@ -106,7 +106,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<dt>Other Dot</dt><dd>Color <input type="text" name="colordota" id="colordota" value="#[colordota]#" size="6" maxlength="6" /></dd>
<dt>Dot-end</dt><dd>Color <input type="text" name="colorlineend" id="colorlineend" value="#[colorlineend]#" size="6" maxlength="6" /></dd>
</dl>
<div align="center"><input type="submit" value="change" /></div>
<div align="center"><input type="submit" class="btn btn-primary" value="change" /></div>
</fieldset>
</form>

@ -19,7 +19,7 @@
<fieldset>
<legend>Websearch Comparison</legend>
<form action="" method="get" accept-charset="UTF-8">
<p><input type="text" class="searchinput" name="query" value="#[search_query]#" size="40" onFocus="this.select()"/><input type="submit" value="Compare" />
<p><input type="text" class="searchinput" name="query" value="#[search_query]#" size="40" onFocus="this.select()"/> <input type="submit" class="btn btn-primary" value="Compare" />
Left Search Engine
<select name="left">
#{searchengines}#

@ -83,9 +83,9 @@
</tr>#{/urllist}#
<tr class="small" style="background-color: #eeeeee">
<td colspan="2">
<input type="button" onclick="selectall(this.form.name)" value="select all" />
<input type="button" onclick="deselectall(this.form.name)" value="deselect all" />
<input type="submit" value="add" name="add" />
<input type="button" class="btn btn-primary" onclick="selectall(this.form.name)" value="select all" />
<input type="button" class="btn btn-primary" onclick="deselectall(this.form.name)" value="deselect all" />
<input type="submit" class="btn btn-primary" value="add" name="add" />
</td>
</tr>
</table>

@ -251,8 +251,6 @@ public final class search {
indexSegment,
rankingProfile,
header.get(HeaderFramework.USER_AGENT, ""),
false,
false,
0.0d,
0.0d,
0.0d,
@ -317,8 +315,6 @@ public final class search {
sb.index,
rankingProfile,
header.get(HeaderFramework.USER_AGENT, ""),
false,
false,
0.0d,
0.0d,
0.0d,

@ -669,10 +669,6 @@ public class yacysearch {
indexSegment,
ranking,
header.get(HeaderFramework.USER_AGENT, ""),
sb.getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, false)
&& sb.getConfigBool(SwitchboardConstants.NETWORK_SEARCHVERIFY, false)
&& sb.peers.mySeed().getFlagAcceptRemoteIndex(),
false,
lat, lon, rad,
sb.getConfigArray("search.navigation", ""));
EventTracker.delete(EventTracker.EClass.SEARCH);

@ -1,9 +1,7 @@
#(content)#::
<div class="searchresults">
<h4 class="linktitle">
<object data="ViewImage.png?width=16&amp;height=16&amp;code=#[faviconCode]#&amp;isStatic=true" type="image/png" id="f#[urlhash]#" class="favicon" style="width:16px; height:16px;">
<img width="16" height="16" src="env/grafics/dfltfvcn.ico" style="width:16px; height:16px;" alt="" />
</object>
<img width="16" height="16" src="ViewImage.png?width=16&amp;height=16&amp;code=#[faviconCode]#&amp;isStatic=true" id="f#[urlhash]#" class="favicon" style="width:16px; height:16px;" alt="" />
<a href="#[link]#" target="#[target]#">#[title]#</a></h4>
<div class="urlactions">
#(heuristic)#::

@ -3304,7 +3304,7 @@ Just a moment, please!==Einen Moment bitte!
Application will terminate after working off all scheduled tasks.==YaCy Proxy wird beendet, nachdem alle ausstehenden Aufgaben abgearbeitet wurden.
Please send us feed-back!==Bitte senden Sie uns Feedback!
We don't track YaCy users, YaCy does not send 'home-pings', we do not even know how many people use YaCy as their private search engine.==Wir tracken YaCy Benutzer nicht. YaCy sendet keine 'Pings nach Hause'. Wir wissen noch nicht einmal wie viele Menschen YaCy als ihre private Suchmaschine verwenden.
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is is possible that we change a bit to suit your needs?==Darum wollen wir Sie fragen: Mögen Sie YaCy? Werden sie es wieder verwenden ... wenn nicht ... Warum? Ist es möglich dass wir uns verändern, um uns Ihren Anforderungen anzupassen?
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is it possible that we change a bit to suit your needs?==Darum wollen wir Sie fragen: Mögen Sie YaCy? Werden sie es wieder verwenden ... wenn nicht ... Warum? Ist es möglich dass wir uns verändern, um uns Ihren Anforderungen anzupassen?
Please send us feed-back about your experience with an==Bitte senden Sie uns Ihr Feedback mit einer
>anonymous message<==>anonymen Nachricht<
or a<==oder einem<

@ -1809,7 +1809,7 @@ See you soon!==&Agrave; bient&ocirc;t!
Application will terminate after working off all scheduled tasks.==L'application se terminera apr&egrave;s avoir achev&eacute; toutes les t&acirc;ches planifi&eacute;es.
Please send us feed-back!==Envoyez-nous vos commentaires!
We don't track YaCy users, YaCy does not send 'home-pings', we do not even know how many people use YaCy as their private search engine.==Nous ne tra&ccedil;ons pas les utilisateurs de YaCy, YaCy n'envoie pas de "home-pings", nous ne savons m&ecirc;me pas combien de gens utilisent YaCy comme moteur de recherche.
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is is possible that we change a bit to suit your needs?==C'est pourquoi nous aimerions beaucoup que vous nous disiez ce que vous pensez de YaCy. Appr&eacute;ciez-vous YaCy? Allez-vous l'utiliser &agrave; nouveau... si non, pourquoi? Nous pouvons peut-&ecirc;tre modifier YaCy pour qu'il r&eacute;ponde &agrave; vos besoins.
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is it possible that we change a bit to suit your needs?==C'est pourquoi nous aimerions beaucoup que vous nous disiez ce que vous pensez de YaCy. Appr&eacute;ciez-vous YaCy? Allez-vous l'utiliser &agrave; nouveau... si non, pourquoi? Nous pouvons peut-&ecirc;tre modifier YaCy pour qu'il r&eacute;ponde &agrave; vos besoins.
Please send us feed-back about your experience with an==Vous pouvez nous faire parvenir vos commentaires avec un
anonymous message==message anonyme
or a<br/>==ou un<br/>

@ -3481,7 +3481,7 @@ Just a moment, please!==Пожалуйста, подождите!
Application will terminate after working off all scheduled tasks.==Приложение завершает свою работу.
Please send us feed-back!==Пожалуйста, отправляйте нам отзывы!
We don't track YaCy users, YaCy does not send 'home-pings', we do not even know how many people use YaCy as their private search engine.==Мы не следим за пользователями YaCy. Мы даже не знаем как много людей пользуются поиском YaCy для личных целей.
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is is possible that we change a bit to suit your needs?==Спросите себя: за что вам нравится YaCy? Вы будете использовать его снова... или нет... почему?
Therefore we like to ask you: do you like YaCy? Will you use it again... if not, why? Is it possible that we change a bit to suit your needs?==Спросите себя: за что вам нравится YaCy? Вы будете использовать его снова... или нет... почему?
Please send us feed-back about your experience with an==Пожалуйста, отправьте нам отзыв о вашем опыте использования
>anonymous message<==>анонимно<
or a<==или<

@ -83,7 +83,7 @@
<compilation-unit>
<package-root>source</package-root>
<package-root>htroot</package-root>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/common-image-3.2.jar;lib/common-io-3.2.jar;lib/common-lang-3.2.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.10.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.4.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.10.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.5.1.jar;lib/httpcore-4.4.4.jar;lib/httpmime-4.5.1.jar;lib/icu4j-56_1.jar;lib/imageio-core-3.2.jar;lib/imageio-metadata-3.2.jar;lib/imageio-tiff-3.2.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.13.jar;lib/jempbox-1.8.10.jar;lib/jetty-client-9.2.14.v20151106.jar;lib/jetty-continuation-9.2.14.v20151106.jar;lib/jetty-deploy-9.2.14.v20151106.jar;lib/jetty-http-9.2.14.v20151106.jar;lib/jetty-io-9.2.14.v20151106.jar;lib/jetty-jmx-9.2.14.v20151106.jar;lib/jetty-proxy-9.2.14.v20151106.jar;lib/jetty-security-9.2.14.v20151106.jar;lib/jetty-server-9.2.14.v20151106.jar;lib/jetty-servlet-9.2.14.v20151106.jar;lib/jetty-servlets-9.2.14.v20151106.jar;lib/jetty-util-9.2.14.v20151106.jar;lib/jetty-webapp-9.2.14.v20151106.jar;lib/jetty-xml-9.2.14.v20151106.jar;lib/jsch-0.1.53.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.8.3.jar;lib/log4j-over-slf4j-1.7.13.jar;lib/lucene-analyzers-common-5.3.1.jar;lib/lucene-analyzers-phonetic-5.3.1.jar;lib/lucene-backward-codecs-5.3.1.jar;lib/lucene-classification-5.3.1.jar;lib/lucene-codecs-5.3.1.jar;lib/lucene-core-5.3.1.jar;lib/lucene-facet-5.3.1.jar;lib/lucene-grouping-5.3.1.jar;lib/lucene-highlighter-5.3.1.jar;lib/lucene-join-5.3.1.jar;lib/lucene-memory-5.3.1.jar;lib/lucene-misc-5.3.1.jar;lib/lucene-queries-5.3.1.jar;lib/lucene-queryparser-5.3.1.jar;lib/lucene-spatial-5.3.1.jar;lib/lucene-suggest-5.3.1.jar;lib/metadata-extractor-2.8.1.jar;lib/noggit-0.6.jar;lib/org.restlet.jar;lib/pdfbox-1.8.10.jar;lib/poi-3.13-20150929.jar;lib/poi-scratchpad-3.13-20150929.jar;lib/slf4j-api-1.7.13.jar;lib/slf4j-jdk14-1.7.13.jar;lib/solr-core-5.3.1.jar;lib/solr-solrj-5.3.1.jar;lib/spatial4j-0.4.1.jar;lib/stax2-api-3.1.4.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.3.jar;lib/woodstox-core-asl-4.4.1.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/common-image-3.2.1.jar;lib/common-io-3.2.1.jar;lib/common-lang-3.2.1.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.10.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.4.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.10.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.5.1.jar;lib/httpcore-4.4.4.jar;lib/httpmime-4.5.1.jar;lib/icu4j-56_1.jar;lib/imageio-bmp-3.2.1.jar;lib/imageio-core-3.2.1.jar;lib/imageio-metadata-3.2.1.jar;lib/imageio-tiff-3.2.1.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.13.jar;lib/jempbox-1.8.10.jar;lib/jetty-client-9.2.14.v20151106.jar;lib/jetty-continuation-9.2.14.v20151106.jar;lib/jetty-deploy-9.2.14.v20151106.jar;lib/jetty-http-9.2.14.v20151106.jar;lib/jetty-io-9.2.14.v20151106.jar;lib/jetty-jmx-9.2.14.v20151106.jar;lib/jetty-proxy-9.2.14.v20151106.jar;lib/jetty-security-9.2.14.v20151106.jar;lib/jetty-server-9.2.14.v20151106.jar;lib/jetty-servlet-9.2.14.v20151106.jar;lib/jetty-servlets-9.2.14.v20151106.jar;lib/jetty-util-9.2.14.v20151106.jar;lib/jetty-webapp-9.2.14.v20151106.jar;lib/jetty-xml-9.2.14.v20151106.jar;lib/jsch-0.1.53.jar;lib/json-simple-1.1.1.jar;lib/jsonic-1.2.0.jar;lib/jsoup-1.8.3.jar;lib/langdetect.jar;lib/log4j-over-slf4j-1.7.13.jar;lib/lucene-analyzers-common-5.3.1.jar;lib/lucene-analyzers-phonetic-5.3.1.jar;lib/lucene-backward-codecs-5.3.1.jar;lib/lucene-classification-5.3.1.jar;lib/lucene-codecs-5.3.1.jar;lib/lucene-core-5.3.1.jar;lib/lucene-facet-5.3.1.jar;lib/lucene-grouping-5.3.1.jar;lib/lucene-highlighter-5.3.1.jar;lib/lucene-join-5.3.1.jar;lib/lucene-memory-5.3.1.jar;lib/lucene-misc-5.3.1.jar;lib/lucene-queries-5.3.1.jar;lib/lucene-queryparser-5.3.1.jar;lib/lucene-spatial-5.3.1.jar;lib/lucene-suggest-5.3.1.jar;lib/metadata-extractor-2.8.1.jar;lib/noggit-0.6.jar;lib/org.restlet.jar;lib/pdfbox-1.8.10.jar;lib/poi-3.13-20150929.jar;lib/poi-scratchpad-3.13-20150929.jar;lib/slf4j-api-1.7.13.jar;lib/slf4j-jdk14-1.7.13.jar;lib/solr-core-5.3.1.jar;lib/solr-solrj-5.3.1.jar;lib/spatial4j-0.4.1.jar;lib/stax2-api-3.1.4.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.3.jar;lib/woodstox-core-asl-4.4.1.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<built-to>lib/yacycore.jar</built-to>
<source-level>1.7</source-level>
</compilation-unit>

@ -213,7 +213,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<version>1.0.0</version>
<executions>
<execution>
<id>filter-src</id>
@ -340,11 +340,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mime4j</artifactId>
@ -433,12 +428,12 @@
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-bmp</artifactId>
<version>3.2</version>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-tiff</artifactId>
<version>3.2</version>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org</groupId>

@ -102,8 +102,8 @@ public class AnchorURL extends DigestURL {
isHTTPS(relPath) ||
isFTP(relPath) ||
isFile(relPath) ||
isSMB(relPath)/*||
relPath.contains(":") && patternMail.matcher(relPath.toLowerCase()).find()*/) {
isSMB(relPath) ||
relPath.startsWith("mailto:")) {
return new AnchorURL(relPath);
}
return new AnchorURL(baseURL, relPath);

@ -202,9 +202,9 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
url = "file://" + url;
}
int p = url.indexOf("://");
int p = url.lastIndexOf("://",5); // lastindexof to look only at the begin of url, up to "https://",
if (p < 0) {
if (url.startsWith("mailto:")) {
if (url.length() > 7 && url.substring(0,7).equalsIgnoreCase("mailto:")) {
p = 6;
} else {
url = "http://" + url;
@ -258,7 +258,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
}
this.userInfo = url.substring(p + 1, q);
this.host = url.substring(q + 1);
this.path = null;
this.path = ""; // TODO: quick fix, as not always checked for path != null
this.port = -1;
this.searchpart = null;
this.anchor = null;
@ -1122,7 +1122,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
// generates a normal form of the URL
boolean defaultPort = false;
if (this.protocol.equals("mailto")) {
return this.protocol + ":" + this.userInfo + "@" + this.host;
return this.userInfo + "@" + this.host;
} else if (isHTTP()) {
if (this.port < 0 || this.port == 80) { defaultPort = true; }
} else if (isHTTPS()) {

@ -205,9 +205,7 @@ public class FederateSearchManager {
sb.index,
sb.getRanking(),
"",//userAgent
false,
false,
0.0, 0.0, -1.0,
0.0d, 0.0d, 0.0d,
new String[0]);
return query(query);

@ -1,313 +0,0 @@
/**
* CachedSolrConnector
* Copyright 2013 by Michael Peter Christen
* First released 18.02.2013 at http://yacy.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.cora.federate.solr.connector;
import java.io.IOException;
import java.util.Collection;
import java.util.LinkedHashMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
import net.yacy.cora.storage.ARC;
import net.yacy.cora.storage.ConcurrentARC;
import net.yacy.kelondro.data.word.Word;
import net.yacy.kelondro.util.MemoryControl;
import net.yacy.search.schema.CollectionSchema;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.ModifiableSolrParams;
public class CachedSolrConnector extends AbstractSolrConnector implements SolrConnector {
private final static Object EXIST = new Object();
private SolrConnector solr;
private final ARC<String, SolrDocument> documentCache;
public final ARC<String, Object> hitCache, missCache;
public long documentCache_Hit = 0, documentCache_Miss = 0, documentCache_Insert = 0; // for statistics only; do not write
public long hitCache_Hit = 0, hitCache_Miss = 0, hitCache_Insert = 0; // for statistics only; do not write
public long missCache_Hit = 0, missCache_Miss = 0, missCache_Insert = 0; // for statistics only; do not write
private static final String idQuery(String id) {
return CollectionSchema.id.getSolrFieldName() + ":\"" + id + "\"";
}
public CachedSolrConnector(SolrConnector c, int hitCacheMax, int missCacheMax, int docCacheMax) {
this.solr = c;
int partitions = Runtime.getRuntime().availableProcessors() * 2;
this.documentCache = new ConcurrentARC<String, SolrDocument>(docCacheMax, partitions);
this.hitCache = new ConcurrentARC<String, Object>(hitCacheMax, partitions);
this.missCache = new ConcurrentARC<String, Object>(missCacheMax, partitions);
}
@Override
public int bufferSize() {
return solr.bufferSize();
}
@Override
public void clearCaches() {
this.hitCache.clear();
this.missCache.clear();
this.documentCache.clear();
if (this.solr != null) this.solr.commit(true);
}
@Override
public boolean isClosed() {
return this.solr == null || this.solr.isClosed();
}
@Override
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {
this.clearCaches();
if (this.solr != null) this.solr.close();
this.solr = null;
}
/**
* delete everything in the solr index
* @throws IOException
*/
@Override
public void clear() throws IOException {
this.clearCaches();
if (this.solr != null) this.solr.clear();
}
/**
* delete an entry from solr
* @param id the url hash of the entry
* @throws IOException
*/
@Override
public void deleteById(final String id) throws IOException {
String q = idQuery(id);
this.documentCache.remove(q);
this.hitCache.remove(q);
this.missCache.put(q, EXIST);
this.missCache_Insert++;
if (this.solr != null) this.solr.deleteByQuery(q);
}
/**
* delete a set of entries from solr; entries are identified by their url hash
* @param ids a list of url hashes
* @throws IOException
*/
@Override
public void deleteByIds(final Collection<String> ids) throws IOException {
for (String id: ids) {
String q = idQuery(id);
this.documentCache.remove(q);
this.hitCache.remove(q);
this.missCache.put(q, EXIST);
this.missCache_Insert++;
}
if (this.solr != null) this.solr.deleteByIds(ids);
}
@Override
public void deleteByQuery(final String querystring) throws IOException {
this.clearCaches();
this.solr.deleteByQuery(querystring);
}
@Override
public SolrDocument getDocumentById(final String id, final String ... fields) throws IOException {
assert id.length() == Word.commonHashLength : "wrong id: " + id;
String q = idQuery(id);
SolrDocument doc = fields.length == 0 ? this.documentCache.get(q) : null;
if (doc != null) {
this.documentCache_Hit++;
return doc;
}
documentCache_Miss++;
if (this.missCache.containsKey(q)) {
this.missCache_Hit++;
return null;
}
this.missCache_Miss++;
if (solr != null && ((doc = solr.getDocumentById(id, fields)) != null)) {
addToCache(doc, fields.length == 0);
return doc;
}
// check if there is a autocommit problem
if (this.hitCache.containsKey(q)) {
// the document should be there, therefore make a commit and check again
if (solr != null && ((doc = solr.getDocumentById(id, fields)) != null)) {
addToCache(doc, fields.length == 0);
}
}
this.missCache.put(q, EXIST);
this.missCache_Insert++;
return null;
}
/**
* add a Solr document
* @param solrdoc
* @throws IOException
*/
@Override
public void add(final SolrInputDocument solrdoc) throws IOException {
String id = (String) solrdoc.getFieldValue(CollectionSchema.id.getSolrFieldName());
assert id != null;
if (id == null) return;
String q = idQuery(id);
SolrDocument doc = ClientUtils.toSolrDocument(solrdoc);
addToCache(doc, true);
this.documentCache.put(q, doc);
this.documentCache_Insert++;
if (this.solr != null) this.solr.add(solrdoc);
}
@Override
public void add(final Collection<SolrInputDocument> solrdocs) throws IOException, SolrException {
for (SolrInputDocument solrdoc: solrdocs) {
String id = (String) solrdoc.getFieldValue(CollectionSchema.id.getSolrFieldName());
assert id != null;
if (id == null) continue;
String q = idQuery(id);
SolrDocument doc = ClientUtils.toSolrDocument(solrdoc);
addToCache(doc, true);
this.documentCache.put(q, doc);
this.documentCache_Insert++;
}
if (this.solr != null) this.solr.add(solrdocs);
}
/**
* get a query result from solr
* to get all results set the query String to "*:*"
* @param querystring
* @throws IOException
*/
@Override
public SolrDocumentList getDocumentListByQuery(final String querystring, final String sort, final int offset, final int count, final String ... fields) throws IOException {
if (offset == 0 && count == 1 && querystring.startsWith("id:") &&
((querystring.length() == 17 && querystring.charAt(3) == '"' && querystring.charAt(16) == '"') ||
querystring.length() == 15)) {
final SolrDocumentList list = new SolrDocumentList();
SolrDocument doc = getDocumentById(querystring.charAt(3) == '"' ? querystring.substring(4, querystring.length() - 1) : querystring.substring(3), fields);
list.add(doc);
// no addToCache(list) here because that was already handlet in get();
return list;
}
if (this.solr != null) {
SolrDocumentList list = this.solr.getDocumentListByQuery(querystring, sort, offset, count, fields);
addToCache(list, fields.length == 0);
return list;
}
// combine both lists
SolrDocumentList list;
list = this.solr.getDocumentListByQuery(querystring, sort, offset, count, fields);
// add caching
addToCache(list, fields.length == 0);
return list;
}
@Override
public QueryResponse getResponseByParams(ModifiableSolrParams query) throws IOException, SolrException {
QueryResponse list = this.solr.getResponseByParams(query);
return list;
}
@Override
public SolrDocumentList getDocumentListByParams(ModifiableSolrParams params) throws IOException, SolrException {
SolrDocumentList sdl = this.solr.getDocumentListByParams(params);
return sdl;
}
@Override
public long getCountByQuery(final String querystring) throws IOException {
return this.solr.getCountByQuery(querystring);
}
@Override
public LinkedHashMap<String, ReversibleScoreMap<String>> getFacets(final String query, final int maxresults, final String ... fields) throws IOException {
return this.solr.getFacets(query, maxresults, fields);
}
private void addToCache(SolrDocumentList list, boolean doccache) {
if (MemoryControl.shortStatus()) clearCaches();
for (final SolrDocument solrdoc: list) {
addToCache(solrdoc, doccache);
}
}
private void addToCache(SolrDocument doc, boolean doccach) {
String id = (String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName());
String q = idQuery(id);
this.missCache.remove(q);
this.hitCache.put(q, EXIST);
this.hitCache_Insert++;
if (doccach) {
this.documentCache.put(q, doc);
this.documentCache_Insert++;
}
}
@Override
public long getSize() {
long s = this.solr.getSize();
return Math.max(this.documentCache.size(), Math.max(this.hitCache.size(), s)); // this might be incorrect if there are other requests than "id:.." in the cache
}
public int nameCacheHitSize() {
return this.hitCache.size();
}
public int nameCacheMissSize() {
return this.missCache.size();
}
public int nameCacheDocumentSize() {
return this.documentCache.size();
}
@Override
public void commit(boolean softCommit) {
this.solr.commit(softCommit);
}
@Override
public void optimize(int maxSegments) {
this.solr.optimize(maxSegments);
}
@Override
public int getSegmentCount() {
return this.solr.getSegmentCount();
}
}

@ -413,13 +413,24 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
Connection=close
Content-Encoding=gzip
Content-Length=7281
Content-Type=text/html
Content-Type=text/html; charset=UTF-8
Date=Mon, 05 Jan 2004 11:55:10 GMT
Server=Apache/1.3.26
*/
/**
* Get mime type from header field content-type
* stripps any parameter (denoted by ';' see RFC 2616)
* @return mime or on missing header field "application/octet-stream"
*/
public String mime() {
return get(CONTENT_TYPE, "application/octet-stream");
final String tmpstr = get(CONTENT_TYPE, "application/octet-stream");
final int pos = tmpstr.indexOf(';');
if (pos > 0) {
return tmpstr.substring(0, pos).trim();
} else {
return tmpstr;
}
}
/*
@ -429,7 +440,7 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
* org.apache.commons.fileupload.RequestContext#getCharacterEncoding()
*/
public String getCharacterEncoding() {
final String mimeType = mime();
final String mimeType = getContentType();
if (mimeType == null) return null;
final String[] parts = CommonPattern.SEMICOLON.split(mimeType);
@ -482,12 +493,12 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Stri
return -1;
}
/*
* (non-Javadoc)
*
/**
* Get header field content-type (unmodified)
* which may include additional parameter (RFC 2616)
* see also mime()
* @see org.apache.commons.fileupload.RequestContext#getContentType()
*/
//@Override
public String getContentType() {
return get(CONTENT_TYPE);
}

@ -254,12 +254,16 @@ public class Response {
return doctype;
}
/**
* Get respons header last modified date
* if missing the first seen date or current date
* @return valid date always != null
*/
public Date lastModified() {
Date docDate = null;
if (this.responseHeader != null) {
docDate = this.responseHeader.lastModified();
if (docDate == null) docDate = this.responseHeader.date();
docDate = this.responseHeader.lastModified(); // is always != null
}
if (docDate == null && this.request != null) docDate = this.request.appdate();
if (docDate == null) docDate = new Date();
@ -594,13 +598,6 @@ public class Response {
// -ranges in request
// we checked that in shallStoreCache
// a picture cannot be indexed
/*
if (Classification.isMediaExtension(url().getFileExtension())) {
return "Media_Content_(forbidden)";
}
*/
// -cookies in request
// unfortunately, we cannot index pages which have been requested with a cookie
// because the returned content may be special for the client
@ -614,14 +611,7 @@ public class Response {
// the set-cookie from the server does not indicate that the content is special
// thus we do not care about it here for indexing
// a picture cannot be indexed
final String mimeType = this.responseHeader.mime();
/*
if (Classification.isPictureMime(mimeType)) {
return "Media_Content_(Picture)";
}
*/
final String parserError = TextParser.supportsMime(mimeType);
final String parserError = TextParser.supportsMime(this.responseHeader.getContentType());
if (parserError != null) {
return "Media_Content, no parser: " + parserError;
}
@ -736,16 +726,10 @@ public class Response {
// check if document can be indexed
if (this.responseHeader != null) {
final String mimeType = this.responseHeader.mime();
final String mimeType = this.responseHeader.getContentType();
final String parserError = TextParser.supportsMime(mimeType);
if (parserError != null && TextParser.supportsExtension(url()) != null) return "no parser available: " + parserError;
}
/*
if (Classification.isMediaExtension(url().getFileExtension()) &&
!Classification.isImageExtension((url().getFileExtension()))) {
return "Media_Content_(forbidden)";
}
*/
// -if-modified-since in request
// if the page is fresh at the very moment we can index it
@ -783,14 +767,21 @@ public class Response {
return null;
}
/**
* Get Mime type from http header or null if unknown (not included in response header)
* @return mime (trimmed and lowercase) or null
*/
public String getMimeType() {
if (this.responseHeader == null) return null;
String mimeType = this.responseHeader.mime();
mimeType = mimeType.trim().toLowerCase();
String mimeType = this.responseHeader.getContentType();
if (mimeType != null) {
mimeType = mimeType.trim().toLowerCase();
final int pos = mimeType.indexOf(';');
return ((pos < 0) ? mimeType : mimeType.substring(0, pos));
final int pos = mimeType.indexOf(';');
return ((pos < 0) ? mimeType : mimeType.substring(0, pos));
}
return null;
}
public String getCharacterEncoding() {
@ -864,10 +855,10 @@ public class Response {
}
public Document[] parse() throws Parser.Failure {
final String supportError = TextParser.supports(url(), this.responseHeader == null ? null : this.responseHeader.mime());
final String supportError = TextParser.supports(url(), this.responseHeader == null ? null : this.responseHeader.getContentType());
if (supportError != null) throw new Parser.Failure("no parser support:" + supportError, url());
try {
return TextParser.parseSource(new AnchorURL(url()), this.responseHeader == null ? null : this.responseHeader.mime(), this.responseHeader == null ? "UTF-8" : this.responseHeader.getCharacterEncoding(), new VocabularyScraper(), this.request.timezoneOffset(), this.request.depth(), this.content);
return TextParser.parseSource(new AnchorURL(url()), this.responseHeader == null ? null : this.responseHeader.getContentType(), this.responseHeader == null ? "UTF-8" : this.responseHeader.getCharacterEncoding(), new VocabularyScraper(), this.request.timezoneOffset(), this.request.depth(), this.content);
} catch (final Exception e) {
return null;
}

@ -159,18 +159,19 @@ public class BlogBoard {
}
public boolean importXML(final String input) {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
final DocumentBuilder builder = factory.newDocumentBuilder();
return parseXMLimport(builder.parse(new ByteArrayInputStream(UTF8.getBytes(input))));
} catch (final ParserConfigurationException ex) {
ConcurrentLog.logException(ex);
} catch (final SAXException ex) {
ConcurrentLog.logException(ex);
} catch (final IOException ex) {
ConcurrentLog.logException(ex);
if (input != null && !input.isEmpty()) {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
final DocumentBuilder builder = factory.newDocumentBuilder();
return parseXMLimport(builder.parse(new ByteArrayInputStream(UTF8.getBytes(input))));
} catch (final ParserConfigurationException ex) {
ConcurrentLog.logException(ex);
} catch (final SAXException ex) {
ConcurrentLog.logException(ex);
} catch (final IOException ex) {
ConcurrentLog.logException(ex);
}
}
return false;
}

@ -398,6 +398,52 @@ public class YMarkTables {
this.worktables.bookmarks.addBookmark(bmk_user, bmk_entry, true, true);
}
/**
* Create YMark bookmark from a loaded document
* this is identical to {@link #createBookmark(net.yacy.repository.LoaderDispatcher, net.yacy.cora.document.id.DigestURL, net.yacy.cora.protocol.ClientIdentification.Agent, java.lang.String, boolean, java.lang.String, java.lang.String) }
* without try calling a loader
*
* @param document to create the YMark bookmark for
* @param bmk_user
* @param autotag
* @param tagsString
* @param foldersString
* @throws IOException
* @throws net.yacy.document.Parser.Failure
*/
public void createBookmark(final Document document, final String bmk_user, final boolean autotag, final String tagsString, final String foldersString) throws IOException, Failure {
if (document != null) {
final YMarkEntry bmk_entry = new YMarkEntry(false);
final YMarkMetadata meta = new YMarkMetadata(document);
final EnumMap<YMarkMetadata.METADATA, String> metadata = meta.loadMetadata();
final String urls = document.dc_identifier();
bmk_entry.put(YMarkEntry.BOOKMARK.URL.key(), urls);
if (!this.worktables.has(YMarkTables.TABLES.BOOKMARKS.tablename(bmk_user), YMarkUtil.getBookmarkId(urls))) {
bmk_entry.put(YMarkEntry.BOOKMARK.PUBLIC.key(), "false");
bmk_entry.put(YMarkEntry.BOOKMARK.TITLE.key(), metadata.get(YMarkMetadata.METADATA.TITLE));
bmk_entry.put(YMarkEntry.BOOKMARK.DESC.key(), metadata.get(YMarkMetadata.METADATA.DESCRIPTION));
}
final String fs = YMarkUtil.cleanFoldersString(foldersString);
if (fs.isEmpty())
bmk_entry.put(YMarkEntry.BOOKMARK.FOLDERS.key(), YMarkEntry.BOOKMARK.FOLDERS.deflt());
else
bmk_entry.put(YMarkEntry.BOOKMARK.FOLDERS.key(), fs);
final StringBuilder strb = new StringBuilder();
if (autotag) {
final String autotags = YMarkAutoTagger.autoTag(document, 3, this.worktables.bookmarks.getTags(bmk_user));
strb.append(autotags);
}
if (!tagsString.isEmpty()) {
strb.append(YMarkUtil.TAGS_SEPARATOR);
strb.append(tagsString);
}
bmk_entry.put(YMarkEntry.BOOKMARK.TAGS.key(), YMarkUtil.cleanTagsString(strb.toString()));
this.worktables.bookmarks.addBookmark(bmk_user, bmk_entry, true, true);
}
}
public boolean hasBookmark(final String bmk_user, final String urlhash) {
final String bmk_table = TABLES.BOOKMARKS.tablename(bmk_user);
try {

@ -83,9 +83,9 @@ public class Document {
// the anchors and images - Maps are URL-to-EntityDescription mappings.
// The EntityDescription appear either as visible text in anchors or as alternative
// text in image tags.
private LinkedHashMap<AnchorURL, String> audiolinks, videolinks, applinks, hyperlinks;
private LinkedHashMap<AnchorURL, String> audiolinks, videolinks, applinks, hyperlinks; // TODO: check if redundant value (set to key.getNameProperty()) is needed
private LinkedHashMap<DigestURL, String> inboundlinks, outboundlinks;
private Map<String, String> emaillinks;
private Set<AnchorURL> emaillinks; // mailto: links
private MultiProtocolURL favicon;
private boolean resorted;
private final Set<String> languages;
@ -430,6 +430,11 @@ dc_rights
return sentences;
}
/**
* All anchor links of the document
* (this includes mailto links)
* @return all links embedded as anchors (clickeable entities)
*/
public Collection<AnchorURL> getAnchors() {
// returns all links embedded as anchors (clickeable entities)
// this is a url(String)/text(String) map
@ -445,6 +450,11 @@ dc_rights
// the next three methods provide a calculated view on the getAnchors/getImages:
/**
* List of links to resources (pages, images, files, media ...)
* (Hyperlinks do not include mailto: links)
* @return a subset of the getAnchor-set: only links to other hyperrefs
*/
public Map<AnchorURL, String> getHyperlinks() {
// this is a subset of the getAnchor-set: only links to other hyperrefs
if (!this.resorted) resortLinks();
@ -473,7 +483,10 @@ dc_rights
return this.applinks;
}
public Map<String, String> getEmaillinks() {
/**
* @return mailto links
*/
public Set<AnchorURL> getEmaillinks() {
// this is part of the getAnchor-set: only links to email addresses
if (!this.resorted) resortLinks();
return this.emaillinks;
@ -491,6 +504,9 @@ dc_rights
return this.lat;
}
/**
* sorts all links (anchors) into individual collections
*/
private void resortLinks() {
if (this.resorted) return;
synchronized (this) {
@ -506,13 +522,21 @@ dc_rights
this.videolinks = new LinkedHashMap<AnchorURL, String>();
this.audiolinks = new LinkedHashMap<AnchorURL, String>();
this.applinks = new LinkedHashMap<AnchorURL, String>();
this.emaillinks = new LinkedHashMap<String, String>();
this.emaillinks = new LinkedHashSet<AnchorURL>();
final Map<AnchorURL, ImageEntry> collectedImages = new HashMap<AnchorURL, ImageEntry>(); // this is a set that is collected now and joined later to the imagelinks
for (final Map.Entry<DigestURL, ImageEntry> entry: this.images.entrySet()) {
if (entry.getKey() != null && entry.getKey().getHost() != null && entry.getKey().getHost().equals(thishost)) this.inboundlinks.put(entry.getKey(), "image"); else this.outboundlinks.put(entry.getKey(), "image");
}
for (final AnchorURL url: this.anchors) {
if (url == null) continue;
u = url.toNormalform(true);
final String name = url.getNameProperty();
// check mailto scheme first (not suppose to get into in/outboundlinks or hyperlinks -> crawler can't process)
if (url.getProtocol().equals("mailto")) {
this.emaillinks.add(url);
continue;
}
final boolean noindex = url.getRelProperty().toLowerCase().indexOf("noindex",0) >= 0;
final boolean nofollow = url.getRelProperty().toLowerCase().indexOf("nofollow",0) >= 0;
if ((thishost == null && url.getHost() == null) ||
@ -523,31 +547,24 @@ dc_rights
} else {
this.outboundlinks.put(url, "anchor" + (noindex ? " noindex" : "") + (nofollow ? " nofollow" : ""));
}
u = url.toNormalform(true);
final String name = url.getNameProperty();
if (u.startsWith("mailto:")) {
this.emaillinks.put(u.substring(7), name);
} else {
extpos = u.lastIndexOf('.');
if (extpos > 0) {
if (((qpos = u.indexOf('?')) >= 0) && (qpos > extpos)) {
ext = u.substring(extpos + 1, qpos).toLowerCase();
} else {
ext = u.substring(extpos + 1).toLowerCase();
}
if (Classification.isMediaExtension(ext)) {
// this is not a normal anchor, its a media link
if (Classification.isImageExtension(ext)) {
collectedImages.put(url, new ImageEntry(url, name, -1, -1, -1));
}
else if (Classification.isAudioExtension(ext)) this.audiolinks.put(url, name);
else if (Classification.isVideoExtension(ext)) this.videolinks.put(url, name);
else if (Classification.isApplicationExtension(ext)) this.applinks.put(url, name);
}
extpos = u.lastIndexOf('.');
if (extpos > 0) {
if (((qpos = u.indexOf('?')) >= 0) && (qpos > extpos)) {
ext = u.substring(extpos + 1, qpos).toLowerCase();
} else {
ext = u.substring(extpos + 1).toLowerCase();
}
if (Classification.isMediaExtension(ext)) {
// this is not a normal anchor, its a media link
if (Classification.isImageExtension(ext)) { // TODO: guess on a-tag href extension (may not be correct)
collectedImages.put(url, new ImageEntry(url, name, -1, -1, -1));
} else if (Classification.isAudioExtension(ext)) this.audiolinks.put(url, name);
else if (Classification.isVideoExtension(ext)) this.videolinks.put(url, name);
else if (Classification.isApplicationExtension(ext)) this.applinks.put(url, name);
}
// in any case we consider this as a link and let the parser decide if that link can be followed
this.hyperlinks.put(url, name);
}
// in any case we consider this as a link and let the parser decide if that link can be followed
this.hyperlinks.put(url, name);
}
// add image links that we collected from the anchors to the image map
@ -761,7 +778,7 @@ dc_rights
return this.crawldepth;
}
public void writeXML(final Writer os, final Date date) throws IOException {
public void writeXML(final Writer os) throws IOException {
os.write("<record>\n");
final String title = dc_title();
if (title != null && title.length() > 0) os.write("<dc:title><![CDATA[" + title + "]]></dc:title>\n");
@ -779,7 +796,7 @@ dc_rights
}
final String language = dc_language();
if (language != null && language.length() > 0) os.write("<dc:language>" + dc_language() + "</dc:language>\n");
os.write("<dc:date>" + ISO8601Formatter.FORMATTER.format(date) + "</dc:date>\n");
os.write("<dc:date>" + ISO8601Formatter.FORMATTER.format(getLastModified()) + "</dc:date>\n");
if (this.lon != 0.0 && this.lat != 0.0) os.write("<geo:Point><geo:long>" + this.lon +"</geo:long><geo:lat>" + this.lat + "</geo:lat></geo:Point>\n");
os.write("</record>\n");
}
@ -789,7 +806,7 @@ dc_rights
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
final Writer osw = new OutputStreamWriter(baos, "UTF-8");
writeXML(osw, this.lastModified);
writeXML(osw);
osw.close();
return UTF8.String(baos.toByteArray());
} catch (final UnsupportedEncodingException e1) {

@ -353,7 +353,7 @@ public class DCEntry extends MultiMapSolrParams {
public void writeXML(OutputStreamWriter os) throws IOException {
Document doc = document();
if (doc != null) {
doc.writeXML(os, this.getDate());
doc.writeXML(os);
}
}
}

@ -523,7 +523,7 @@ public class MediawikiImporter extends Thread implements Importer {
}
}
public void writeXML(final OutputStreamWriter os) throws IOException {
this.document.writeXML(os, new Date());
this.document.writeXML(os);
}
}
@ -710,7 +710,7 @@ public class MediawikiImporter extends Thread implements Importer {
this.osw.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + SurrogateReader.SURROGATES_MAIN_ELEMENT_OPEN + "\n");
}
ConcurrentLog.info("WIKITRANSLATION", "[CONSUME] Title: " + record.title);
record.document.writeXML(this.osw, new Date());
record.document.writeXML(this.osw);
this.rc++;
if (this.rc >= 10000) {
this.osw.write("</surrogates>\n");

@ -475,7 +475,7 @@ public class ContentScraper extends AbstractScraper implements Scraper {
final String type = tag.opts.getProperty("type", EMPTY_STRING);
final String hreflang = tag.opts.getProperty("hreflang", EMPTY_STRING);
if (rel.equalsIgnoreCase("shortcut icon")) {
if (rel.equalsIgnoreCase("shortcut icon") || rel.equalsIgnoreCase("icon")) { // html5 -> rel="icon")
final ImageEntry ie = new ImageEntry(newLink, linktitle, -1, -1, -1);
this.images.add(ie);
this.favicon = newLink;

@ -178,10 +178,10 @@ public class ooxmlParser extends AbstractParser implements Parser {
docKeywords,
singleList(docLongTitle),
docAuthor,
"",
null,
null,
descriptions,
0.0f, 0.0f,
0.0d, 0.0d,
contentBytes,
null,
null,

@ -8,7 +8,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.regex.PatternSyntaxException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@ -122,22 +122,18 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
}
// 2 - get target url
URL proxyurl = null;
String strARGS = request.getQueryString();
if (strARGS == null) {
final String strUrl = request.getParameter("url");
if (strUrl == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND,"url parameter missing");
return;
}
if (strARGS.startsWith("url=")) {
final String strUrl = strARGS.substring(4); // strip "url="
try {
proxyurl = new URL(strUrl);
} catch (final MalformedURLException e) {
proxyurl = new URL(URLDecoder.decode(strUrl, UTF8.charset.name()));
}
try {
proxyurl = new URL(strUrl);
} catch (final MalformedURLException e) {
proxyurl = new URL(URLDecoder.decode(strUrl, UTF8.charset.name()));
}
if (proxyurl == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND,"url parameter missing");
return;
@ -334,16 +330,17 @@ public class UrlProxyServlet extends ProxyServlet implements Servlet {
private boolean proxyippatternmatch(final String key) {
// the cfgippattern is a comma-separated list of patterns
// each pattern may contain one wildcard-character '*' which matches anything
final String cfgippattern = Switchboard.getSwitchboard().getConfig("proxyURL.access", "*");
if (cfgippattern.equals("*")) {
final String[] cfgippattern = Switchboard.getSwitchboard().getConfigArray("proxyURL.access", "*");
if (cfgippattern[0].equals("*")) {
return true;
}
final StringTokenizer st = new StringTokenizer(cfgippattern, ",");
String pattern;
while (st.hasMoreTokens()) {
pattern = st.nextToken();
if (key.matches(pattern)) {
return true;
for (String pattern : cfgippattern) {
try {
if (key.matches(pattern)) {
return true;
}
} catch (PatternSyntaxException ex) {
this._log.warn("wrong ip pattern in url proxy config", ex.getMessage() );
}
}
return false;

@ -794,9 +794,9 @@ public class YaCyDefaultServlet extends HttpServlet {
long now = System.currentTimeMillis();
response.setDateHeader(HeaderFramework.LAST_MODIFIED, now);
if (target.endsWith(".css")) {
response.setDateHeader(HeaderFramework.EXPIRES, now + 4000); // expires in 4 seconds (which is still too often)
response.setDateHeader(HeaderFramework.EXPIRES, now + 3600000); // expires in 1 hour (which is still often, others use 1 week, month or year)
} else if (target.endsWith(".png")) {
response.setDateHeader(HeaderFramework.EXPIRES, now + 1000); // expires in 1 seconds (reduce heavy image creation load)
response.setDateHeader(HeaderFramework.EXPIRES, now + 60000); // expires in 1 minute (reduce heavy image creation load)
} else {
response.setDateHeader(HeaderFramework.EXPIRES, now); // expires now
}
@ -858,8 +858,8 @@ public class YaCyDefaultServlet extends HttpServlet {
result.close();
return;
}
if (yp.isStatic()) {
response.setDateHeader(HeaderFramework.EXPIRES, now + 600000); // expires in ten minutes
if (yp.isStatic()) { // static image never expires
response.setDateHeader(HeaderFramework.EXPIRES, now + 3600000); // expires in 1 hour
}
} else if (tmp instanceof Image) {
final Image i = (Image) tmp;

@ -172,7 +172,7 @@ public class YaCyProxyServlet extends ProxyServlet implements Servlet {
response.setContentType(mimeType);
response.setStatus(httpStatus);
if ((mimeType != null) && (mimeType.startsWith("text/html") || mimeType.startsWith("text"))) {
if ((mimeType != null) && (mimeType.startsWith("text"))) {
final StringWriter buffer = new StringWriter();
if (proxyResponseHeader.containsKey(HeaderFramework.TRANSFER_ENCODING) && proxyResponseHeader.get(HeaderFramework.TRANSFER_ENCODING).contains("chunked")) {

@ -171,9 +171,21 @@ public class URIMetadataNode extends SolrDocument /* implements Comparable<URIMe
Float scorex = (Float) doc.getFieldValue("score"); // this is a special Solr field containing the ranking score of a search result
this.score = scorex == null ? 0.0f : scorex.floatValue();
*/
final byte[] hash = ASCII.getBytes(getString(CollectionSchema.id)); // TODO: can we trust this id ?
final String hashstr = getString(CollectionSchema.id); // id or empty string
final String urlRaw = getString(CollectionSchema.sku);
this.url = new DigestURL(urlRaw, hash);
this.url = new DigestURL(urlRaw);
if (!hashstr.isEmpty()) { // remote id might not correspond in all cases
final String myhash = ASCII.String(this.url.hash());
if (!hashstr.equals(myhash)) {
this.addField(CollectionSchema.id.getSolrFieldName(), myhash);
ConcurrentLog.fine("URIMetadataNode", "updated document.ID of " + urlRaw + " from " + hashstr + " to " + myhash);
// ususally the hosthash matches but just to be on the safe site
final String hostidstr = getString(CollectionSchema.host_id_s); // id or empty string
if (!hostidstr.isEmpty() && !hostidstr.equals(this.url.hosthash())) {
this.addField(CollectionSchema.host_id_s.getSolrFieldName(), this.url.hosthash());
}
}
}
}
public URIMetadataNode(final SolrDocument doc, final WordReferenceVars searchedWord, final float scorex) throws MalformedURLException {
@ -371,9 +383,12 @@ public class URIMetadataNode extends SolrDocument /* implements Comparable<URIMe
return mime == null || mime.size() == 0 ? null : mime.get(0);
}
/**
* Content language
* @return 2-char language code or empty string
*/
public String language() {
String language = getString(CollectionSchema.language_s);
if (language == null || language.length() == 0) return "en";
return language;
}

@ -568,10 +568,10 @@ public final class LoaderDispatcher {
if (responseHeader == null) throw new IOException("responseHeader == null");
Document[] documents = null;
final String supportError = TextParser.supports(url, responseHeader.mime());
final String supportError = TextParser.supports(url, responseHeader.getContentType());
if (supportError != null) throw new IOException("no parser support: " + supportError);
try {
documents = TextParser.parseSource(url, responseHeader.mime(), responseHeader.getCharacterEncoding(), response.profile().scraper(), timezoneOffset, response.depth(), response.getContent());
documents = TextParser.parseSource(url, responseHeader.getContentType(), responseHeader.getCharacterEncoding(), response.profile().scraper(), timezoneOffset, response.depth(), response.getContent());
if (documents == null) throw new IOException("document == null");
} catch (final Exception e) {
throw new IOException("parser error: " + e.getMessage());

@ -3228,7 +3228,6 @@ public final class Switchboard extends serverSwitch {
if (reasonString != null) return reasonString;
// create a bookmark from crawl start url
//final Set<String> tags=ListManager.string2set(BookmarkHelper.cleanTagsString(post.get("bookmarkFolder","/crawlStart")));
final Set<String> tags=ListManager.string2set(BookmarkHelper.cleanTagsString("/crawlStart"));
tags.add("crawlStart");
final Set<String> keywords = scraper.dc_subject();
@ -3238,8 +3237,10 @@ public final class Switchboard extends serverSwitch {
if (kk.length() > 0) tags.add(kk);
}
}
String tagStr = tags.toString();
if (tagStr.length() > 2 && tagStr.startsWith("[") && tagStr.endsWith("]")) tagStr = tagStr.substring(1, tagStr.length() - 2);
// TODO: what to do with the result ?
//String tagStr = tags.toString();
//if (tagStr.length() > 2 && tagStr.startsWith("[") && tagStr.endsWith("]")) tagStr = tagStr.substring(1, tagStr.length() - 2);
// we will create always a bookmark to use this to track crawled hosts
final BookmarksDB.Bookmark bookmark = this.bookmarksDB.createorgetBookmark(url.toNormalform(true), "admin");
@ -3254,7 +3255,7 @@ public final class Switchboard extends serverSwitch {
// do the same for ymarks
// TODO: could a non admin user add crawls?
try {
this.tables.bookmarks.createBookmark(this.loader, url, profile.getAgent(), YMarkTables.USER_ADMIN, true, "crawlStart", "/Crawl Start");
this.tables.bookmarks.createBookmark(scraper, YMarkTables.USER_ADMIN, true, "crawlStart", "/Crawl Start");
} catch (final IOException e) {
ConcurrentLog.logException(e);
} catch (final Failure e) {

@ -141,7 +141,6 @@ public final class QueryParams {
public int transmitcount; // number of results that had been shown to the user
public long searchtime, urlretrievaltime, snippetcomputationtime; // time to perform the search, to get all the urls, and to compute the snippets
public final String userAgent;
protected boolean filterfailurls, filterscannerfail;
protected double lat, lon, radius;
public LinkedHashSet<String> facetfields;
private SolrQuery cachedQuery;
@ -173,8 +172,6 @@ public final class QueryParams {
final Segment indexSegment,
final RankingProfile ranking,
final String userAgent,
final boolean filterfailurls,
final boolean filterscannerfail,
final double lat,
final double lon,
final double radius,
@ -241,8 +238,6 @@ public final class QueryParams {
this.indexSegment = indexSegment;
this.userAgent = userAgent;
this.transmitcount = 0;
this.filterfailurls = filterfailurls;
this.filterscannerfail = filterscannerfail;
// we normalize here the location and radius because that should cause a better caching
// and as surplus it will increase privacy
this.lat = Math.floor(lat * this.kmNormal) / this.kmNormal;

@ -58,7 +58,6 @@ import net.yacy.cora.federate.yacy.Distribution;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.Base64Order;
import net.yacy.cora.protocol.Domains;
import net.yacy.cora.protocol.Scanner;
import net.yacy.cora.sorting.ClusteredScoreMap;
import net.yacy.cora.sorting.ConcurrentScoreMap;
import net.yacy.cora.sorting.ReversibleScoreMap;
@ -1176,7 +1175,6 @@ public final class SearchEvent {
}
// check modifier constraint (language)
// TODO: : page.language() never null but defaults to "en" (may cause false drop of result)
if (this.query.modifier.language != null && !this.query.modifier.language.equals(page.language())) {
if (log.isFine()) log.fine("dropped RWI: language constraint = " + this.query.modifier.language);
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
@ -1267,14 +1265,6 @@ public final class SearchEvent {
}
}
// check Scanner
if (this.query.filterscannerfail && !Scanner.acceptURL(page.url())) {
if (log.isFine()) log.fine("dropped RWI: url not accepted by scanner");
if (page.word().local()) this.local_rwi_available.decrementAndGet(); else this.remote_rwi_available.decrementAndGet();
continue;
}
// check vocabulary terms (metatags) {only available in Solr index as vocabulary_xxyyzzz_sxt field}
// TODO: vocabulary is only valid and available in local Solr index (consider to auto-switch to Searchdom.LOCAL)
if (this.query.metatags != null && !this.query.metatags.isEmpty()) {

@ -170,7 +170,8 @@ public class SearchEventCache {
// start a new event
Switchboard sb = Switchboard.getSwitchboard();
final boolean delete = sb == null || Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true);
final boolean delete = sb == null || Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.SEARCH_VERIFY_DELETE, true)
|| (sb.getConfigBool(SwitchboardConstants.NETWORK_SEARCHVERIFY, false) && sb.peers.mySeed().getFlagAcceptRemoteIndex());
final boolean addToLocalIdx = sb == null || Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.REMOTESEARCH_RESULT_STORE, true);
event = new SearchEvent(query, peers, workTables, preselectedPeerHashes, generateAbstracts, loader, remote_maxcount, remote_maxtime, delete, addToLocalIdx);
MemoryControl.request(100 * 1024 * 1024, false); // this may trigger a short memory status which causes a reducing of cache space of other threads

@ -965,7 +965,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
Boolean canonical_equal_sku = canonical == null ? null : canonical.toNormalform(true).equals(url);
if (webgraph != null && (!containsCanonical || (canonical_equal_sku != null && (canonical_equal_sku.booleanValue())))) {
// a document with canonical tag should not get a webgraph relation, because that belongs to the canonical document
List<SolrInputDocument> edges = webgraph.getEdges(subgraph, digestURL, responseHeader, collections, crawldepth, processTypes, document.getAnchors(), sourceName);
List<SolrInputDocument> edges = webgraph.getEdges(subgraph, digestURL, responseHeader, collections, crawldepth, processTypes, document.getHyperlinks().keySet(), sourceName);
// this also enriched the subgraph
doc.webgraphDocuments.addAll(edges);
} else {
@ -976,7 +976,7 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
contains(CollectionSchema.outboundlinks_protocol_sxt) ||
contains(CollectionSchema.outboundlinks_urlstub_sxt) ||
contains(CollectionSchema.outboundlinks_anchortext_txt)) {
for (final AnchorURL target_url: document.getAnchors()) {
for (final AnchorURL target_url: document.getHyperlinks().keySet()) {
enrichSubgraph(subgraph, digestURL, target_url);
}
}

@ -1187,9 +1187,6 @@ public final class HTTPDProxyHandler {
if (conProp.containsKey(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER)) {
final HeaderFramework proxyRespondHeader = (HeaderFramework) conProp.get(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_HEADER);
mime = proxyRespondHeader.mime();
if (mime.indexOf(';') != -1) {
mime = mime.substring(0,mime.indexOf(';'));
}
}
logMessage.append(mime);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save