Re: Passing request params to a flowscript thru a resource?

2003-12-03 Thread Stephan Coboos
Geoff Howard wrote:

Stephan Coboos wrote:

Hello,

because I've got no answer for my question postet in the users list 
before, I will try it on the dev list...

I have the following sitemap fragment:

...
map:resources
 map:resource name=main
map:call function=main/
 /map:resource
/map:resources
map:flow language=javascript
map:script src=flows/myScript.js/
/map:flow
map:pipelines
 map:pipeline
map:match pattern=
   map:call resource=main/
/map:match
 /map:pipeline
/map:pipelines
...
In the match section I'm calling the resource 'main' which is calling 
a flowscript function itself. But if I do that this way I don't have 
access to the request params in the flowscript because 
cocoon.request... returns nothing! How do I activate passing request 
parameters thru resources to a flowscript?


Can you explain why you would need to do this?  The example you've 
given above is pointless AFAICS.

Geoff


Hello Geoff,

yes, I can explain it for you. I'm writing a simple cms. In this cms it 
is possible to surf arround the entire websites and when the customer 
wants to edit a page he has to click the edit button situated on top on 
the page if he is logged in. The whole cms is organized by only one 
central flowscript which checks for login, recievies the values from the 
database via components and makes other things. The status of the 
flowscript must be valid during the user is logged. So I have written 
two simple actions: The first sets the actual continuation id to the 
session and the second one extracts the continuation id from the 
session. At this way, no need is necessary to change the url's on the 
webpage to forward the continuation id. But to call the two actions I 
need to call resource every time before the flowscript is called and 
before the response is sent to the client:

...

!-- Sets the continuation-id into the session --
map:resource name=setContinuation
   map:act type=setCont/
   map:serialize type=html/
/map:resources
!-- Extracts the cont-id from the session and loads the continuation
   If no continuation-id exists, the function cms will be called --
map:resource name=getContinuation
   map:act type=getCont
   !-- param continuation-id comes from the action --
  map:call continuation={continuation-id}/
   /map:act
   map:call function=cms/
/map:resource
...

All works fine! Only the request returns everytime null when I'm calling 
the function cms this way. If I call the function directly in the 
match block, the request works and returns the correkt values!

Regards
Stephan


Passing request params to a flowscript thru a resource?

2003-12-02 Thread Stephan Coboos
Hello,

because I've got no answer for my question postet in the users list 
before, I will try it on the dev list...

I have the following sitemap fragment:

...
map:resources
 map:resource name=main
map:call function=main/
 /map:resource
/map:resources
map:flow language=javascript
map:script src=flows/myScript.js/
/map:flow
map:pipelines
 map:pipeline
map:match pattern=
   map:call resource=main/
/map:match
 /map:pipeline
/map:pipelines
...
In the match section I'm calling the resource 'main' which is calling a 
flowscript function itself. But if I do that this way I don't have 
access to the request params in the flowscript because cocoon.request... 
returns nothing! How do I activate passing request parameters thru 
resources to a flowscript?

Thank you.

Regards
Stephan


Re: Passing request params to a flowscript thru a resource?

2003-12-02 Thread Carlos Chávez

Stephan Coboos Escribio :-)
 Hello,

 because I've got no answer for my question postet in the users list
 before, I will try it on the dev list...

 I have the following sitemap fragment:

 ...
 map:resources
   map:resource name=main
  map:call function=main/
   /map:resource
 /map:resources

 map:flow language=javascript
  map:script src=flows/myScript.js/
 /map:flow

 map:pipelines
   map:pipeline
  map:match pattern=
 map:call resource=main/
  /map:match
   /map:pipeline
 /map:pipelines
 ...

 In the match section I'm calling the resource 'main' which is calling a
 flowscript function itself. But if I do that this way I don't have
 access to the request params in the flowscript because cocoon.request...
 returns nothing!

 Hi, Stephan

 try in flowcript this:

 var parameter = cocoon.parameters[parameter from sitemap]

 Cheers,


 How do I activate passing request parameters thru
 resources to a flowscript?

 Thank you.

 Regards
 Stephan



-- 
Carlos Chávez
AG Software, S.A.
876-8344
267-3007


Re: Passing request params to a flowscript thru a resource?

2003-12-02 Thread Stephan Coboos
Carlos Chávez wrote:

Stephan Coboos Escribio :-)
 

Hello,

because I've got no answer for my question postet in the users list
before, I will try it on the dev list...
I have the following sitemap fragment:

...
map:resources
 map:resource name=main
map:call function=main/
 /map:resource
/map:resources
map:flow language=javascript
map:script src=flows/myScript.js/
/map:flow
map:pipelines
 map:pipeline
map:match pattern=
   map:call resource=main/
/map:match
 /map:pipeline
/map:pipelines
...
In the match section I'm calling the resource 'main' which is calling a
flowscript function itself. But if I do that this way I don't have
access to the request params in the flowscript because cocoon.request...
returns nothing!
   

Hi, Stephan

try in flowcript this:

var parameter = cocoon.parameters[parameter from sitemap]

Cheers,

 

How do I activate passing request parameters thru
resources to a flowscript?
Thank you.

Regards
Stephan
   

Hello Carlos,

so I have to use the request module to pass the request parameters? Or 
what do you mean?

Thank you.

Stephan



Re: Passing request params to a flowscript thru a resource?

2003-12-02 Thread Geoff Howard
Stephan Coboos wrote:
Hello,

because I've got no answer for my question postet in the users list 
before, I will try it on the dev list...

I have the following sitemap fragment:

...
map:resources
 map:resource name=main
map:call function=main/
 /map:resource
/map:resources
map:flow language=javascript
map:script src=flows/myScript.js/
/map:flow
map:pipelines
 map:pipeline
map:match pattern=
   map:call resource=main/
/map:match
 /map:pipeline
/map:pipelines
...
In the match section I'm calling the resource 'main' which is calling a 
flowscript function itself. But if I do that this way I don't have 
access to the request params in the flowscript because cocoon.request... 
returns nothing! How do I activate passing request parameters thru 
resources to a flowscript?
Can you explain why you would need to do this?  The example you've given 
above is pointless AFAICS.

Geoff



Re: Passing request params to a flowscript thru a resource?

2003-12-02 Thread Vadim Gritsenko
Geoff Howard wrote:

Stephan Coboos wrote:

Hello,

because I've got no answer for my question postet in the users list 
before, I will try it on the dev list...

I have the following sitemap fragment:

...
map:resources
 map:resource name=main
map:call function=main/
 /map:resource
/map:resources
map:flow language=javascript
map:script src=flows/myScript.js/
/map:flow
map:pipelines
 map:pipeline
map:match pattern=
   map:call resource=main/
/map:match
 /map:pipeline
/map:pipelines
...
In the match section I'm calling the resource 'main' which is calling 
a flowscript function itself. But if I do that this way I don't have 
access to the request params in the flowscript because 
cocoon.request... returns nothing! How do I activate passing request 
parameters thru resources to a flowscript?


Can you explain why you would need to do this?  The example you've 
given above is pointless AFAICS.


But syntax is valid (unless there is an error in myScript.js) -- which 
means it should work. And if it is genuine bug it should be filed and 
(eventually) fixed.

Vadim