stevenn 2003/06/18 02:27:45
Modified: src/blocks/linotype/samples flow.js
Log:
flame at will, maybe this fixes part of the path problem, if we can live with the
assumption URI & sitemap layout are similar
Revision Changes Path
1.3 +8 -5 cocoon-2.1/src/blocks/linotype/samples/flow.js
Index: flow.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/linotype/samples/flow.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- flow.js 17 Jun 2003 17:24:05 -0000 1.2
+++ flow.js 18 Jun 2003 09:27:45 -0000 1.3
@@ -1,8 +1,11 @@
-/*
- * Yeah, I know that hardwiring those is hacky as hell. But I'll try to
- * fix this with link translation later on.
- */
-var home = cocoon.context.getRealPath("/") + "samples/linotype/";
+var realpath = cocoon.context.getRealPath("/");
+
+var requesturi = cocoon.request.getRequestURI();
+var sitemapuri = cocoon.request.getSitemapURI();
+
+var mountpoint = requesturi.substring(1,requesturi.indexOf(sitemapuri));
+
+var home = realpath + mountpoint;
var stream = new java.io.FileInputStream(home + "linotype.users.properties");
var users = new
Packages.org.apache.cocoon.components.UserManager.getInstance(stream);