From f0833b0328282a2e20512742d8a24eb1cb9f8fd0 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 6 Apr 2006 21:48:24 +0000 Subject: [PATCH] introduced simple search interface git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2007 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- build.properties | 2 +- htroot/env/templates/header.template | 2 +- htroot/env/templates/simplefooter.template | 6 +++ htroot/env/templates/simpleheader.template | 27 +++++++++++ htroot/index.html | 30 ++++++++---- htroot/index.java | 46 +++++++++++-------- htroot/yacysearch.html | 12 ++++- htroot/yacysearch.java | 5 ++ .../de/anomic/plasma/plasmaSwitchboard.java | 3 ++ 9 files changed, 101 insertions(+), 32 deletions(-) create mode 100644 htroot/env/templates/simplefooter.template create mode 100644 htroot/env/templates/simpleheader.template diff --git a/build.properties b/build.properties index 85db3bd12..f7aae6a4b 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ javacSource=1.4 javacTarget=1.4 # Release Configuration -releaseVersion=0.442 +releaseVersion=0.443 releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz #releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr} diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 2d0e025ce..2315c946e 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -26,7 +26,7 @@ - + diff --git a/htroot/env/templates/simplefooter.template b/htroot/env/templates/simplefooter.template new file mode 100644 index 000000000..45eab8fd7 --- /dev/null +++ b/htroot/env/templates/simplefooter.template @@ -0,0 +1,6 @@ +

+ + + + + diff --git a/htroot/env/templates/simpleheader.template b/htroot/env/templates/simpleheader.template new file mode 100644 index 000000000..59dfe43a6 --- /dev/null +++ b/htroot/env/templates/simpleheader.template @@ -0,0 +1,27 @@ + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
\ No newline at end of file diff --git a/htroot/index.html b/htroot/index.html index 349370f86..f2409eac5 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -6,12 +6,17 @@ +#(display)# +#%env/templates/simpleheader.template%# +:: #%env/templates/header.template%# +#(/display)#
Kaskelix - the YaCy logo
P2P WEB SEARCH

#[promoteSearchPageGreeting]#

+
@@ -22,9 +27,18 @@

- - + + #(searchoptions)# + + + + +

+ + + + :: + #(/searchoptions)#
more options...
Max. number of results: @@ -92,17 +106,15 @@ #(/urlmaskoptions)#
-







-
-
YaCy is a GPL'ed project -with the target of implementing a P2P-based global search engine.
-Architecture (C) by Michael Peter Christen, -
- +#(display)# +#%env/templates/simplefooter.template%# +:: #%env/templates/footer.template%# +#(/display)# \ No newline at end of file diff --git a/htroot/index.java b/htroot/index.java index f312fe04c..478b1ad2a 100644 --- a/htroot/index.java +++ b/htroot/index.java @@ -64,7 +64,10 @@ public class index { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { final plasmaSwitchboard sb = (plasmaSwitchboard) env; + boolean authenticated = sb.adminAuthenticated(header) >= 2; + int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0); boolean global = (post == null) ? true : post.get("resource", "global").equals("global"); + int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0); final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true"); final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true"); if (!indexDistributeGranted || !indexReceiveGranted) { global = false; } @@ -96,30 +99,33 @@ public class index { prop.put("excluded", 0); prop.put("combine", 0); prop.put("resultbottomline", 0); - prop.put("count-10", 1); - prop.put("count-50", 0); - prop.put("count-100", 0); - prop.put("count-1000", 0); - prop.put("order-ybr-date-quality", plasmaSearchPreOrder.canUseYBR() ? 1 : 0); - prop.put("order-ybr-quality-date", 0); - prop.put("order-date-ybr-quality", 0); - prop.put("order-quality-ybr-date", 0); - prop.put("order-date-quality-ybr", plasmaSearchPreOrder.canUseYBR() ? 0 : 1); - prop.put("order-quality-date-ybr", 0); - prop.put("resource-global", ((global) ? 1 : 0)); - prop.put("resource-local", ((global) ? 0 : 1)); - prop.put("time-1", 0); - prop.put("time-3", 0); - prop.put("time-6", 1); - prop.put("time-10", 0); - prop.put("time-30", 0); - prop.put("time-60", 0); + prop.put("searchoptions", searchoptions); + prop.put("searchoptions_count-10", 1); + prop.put("searchoptions_count-50", 0); + prop.put("searchoptions_count-100", 0); + prop.put("searchoptions_count-1000", 0); + prop.put("searchoptions_order-ybr-date-quality", plasmaSearchPreOrder.canUseYBR() ? 1 : 0); + prop.put("searchoptions_order-ybr-quality-date", 0); + prop.put("searchoptions_order-date-ybr-quality", 0); + prop.put("searchoptions_order-quality-ybr-date", 0); + prop.put("searchoptions_order-date-quality-ybr", plasmaSearchPreOrder.canUseYBR() ? 0 : 1); + prop.put("searchoptions_order-quality-date-ybr", 0); + prop.put("searchoptions_resource-global", ((global) ? 1 : 0)); + prop.put("searchoptions_resource-local", ((global) ? 0 : 1)); + prop.put("searchoptions_time-1", 0); + prop.put("searchoptions_time-3", 0); + prop.put("searchoptions_time-6", 1); + prop.put("searchoptions_time-10", 0); + prop.put("searchoptions_time-30", 0); + prop.put("searchoptions_time-60", 0); + prop.put("searchoptions_urlmaskoptions", 0); + prop.put("searchoptions_urlmaskoptions_urlmaskfilter", ".*"); prop.put("results", ""); - prop.put("urlmaskoptions", 0); - prop.put("urlmaskoptions_urlmaskfilter", ".*"); prop.put("cat", "href"); prop.put("type", "0"); prop.put("depth", "0"); + prop.put("display", display); + prop.put("searchoptions_display", display); return prop; } diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 97331dc95..25627bdc9 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -10,8 +10,13 @@ - + + +#(display)# +#%env/templates/simpleheader.template%# +:: #%env/templates/header.template%# +#(/display)#