diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java index 325fe0e21..c78c5b7ba 100644 --- a/htroot/Vocabulary_p.java +++ b/htroot/Vocabulary_p.java @@ -191,6 +191,7 @@ public class Vocabulary_p { prop.putHTML("edit_editable_file", editable ? vocabulary.getFile().getAbsolutePath() : ""); prop.putHTML("edit_name", vocabulary.getName()); prop.putHTML("edit_namespace", vocabulary.getNamespace()); + prop.put("edit_size", vocabulary.size()); prop.putHTML("edit_predicate", vocabulary.getPredicate()); prop.putHTML("edit_prefix", Tagging.DEFAULT_PREFIX); prop.putHTML("edit_editable_objectspace", vocabulary.getObjectspace() == null ? "" : vocabulary.getObjectspace()); 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 000000000..f61fec3f6 Binary files /dev/null and b/htroot/interaction_elements/document.png differ 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});