Merge branch 'master' of git://github.com/f1ori/yacy

pull/1/head
admin 13 years ago
commit 3e0125b485

@ -25,7 +25,7 @@ public class YMarkEntry extends TreeMap<String, String> {
DATE_ADDED ("date_added", "", "", "add_date", "added", "dateAdded", "date"), DATE_ADDED ("date_added", "", "", "add_date", "added", "dateAdded", "date"),
DATE_MODIFIED ("date_modified", "", "", "last_modified", "modified", "lastModified", "date"), DATE_MODIFIED ("date_modified", "", "", "last_modified", "modified", "lastModified", "date"),
DATE_VISITED ("date_visited", "", "", "last_visited", "visited", "", "date"), DATE_VISITED ("date_visited", "", "", "last_visited", "visited", "", "date"),
PUBLIC ("public", "", "flase", "", "yacy:public", "", "lock"), PUBLIC ("public", "", "flase", "private", "yacy:public", "", "lock"),
TAGS ("tags", "dc:subject", "unsorted", "shortcuturl", "yacy:tags", "keyword", "tag"), TAGS ("tags", "dc:subject", "unsorted", "shortcuturl", "yacy:tags", "keyword", "tag"),
VISITS ("visits", "", "0", "", "yacy:visits", "", "stat"), VISITS ("visits", "", "0", "", "yacy:visits", "", "stat"),
FOLDERS ("folders", "", "/unsorted", "", "", "", "folder"); FOLDERS ("folders", "", "/unsorted", "", "", "", "folder");

@ -131,23 +131,35 @@ public class YMarkHTMLImporter extends HTMLEditorKit.ParserCallback implements R
} }
final String url = (String)a.getAttribute(HTML.Attribute.HREF); final String url = (String)a.getAttribute(HTML.Attribute.HREF);
this.bmk.put(YMarkEntry.BOOKMARK.URL.key(), url); this.bmk.put(YMarkEntry.BOOKMARK.URL.key(), url);
final StringBuilder sb = new StringBuilder(255);
for (YMarkEntry.BOOKMARK bmk : YMarkEntry.BOOKMARK.values()) { for (YMarkEntry.BOOKMARK bmk : YMarkEntry.BOOKMARK.values()) {
final String s = (String)a.getAttribute(bmk.html_attrb()); sb.setLength(0);
if(s != null) { if (a.isDefined(a.isDefined(bmk.html_attrb())))
switch(bmk) { sb.append((String)a.getAttribute(bmk.html_attrb()));
case TAGS: switch(bmk) {
// mozilla shortcuturl case TAGS:
this.bmk.put(bmk.key(), YMarkUtil.cleanTagsString(s)); // sb already contains the mozilla shortcuturl
break; // add delicious.com tags that are stored in the tags attribute
case DATE_ADDED: if (a.isDefined(YMarkEntry.BOOKMARK.TAGS.key())) {
case DATE_MODIFIED: sb.append(YMarkUtil.TAGS_SEPARATOR);
case DATE_VISITED: sb.append((String)a.getAttribute(YMarkEntry.BOOKMARK.TAGS.key()));
this.bmk.put(bmk.key(), s+MILLIS); }
break; this.bmk.put(bmk.key(), YMarkUtil.cleanTagsString(sb.toString()));
default: break;
break; case PUBLIC:
} // look for delicious.com private attribute
if(sb.toString().equals("0"))
this.bmk.put(bmk.key(), "true");
break;
case DATE_ADDED:
case DATE_MODIFIED:
case DATE_VISITED:
sb.append(sb.toString());
sb.append(MILLIS);
this.bmk.put(bmk.key(), sb.toString());
break;
default:
break;
} }
} }
state = STATE.BOOKMARK; state = STATE.BOOKMARK;

Loading…
Cancel
Save