git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5554 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 16 years ago
parent ef82cced01
commit 416d16e026

@ -23,10 +23,10 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</div> </div>
#%env/templates/header.template%# #%env/templates/header.template%#
<div class="SubMenu">
<h3>Bookmarks</h3>
#(mode)# #(mode)#
<!-- SubMenu (mode=0) --> <!-- SubMenu (mode=0) -->
<div class="SubMenu">
<h3>Bookmarks</h3>
<ul class="SubMenu"> <ul class="SubMenu">
<li><a href="Bookmarks.html?login=true" class="MenuItemLink">Login</a></li> <li><a href="Bookmarks.html?login=true" class="MenuItemLink">Login</a></li>
<li><a href="Bookmarks.html?login=true&mode=add" class="MenuItemLink lock">Add Bookmark</a></li> <li><a href="Bookmarks.html?login=true&mode=add" class="MenuItemLink lock">Add Bookmark</a></li>
@ -36,10 +36,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<li><a href="Bookmarks.rss" class="MenuItemLink lock">Bookmarks (RSS)</a></li> <li><a href="Bookmarks.rss" class="MenuItemLink lock">Bookmarks (RSS)</a></li>
</ul> </ul>
<p/> <p/>
</div>
:: <!-- Submenu isAdmin (mode=1) --> :: <!-- Submenu isAdmin (mode=1) -->
<div class="SubMenu">
<h3>Bookmarks</h3>
<ul class="SubMenu"> <ul class="SubMenu">
<li><a href="Bookmarks.html?mode=add" class="MenuItemLink lock">Add Bookmark</a></li> <li><a href="Bookmarks.html?mode=add" class="MenuItemLink lock">Add Bookmark</a></li>
<li><a href="Bookmarks.html?mode=importxml" class="MenuItemLink lock">Import Bookmarks</a></li> <li><a href="Bookmarks.html?mode=importxml" class="MenuItemLink lock">Import Bookmarks</a></li>
@ -48,7 +45,6 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<li><a href="Bookmarks.rss" class="MenuItemLink lock">Bookmarks (RSS)</a></li> <li><a href="Bookmarks.rss" class="MenuItemLink lock">Bookmarks (RSS)</a></li>
</ul> </ul>
<p/> <p/>
</div>
:: <!-- add or edit Bookmark (mode=2) --> :: <!-- add or edit Bookmark (mode=2) -->
<form action="Bookmarks.html" method="get"> <form action="Bookmarks.html" method="get">
<fieldset> <fieldset>
@ -163,42 +159,10 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</fieldset> </fieldset>
</form> </form>
:: ::
<!-- manage Bookmarks (mode=4) --> <!-- (mode=4) -->
<fieldset> #(/mode)#
<legend>Manage Bookmarks</legend> </div>
</fieldset> #(display)#
<table border="0" width="60%" cellpadding="2" cellspacing="1">
<colgroup>
<col width="60" span="2" />
<col width="10" />
<col width="80" />
<col width="180" />
<col />
<col width="10" />
</colgroup>
<tr class="TableHeader">
<th>Initiator</th>
<th>Profile</th>
<th>Depth</th>
<th>Modified Date</th>
<th>Anchor Name</th>
<th>URL</th>
<th>Delete</th>
</tr>
#{bookmarks}#
<!--<tr class="TableCell#(dark)#Light::Dark#(/dark)#">-->
<tr>
<td>#[public]#</td>
<td><a href="#[link]#">#[title]#</a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
#{/bookmarks}#
</table>
#(/mode)#
<!-- show Folders --> <!-- show Folders -->
<div class="TagList"> <div class="TagList">
<fieldset> <fieldset>
@ -273,7 +237,9 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<a href="Bookmarks.html?tag=#[tag]#&amp;start=#[start]#&amp;num=100">100</a> <a href="Bookmarks.html?tag=#[tag]#&amp;start=#[start]#&amp;num=100">100</a>
Bookmarks per page. Bookmarks per page.
</p> </p>
</div> </div>
::
#(/display)#
#%env/templates/footer.template%# #%env/templates/footer.template%#
</body> </body>
</html> </html>

@ -97,10 +97,13 @@ public class Bookmarks {
//defaultvalues //defaultvalues
if(isAdmin) { if(isAdmin) {
prop.put("mode", "1"); prop.put("mode", "1");
prop.put("admin", "1"); prop.put("admin", "1");
prop.put("display", "0");
} else { } else {
prop.put("mode", "0"); prop.put("mode", "0");
prop.put("admin", "0"); prop.put("admin", "0");
prop.put("display", "0");
} }
prop.put("mode_edit", "0"); prop.put("mode_edit", "0");
prop.put("mode_title", ""); prop.put("mode_title", "");
@ -120,10 +123,10 @@ public class Bookmarks {
final String mode=post.get("mode"); final String mode=post.get("mode");
if(mode.equals("add")){ if(mode.equals("add")){
prop.put("mode", "2"); prop.put("mode", "2");
prop.put("display", "1");
}else if(mode.equals("importxml")){ }else if(mode.equals("importxml")){
prop.put("mode", "3"); prop.put("mode", "3");
}else if(mode.equals("manage")){ prop.put("display", "1");
prop.put("mode", "4");
} }
}else if(post.containsKey("add")){ //add an Entry }else if(post.containsKey("add")){ //add an Entry
final String url=post.get("url"); final String url=post.get("url");
@ -162,6 +165,7 @@ public class Bookmarks {
}else if(post.containsKey("edit")){ }else if(post.containsKey("edit")){
final String urlHash=post.get("edit"); final String urlHash=post.get("edit");
prop.put("mode", "2"); prop.put("mode", "2");
prop.put("display", "1");
if (urlHash.length() == 0) { if (urlHash.length() == 0) {
prop.put("mode_edit", "0"); // create mode prop.put("mode_edit", "0"); // create mode
prop.putHTML("mode_title", post.get("title")); prop.putHTML("mode_title", post.get("title"));
@ -264,14 +268,14 @@ public class Bookmarks {
Iterator<String> tagsIt; Iterator<String> tagsIt;
int tagCount; int tagCount;
prop.put("num-bookmarks", sb.bookmarksDB.bookmarksSize()); prop.put("display_num-bookmarks", sb.bookmarksDB.bookmarksSize());
count=0; count=0;
if(!tagName.equals("")){ if(!tagName.equals("")){
prop.put("selected", ""); prop.put("display_selected", "");
it=sb.bookmarksDB.getBookmarksIterator(tagName, isAdmin); it=sb.bookmarksDB.getBookmarksIterator(tagName, isAdmin);
}else{ }else{
prop.put("selected", " selected=\"selected\""); prop.put("display_selected", " selected=\"selected\"");
it=sb.bookmarksDB.getBookmarksIterator(isAdmin); it=sb.bookmarksDB.getBookmarksIterator(isAdmin);
} }
@ -287,14 +291,14 @@ public class Bookmarks {
bookmark=sb.bookmarksDB.getBookmark(it.next()); bookmark=sb.bookmarksDB.getBookmark(it.next());
if(bookmark!=null){ if(bookmark!=null){
if(bookmark.getFeed() && isAdmin) if(bookmark.getFeed() && isAdmin)
prop.put("bookmarks_"+count+"_link", "/FeedReader_p.html?url="+bookmark.getUrl()); prop.put("display_bookmarks_"+count+"_link", "/FeedReader_p.html?url="+bookmark.getUrl());
else else
prop.put("bookmarks_"+count+"_link",bookmark.getUrl()); prop.put("display_bookmarks_"+count+"_link",bookmark.getUrl());
prop.putHTML("bookmarks_"+count+"_title", bookmark.getTitle()); prop.putHTML("display_bookmarks_"+count+"_title", bookmark.getTitle());
prop.putHTML("bookmarks_"+count+"_description", bookmark.getDescription()); prop.putHTML("display_bookmarks_"+count+"_description", bookmark.getDescription());
prop.put("bookmarks_"+count+"_date", DateFormatter.formatISO8601(new Date(bookmark.getTimeStamp()))); prop.put("display_bookmarks_"+count+"_date", DateFormatter.formatISO8601(new Date(bookmark.getTimeStamp())));
prop.put("bookmarks_"+count+"_rfc822date", DateFormatter.formatRFC1123(new Date(bookmark.getTimeStamp()))); prop.put("display_bookmarks_"+count+"_rfc822date", DateFormatter.formatRFC1123(new Date(bookmark.getTimeStamp())));
prop.put("bookmarks_"+count+"_public", (bookmark.getPublic() ? "1" : "0")); prop.put("display_bookmarks_"+count+"_public", (bookmark.getPublic() ? "1" : "0"));
//List Tags. //List Tags.
tags=bookmark.getTags(); tags=bookmark.getTags();
@ -303,34 +307,34 @@ public class Bookmarks {
while (tagsIt.hasNext()) { while (tagsIt.hasNext()) {
final String tname = tagsIt.next(); final String tname = tagsIt.next();
if ((!tname.startsWith("/")) && (!tname.equals(""))) { if ((!tname.startsWith("/")) && (!tname.equals(""))) {
prop.putHTML("bookmarks_"+count+"_tags_"+tagCount+"_tag", tname); prop.putHTML("display_bookmarks_"+count+"_tags_"+tagCount+"_tag", tname);
tagCount++; tagCount++;
} }
} }
prop.put("bookmarks_"+count+"_tags", tagCount); prop.put("display_bookmarks_"+count+"_tags", tagCount);
prop.put("bookmarks_"+count+"_hash", bookmark.getUrlHash()); prop.put("display_bookmarks_"+count+"_hash", bookmark.getUrlHash());
count++; count++;
} }
} }
prop.putHTML("tag", tagName); prop.putHTML("display_tag", tagName);
prop.put("start", start); prop.put("display_start", start);
if(it.hasNext()){ if(it.hasNext()){
prop.put("next-page", "1"); prop.put("display_next-page", "1");
prop.put("next-page_start", start+max_count); prop.put("display_next-page_start", start+max_count);
prop.putHTML("next-page_tag", tagName); prop.putHTML("display_next-page_tag", tagName);
prop.put("next-page_num", max_count); prop.put("display_next-page_num", max_count);
} }
if(start >= max_count){ if(start >= max_count){
start=start-max_count; start=start-max_count;
if(start <0){ if(start <0){
start=0; start=0;
} }
prop.put("prev-page", "1"); prop.put("display_prev-page", "1");
prop.put("prev-page_start", start); prop.put("display_prev-page_start", start);
prop.putHTML("prev-page_tag", tagName); prop.putHTML("display_prev-page_tag", tagName);
prop.put("prev-page_num", max_count); prop.put("display_prev-page_num", max_count);
} }
prop.put("bookmarks", count); prop.put("display_bookmarks", count);
//----------------------- //-----------------------
@ -339,7 +343,7 @@ public class Bookmarks {
count = 0; count = 0;
count = recurseFolders(sb.bookmarksDB.getFolderList(isAdmin),"/",0,true,""); count = recurseFolders(sb.bookmarksDB.getFolderList(isAdmin),"/",0,true,"");
prop.put("folderlist", count); prop.put("display_folderlist", count);
return prop; // return from serverObjects respond() return prop; // return from serverObjects respond()
@ -387,7 +391,7 @@ public class Bookmarks {
if(fn.equals("\uffff")) { if(fn.equals("\uffff")) {
int i = prev.replaceAll("[^/]","").length(); int i = prev.replaceAll("[^/]","").length();
while(i>0){ while(i>0){
prop.put("folderlist_"+count+"_folder", "</ul></li>"); prop.put("display_folderlist_"+count+"_folder", "</ul></li>");
count++; count++;
i--; i--;
} }
@ -395,20 +399,20 @@ public class Bookmarks {
} }
if(fn.startsWith((root.equals("/") ? root : root+"/"))){ if(fn.startsWith((root.equals("/") ? root : root+"/"))){
prop.put("folderlist_"+count+"_folder", "<li>"+fn.replaceFirst(root+"/*","")+"<ul class=\"folder\">"); prop.put("display_folderlist_"+count+"_folder", "<li>"+fn.replaceFirst(root+"/*","")+"<ul class=\"folder\">");
count++; count++;
final Iterator<String> bit=sb.bookmarksDB.getBookmarksIterator(fn, isAdmin); final Iterator<String> bit=sb.bookmarksDB.getBookmarksIterator(fn, isAdmin);
while(bit.hasNext()){ while(bit.hasNext()){
bookmark=sb.bookmarksDB.getBookmark(bit.next()); bookmark=sb.bookmarksDB.getBookmark(bit.next());
if(bookmark == null) break; if(bookmark == null) break;
prop.put("folderlist_"+count+"_folder", "<li><a href=\""+bookmark.getUrl()+"\" title=\""+bookmark.getDescription()+"\">"+ bookmark.getTitle()+"</a></li>"); prop.put("display_folderlist_"+count+"_folder", "<li><a href=\""+bookmark.getUrl()+"\" title=\""+bookmark.getDescription()+"\">"+ bookmark.getTitle()+"</a></li>");
count++; count++;
} }
if(it.hasNext()){ if(it.hasNext()){
count = recurseFolders(it, fn, count, true, fn); count = recurseFolders(it, fn, count, true, fn);
} }
} else { } else {
prop.put("folderlist_"+count+"_folder", "</ul></li>"); prop.put("display_folderlist_"+count+"_folder", "</ul></li>");
count++; count++;
root = root.replaceAll("(/.[^/]*$)", ""); root = root.replaceAll("(/.[^/]*$)", "");
if(root.equals("")) root = "/"; if(root.equals("")) root = "/";

Loading…
Cancel
Save