From e4dab1904541c21d313758339906fb8293f4b79c Mon Sep 17 00:00:00 2001 From: cominch Date: Sun, 17 Jun 2012 23:05:53 +0200 Subject: [PATCH] Augmented Browsing: added template for document info bar --- htroot/api/getpageinfo.java | 13 +++- .../interaction_elements/Document_part.html | 61 ++++++++++++++++++ .../interaction_elements/Document_part.java | 28 ++++++++ .../OverlayInteraction.html | 5 +- htroot/interaction_elements/document.png | Bin 0 -> 4847 bytes .../interaction_metadata.js | 2 +- 6 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 htroot/interaction_elements/Document_part.html create mode 100644 htroot/interaction_elements/Document_part.java create mode 100644 htroot/interaction_elements/document.png diff --git a/htroot/api/getpageinfo.java b/htroot/api/getpageinfo.java index 126103724..c031cca1a 100644 --- a/htroot/api/getpageinfo.java +++ b/htroot/api/getpageinfo.java @@ -102,7 +102,7 @@ public class getpageinfo { } if (scraper != null) { // put the document title - prop.putXML("title", scraper.dc_title()); + prop.putXML("title", removelinebreaks(scraper.dc_title())); // put the favicon that belongs to the document prop.put("favicon", (scraper.getFavicon()==null) ? "" : scraper.getFavicon().toString()); @@ -119,7 +119,7 @@ public class getpageinfo { } prop.put("tags", count); // put description - prop.putXML("desc", scraper.dc_description()); + prop.putXML("desc", removelinebreaks(scraper.dc_description())); // put language final Set languages = scraper.getContentLanguages(); prop.putXML("lang", (languages == null) ? "unknown" : languages.iterator().next()); @@ -185,7 +185,14 @@ public class getpageinfo { return prop; } - private static String checkOAI(final String url) { + private static String removelinebreaks(String dc_title) { + String newtitle = dc_title.replace ("\r", ""); + newtitle = newtitle.replace ("\n", ""); + newtitle = newtitle.replace ("\r\n", ""); + return newtitle; + } + + private static String checkOAI(final String url) { final DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); try { diff --git a/htroot/interaction_elements/Document_part.html b/htroot/interaction_elements/Document_part.html new file mode 100644 index 000000000..270da70c3 --- /dev/null +++ b/htroot/interaction_elements/Document_part.html @@ -0,0 +1,61 @@ + + + + + diff --git a/htroot/interaction_elements/Document_part.java b/htroot/interaction_elements/Document_part.java new file mode 100644 index 000000000..57b7258fd --- /dev/null +++ b/htroot/interaction_elements/Document_part.java @@ -0,0 +1,28 @@ +package interaction_elements; + + +import java.util.Collection; + +import net.yacy.cora.lod.vocabulary.Tagging; +import net.yacy.cora.protocol.HeaderFramework; +import net.yacy.cora.protocol.RequestHeader; +import net.yacy.document.LibraryProvider; +import net.yacy.search.Switchboard; +import de.anomic.data.UserDB; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public class Document_part { + + public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { + + final Switchboard sb = (Switchboard) env; + + final serverObjects prop = new serverObjects(); + + prop.put("hash", post.get("hash", "")); + prop.put("url", post.get("url", "")); + + return prop; + } +} diff --git a/htroot/interaction_elements/OverlayInteraction.html b/htroot/interaction_elements/OverlayInteraction.html index 06de6f673..580354a5a 100644 --- a/htroot/interaction_elements/OverlayInteraction.html +++ b/htroot/interaction_elements/OverlayInteraction.html @@ -179,7 +179,10 @@ z-index:99999; diff --git a/htroot/interaction_elements/document.png b/htroot/interaction_elements/document.png new file mode 100644 index 0000000000000000000000000000000000000000..f61fec3f64eace89ba6ee95097e3c27205d49f95 GIT binary patch literal 4847 zcmV1to76T^6s1YiDymfVOQn8j z)DQcit=uN6*8Ng%`ytv{=!Yey$wF&;7bLUHc(oYg7;q?NjDWEg%*bX518B{_jx!lv z1cNIWfe_1xQiP?`|MNfR-g#kwnYr__6Z_G<=iYOkb2-oNJm)#*-nlcjEX#V%dVcoh z4>o31xQa5RCRAK4KKRk^S)Z~h`tLdG(?frkP>1SimE}OK0m16W@BXRvJX%$;f6rSl z#hz5(e33)71X=v}%C{+?dmOc2uy82l~5&V+%8nEq64swff6sPM=C_GKWb z6o9yjVV^A0r1*(>ab9&RL(2w`-v2x3`x%t&K+8t(lgMBEdN~mQz=qS@Ue&Au*e8P&6S}b13&_43(qB{v|u2OUSp&>L`2f%s;z!ZRb&JFc6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T z=YZfd)~{N>WBsA^m70}5uzt(>g7reN|H;Cq;5aWL8oX4q@;Mm)3zhsY+kbBU{XY`6 VLE}14Da-%>002ovPDHLkV1h?o;kN() literal 0 HcmV?d00001 diff --git a/htroot/interaction_elements/interaction_metadata.js b/htroot/interaction_elements/interaction_metadata.js index f063ed100..59b7aab31 100644 --- a/htroot/interaction_elements/interaction_metadata.js +++ b/htroot/interaction_elements/interaction_metadata.js @@ -2,7 +2,7 @@ function getMetadata (url) { - var res = {"item": ""}; + var res = {"item": {"title": "no title"}}; $.ajaxSetup({async: false});