*) SOAP: bookmarks list now indicates if a bookmark is private (requested by KoH)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3775 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
(no author) 18 years ago
parent 957a25afff
commit 92351c4dcb

@ -62,12 +62,17 @@ public class all {
plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
boolean isAdmin=switchboard.verifyAuthentication(header, true);
serverObjects prop = new serverObjects();
Iterator it;
if(post != null && post.containsKey("tag")){
it=switchboard.bookmarksDB.getBookmarksIterator((String) post.get("tag"), isAdmin);
}else{
it=switchboard.bookmarksDB.getBookmarksIterator(isAdmin);
}
// if an extended xml should be used
boolean extendedXML = (post != null && post.containsKey("extendedXML"));
int count=0;
bookmarksDB.Bookmark bookmark;
Date date;
@ -80,6 +85,12 @@ public class all {
date=new Date(bookmark.getTimeStamp());
prop.putSafeXML("posts_"+count+"_time", serverDate.dateToiso8601(date));
prop.putSafeXML("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," "));
// additional XML tags
prop.put("posts_"+count+"_isExtended",extendedXML ? 1:0);
if (extendedXML) {
prop.putSafeXML("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic()));
}
count++;
}
prop.put("posts", count);

@ -1,5 +1,5 @@
<?xml version='1.0' standalone='yes'?>
<posts>
#{posts}#<post href="#[url]#" description="#[title]#" extended="#[description]#" hash="#[md5]#" tag="#[tags]#" time="#[time]#"/>
#{posts}#<post href="#[url]#" description="#[title]#" extended="#[description]#" hash="#[md5]#" tag="#[tags]#" time="#[time]#" #(isExtended)#::private="#[private]#"#(/isExtended)#/>
#{/posts}#
</posts>

@ -50,6 +50,10 @@ public class get {
}else{
date=serverDate.dateToiso8601(new Date(System.currentTimeMillis()));
}
// if an extended xml should be used
boolean extendedXML = (post != null && post.containsKey("extendedXML"));
int count=0;
Date parsedDate = null;
@ -73,6 +77,12 @@ public class get {
prop.putSafeXML("posts_"+count+"_md5", serverCodings.encodeMD5Hex(bookmark.getUrl()));
prop.putSafeXML("posts_"+count+"_time", date);
prop.putSafeXML("posts_"+count+"_tags", bookmark.getTagsString().replaceAll(","," "));
// additional XML tags
prop.put("posts_"+count+"_isExtended",extendedXML ? 1:0);
if (extendedXML) {
prop.putSafeXML("posts_"+count+"_isExtended_private", Boolean.toString(!bookmark.getPublic()));
}
count++;
}
}

@ -1,5 +1,5 @@
<?xml version='1.0' standalone='yes'?>
<posts>
#{posts}#<post href="#[url]#" description="#[title]#" extended="#[description]#" hash="#[md5]#" tag="#[tags]#" time="#[time]#"/>
#{posts}#<post href="#[url]#" description="#[title]#" extended="#[description]#" hash="#[md5]#" tag="#[tags]#" time="#[time]#" #(isExtended)#::private="#[private]#"#(/isExtended)#/>
#{/posts}#
</posts>

@ -415,6 +415,7 @@ public class BookmarkService extends AbstractService {
// generating the template containing the network status information
serverObjects args = new serverObjects();
args.put("extendedXML", "");
if (tag != null) args.put("tag",tag);
if (date != null) args.put("date",date);

Loading…
Cancel
Save