Skip to content

Commit

Permalink
templates for embedded display. try:
Browse files Browse the repository at this point in the history
http://localhost:8080/yacysearch.html?display=2&input=0&search=yacy&resource=local

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3557 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 10, 2007
1 parent b79b408 commit 4eecf0b
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 50 deletions.
1 change: 1 addition & 0 deletions htroot/env/templates/embeddedfooter.template
@@ -0,0 +1 @@
</div>
1 change: 1 addition & 0 deletions htroot/env/templates/embeddedheader.template
@@ -0,0 +1 @@
<div style="clear:center; padding:10px;">
8 changes: 6 additions & 2 deletions htroot/index.html
Expand Up @@ -10,7 +10,9 @@
#(display)#
#%env/templates/simpleheader.template%#
::
#%env/templates/header.template%#
#%env/templates/header.template%#
::
#%env/templates/embeddedheader.template%#
#(/display)#

<h2 class="yacy">
Expand Down Expand Up @@ -113,7 +115,9 @@ <h2 class="yacy">
#(display)#
#%env/templates/simplefooter.template%#
::
#%env/templates/footer.template%#
#%env/templates/footer.template%#
::
#%env/templates/embeddedfooter.template%#
#(/display)#
</body>
</html>
18 changes: 13 additions & 5 deletions htroot/yacysearch.html
Expand Up @@ -16,8 +16,12 @@
#%env/templates/simpleheader.template%#
::
#%env/templates/header.template%#
::
#%env/templates/embeddedheader.template%#
#(/display)#

#(input)#
::
<form class="search small" action="yacysearch.html" method="get" accept-charset="UTF-8">
<p class="yacylogo"><a href="http://yacy.net/yacy/" class="yacylogo"><img src="/env/grafics/yacy.png" alt="yacy" /></a></p>
<h2>#[promoteSearchPageGreeting]#</h2>
Expand Down Expand Up @@ -53,7 +57,8 @@ <h2>#[promoteSearchPageGreeting]#</h2>
</fieldset>
</div>
</form>

#(/input)#

<script type="text/javascript">
document.getElementById("Enter").value = "search again - catch up more links";
</script>
Expand Down Expand Up @@ -199,14 +204,17 @@ <h4 class="linktitle"><a href="#[url]#">#[description]#</a></h4>
</table>
#(/type)#

<p class="info">
YaCy is a GPL'ed project with the target of implementing a P2P-based global search engine.<br />
Architecture (C) by Michael Peter Christen, <img src="/env/grafics/mcemailh.gif" alt="Mail-Adresse von Michael Peter Christen" />
</p>

#(display)#
<p class="info">
YaCy is a GPL'ed project with the target of implementing a P2P-based global search engine.<br />
Architecture (C) by Michael Peter Christen, <img src="/env/grafics/mcemailh.gif" alt="Mail-Adresse von Michael Peter Christen" />
</p>
#%env/templates/simplefooter.template%#
::
#%env/templates/footer.template%#
::
#%env/templates/embeddedfooter.template%#
#(/display)#

</body>
Expand Down
85 changes: 42 additions & 43 deletions htroot/yacysearch.java
Expand Up @@ -93,6 +93,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

boolean authenticated = sb.adminAuthenticated(header) >= 2;
int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
int input = (post == null) ? 0 : post.getInt("input", 1);
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH";

Expand All @@ -119,31 +120,31 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

// we create empty entries for template strings
final serverObjects prop = new serverObjects();
prop.putASIS("promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("former", "");
prop.put("count", 10);
prop.put("order", plasmaSearchPreOrder.canUseYBR() ? "YBR-Date-Quality" : "Date-Quality-YBR");
prop.put("resource", "global");
prop.put("time", 6);
prop.put("urlmaskfilter", ".*");
prop.put("prefermaskfilter", "");
prop.put("indexof", "off");
prop.put("constraint", plasmaSearchQuery.catchall_constraint.exportB64());
prop.put("cat", "href");
prop.put("depth", "0");
prop.put("type", 0);
prop.put("type_excluded", 0);
prop.put("type_num-results", 0);
prop.put("type_combine", 0);
prop.put("type_resultbottomline", 0);
prop.put("type_results", "");
prop.put("display", display);
prop.put("contentdom", "text");
prop.put("contentdomCheckText", 1);
prop.put("contentdomCheckAudio", 0);
prop.put("contentdomCheckVideo", 0);
prop.put("contentdomCheckImage", 0);
prop.put("contentdomCheckApp", 0);
prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", "");
prop.put("input_count", 10);
prop.put("input_resource", "global");
prop.put("input_time", 6);
prop.put("input_urlmaskfilter", ".*");
prop.put("input_prefermaskfilter", "");
prop.put("input_indexof", "off");
prop.put("input_constraint", plasmaSearchQuery.catchall_constraint.exportB64());
prop.put("input_cat", "href");
prop.put("input_depth", "0");
prop.put("input_type", 0);
prop.put("input_type_excluded", 0);
prop.put("input_type_num-results", 0);
prop.put("input_type_combine", 0);
prop.put("input_type_resultbottomline", 0);
prop.put("input_type_results", "");
prop.put("input_contentdom", "text");
prop.put("input_contentdomCheckText", 1);
prop.put("input_contentdomCheckAudio", 0);
prop.put("input_contentdomCheckVideo", 0);
prop.put("input_contentdomCheckImage", 0);
prop.put("input_contentdomCheckApp", 0);
prop.put("input", 0);
return prop;
}

Expand All @@ -157,7 +158,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
if (sb.facilityDB != null) try { sb.facilityDB.update("zeitgeist", querystring, post); } catch (Exception e) {}

int count = Integer.parseInt(post.get("count", "10"));
final String order = post.get("order", plasmaSearchPreOrder.canUseYBR() ? "YBR-Date-Quality" : "Date-Quality-YBR");
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean indexof = post.get("indexof","").equals("on");
final long searchtime = 1000 * Long.parseLong(post.get("time", "10"));
Expand Down Expand Up @@ -398,7 +398,6 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("type_combine_words_" + hintcount + "_word", word);
prop.put("type_combine_words_" + hintcount + "_newsearch", post.get("search", "").replace(' ', '+') + "+" + word);
prop.put("type_combine_words_" + hintcount + "_count", count);
prop.put("type_combine_words_" + hintcount + "_order", order);
prop.put("type_combine_words_" + hintcount + "_resource", ((global) ? "global" : "local"));
prop.put("type_combine_words_" + hintcount + "_time", (searchtime / 1000));
}
Expand Down Expand Up @@ -489,24 +488,24 @@ else if (yacyonline) {
for (int i=0; i<linkcount; i++)
prop.put("type_results_" + i + "_authorized", (authenticated) ? 1 : 0);

prop.putASIS("promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("former", post.get("search", ""));
prop.put("count", count);
prop.put("order", order);
prop.put("resource", (global) ? "global" : "local");
prop.put("time", searchtime / 1000);
prop.put("urlmaskfilter", urlmask);
prop.put("prefermaskfilter", prefermask);
prop.put("display", display);
prop.put("indexof", (indexof) ? "on" : "off");
prop.put("constraint", constraint.exportB64());
prop.put("contentdom", contentdomString);
prop.put("contentdomCheckText", (contentdomCode == plasmaSearchQuery.CONTENTDOM_TEXT) ? 1 : 0);
prop.put("contentdomCheckAudio", (contentdomCode == plasmaSearchQuery.CONTENTDOM_AUDIO) ? 1 : 0);
prop.put("contentdomCheckVideo", (contentdomCode == plasmaSearchQuery.CONTENTDOM_VIDEO) ? 1 : 0);
prop.put("contentdomCheckImage", (contentdomCode == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 1 : 0);
prop.put("contentdomCheckApp", (contentdomCode == plasmaSearchQuery.CONTENTDOM_APP) ? 1 : 0);

prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", post.get("search", ""));
prop.put("input_count", count);
prop.put("input_resource", (global) ? "global" : "local");
prop.put("input_time", searchtime / 1000);
prop.put("input_urlmaskfilter", urlmask);
prop.put("input_prefermaskfilter", prefermask);
prop.put("input_indexof", (indexof) ? "on" : "off");
prop.put("input_constraint", constraint.exportB64());
prop.put("input_contentdom", contentdomString);
prop.put("input_contentdomCheckText", (contentdomCode == plasmaSearchQuery.CONTENTDOM_TEXT) ? 1 : 0);
prop.put("input_contentdomCheckAudio", (contentdomCode == plasmaSearchQuery.CONTENTDOM_AUDIO) ? 1 : 0);
prop.put("input_contentdomCheckVideo", (contentdomCode == plasmaSearchQuery.CONTENTDOM_VIDEO) ? 1 : 0);
prop.put("input_contentdomCheckImage", (contentdomCode == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 1 : 0);
prop.put("input_contentdomCheckApp", (contentdomCode == plasmaSearchQuery.CONTENTDOM_APP) ? 1 : 0);
prop.put("input", input);

// return rewrite properties
return prop;
}
Expand Down

0 comments on commit 4eecf0b

Please sign in to comment.