Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Add Triplestore settings functionality

cominche859481889cf
diff --git a/htroot/Triple_p.csv b/htroot/Triple_p.csv
new file mode 100644
index 000000000..f02195fc5
--- /dev/null
+++ b/htroot/Triple_p.csv
@@ -0,0 +1,2 @@
+#{entries}##[s]#;#[p]#;#[o]#
+#{/entries}#
\ No newline at end of file
diff --git a/htroot/Triple_p.html b/htroot/Triple_p.html
index 0765ebd0f..ba8a59636 100644
--- a/htroot/Triple_p.html
+++ b/htroot/Triple_p.html
@@ -10,6 +10,7 @@
<body id="Experiments">
#%env/templates/header.template%#
+ #%env/templates/submenuTriplestore.template%#
#(mode)#
diff --git a/htroot/Triplestore_p.html b/htroot/Triplestore_p.html
new file mode 100644
index 000000000..c01f9700c
--- /dev/null
+++ b/htroot/Triplestore_p.html
@@ -0,0 +1,55 @@
+<!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]#': Triplestore</title>
+ #%env/templates/metas.template%#
+ </head>
+ <body id="Settings">
+ #%env/templates/header.template%#
+ #%env/templates/submenuTriplestore.template%#
+ <h2>Triplestore</h2>
+
+ <form id="parsersettings" action="Triplestore_p.html" method="post" enctype="multipart/form-data">
+<fieldset><legend id="urlproxy">Triplestore</legend>
+<p>
+ With this settings you change the behavior of the jena-based Triplestore.
+</p>
+
+ <dl>
+
+ <dt><label for="content">Persistent store:</label></dt>
+ <dd>
+ <input type="checkbox" name="tspersistentenabled" id="tspersistentenabled" #(tspersistentenabled_checked)#:: checked="checked"#(/tspersistentenabled_checked)# />Enabled<br/>
+ <p class="help">
+ If enabled, the Triplestore will save its content on shutdown on the filesystem and load it again on startup.
+ </p>
+ </dd>
+
+ <!-- <dt><label for="author">Forward feedback to peer:</label></dt>
+ <dd>
+ <input type="text" name="feedbackforward" value="#[feedbackforward]#" size="60" /><br/><br/>
+ <p class="help">
+ Feedback is forwarded to this peer.
+ </p>
+ </dd>
+
+ <dt><label for="content">Store Feedback on this peer:</label></dt>
+ <dd>
+ <input type="checkbox" name="acceptfeedbackenabled" id="acceptfeedbackenabled" #(acceptfeedbackenabled_checked)#:: checked="checked"#(/acceptfeedbackenabled_checked)# />Enabled<br/>
+ <p class="help">
+ If enabled, this peer will accept Feedback items and will NOT forward them.
+ </p>
+ </dd> -->
+
+
+ </dl>
+
+
+ <input type="submit" name="tsSettings" value="Submit"/>
+</fieldset>
+</form>
+
+
+ #%env/templates/footer.template%#
+ </body>
+</html>
diff --git a/htroot/Triplestore_p.java b/htroot/Triplestore_p.java
new file mode 100644
index 000000000..58bf82e91
--- /dev/null
+++ b/htroot/Triplestore_p.java
@@ -0,0 +1,38 @@
+import net.yacy.cora.protocol.RequestHeader;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public final class Triplestore_p {
+
+ public static serverObjects respond(final RequestHeader header,
+ final serverObjects post, final serverSwitch env) {
+ // return variable that accumulates replacements
+ final serverObjects prop = new serverObjects();
+
+ if (post != null) {
+
+ if (post.containsKey("tsSettings")) {
+
+ env.setConfig("triplestore.persistent",
+ "on".equals(post.get("tspersistentenabled")) ? true : false);
+
+// env.setConfig("interaction.feedback.accept",
+// "on".equals(post.get("acceptfeedbackenabled")) ? true : false);
+
+ }
+
+
+ }
+
+ prop.put("tspersistentenabled_checked",
+ env.getConfigBool("triplestore.persistent", false) ? "1" : "0");
+
+// prop.put("acceptfeedbackenabled_checked",
+// env.getConfigBool("interaction.feedback.accept", false) ? "1" : "0");
+
+
+ // return rewrite properties
+ return prop;
+ }
+
+}
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index f4f075a1c..852521b42 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -25,8 +25,11 @@
</li>
<li class="menugroup" id="menugroupInteraction">
<h3>Interaction</h3>
- <ul class="menu">
- <li><a href="/AugmentedBrowsing_p.html" class="MenuItemLink">Augmented Browsing</a></li>
+ <ul class="menu">
+ <li><a href="/AugmentedBrowsing_p.html" class="MenuItemLink lock">Augmented Browsing</a></li>
+ <li><a href="/Autocrawler_p.html" class="MenuItemLink lock">Auto Crawler</a></li>
+ <li><a href="/Feedback_p.html" class="MenuItemLink lock">Feedback</a></li>
+ <li><a href="/Triplestore_p.html" class="MenuItemLink lock">Triplestore</a></li>
</ul>
</li>
<li class="menugroup" id="menugroupCrawlerControl">
diff --git a/htroot/env/templates/submenuTriplestore.template b/htroot/env/templates/submenuTriplestore.template
new file mode 100644
index 000000000..d3598018e
--- /dev/null
+++ b/htroot/env/templates/submenuTriplestore.template
@@ -0,0 +1,7 @@
+<div class="SubMenu">
+ <h3>Triplestore</h3>
+ <ul class="SubMenu">
+ <li><a href="Triplestore_p.html" class="MenuItemLink lock">Triplestore</a></li>
+ <li><a href="Triple_p.html" class="MenuItemLink lock">Query</a></li>
+ </ul>
+</div>
\ No newline at end of file