diff --git a/htroot/AugmentedBrowsingFilters_p.html b/htroot/AugmentedBrowsingFilters_p.html new file mode 100644 index 000000000..e135ea437 --- /dev/null +++ b/htroot/AugmentedBrowsingFilters_p.html @@ -0,0 +1,90 @@ + + + + YaCy '#[clientname]#': Augmented Browsing - Filters and Modules + #%env/templates/metas.template%# + + + #%env/templates/header.template%# + #%env/templates/submenuAugmentation.template%# +

Augmented Browsing - Filters and Modules

+ +
+
Augmented Browsing Filters +

+ Select the desired functionality. +

+ +
+ +
+
+ Enabled
+

+ Send webpages to REFLECT (http://reflect.ws/) +

+
+ + + +
+ +

+ Select the desired inbuilt functionality +

+ +
+ +
+
+ Enabled
+

+ Add DOCTYPE information if not given. This is required for IE to render position:absolute correctly. +

+
+ +
+
+ Enabled
+

+ Put webpage back into schema (htmlparser document) to allow node by node manipulation. +

+
+ + + + +
+ + + +
+
+ + + + #%env/templates/footer.template%# + + diff --git a/htroot/AugmentedBrowsingFilters_p.java b/htroot/AugmentedBrowsingFilters_p.java new file mode 100644 index 000000000..39b57d1e8 --- /dev/null +++ b/htroot/AugmentedBrowsingFilters_p.java @@ -0,0 +1,63 @@ +import net.yacy.cora.protocol.RequestHeader; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public final class AugmentedBrowsingFilters_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("augmentationFiltersSettings")) { + + env.setConfig("augmentation.reflect", "on".equals(post + .get("augmentedReflect")) ? true : false); + + env.setConfig("augmentation.addDoctype", "on".equals(post + .get("augmentedAddDoctype")) ? true : false); + + env.setConfig("augmentation.reparse", "on".equals(post + .get("augmentedReparse")) ? true : false); + +// env.setConfig("augmentation.reparse.adduniqueid", "on".equals(post +// .get("augmentedReparseAdduniqueid")) ? true : false); +// +// env.setConfig("augmentation.reparse.addserverinfo", "on".equals(post +// .get("augmentedReparseAddserver")) ? true : false); +// +// env.setConfig("augmentation.reparse.addrdf", "on".equals(post +// .get("augmentedReparseAddrdf")) ? true : false); + + } + + } + + prop.put("augmentedReflect_checked", + env.getConfigBool("augmentation.reflect", false) ? "1" : "0"); + + prop.put("augmentedAddDoctype_checked", + env.getConfigBool("augmentation.addDoctype", true) ? "1" : "0"); + + prop.put("augmentedReparse_checked", + env.getConfigBool("augmentation.reparse", true) ? "1" : "0"); + +// prop.put("augmentedReparseAdduniqueid_checked", +// env.getConfigBool("augmentation.reparse.adduniqueid", true) ? "1" : "0"); +// +// prop.put("augmentedReparseAddserver_checked", +// env.getConfigBool("augmentation.reparse.addserverinfo", true) ? "1" : "0"); +// +// prop.put("augmentedReparseAddrdf_checked", +// env.getConfigBool("augmentation.reparse.addrdf", true) ? "1" : "0"); + + + + // return rewrite properties + return prop; + } + +} diff --git a/htroot/AugmentedBrowsing_p.html b/htroot/AugmentedBrowsing_p.html new file mode 100644 index 000000000..2960aff2c --- /dev/null +++ b/htroot/AugmentedBrowsing_p.html @@ -0,0 +1,91 @@ + + + + YaCy '#[clientname]#': Augmented Browsing + #%env/templates/metas.template%# + + + #%env/templates/header.template%# + #%env/templates/submenuAugmentation.template%# +

Augmented Browsing

+ +
+
URL Proxy Settings +

+ With this settings you can activate or deactivate URL proxy which is the method used for augmentation. + Service call: http://localhost:8080/proxy.html?url=parameter, where parameter is the url of an external web page. +

+ +
+ +
+
+ Enabled
+

+ Globally enables or disables URL proxy via http://yourpeer:yourport/proxy.html?url=http://externalurl/ +

+
+ +
+
+ Enabled
+

+ Enables or disables URL proxy for all search results. If enabled, all search results will be tunneled through URL proxy. +

+
+ +
+
+

+

+ Define client filter. Default: 127.0.0.1,0:0:0:0:0:0:0:1. +

+
+
+
+

+

+ Define URL substitution rules which allow navigating in proxy environment. Possible values: all, domainlist. Default: domainlist. +

+
+ + +
+ + + +
+
+ + + +
+ +
Augmented Browsing Settings +

+ With this settings you can activate or deactivate augmented browsing which happens usually via the URL proxy. +

+ + +
+ +
+
+ Enabled
+

+ Enables or disables augmented browsing. If enabled, all websites will be modified during loading. +

+
+ + + +
+ + + +
+
+ + #%env/templates/footer.template%# + + diff --git a/htroot/AugmentedBrowsing_p.java b/htroot/AugmentedBrowsing_p.java new file mode 100644 index 000000000..d97b9780c --- /dev/null +++ b/htroot/AugmentedBrowsing_p.java @@ -0,0 +1,57 @@ +import net.yacy.cora.protocol.RequestHeader; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public final class AugmentedBrowsing_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("urlproxySettings")) { + + env.setConfig("proxyURL.access", post.get("urlproxyfilter")); + + env.setConfig("proxyURL.rewriteURLs", + post.get("urlproxydomains")); + + env.setConfig("proxyURL", + "on".equals(post.get("urlproxyenabled")) ? true : false); + + env.setConfig("proxyURL.useforresults", + "on".equals(post.get("urlproxyuseforresults")) ? true : false); + + } + + if (post.containsKey("augmentationSettings")) { + + env.setConfig("proxyAugmentation", "on".equals(post + .get("augmentationenabled")) ? true : false); + + } + + } + + prop.putHTML("urlproxyfilter", + env.getConfig("proxyURL.access", "127.0.0.1,0:0:0:0:0:0:0:1")); + + prop.putHTML("urlproxydomains", + env.getConfig("proxyURL.rewriteURLs", "domainlist")); + + prop.put("urlproxyenabled_checked", + env.getConfigBool("proxyURL", false) ? "1" : "0"); + + prop.put("urlproxyuseforresults_checked", + env.getConfigBool("proxyURL.useforresults", false) ? "1" : "0"); + + prop.put("augmentationenabled_checked", + env.getConfigBool("proxyAugmentation", false) ? "1" : "0"); + + // return rewrite properties + return prop; + } + +} diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index b4535f66a..f4f075a1c 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -23,6 +23,12 @@
  • Local Peer Wiki
  • +