bugfix: bookmarks can now handle folder names like /news and /newspaper without getting confused...

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5470 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 16 years ago
parent e948df68ac
commit 3dc208fad0

@ -380,7 +380,7 @@ public class Bookmarks {
private static int recurseFolders(final Iterator<String> it, String root, int count, final boolean next, final String prev){
String fn="";
bookmarksDB.Bookmark bookmark;
if (next) fn = it.next();
else fn = prev;
@ -394,7 +394,7 @@ public class Bookmarks {
return count;
}
if(fn.startsWith(root)){
if(fn.startsWith((root.equals("/") ? root : root+"/"))){
prop.put("folderlist_"+count+"_folder", "<li>"+fn.replaceFirst(root+"/*","")+"<ul class=\"folder\">");
count++;
final Iterator<String> bit=sb.bookmarksDB.getBookmarksIterator(fn, isAdmin);

@ -213,7 +213,7 @@ public class get_bookmarks {
return count;
}
if(fn.startsWith(root)){
if(fn.startsWith((root.equals("/") ? root : root+"/"))){
prop.put("display_xbel_"+count+"_elements", "<folder id=\""+bookmarksDB.tagHash(fn)+"\">");
count++;
@ -226,8 +226,10 @@ public class get_bookmarks {
count = recurseFolders(it, fn, count, true, fn);
}
} else {
prop.put("display_xbel_"+count+"_elements", "</folder>");
count++;
if (count > 0) {
prop.put("display_xbel_"+count+"_elements", "</folder>");
count++;
}
root = root.replaceAll("(/.[^/]*$)", "");
if(root.equals("")) root = "/";
count = recurseFolders(it, root, count, false, fn);

@ -78,7 +78,7 @@ public class xbel {
return count;
}
if(fn.startsWith(root)){
if(fn.startsWith((root.equals("/") ? root : root+"/"))){
prop.put("xbel_"+count+"_elements", "<folder id=\""+bookmarksDB.tagHash(fn)+"\">");
count++;
@ -91,8 +91,10 @@ public class xbel {
count = recurseFolders(it, fn, count, true, fn);
}
} else {
prop.put("xbel_"+count+"_elements", "</folder>");
count++;
if (count > 0) {
prop.put("xbel_"+count+"_elements", "</folder>");
count++;
}
root = root.replaceAll("(/.[^/]*$)", "");
if(root.equals("")) root = "/";
count = recurseFolders(it, root, count, false, fn);

@ -323,8 +323,8 @@ public class bookmarksDB {
Tag tag;
while(it.hasNext()){
tag=it.next();
if (tag.getFriendlyName().startsWith(root)) {
tag=it.next();
if (tag.getFriendlyName().startsWith((root.equals("/") ? root : root+"/"))) {
path = tag.getFriendlyName();
path = cleanTagsString(path);
while(path.length() > 0 && !path.equals(root)){

Loading…
Cancel
Save