You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paolo <la...@arsenio.net> on 2001/09/10 09:27:21 UTC

Sitemap parameters scope and non-destructive session parameters propagation

I am working with Cocoon but I have some problems with sitemap variables
scope. It seems that Sitemap Parameters propagated from db-authenticator
actions are not inherited into selectors or other db-authenticator
actions. Please look at this code and the scope of myvar_dbvars1
(propagated by db-authenticator action) to the session and Sitemap:

<map:act type="db-authenticator">
	<map:parameter name="descriptor" value="dbvars1.xml"/>
  	<map:select type="session">
      	<map:parameter name="state-key" value="myvar_dbvars1"/>

		<map:when test="customer">
        		<map:act type="db-authenticator">
	    			<map:parameter name="create-session"
value="no"/>
          			<map:parameter name="descriptor"
value="dbvars2.xml"/>
	    			<map:redirect-to uri="{myvar_dbvars1}"/>
	  		</map:act>
					
			<map:act type="session-invalidator">
	    			<map:redirect-to uri="login"/>
	  		</map:act>
      	</map:when>
							
		<map:otherwise>
	  		<map:redirect-to uri="{myvar_dbvars1}"/>
		</map:otherwise>
    	</map:select>
</map:act>

Then, my questions:
1) is it possibile to propagate Sitemap parameters into child elements
of sitemap?
2) is it possibile to check and propagate session attributes to Sitemap
without deleting an existing session?

Thanx!

ByeBye,
Paolo Scaffardi
AIRVENT SAM S.p.A.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


R: Sitemap parameters scope and non-destructive session parameters propagation

Posted by Paolo <la...@arsenio.net>.
Hi Jorn!

>To get access to a parameter in a different hierachy, I use {../1}. 

Thanx very much! I really didnt find it in the original documentation!!
Cocoon 2 is a great project but it still has holes in documentation!

>To propagate session values to the sitemap, I think you have to write
an
>action for that (I don't know if there's such an action in cocoon right
now:

Ok, I'll do it...
Many many many many many thanx!!

Paolo Scaffardi
AIRVENT SAM S.p.A.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


AW: Sitemap parameters scope and non-destructive session parameters propagation

Posted by Jörn Heid <he...@fh-heilbronn.de>.
I hope I understood your problem.
I had a similar problem with parameters (look for 'Confused about Actions').
To get access to a parameter in a different hierachy, I use {../1}. Perhaps
this will solve your first question (try {../myvar_dbvars1}).

To propagate session values to the sitemap, I think you have to write an
action for that (I don't know if there's such an action in cocoon right now:

public void act ... {

Map sitemapParams = new HashMap ();
for (Enumeration e = request.getSession ().getAttributeNames (); e.hasNext
()) {
    String key = e.nextElement ().toString ();
    if (request.getSession ().getAttribute (key) != null)
       sitemapParams.put (key, request.getSession ().getAttribute
(key).toString ());
    }
return sitemapParams;
}

No session attributes would be deleted. You could easily modify this code so
that only your attributes would be propagated (in this solution only
String-attributes would be useful).

If this doesn't help you feel free to write me directly.

JOERN_HEID

-----Ursprüngliche Nachricht-----
Von: Paolo [mailto:lavoro@arsenio.net]
Gesendet: Montag, 10. September 2001 09:27
An: cocoon-dev@xml.apache.org
Cc: Cocoon-Users
Betreff: Sitemap parameters scope and non-destructive session parameters
propagation


I am working with Cocoon but I have some problems with sitemap variables
scope. It seems that Sitemap Parameters propagated from db-authenticator
actions are not inherited into selectors or other db-authenticator
actions. Please look at this code and the scope of myvar_dbvars1
(propagated by db-authenticator action) to the session and Sitemap:

<map:act type="db-authenticator">
	<map:parameter name="descriptor" value="dbvars1.xml"/>
  	<map:select type="session">
      	<map:parameter name="state-key" value="myvar_dbvars1"/>

		<map:when test="customer">
        		<map:act type="db-authenticator">
	    			<map:parameter name="create-session"
value="no"/>
          			<map:parameter name="descriptor"
value="dbvars2.xml"/>
	    			<map:redirect-to uri="{myvar_dbvars1}"/>
	  		</map:act>

			<map:act type="session-invalidator">
	    			<map:redirect-to uri="login"/>
	  		</map:act>
      	</map:when>

		<map:otherwise>
	  		<map:redirect-to uri="{myvar_dbvars1}"/>
		</map:otherwise>
    	</map:select>
</map:act>

Then, my questions:
1) is it possibile to propagate Sitemap parameters into child elements
of sitemap?
2) is it possibile to check and propagate session attributes to Sitemap
without deleting an existing session?

Thanx!

ByeBye,
Paolo Scaffardi
AIRVENT SAM S.p.A.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>