git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5536 6c8d7289-2bf4-0310-a012-ef5d649a1542
parent
08ed14603e
commit
3905caf8a1
@ -1,33 +0,0 @@
|
|||||||
|
|
||||||
import de.anomic.http.httpRequestHeader;
|
|
||||||
import de.anomic.plasma.plasmaSwitchboard;
|
|
||||||
import de.anomic.server.serverObjects;
|
|
||||||
import de.anomic.server.serverSwitch;
|
|
||||||
import de.anomic.data.bookmarksDB.Bookmark;
|
|
||||||
|
|
||||||
|
|
||||||
public class addTag {
|
|
||||||
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
||||||
|
|
||||||
final plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
|
|
||||||
final serverObjects prop = new serverObjects();
|
|
||||||
boolean isAdmin = false;
|
|
||||||
isAdmin = switchboard.verifyAuthentication(header, true);
|
|
||||||
|
|
||||||
prop.put("result", "0");//error
|
|
||||||
//rename tags
|
|
||||||
if(post != null && isAdmin) {
|
|
||||||
if (post.containsKey("selectTag") && post.containsKey("addTag")) {
|
|
||||||
switchboard.bookmarksDB.addTag(post.get("selectTag"), post.get("addTag"));
|
|
||||||
prop.put("result", "1");//success
|
|
||||||
} else if (post.containsKey("urlhash") && post.containsKey("addTag")) {
|
|
||||||
final Bookmark bm = switchboard.bookmarksDB.getBookmark(post.get("urlhash"));
|
|
||||||
bm.addTag(post.get("addTag"));
|
|
||||||
prop.put("result", "1");//success
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// return rewrite properties
|
|
||||||
return prop;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<?xml version='1.0' encoding="UTF-8" standalone='yes'?>
|
|
||||||
<result>#(result)#something went wrong::done#(/result)#</result>
|
|
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
import de.anomic.http.httpRequestHeader;
|
|
||||||
import de.anomic.plasma.plasmaSwitchboard;
|
|
||||||
import de.anomic.server.serverObjects;
|
|
||||||
import de.anomic.server.serverSwitch;
|
|
||||||
|
|
||||||
public class editTag {
|
|
||||||
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
||||||
|
|
||||||
final plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
|
|
||||||
final serverObjects prop = new serverObjects();
|
|
||||||
boolean isAdmin = false;
|
|
||||||
isAdmin = switchboard.verifyAuthentication(header, true);
|
|
||||||
|
|
||||||
prop.put("result", "0");//error
|
|
||||||
//rename tags
|
|
||||||
if(post != null && isAdmin && post.containsKey("old") && post.containsKey("new")){
|
|
||||||
if(switchboard.bookmarksDB.renameTag(post.get("old"), post.get("new")))
|
|
||||||
prop.put("result", "1");//success
|
|
||||||
}
|
|
||||||
// return rewrite properties
|
|
||||||
return prop;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<?xml version='1.0' encoding="UTF-8" standalone='yes'?>
|
|
||||||
<result>#(result)#something went wrong::done#(/result)#</result>
|
|
@ -1,22 +0,0 @@
|
|||||||
|
|
||||||
import de.anomic.http.httpRequestHeader;
|
|
||||||
import de.anomic.plasma.plasmaSwitchboard;
|
|
||||||
import de.anomic.server.serverObjects;
|
|
||||||
import de.anomic.server.serverSwitch;
|
|
||||||
|
|
||||||
public class rename_p {
|
|
||||||
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
||||||
// return variable that accumulates replacements
|
|
||||||
final plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
|
|
||||||
final serverObjects prop = new serverObjects();
|
|
||||||
prop.put("result", "0");//error
|
|
||||||
//rename tags
|
|
||||||
if(post != null && post.containsKey("old") && post.containsKey("new")){
|
|
||||||
if(switchboard.bookmarksDB.renameTag(post.get("old"), post.get("new")))
|
|
||||||
prop.put("result", "1");//success
|
|
||||||
}
|
|
||||||
// return rewrite properties
|
|
||||||
return prop;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<?xml version='1.0' encoding="UTF-8" standalone='yes'?>
|
|
||||||
<result>#(result)#something went wrong::done#(/result)#</result>
|
|
Loading…
Reference in new issue