summaryrefslogtreecommitdiff
path: root/htroot
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2005-07-29 14:10:19 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2005-07-29 14:10:19 +0000
commit60117a2073f74751b632409eb41fdb41d1677d2f (patch)
treed09cf3d317a3938c8a9bb1e95516552ed75eaa41 /htroot
parentb8e294f149e87ccb78cb03eb5e6aed6851ec1cb2 (diff)
integrated YaCyNews basis
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@455 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
-rw-r--r--htroot/Help.html3
-rw-r--r--htroot/News.html67
-rw-r--r--htroot/News.java96
-rw-r--r--htroot/env/templates/header.template3
4 files changed, 167 insertions, 2 deletions
diff --git a/htroot/Help.html b/htroot/Help.html
index 461f6dfcd..2875acc61 100644
--- a/htroot/Help.html
+++ b/htroot/Help.html
@@ -63,7 +63,8 @@ You may want to use accesskeys to navigate through the YaCy webinterface:<p>
<li> All OS and Amaya: Strg + Accesskey<p>
s --> Search Page<br>
-n --> Network<br>
+n --> News<br>
+w --> Network<br>
t --> Status<br>
#[footer]#
diff --git a/htroot/News.html b/htroot/News.html
new file mode 100644
index 000000000..5e0d166e0
--- /dev/null
+++ b/htroot/News.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>YaCy: News</title>
+#[metas]#
+</head>
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+#[header]#
+<table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu">
+<tr height="10"><td colspan="9" class="MenuHeader">&nbsp;Network Menu</td></tr>
+<tr height="2"><td colspan="9"></td></tr>
+<tr class="TableHeader">
+<td width="20%" class="MenuSubItem">&nbsp;&nbsp;<a href="/News.html" class="MenuItemLink">News&nbsp;Overview</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="20%" class="MenuSubItem">&nbsp;&nbsp;<a href="/News.html?page=1" class="MenuItemLink">Incoming&nbsp;News</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="20%" class="MenuSubItem">&nbsp;&nbsp;<a href="/News.html?page=2" class="MenuItemLink">Processed&nbsp;News</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="20%" class="MenuSubItem">&nbsp;&nbsp;<a href="/News.html?page=3" class="MenuItemLink">Outgoing&nbsp;News</a>&nbsp;</td>
+<td class="MenuSubSpacer"></td>
+<td width="20%" class="MenuSubItem">&nbsp;&nbsp;<a href="/News.html?page=4" class="MenuItemLink">Published&nbsp;News</a>&nbsp;</td>
+</tr>
+</table>
+<br>
+#(page)#
+<h2>News Overview</h2>
+::
+<h2>Incoming&nbsp;News</h2>
+::
+<h2>Processed&nbsp;News</h2>
+::
+<h2>Outgoing&nbsp;News</h2>
+::
+<h2>Published&nbsp;News</h2>
+#(/page)#
+<p>
+#(table)#
+<p>
+This is the news system (currently under testing).
+</p>
+::
+<p>
+<table border="0" cellpadding="2" cellspacing="1">
+<tr class="TableHeader" valign="bottom">
+<td class="small">Originator</td>
+<td class="small">Created</td>
+<td class="small">Category</td>
+<td class="small">Received</td>
+<td class="small">Distributed</td>
+<td class="small">Attributes</td>
+</tr>
+#{list}#
+<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
+<td class="small" align="right">#[ori]#</td>
+<td class="small" align="right">#[cre]#</td>
+<td class="small" align="right">#[cat]#</td>
+<td class="small" align="right">#[rec]#</td>
+<td class="small" align="right">#[dis]#</td>
+<td class="small" align="right">#[att]#</td>
+</tr>
+#{/list}#
+</table>
+</p>
+#(/table)#
+#[footer]#
+</body>
+</html>
diff --git a/htroot/News.java b/htroot/News.java
new file mode 100644
index 000000000..cc16a8708
--- /dev/null
+++ b/htroot/News.java
@@ -0,0 +1,96 @@
+// News.java
+// -----------------------
+// part of YaCy
+// (C) by Michael Peter Christen; mc@anomic.de
+// first published on http://www.anomic.de
+// Frankfurt, Germany, 2005
+// last major change: 29.07.2005
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Using this software in any meaning (reading, learning, copying, compiling,
+// running) means that you agree that the Author(s) is (are) not responsible
+// for cost, loss of data or any harm that may be caused directly or indirectly
+// by usage of this softare or this documentation. The usage of this software
+// is on your own risk. The installation and usage (starting/running) of this
+// software may allow other people or application to access your computer and
+// any attached devices and is highly dependent on the configuration of the
+// software which must be done by the user of the software; the author(s) is
+// (are) also not responsible for proper configuration and usage of the
+// software, even if provoked by documentation provided together with
+// the software.
+//
+// Any changes to this file according to the GPL as documented in the file
+// gpl.txt aside this file in the shipment you received can be done to the
+// lines that follows this copyright notice here, but changes must not be
+// done inside the copyright notive above. A re-distribution must contain
+// the intact and unchanged copyright notice.
+// Contributions and changes to the program code must be marked as such.
+
+// You must compile this file with
+// javac -classpath .:../classes Network.java
+// if the shell's current path is HTROOT
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.io.IOException;
+
+import de.anomic.http.httpHeader;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+import de.anomic.server.serverDate;
+import de.anomic.yacy.yacyCore;
+import de.anomic.yacy.yacyNewsRecord;
+
+public class News {
+
+ public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
+ // return variable that accumulates replacements
+ serverObjects prop = new serverObjects();
+ boolean overview = (post == null) || (((String) post.get("page", "0")).equals("0"));
+
+ if (overview) {
+ // show overview
+ prop.put("table", 0);
+ prop.put("page", 0);
+ } else {
+ // generate table
+ int tableID = Integer.parseInt((String) post.get("page", "1")) - 1;
+ prop.put("table", 1);
+ prop.put("page", tableID + 1);
+
+ if (yacyCore.seedDB == null) {
+
+ } else {
+ int maxCount = yacyCore.newsPool.size(tableID);
+ if (maxCount > 500) maxCount = 500;
+
+ yacyNewsRecord record;
+ for (int i = 0; i < maxCount; i++) try {
+ record = yacyCore.newsPool.get(tableID, i);
+ prop.put("table_list_" + i + "_ori", record.originator());
+ prop.put("table_list_" + i + "_cre", yacyCore.universalDateShortString(record.created()));
+ prop.put("table_list_" + i + "_cat", record.category());
+ prop.put("table_list_" + i + "_rec", record.received());
+ prop.put("table_list_" + i + "_dis", record.attributes().toString());
+ } catch (IOException e) {e.printStackTrace();}
+ prop.put("table_list", maxCount);
+ }
+ }
+ // return rewrite properties
+ return prop;
+ }
+
+}
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 479f396ef..14515d4c5 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -59,7 +59,8 @@
<tr><td class="MenuHeader">&nbsp;Peer&nbsp;Control</td></tr>
<tr><td class="MenuItem">&nbsp;<a href="/Status.html" accesskey="t" class="MenuItemLink">Status</a></td></tr>
- <tr><td class="MenuItem">&nbsp;<a href="/Network.html" accesskey="n" class="MenuItemLink">Network</a></td></tr>
+ <tr><td class="MenuItem">&nbsp;<a href="/News.html" accesskey="n" class="MenuItemLink">News</a></td></tr>
+ <tr><td class="MenuItem">&nbsp;<a href="/Network.html" accesskey="w" class="MenuItemLink">Network</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/ViewLog_p.html" class="MenuItemLink">Log</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/Settings_p.html" class="MenuItemLink">Settings</a></td></tr>
<tr><td class="MenuItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;<a href="/Performance_p.html" class="MenuItemLink">Performance</a></td></tr>