Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new demonstration module for client-side key-value store (backend:
triplestore): /DemoServletInteraction.html Conflicts: source/net/yacy/interaction/Interaction.java
- Loading branch information
Showing
6 changed files
with
260 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>YaCy '#[clientname]#': Demo-Servlet</title> | ||
|
||
<!-- This element contains the jQuery libraries and interaction routines --> | ||
#%env/templates/metas.template%# | ||
|
||
</head> | ||
|
||
|
||
<body id="index"> | ||
|
||
<p> | ||
JavaScript example: Permanent storage of value | ||
</p> | ||
<br/> | ||
|
||
|
||
<p> | ||
|
||
<input id="SliderSingle" type="slider" name="price" value="0" /> | ||
|
||
<script type="text/javascript" charset="utf-8"> | ||
|
||
var oldvalue = loadvalue ('http://virtual.x/document/uniquenameDemo123', 'http://virtual.x/hasvalue'); | ||
|
||
if (oldvalue == "") { | ||
oldvalue = "0"; | ||
} | ||
|
||
document.getElementById('SliderSingle').value = oldvalue; | ||
|
||
$("#SliderSingle").slider( | ||
{ | ||
from: 0, | ||
to: 100, | ||
step: 2.5, | ||
round: 1, | ||
format: { format: '##.0', locale: 'de'}, | ||
dimension: ' points', | ||
skin: 'round', | ||
onstatechange: function(value) { | ||
|
||
storevalue ('http://virtual.x/document/uniquenameDemo123', 'http://virtual.x/hasvalue', value); | ||
|
||
} | ||
} | ||
); | ||
</script> | ||
|
||
|
||
</p> | ||
|
||
</body> | ||
|
||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import net.yacy.cora.protocol.RequestHeader; | ||
import de.anomic.data.BookmarkHelper; | ||
import de.anomic.server.serverObjects; | ||
import de.anomic.server.serverSwitch; | ||
|
||
public final class DemoServletInteraction { | ||
|
||
public static serverObjects respond(final RequestHeader header, | ||
final serverObjects post, final serverSwitch env) { | ||
// return variable that accumulates replacements | ||
final serverObjects prop = new serverObjects(); | ||
|
||
prop.put("temperature", "-10°C"); | ||
|
||
// return rewrite properties | ||
return prop; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"url": "#[url]#" | ||
"comment": "#[comment]#" | ||
"url": "#[url]#", | ||
"result": "#[result]#" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.