yacy_search_server/htroot/DemoServletRDF.java

47 lines
1.0 KiB
Java
Raw Normal View History

2012-05-16 09:22:55 +02:00
import net.yacy.cora.protocol.RequestHeader;
2012-09-21 15:48:16 +02:00
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
2012-05-16 09:22:55 +02:00
public final class DemoServletRDF {
public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header,
final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {
2012-05-16 09:22:55 +02:00
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
// prop.put("temperature", "-10°C");
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
if (post != null) {
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
if (post.containsKey("submit")) {
prop.put("temperature", post.get("textthing"));
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
String filename= post.get("textthing");
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
// prop.put("imglink", filename+".jpg");
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
int counter = 0;
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
while (counter < 10) {
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
prop.put("localimg_"+counter+"_path","/"+filename);
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
prop.put("localimg_"+counter+"_checked", "2");
counter++;
}
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
prop.put("localimg", counter);
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
// prop.put("temperature",yacy.homedir+"/DATA/HTDOCS/"+filename);
}
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
}
2012-06-17 11:22:08 +02:00
2012-05-16 09:22:55 +02:00
// return rewrite properties
return prop;
}
}