mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
Merge branch 'master' of ssh://git@gitorious.org/yacy/rc1.git
Conflicts: source/net/yacy/document/importer/OAIPMHLoader.java
This commit is contained in:
commit
26cb1c65c2
|
@ -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());
|
||||
|
|
|
@ -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<String> languages = scraper.getContentLanguages();
|
||||
prop.putXML("lang", (languages == null) ? "unknown" : languages.iterator().next());
|
||||
|
@ -185,6 +185,13 @@ public class getpageinfo {
|
|||
return prop;
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
61
htroot/interaction_elements/Document_part.html
Normal file
61
htroot/interaction_elements/Document_part.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<span id="sci_doc_#[hash]#" class="sci_doc" style="display: none;">
|
||||
|
||||
<img id="sci_doc_#[hash]#_img" src="/currentyacypeer/interaction_elements/document.png" width="16px" height="16px" alt="0" onclick="/* $('#sci_doc_#[hash]#_box').toggle();*/ return false"> <span style="font-size: x-small; position: absolute; margin-top: 4px;"><span id="sci_doc_#[hash]#_title"></span></span>
|
||||
|
||||
</span>
|
||||
|
||||
<style type="text/css" >
|
||||
|
||||
.sci_panel {
|
||||
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: 10px;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
background: #ffffff;
|
||||
border:1px solid #5a346e;
|
||||
|
||||
width: 210px;
|
||||
height: auto;
|
||||
padding: 30px 110px 30px 30px;
|
||||
|
||||
z-index:99998;
|
||||
|
||||
color: #5a346e;
|
||||
}
|
||||
|
||||
.sci_document {
|
||||
|
||||
font: arial,helvetica,sans-serif;
|
||||
font-size: 10px;
|
||||
position: fixed;
|
||||
right: 100px;
|
||||
top: 0;
|
||||
background: #ffffff;
|
||||
border:0px;
|
||||
|
||||
width: 65px;
|
||||
height: 20px;
|
||||
padding: 5px 5px 5px 5px;
|
||||
|
||||
z-index:99998;
|
||||
|
||||
color: #5a346e;
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="sci_doc_#[hash]#_box" class="sci_panel" style="top: 50px; display: none;">
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
document.getElementById('sci_doc_#[hash]#').style.display = "";
|
||||
var metajson = getMetadata('#[url]#');
|
||||
|
||||
document.getElementById('sci_doc_#[hash]#_title').innerHTML = metajson.item.title;
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
28
htroot/interaction_elements/Document_part.java
Normal file
28
htroot/interaction_elements/Document_part.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -179,6 +179,9 @@ z-index:99999;
|
|||
<div id="sidebar-logo" class="sci_left" style="">
|
||||
|
||||
<img src="/currentyacypeer/env/grafics/yacy.png" height="20px" width="36px"/>
|
||||
<img src="/currentyacypeer/env/grafics/empty.gif" height="20px" width="20px"/>
|
||||
<!--#include virtual="/currentyacypeer/interaction_elements/Document_part.html?hash=#[urlhash]#&url=#[url]#" -->
|
||||
<img src="/currentyacypeer/env/grafics/empty.gif" height="20px" width="20px"/>
|
||||
<!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#" -->
|
||||
|
||||
</div>
|
||||
|
|
BIN
htroot/interaction_elements/document.png
Normal file
BIN
htroot/interaction_elements/document.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
|
@ -2,7 +2,7 @@
|
|||
function getMetadata (url) {
|
||||
|
||||
|
||||
var res = {"item": ""};
|
||||
var res = {"item": {"title": "no title"}};
|
||||
|
||||
$.ajaxSetup({async: false});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user