* maske ampersan & Co. in xbel export

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4975 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 17 years ago
parent 7052f2f61f
commit 3980dd7554

@ -9,6 +9,7 @@ import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverDate; import de.anomic.server.serverDate;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
import de.anomic.data.htmlTools;
public class xbel { public class xbel {
@ -68,7 +69,7 @@ public class xbel {
if(fn.startsWith(root)){ if(fn.startsWith(root)){
prop.put("xbel_"+count+"_elements", "<folder id=\""+bookmarksDB.tagHash(fn)+"\">"); prop.put("xbel_"+count+"_elements", "<folder id=\""+bookmarksDB.tagHash(fn)+"\">");
count++; count++;
prop.put("xbel_"+count+"_elements", "<title>"+fn.replaceFirst(root+"/*","")+"</title>"); prop.put("xbel_"+count+"_elements", "<title>" + htmlTools.encodeUnicode2xml(fn.replaceFirst(root+"/*","")) + "</title>");
count++; count++;
Iterator<String> bit=switchboard.bookmarksDB.getBookmarksIterator(fn, isAdmin); Iterator<String> bit=switchboard.bookmarksDB.getBookmarksIterator(fn, isAdmin);
count = print_XBEL(bit, count); count = print_XBEL(bit, count);
@ -90,17 +91,21 @@ public class xbel {
while(bit.hasNext()){ while(bit.hasNext()){
bookmark=switchboard.bookmarksDB.getBookmark(bit.next()); bookmark=switchboard.bookmarksDB.getBookmark(bit.next());
date=new Date(bookmark.getTimeStamp()); date=new Date(bookmark.getTimeStamp());
prop.put("xbel_"+count+"_elements", "<bookmark id=\""+bookmark.getUrlHash()+"\" href=\""+bookmark.getUrl()+"\" added=\""+serverDate.formatISO8601(date)+"\">"); prop.put("xbel_"+count+"_elements", "<bookmark id=\"" + bookmark.getUrlHash()
+ "\" href=\"" + htmlTools.encodeUnicode2xml(bookmark.getUrl())
+ "\" added=\"" + htmlTools.encodeUnicode2xml(serverDate.formatISO8601(date))+"\">");
count++; count++;
prop.put("xbel_"+count+"_elements", "<title>"); prop.put("xbel_"+count+"_elements", "<title>");
count++; count++;
prop.putHTML("xbel_"+count+"_elements", bookmark.getTitle(),true); prop.putHTML("xbel_"+count+"_elements", bookmark.getTitle(), true);
count++; count++;
prop.put("xbel_"+count+"_elements", "</title>"); prop.put("xbel_"+count+"_elements", "</title>");
count++; count++;
prop.put("xbel_"+count+"_elements", "<info>"); prop.put("xbel_"+count+"_elements", "<info>");
count++; count++;
prop.put("xbel_"+count+"_elements", "<metadata owner=\"Mozilla\" ShortcutURL=\""+bookmark.getTagsString().replaceAll("/.*,", "").toLowerCase()+"\"/>"); prop.put("xbel_"+count+"_elements", "<metadata owner=\"Mozilla\" ShortcutURL=\""
+ htmlTools.encodeUnicode2xml(bookmark.getTagsString().replaceAll("/.*,", "").toLowerCase())
+ "\"/>");
count++; count++;
prop.put("xbel_"+count+"_elements", "<metadata owner=\"YaCy\" public=\""+Boolean.toString(bookmark.getPublic())+"\"/>"); prop.put("xbel_"+count+"_elements", "<metadata owner=\"YaCy\" public=\""+Boolean.toString(bookmark.getPublic())+"\"/>");
count++; count++;
@ -108,7 +113,7 @@ public class xbel {
count++; count++;
prop.put("xbel_"+count+"_elements", "<desc>"); prop.put("xbel_"+count+"_elements", "<desc>");
count++; count++;
prop.putHTML("xbel_"+count+"_elements", bookmark.getDescription(),true); prop.putHTML("xbel_"+count+"_elements", bookmark.getDescription(), true);
count++; count++;
prop.put("xbel_"+count+"_elements", "</desc>"); prop.put("xbel_"+count+"_elements", "</desc>");
count++; count++;

Loading…
Cancel
Save