git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7670 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
06d50fd801
commit
b2281f0b7d
@ -0,0 +1,15 @@
|
||||
{
|
||||
page: #[page]#,
|
||||
total: #[total]#,
|
||||
rows: [
|
||||
#{json}#
|
||||
{id:"#[id]#",cell:[
|
||||
"#[hash]#",
|
||||
#(public)#"<img src='img-2/world2.png' alt='public' title='public bookmark'/>"::"<img src='img-2/lock.png' alt='private' title='private bookmark'/>"#(/public)#,
|
||||
"<h3 class='linktitle'>#[title]#</h3><p class='desc'>#[desc]#</p><p class='url'><a href='#[url]#'>#[url]#</a>",
|
||||
"<p class='tags'>#[tags]#</p>",
|
||||
"<p class='folders'>#[folders]#</p>",
|
||||
"<p class='date'>#[date_added]#</p>"]}#[comma]#
|
||||
#{/json}#
|
||||
]
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<posts>
|
||||
#{bookmarks}#
|
||||
#{xml}#
|
||||
<post href="#[url]#" id="#[id]#" title="#[title]#" tag="#[tags]#" folders="#[folders]#" added="#[date_added]#"/>
|
||||
#{/bookmarks}#
|
||||
#{/xml}#
|
||||
</posts>
|
@ -0,0 +1,29 @@
|
||||
package de.anomic.data.ymark;
|
||||
|
||||
import java.util.Comparator;
|
||||
import net.yacy.cora.document.UTF8;
|
||||
import net.yacy.kelondro.blob.Tables;
|
||||
|
||||
public class TablesRowComparator implements Comparator<Tables.Row> {
|
||||
private String sortname;
|
||||
|
||||
public TablesRowComparator(final String sortname) {
|
||||
setSortName(sortname);
|
||||
}
|
||||
|
||||
public void setSortName(final String sortname) {
|
||||
this.sortname = sortname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(Tables.Row row0, Tables.Row row1) {
|
||||
if(row0 != null && row1 != null) {
|
||||
if(row0.containsKey(this.sortname) && row1.containsKey(this.sortname)) {
|
||||
String name1 = UTF8.String(row0.get(this.sortname)).toLowerCase();
|
||||
String name2 = UTF8.String(row1.get(this.sortname)).toLowerCase();
|
||||
return name1.compareTo(name2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue