Show tags in search results (if activated in ConfigPortal_p.html)

pull/1/head
cominch 13 years ago
parent a5cdfb91de
commit 3c255c025b

@ -750,6 +750,7 @@ search.result.show.parser = false
search.result.show.pictures = false
search.result.show.cache = true
search.result.show.proxy = false
search.result.show.tags = false
# search navigators: comma-separated list of default values for search navigation.
# can be temporary different if search string is given with differen navigation values

@ -77,6 +77,7 @@
<input type="checkbox" name="search.result.show.pictures" value="true" #(search.result.show.pictures)#::checked="checked"#(/search.result.show.pictures)# />Pictures&nbsp;
<input type="checkbox" name="search.result.show.cache" value="true" #(search.result.show.cache)#::checked="checked"#(/search.result.show.cache)# />Cache
<input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked"#(/search.result.show.proxy)# />Augmented Proxy
<input type="checkbox" name="search.result.show.tags" value="true" #(search.result.show.tags)#::checked="checked"#(/search.result.show.tags)# />Tags
</dd>
<dt>Show Navigation on Side-Bar</dt>

@ -94,6 +94,7 @@ public class ConfigPortal {
sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures", false));
sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache", false));
sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy", false));
sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags", false));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete", false));
@ -140,6 +141,7 @@ public class ConfigPortal {
sb.setConfig("search.result.show.pictures", false);
sb.setConfig("search.result.show.cache", true);
sb.setConfig("search.result.show.proxy", false);
sb.setConfig("search.result.show.tags", false);
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh");
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");
sb.setConfig("about.headline", "");
@ -171,6 +173,7 @@ public class ConfigPortal {
prop.put("search.result.show.pictures", sb.getConfigBool("search.result.show.pictures", false) ? 1 : 0);
prop.put("search.result.show.cache", sb.getConfigBool("search.result.show.cache", false) ? 1 : 0);
prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);
prop.put("search.result.show.tags", sb.getConfigBool("search.result.show.tags", false) ? 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);

@ -107,10 +107,18 @@ public class Triple {
if(post.containsKey("s")){
s = post.get("s");
}
if(post.containsKey("sp")){
s = post.get("sp") + "#" + s;
}
if(post.containsKey("p")){
p = post.get("p");
}
if(post.containsKey("pp")){
p = post.get("pp") + "#" + p;
}
if(post.containsKey("o")){
o = post.get("o");
@ -123,9 +131,9 @@ public class Triple {
if (post.containsKey("load")) {
if (global) {
o = JenaTripleStore.getObject(s, p).toString();
o = JenaTripleStore.getObject(s, p);
} else {
o = JenaTripleStore.getObject(s, p, username).toString();
o = JenaTripleStore.getObject(s, p, username);
}

@ -181,3 +181,21 @@ function loadvalueglobal (s, p) {
return res.result;
}
function triple_get_prefix (sp, s, pp, p) {
var res = {result: ""};
$.ajaxSetup({async: false});
$.getJSON('/currentyacypeer/interaction/Triple.json?sep=true&global=true&sp='+sp+'&s='+s+'&pp='+pp+'&p='+p+'&load=true', function (data) {
res = data;
});
return res.result;
}

@ -3,6 +3,7 @@
<head>
<title>#[former]# - YaCy '#[clientname]#': Search Page</title>
#%env/templates/metas.template%#
#%env/templates/interactionheader.template%#
<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="yacysearch.rss?query=#[former]#" />
<link rel="search" type="application/opensearchdescription+xml" title="YaCy Search on '#[clientname]#'" href="http://#[thisaddress]#/opensearchdescription.xml" />
<link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />

@ -31,6 +31,7 @@
#(showPictures)#::&nbsp;|&nbsp;<a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#">Pictures</a>#(/showPictures)#
#(showCache)#::&nbsp;|&nbsp;<a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)#
#(showProxy)#::&nbsp;|&nbsp;<a href="proxy.html?url=#[link]#" target="_blank">Augmented Proxy</a>#(/showProxy)#
#(showTags)#::<br/><!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#&amp;url=#[url]#" -->#(/showTags)#
</p>
</div>
::

@ -130,6 +130,7 @@ public class yacysearchitem {
prop.put("content_showPictures", sb.getConfigBool("search.result.show.pictures", true) ? 1 : 0);
prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) ? 1 : 0);
prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0);
prop.put("content_showTags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("content_authorized", authenticated ? "1" : "0");
final String urlhash = ASCII.String(result.hash());
prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");
@ -189,6 +190,7 @@ public class yacysearchitem {
prop.put("content_showCache_link", resultUrlstring);
prop.put("content_showProxy_link", resultUrlstring);
prop.put("content_showParser_urlhash", resulthashString);
prop.put("content_showTags_urlhash", resulthashString);
prop.put("content_urlhexhash", Seed.b64Hash2hexHash(resulthashString));
prop.putHTML("content_urlname", nxTools.shortenURLString(result.urlname(), MAX_URL_LENGTH));
prop.put("content_showDate_date", GenericFormatter.RFC1123_SHORT_FORMATTER.format(result.modified()));

@ -199,35 +199,27 @@ public class JenaTripleStore {
}
public static String getObject (final String subject, final String predicate) {
Iterator<RDFNode> iter = getObjects (subject, predicate);
while (iter.hasNext()) {
return (iter.next().toString());
}
Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");
return null;
Iterator<RDFNode> ni = JenaTripleStore.getObjects (subject, predicate);
if (!ni.hasNext()) return "";
return ni.next().toString();
}
public static String getObject (final String subject, final String predicate, final String username) {
Iterator<RDFNode> iter = getObjects (subject, predicate, username);
while (iter.hasNext()) {
return (iter.next().toString());
}
Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ("+username+")");
return null;
Iterator<RDFNode> ni = JenaTripleStore.getObjects (subject, predicate, username);
if (!ni.hasNext()) return "";
return ni.next().toString();
}
public static Iterator<RDFNode> getObjects(final String subject, final String predicate, final String username) {
Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");
final Resource r = JenaTripleStore.getResource(subject, username);
if (privatestorage != null && privatestorage.containsKey(username)) {
@ -238,8 +230,7 @@ public class JenaTripleStore {
return null;
}
public static Iterator<RDFNode> getObjects(final String subject, final String predicate) {
Log.logInfo("TRIPLESTORE", "GET " + subject + " - " + predicate + " ... ");
public static Iterator<RDFNode> getObjects(final String subject, final String predicate) {
final Resource r = JenaTripleStore.getResource(subject);
return getObjects(r, predicate);
}
@ -250,7 +241,8 @@ public class JenaTripleStore {
public static Iterator<RDFNode> getObjects(final Resource r, final String predicate, final Model model) {
final Property pr = JenaTripleStore.getProperty(predicate, model);
final StmtIterator iter = model.listStatements(r, pr, (Resource) null);
final StmtIterator iter = model.listStatements(r, pr, (Resource) null);
return new Iterator<RDFNode>() {
@Override
public boolean hasNext() {

Loading…
Cancel
Save