git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1627 6c8d7289-2bf4-0310-a012-ef5d649a1542

pull/1/head
allo 19 years ago
parent bc6d400b03
commit 73f18ed5b2

@ -71,13 +71,13 @@ public class all {
Date date;
while(it.hasNext()){
bookmark=switchboard.bookmarksDB.getBookmark((String) it.next());
prop.put("posts_"+count+"_url", bookmark.getUrl());
prop.put("posts_"+count+"_title", bookmark.getTitle());
prop.put("posts_"+count+"_description", bookmark.getDescription());
prop.put("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl()));
prop.putNoHTML("posts_"+count+"_url", bookmark.getUrl());
prop.putNoHTML("posts_"+count+"_title", bookmark.getTitle());
prop.putNoHTML("posts_"+count+"_description", bookmark.getDescription());
prop.putNoHTML("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl()));
date=new Date(bookmark.getTimeStamp());
prop.put("posts_"+count+"_time", bookmarksDB.dateToiso8601(date));
prop.put("posts_"+count+"_tags", bookmark.getTags().replaceAll(","," "));
prop.putNoHTML("posts_"+count+"_time", bookmarksDB.dateToiso8601(date));
prop.putNoHTML("posts_"+count+"_tags", bookmark.getTags().replaceAll(","," "));
count++;
}
prop.put("posts", count);

@ -71,13 +71,13 @@ public class all_p {
Date date;
while(it.hasNext()){
bookmark=switchboard.bookmarksDB.getBookmark((String) it.next());
prop.put("posts_"+count+"_url", bookmark.getUrl());
prop.put("posts_"+count+"_title", bookmark.getTitle());
prop.put("posts_"+count+"_description", bookmark.getDescription());
prop.put("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl()));
prop.putNoHTML("posts_"+count+"_url", bookmark.getUrl());
prop.putNoHTML("posts_"+count+"_title", bookmark.getTitle());
prop.putNoHTML("posts_"+count+"_description", bookmark.getDescription());
prop.putNoHTML("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl()));
date=new Date(bookmark.getTimeStamp());
prop.put("posts_"+count+"_time", (new SimpleDateFormat("yyyy-MM-dd")).format(date)+"T"+(new SimpleDateFormat("HH:mm:ss")).format(date)+"Z");
prop.put("posts_"+count+"_tags", bookmark.getTags().replaceAll(","," "));
prop.putNoHTML("posts_"+count+"_time", (new SimpleDateFormat("yyyy-MM-dd")).format(date)+"T"+(new SimpleDateFormat("HH:mm:ss")).format(date)+"Z");
prop.putNoHTML("posts_"+count+"_tags", bookmark.getTags().replaceAll(","," "));
count++;
}
prop.put("posts", count);

@ -339,21 +339,16 @@ public class bookmarksDB {
return set.iterator();
}
public Iterator getTagIterator(boolean priv){
if(priv){
return tagIterator(true);
}else{
Vector publicTags=new Vector();
Iterator it=tagIterator(true);
Tag tag;
while(it.hasNext()){
tag=(Tag)it.next();
//this may be slow...
if(tag.hasPublicItems()){
publicTags.add(tag);
}
TreeSet set=new TreeSet(new tagComparator());
Iterator it=tagIterator(true);
Tag tag;
while(it.hasNext()){
tag=(Tag) it.next();
if(!priv ||tag.hasPublicItems()){
set.add(tag);
}
return publicTags.iterator();
}
return set.iterator();
}
public boolean removeBookmark(String urlHash){
Bookmark bookmark = getBookmark(urlHash);
@ -829,4 +824,12 @@ public class bookmarksDB {
return (new Long(bm1.getTimeStamp() - bm2.getTimeStamp())).intValue();
}
}
/**
* sorts the tag for name
*/
public class tagComparator implements Comparator{
public int compare(Object obj1, Object obj2){
return ((Tag)obj1).getTagName().compareTo(((Tag)obj2).getTagName());
}
}
}

@ -66,6 +66,7 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
import de.anomic.data.wikiCode;
import de.anomic.http.httpHeader;
public final class serverObjects extends Hashtable implements Cloneable {
@ -94,6 +95,13 @@ public final class serverObjects extends Hashtable implements Cloneable {
super(input);
}
/**
* like put, but it replaces any HTML special chars.
*/
public Object putNoHTML(Object key, String value){
return put(key, wikiCode.replaceHTMLonly(value));
}
// new put takes also null values
public Object put(Object key, Object value) {
if (key == null) {

Loading…
Cancel
Save