changed bookmark hand-over method: read from database

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1583 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent fe39493145
commit 5a38bf7017

@ -45,6 +45,7 @@
// javac -classpath .:../Classes Blacklist_p.java
// if the shell's current path is HTROOT
import java.io.IOException;
import java.util.Iterator;
import java.util.Vector;
@ -52,6 +53,7 @@ import de.anomic.data.bookmarksDB;
import de.anomic.data.bookmarksDB.Tag;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.plasma.plasmaCrawlLURL;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@ -107,17 +109,33 @@ public class Bookmarks_p {
prop.put("public", 0);
} else {
bookmarksDB.Bookmark bookmark = switchboard.bookmarksDB.getBookmark(urlHash);
prop.put("edit", 1); // edit mode
prop.put("title", bookmark.getTitle());
prop.put("description", bookmark.getDescription());
prop.put("url", bookmark.getUrl());
prop.put("tags", bookmark.getTags());
if (bookmark.getPublic()) {
prop.put("public", 1);
if (bookmark == null) {
// try to get the bookmark from the LURL database
try {
plasmaCrawlLURL.Entry urlentry = switchboard.urlPool.loadedURL.getEntry(urlHash, null);
prop.put("edit", 0); // create mode
prop.put("title", urlentry.descr());
prop.put("description", urlentry.descr());
prop.put("url", urlentry.url());
prop.put("tags", "");
prop.put("public", 0);
} catch (IOException e) {
e.printStackTrace();
}
} else {
prop.put("public", 0);
// get from the bookmark database
prop.put("edit", 1); // edit mode
prop.put("title", bookmark.getTitle());
prop.put("description", bookmark.getDescription());
prop.put("url", bookmark.getUrl());
prop.put("tags", bookmark.getTags());
if (bookmark.getPublic()) {
prop.put("public", 1);
} else {
prop.put("public", 0);
}
}
}
}
}
if(post.containsKey("delete")){
String urlHash=(String) post.get("delete");

@ -152,7 +152,7 @@ from 'late' peers.
#{results}#
<!-- link begin -->
<p style="border-bottom:1px #000 dashed; padding-bottom: 1em;">
<a href="/Bookmarks_p.html?edit=&title=#[description]#&description=&url=#[url]#&tags=quickadd" onMouseover="document.plus_#[urlhexhash]#.src=picPlus.src" onMouseout="document.plus_#[urlhexhash]#.src=picEmpty.src">
<a href="/Bookmarks_p.html?edit=#[urlhash]#" onMouseover="document.plus_#[urlhexhash]#.src=picPlus.src" onMouseout="document.plus_#[urlhexhash]#.src=picEmpty.src">
<img src="/env/grafics/empty.gif" title="bookmark" alt="bookmark" name="plus_#[urlhexhash]#" border="0"></a>&nbsp;
<b><font color="#4070a0">#[description]#</font></b><br>
<a href="#[delete]#" onMouseover="document.minus_#[urlhexhash]#.src=picMinus.src" onMouseout="document.minus_#[urlhexhash]#.src=picEmpty.src">

Loading…
Cancel
Save