From a5cdfb91de700285890ea8db5ed8b1a785303c60 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 14 Jun 2012 19:55:34 +0200 Subject: [PATCH] - fixed Cache link (below snippet) - added 'Augmented Proxy' link below snippet - added configuration options for augmented proxy --- defaults/yacy.init | 1 + htroot/ConfigPortal.html | 1 + htroot/ConfigPortal.java | 9 ++++++--- htroot/Vocabulary_p.java | 8 ++++++-- htroot/yacysearchitem.html | 6 ++++-- htroot/yacysearchitem.java | 4 +++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 9d8ceda59..0026fec69 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -749,6 +749,7 @@ search.result.show.metadata = false search.result.show.parser = false search.result.show.pictures = false search.result.show.cache = true +search.result.show.proxy = 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 diff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.html index 4d1a80758..4f4ab4c6e 100644 --- a/htroot/ConfigPortal.html +++ b/htroot/ConfigPortal.html @@ -76,6 +76,7 @@ Parser  Pictures  Cache + Augmented Proxy
Show Navigation on Side-Bar
diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java index 7411d4a6a..7b1822334 100644 --- a/htroot/ConfigPortal.java +++ b/htroot/ConfigPortal.java @@ -93,6 +93,7 @@ public class ConfigPortal { sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser", false)); 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(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist")); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete", false)); @@ -134,10 +135,11 @@ public class ConfigPortal { sb.setConfig("search.app", false); sb.setConfig("search.result.show.date", true); sb.setConfig("search.result.show.size", false); - sb.setConfig("search.result.show.metadata", true); - sb.setConfig("search.result.show.parser", true); + sb.setConfig("search.result.show.metadata", false); + sb.setConfig("search.result.show.parser", false); sb.setConfig("search.result.show.pictures", false); - sb.setConfig("search.result.show.cache", false); + sb.setConfig("search.result.show.cache", true); + sb.setConfig("search.result.show.proxy", false); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh"); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true"); sb.setConfig("about.headline", ""); @@ -168,6 +170,7 @@ public class ConfigPortal { prop.put("search.result.show.parser", sb.getConfigBool("search.result.show.parser", false) ? 1 : 0); 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.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); diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java index b43a7249a..2cef2b425 100644 --- a/htroot/Vocabulary_p.java +++ b/htroot/Vocabulary_p.java @@ -76,7 +76,7 @@ public class Vocabulary_p { File propFile = LibraryProvider.autotagging.getVocabularyFile(discovername); while (ui.hasNext()) { DigestURI u = ui.next(); - String u0 = u.toNormalform(false, false); + String u0 = u.toNormalform(true, false); String t = u0.substring(discoverobjectspace.length()); if (t.indexOf('/') >= 0) continue; int p = t.indexOf('.'); @@ -99,7 +99,11 @@ public class Vocabulary_p { // check if a term was added if (post.get("add_new", "").equals("checked") && post.get("newterm", "").length() > 0) { - vocabulary.put(post.get("newterm", ""), post.get("newsynonyms", ""), post.get("newobjectlink", "")); + String objectlink = post.get("newobjectlink", ""); + if (objectlink.length() > 0) try { + objectlink = new MultiProtocolURI(objectlink).toNormalform(true, false); + } catch (MalformedURLException e) {} + vocabulary.put(post.get("newterm", ""), post.get("newsynonyms", ""), objectlink); } // check if a term was modified diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html index de0086832..f3b5d748d 100644 --- a/htroot/yacysearchitem.html +++ b/htroot/yacysearchitem.html @@ -28,8 +28,10 @@ #(showSize)#:: | #[sizename]##(/showSize)# #(showMetadata)#:: | Metadata#(/showMetadata)# #(showParser)#:: | Parser#(/showParser)# - #(showPictures)#:: | Pictures

#(/showPictures)# - #(showCache)#:: | Cache

#(/showCache)# + #(showPictures)#:: | Pictures#(/showPictures)# + #(showCache)#:: | Cache#(/showCache)# + #(showProxy)#:: | Augmented Proxy#(/showProxy)# +

:: #(item)#::
diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index a4f313b4f..4256754f3 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -34,7 +34,6 @@ import net.yacy.cora.document.Classification.ContentDomain; import net.yacy.cora.protocol.HeaderFramework; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader.FileType; -import net.yacy.interaction.Interaction; import net.yacy.kelondro.data.meta.DigestURI; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.util.Formatter; @@ -130,6 +129,7 @@ public class yacysearchitem { prop.put("content_showParser", sb.getConfigBool("search.result.show.parser", true) ? 1 : 0); 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_authorized", authenticated ? "1" : "0"); final String urlhash = ASCII.String(result.hash()); prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1"); @@ -186,6 +186,8 @@ public class yacysearchitem { prop.put("content_urlhash", resulthashString); prop.put("content_ranking", result.ranking); prop.put("content_showMetadata_urlhash", resulthashString); + prop.put("content_showCache_link", resultUrlstring); + prop.put("content_showProxy_link", resultUrlstring); prop.put("content_showParser_urlhash", resulthashString); prop.put("content_urlhexhash", Seed.b64Hash2hexHash(resulthashString)); prop.putHTML("content_urlname", nxTools.shortenURLString(result.urlname(), MAX_URL_LENGTH));