diff --git a/htroot/Bookmarks_p.java b/htroot/Bookmarks_p.java index f90c53d45..e318c03a9 100644 --- a/htroot/Bookmarks_p.java +++ b/htroot/Bookmarks_p.java @@ -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"); diff --git a/htroot/index.html b/htroot/index.html index 9de6404d3..95e977e0e 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -152,7 +152,7 @@ from 'late' peers. #{results}#
-
+
#[description]#