joerg 2004/03/02 16:35:44
Modified: src/blocks/linotype/samples sitemap.xmap flow.js
Log:
fixed realpath issue, main() no longer relies on parameter order in sitemap
Revision Changes Path
1.6 +5 -5 cocoon-2.1/src/blocks/linotype/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/linotype/samples/sitemap.xmap,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sitemap.xmap 6 Nov 2003 12:59:40 -0000 1.5
+++ sitemap.xmap 3 Mar 2004 00:35:44 -0000 1.6
@@ -156,7 +156,7 @@
<map:component-configurations>
<global-variables>
- <home>/samples/linotype</home>
+ <home>/samples/linotype/</home>
<count>3</count>
</global-variables>
</map:component-configurations>
@@ -299,8 +299,8 @@
<map:match pattern="private/edit/news/*/*">
<map:call function="main">
- <map:parameter name="page" value="edit"/>
- <map:parameter name="root" value="{realpath:/}"/>
+ <map:parameter name="action" value="edit"/>
+ <map:parameter name="home" value="{realpath:/}{global:home}"/>
<map:parameter name="id" value="{1}"/>
<map:parameter name="type" value="news"/>
<map:parameter name="subpage" value="{2}"/>
@@ -309,8 +309,8 @@
<map:match pattern="private/**">
<map:call function="main">
- <map:parameter name="page" value="{1}"/>
- <map:parameter name="root" value="{realpath:/}"/>
+ <map:parameter name="action" value="{1}"/>
+ <map:parameter name="home" value="{realpath:/}{global:home}"/>
</map:call>
</map:match>
1.9 +8 -21 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- flow.js 7 Aug 2003 22:11:03 -0000 1.8
+++ flow.js 3 Mar 2004 00:35:44 -0000 1.9
@@ -1,17 +1,3 @@
-/*
-
+-----------------------------------------------------------------------------+
- |
|
- | This flowscript is based upon a unsupported object model. The flow
|
- | interpreter that supports it has been commented out in cocoon.xcon
|
- |
|
-
+-----------------------------------------------------------------------------+
-*/
-
-/*
- * Yeah, I know that hardwiring those is hacky as hell. But I'll try to
- * fix this with link translation later on.
- */
-
var repo = new
Packages.org.apache.cocoon.components.Repository.getInstance();
var users;
@@ -22,12 +8,13 @@
/*
* Main entry point for the flow. This is where user authorization takes
place.
*/
-function main(action, root) {
- home = root + "samples/linotype/";
- var args = new Array(arguments.length - 2);
- for (var i = 2; i < arguments.length; i++) {
- args[i-2] = arguments[i];
- }
+function main() {
+ var action = cocoon.parameters["action"];
+ home = cocoon.parameters["home"];
+ var args = new Array(3);
+ args[0] = cocoon.parameters["id"];
+ args[1] = cocoon.parameters["type"];
+ args[2] = cocoon.parameters["subpage"];
if ((userid == undefined) || (userid == "")) {
login(action, args);
@@ -37,7 +24,7 @@
}
/*
- * If the user is not yet authorized, than authentication takes place
+ * If the user is not yet authorized, then authentication takes place
*/
function login(action, args) {
var name = "";