added url to bookmark icon link

url is anyway needed, saves index lookup and works w/o commited url.
Removed unused order parameter
pull/1/head
reger 10 years ago
parent 5594c43d2e
commit ebe5faeb01

@ -88,6 +88,7 @@ import net.yacy.search.ranking.RankingProfile;
import net.yacy.server.serverObjects; import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch; import net.yacy.server.serverSwitch;
import net.yacy.server.servletProperties; import net.yacy.server.servletProperties;
import net.yacy.utils.crypt;
public class yacysearch { public class yacysearch {
@ -586,32 +587,27 @@ public class yacysearch {
prop.authenticationRequired(); prop.authenticationRequired();
return prop; return prop;
} }
final String bookmarkHash = post.get("bookmarkref", ""); // urlhash //final String bookmarkHash = post.get("bookmarkref", ""); // urlhash
try { final String urlstr = crypt.simpleDecode(post.get("bookmarkurl"));
final DigestURL url = indexSegment.fulltext().getURL(bookmarkHash); if (urlstr != null) {
if ( url != null ) { try {
try { final Bookmark bmk = sb.bookmarksDB.createBookmark(urlstr, YMarkTables.USER_ADMIN);
final Bookmark bmk = sb.bookmarksDB.createBookmark(url.toNormalform(true), YMarkTables.USER_ADMIN); bmk.setProperty(Bookmark.BOOKMARK_DESCRIPTION, "query="+querystring);
bmk.setProperty(Bookmark.BOOKMARK_DESCRIPTION, querystring); //bmk.setProperty(Bookmark.BOOKMARK_QUERY, originalquerystring);
//bmk.setProperty(Bookmark.BOOKMARK_QUERY, originalquerystring); bmk.addTag("/search"); // add to bookmark folder
bmk.addTag("/search"); // add to bookmark folder bmk.addTag("searchresult"); // add tag
bmk.addTag("searchresult"); // add tag sb.bookmarksDB.saveBookmark(bmk);
sb.bookmarksDB.saveBookmark(bmk);
// do the same for YMarks ?
// do the same for YMarks ? sb.tables.bookmarks.createBookmark(
sb.tables.bookmarks.createBookmark(
sb.loader, sb.loader,
url, urlstr,
ClientIdentification.yacyInternetCrawlerAgent, ClientIdentification.yacyInternetCrawlerAgent,
YMarkTables.USER_ADMIN, YMarkTables.USER_ADMIN,
true, true,
"searchresult", "searchresult",
"/search"); "/search");
} catch (final Throwable e ) { } catch (final Throwable e) { }
}
}
} catch (IOException e) {
ConcurrentLog.logException(e);
} }
} }

@ -144,7 +144,7 @@ public class yacysearchitem {
prop.put("content_authorized_bookmark", !bookmarkexists); prop.put("content_authorized_bookmark", !bookmarkexists);
// bookmark icon check for YMarks // bookmark icon check for YMarks
//prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1"); //prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");
prop.putHTML("content_authorized_bookmark_bookmarklink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&order=" + crypt.simpleEncode(theSearch.query.ranking.toExternalString()) + "&resource=" + resource + "&time=3&bookmarkref=" + urlhash + "&urlmaskfilter=.*"); prop.putHTML("content_authorized_bookmark_bookmarklink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&resource=" + resource + "&time=3&bookmarkref=" + urlhash + "&bookmarkurl=" + crypt.simpleEncode(resultUrlstring) + "&urlmaskfilter=.*");
prop.put("content_authorized_recommend", (sb.peers.newsPool.getSpecific(NewsPool.OUTGOING_DB, NewsPool.CATEGORY_SURFTIPP_ADD, "url", resultUrlstring) == null) ? "1" : "0"); prop.put("content_authorized_recommend", (sb.peers.newsPool.getSpecific(NewsPool.OUTGOING_DB, NewsPool.CATEGORY_SURFTIPP_ADD, "url", resultUrlstring) == null) ? "1" : "0");
prop.putHTML("content_authorized_recommend_deletelink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&order=" + crypt.simpleEncode(theSearch.query.ranking.toExternalString()) + "&resource=" + resource + "&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*"); prop.putHTML("content_authorized_recommend_deletelink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&order=" + crypt.simpleEncode(theSearch.query.ranking.toExternalString()) + "&resource=" + resource + "&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*");
prop.putHTML("content_authorized_recommend_recommendlink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&order=" + crypt.simpleEncode(theSearch.query.ranking.toExternalString()) + "&resource=" + resource + "&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*"); prop.putHTML("content_authorized_recommend_recommendlink", "yacysearch.html?query=" + origQ.replace(' ', '+') + "&Enter=Search&count=" + theSearch.query.itemsPerPage() + "&offset=" + (theSearch.query.neededResults() - theSearch.query.itemsPerPage()) + "&order=" + crypt.simpleEncode(theSearch.query.ranking.toExternalString()) + "&resource=" + resource + "&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*");

Loading…
Cancel
Save