Description Field

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1258 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 867573de71
commit 4c824cacba

@ -15,6 +15,7 @@
<form action="Bookmarks_p.html" method="GET">
Url: <input type="text" name="url" value="#[url]#"><br />
Title: <input type="text" name="title" value="#[title]#"><br />
Description: <input type="text" name="description" value="#[description]#"><br />
Tags(comma separated): <input type="text" name="tags" value="#[tags]#"><br />
Public: <select name="public">
<option value="public" #(public)#::selected#(/public)#>yes</option>
@ -31,7 +32,8 @@ Public: <select name="public">
<td width="100%">
#{bookmarks}#
<a href="#[link]#" target="_blank">#[title]#</a><br />
Tagged with #[tags]#. <br />
#[description]#<br />
Tagged with <span class="bookmarkTags">#[tags]#</span>. <br />
<a href="Bookmarks_p.html?edit=#[hash]#">Edit</a> /
<a href="Bookmarks_p.html?delete=#[hash]#">Delete</a>
<p />

@ -65,6 +65,7 @@ public class Bookmarks_p {
//defaultvalues
prop.put("edit", 0);
prop.put("title", "");
prop.put("description", "");
prop.put("url", "");
prop.put("tags", "");
prop.put("public", 1); //1=is public
@ -72,6 +73,7 @@ public class Bookmarks_p {
if(post.containsKey("add")){ //add an Entry
String url=(String) post.get("url");
String title=(String) post.get("title");
String description=(String) post.get("description");
String tagsString = (String)post.get("tags");
if(tagsString.equals("")){
tagsString="unsorted"; //defaulttag
@ -85,6 +87,7 @@ public class Bookmarks_p {
bookmarksDB.Bookmark bookmark = switchboard.bookmarksDB.createBookmark(url);
if(bookmark != null){
bookmark.setProperty(bookmarksDB.Bookmark.BOOKMARK_TITLE, title);
bookmark.setProperty(bookmarksDB.Bookmark.BOOKMARK_DESCRIPTION, description);
bookmark.setProperty(bookmarksDB.Bookmark.BOOKMARK_PUBLIC, (String) post.get("public"));
bookmark.setTags(tags);
bookmark.setBookmarksTable();
@ -97,6 +100,7 @@ public class Bookmarks_p {
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()){
@ -142,6 +146,7 @@ public class Bookmarks_p {
if(bookmark!=null){
prop.put("bookmarks_"+count+"_link", bookmark.getUrl());
prop.put("bookmarks_"+count+"_title", bookmark.getTitle());
prop.put("bookmarks_"+count+"_description", bookmark.getDescription());
prop.put("bookmarks_"+count+"_tags", bookmark.getTags());
prop.put("bookmarks_"+count+"_hash", bookmark.getUrlHash());
count++;

@ -168,3 +168,6 @@ background-color: #eeeeee;
.MessageBackground {
background-color: #eeeeee;
}
.bookmarkTags{
color: blue;
}

@ -324,6 +324,7 @@ public class bookmarksDB {
public class Bookmark{
public static final String BOOKMARK_URL="bookmarkUrl";
public static final String BOOKMARK_TITLE="bookmarkTitle";
public static final String BOOKMARK_DESCRIPTION="bookmarkDesc";
public static final String BOOKMARK_TAGS="bookmarkTags";
public static final String BOOKMARK_PUBLIC="bookmarkPublic";
public static final String BOOKMARK_TIMESTAMP="bookmarkTimestamp";
@ -375,6 +376,12 @@ public class bookmarksDB {
}
return "";
}
public String getDescription(){
if(this.mem.containsKey(BOOKMARK_DESCRIPTION)){
return (String) this.mem.get(BOOKMARK_DESCRIPTION);
}
return "";
}
public String getTitle(){
if(this.mem.containsKey(BOOKMARK_TITLE)){
return (String) this.mem.get(BOOKMARK_TITLE);

Loading…
Cancel
Save