This function provides an URL filter to the proxy; any blacklisted URL is blocked
@@ -116,6 +116,6 @@ File:
#(/status)#
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/CacheAdmin_p.html b/htroot/CacheAdmin_p.html
index 010c619a7..a0489d5d0 100644
--- a/htroot/CacheAdmin_p.html
+++ b/htroot/CacheAdmin_p.html
@@ -2,10 +2,10 @@
YaCy '#[clientname]#': Local Cache Management
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Local Cache
@@ -21,6 +21,6 @@ The current cache size is #[cachesize]# KB. The maximum cache size is #[cachemax
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/Config_p.html b/htroot/Config_p.html
index b9ef6bff1..9538437b3 100644
--- a/htroot/Config_p.html
+++ b/htroot/Config_p.html
@@ -2,7 +2,7 @@
YaCy '#[clientname]#': Advanced Config
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Advanced Config
@@ -32,6 +32,6 @@ For explanation please look into yacy.init
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/Connections_p.html b/htroot/Connections_p.html
index f13af8523..739d55e4d 100644
--- a/htroot/Connections_p.html
+++ b/htroot/Connections_p.html
@@ -2,11 +2,11 @@
Showing #[numActiveRunning]# active connections, #[numActivePending]# pending connections from a max. of #[numMax]# allowed incoming connections.
@@ -32,7 +32,7 @@
-#[footer]#
+#%env/templates/footer.template%#
\ No newline at end of file
diff --git a/htroot/CookieMonitorIncoming_p.html b/htroot/CookieMonitorIncoming_p.html
index 2f2007f3e..a94525d67 100644
--- a/htroot/CookieMonitorIncoming_p.html
+++ b/htroot/CookieMonitorIncoming_p.html
@@ -2,11 +2,11 @@
YaCy '#[clientname]#': Incoming Cookies Monitor
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
-#[submenuCookie]#
+#%env/templates/header.template%#
+#%env/templates/submenuCookie.template%#
Cookie Monitor: Incoming Cookies
@@ -30,6 +30,6 @@ Showing #[num]# entries from a total of #[total]# Cookies.
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/CookieMonitorOutgoing_p.html b/htroot/CookieMonitorOutgoing_p.html
index df673096c..ae6371592 100644
--- a/htroot/CookieMonitorOutgoing_p.html
+++ b/htroot/CookieMonitorOutgoing_p.html
@@ -2,11 +2,11 @@
YaCy '#[clientname]#': Outgoing Cookies Monitor
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
-#[submenuCookie]#
+#%env/templates/header.template%#
+#%env/templates/submenuCookie.template%#
Cookie Monitor: Outgoing Cookies
@@ -30,6 +30,6 @@ Showing #[num]# entries from a total of #[total]# Cookies.
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/EditProfile_p.html b/htroot/EditProfile_p.html
index 3432d7394..ded879c5d 100644
--- a/htroot/EditProfile_p.html
+++ b/htroot/EditProfile_p.html
@@ -2,10 +2,10 @@
YaCy '#[clientname]#': Your Personal Profile
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Your Personal Profile
@@ -70,7 +70,7 @@ You do not need to provide any personal data here, but if you want to distribute
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/Help.html b/htroot/Help.html
index 4bc0e5470..71306d3ee 100644
--- a/htroot/Help.html
+++ b/htroot/Help.html
@@ -2,10 +2,10 @@
YaCy: Help
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Help
@@ -105,6 +105,6 @@ This matches heise.de/ with a string in front of it, for example "http://www.",
A possible URL which would match this regexp is: http://www.heise.de/newsticker/meldung/59421
An URL which would not match is: http://www.heise.de/tp/r4/artikel/20/20701/1.html
There is ".html" at the end, which is not included with the Regular Expression.
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/IndexControl_p.html b/htroot/IndexControl_p.html
index 14822f817..77cf1b3ae 100644
--- a/htroot/IndexControl_p.html
+++ b/htroot/IndexControl_p.html
@@ -2,10 +2,10 @@
YaCy '#[clientname]#': Index Control
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Index Administration
@@ -97,6 +97,6 @@ The DHT-rules do not work without this function.
#[result]#
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/IndexCreateIndexingQueue_p.html b/htroot/IndexCreateIndexingQueue_p.html
index 30e7253db..b43c518a2 100644
--- a/htroot/IndexCreateIndexingQueue_p.html
+++ b/htroot/IndexCreateIndexingQueue_p.html
@@ -2,11 +2,11 @@
YaCy '#[clientname]#': Index Creation/Indexing Queue
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
-#[submenuIndexCreate]#
+#%env/templates/header.template%#
+#%env/templates/submenuIndexCreate.template%#
Index Creation: Indexing Queue
@@ -77,6 +77,6 @@ There are #[num]# entries in the rejected-queue:
#(/rejected)#
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/IndexCreateLoaderQueue_p.html b/htroot/IndexCreateLoaderQueue_p.html
index 3f4d71a2d..300efdee9 100644
--- a/htroot/IndexCreateLoaderQueue_p.html
+++ b/htroot/IndexCreateLoaderQueue_p.html
@@ -2,11 +2,11 @@
YaCy '#[clientname]#': Index Creation / Loader Queue
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
-#[submenuIndexCreate]#
+#%env/templates/header.template%#
+#%env/templates/submenuIndexCreate.template%#
Index Creation: Loader Queue
@@ -32,6 +32,6 @@ There are #[num]# entries in the loader set:
#(/loader-set)#
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/IndexCreateWWWGlobalQueue_p.html b/htroot/IndexCreateWWWGlobalQueue_p.html
index 83dbb214e..fcd6824b7 100644
--- a/htroot/IndexCreateWWWGlobalQueue_p.html
+++ b/htroot/IndexCreateWWWGlobalQueue_p.html
@@ -2,11 +2,11 @@
YaCy '#[clientname]#': Index Creation / WWW Global Crawl Queue
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
-#[submenuIndexCreate]#
+#%env/templates/header.template%#
+#%env/templates/submenuIndexCreate.template%#
Index Creation: WWW Global Crawl Queue
@@ -45,6 +45,6 @@ There are #[num]# entries in the global crawler queue. Showing #[show-num]# most
#(/crawler-queue)#
This is the configuration page for YaCy. Access to this page should be limited to an administration person only.
@@ -45,6 +45,6 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold
@@ -132,6 +132,6 @@ with the target of implementing a P2P-based global search engine.
Architecture (C) by Michael Peter Christen,
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/sharedBlacklist_p.html b/htroot/sharedBlacklist_p.html
index 555c0a5dc..5990291b9 100644
--- a/htroot/sharedBlacklist_p.html
+++ b/htroot/sharedBlacklist_p.html
@@ -2,7 +2,7 @@
YaCy '#[clientname]#': Shared Blacklist
-#[metas]#
+#%env/templates/metas.template%#
-#[header]#
+#%env/templates/header.template%#
Add Items to Blacklist
@@ -60,6 +60,6 @@ Wrong Invocation! Please invoke with sharedBlacklist.html?name=PeerName
-#[footer]#
+#%env/templates/footer.template%#
diff --git a/htroot/simple_search.html b/htroot/simple_search.html
index 0226ebdbf..e5c22bc45 100644
--- a/htroot/simple_search.html
+++ b/htroot/simple_search.html
@@ -2,7 +2,7 @@
YaCy '#[clientname]#': Search Page
-#[metas]#
+#%env/templates/metas.template%#
diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.java
index d35c65a3e..b827a82dd 100644
--- a/source/de/anomic/http/httpTemplate.java
+++ b/source/de/anomic/http/httpTemplate.java
@@ -45,12 +45,14 @@ package de.anomic.http;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PushbackInputStream;
+import java.util.HashMap;
import java.util.Hashtable;
import de.anomic.server.serverFileUtils;
@@ -423,5 +425,27 @@ public final class httpTemplate {
e.printStackTrace();
}
}
+ /*
+ * loads all Files from path into a filename->content HashMap
+ */
+ public static HashMap loadTemplates(File path) {
+ // reads all templates from a path
+ // we use only the folder from the given file path
+ HashMap result = new HashMap();
+ if (path == null) return result;
+ if (!(path.isDirectory())) path = path.getParentFile();
+ if ((path == null) || (!(path.isDirectory()))) return result;
+ String[] templates = path.list();
+ int c;
+ for (int i = 0; i < templates.length; i++) {
+ if (templates[i].endsWith(".template"))
+ try {
+ //System.out.println("TEMPLATE " + templates[i].substring(0, templates[i].length() - 9) + ": " + new String(buf, 0, c));
+ result.put(templates[i].substring(0, templates[i].length() - 9),
+ new String(serverFileUtils.read(new File(path, templates[i]))));
+ } catch (Exception e) {}
+ }
+ return result;
+ }
}
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java
index d27394de0..5860a3da1 100644
--- a/source/de/anomic/http/httpdFileHandler.java
+++ b/source/de/anomic/http/httpdFileHandler.java
@@ -195,7 +195,8 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
htTemplatePath = new File(switchboard.getRootPath(), switchboard.getConfig("htTemplatePath","htroot/env/templates"));
if (!(htTemplatePath.exists())) htTemplatePath.mkdir();
}
- if (templates.size() == 0) templates.putAll(loadTemplates(htTemplatePath));
+ //This is now handles by #%env/templates/foo%#
+ //if (templates.size() == 0) templates.putAll(httpTemplate.loadTemplates(htTemplatePath));
// create htLocaleDefault, htLocalePath
if (htDefaultPath == null) htDefaultPath = new File(switchboard.getRootPath(), switchboard.getConfig("htDefaultPath","htroot"));
@@ -728,26 +729,6 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
}
}
- private static HashMap loadTemplates(File path) {
- // reads all templates from a path
- // we use only the folder from the given file path
- HashMap result = new HashMap();
- if (path == null) return result;
- if (!(path.isDirectory())) path = path.getParentFile();
- if ((path == null) || (!(path.isDirectory()))) return result;
- String[] templates = path.list();
- int c;
- for (int i = 0; i < templates.length; i++) {
- if (templates[i].endsWith(".template"))
- try {
- //System.out.println("TEMPLATE " + templates[i].substring(0, templates[i].length() - 9) + ": " + new String(buf, 0, c));
- result.put(templates[i].substring(0, templates[i].length() - 9),
- new String(serverFileUtils.read(new File(path, templates[i]))));
- } catch (Exception e) {}
- }
- return result;
- }
-
private File rewriteClassFile(File template) {
try {
String f = template.getCanonicalPath();