Passing parameters to action-set

2002-10-09 Thread Robin Wyles

Hi All,

Apologies if this has been answered before, I can't find it in the
archives...

I am trying to pass a parameter to an action set, but I cannot seem to get
this to work. Should this be possible at all?

Here are some snippets from my sitemap:

[...]
map:action-set name=nodePage
   map:act type=navigation
  map:parameter name=action value=set /
  map:parameter name=nextPage value={process} /
  map:parameter name=onError value={process} /
   /map:act
/map:action-set
[...]

map:match pattern=home**
map:act type=security
map:parameter name=action value=isLoggedOn /
map:act set=nodePage
map:parameter name=process value=home /
/map:act
map:generate type=file src=docs/home.xml /
map:call resource=XHTML /
/map:act
/map:match

[...]

Thanks in advance,

Robin Wyles


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

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Sitemap wildcards

2002-10-09 Thread Robin Wyles

Hi All,

I am familiar with the user of wildcards in matchers, and the use of the
resulting sitemap variables {1}, {../1} etc. But my question is this:

Is there a sitemap variable that corresponds to the matched pattern for the
current matcher? For example in the following matcher:

map:match pattern=home
map:generate type=file src=docs/home.xml /
map:call resource=XHTML /
/map:match


is there a variable I can use this will return home as the value? I would
like to have an action-set/resource that uses the matched pattern as a
parameter. I can then use this in all my matchers without having to set the
parameter manually for each one.

Thanks in advance,

Robin Wyles


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

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




map:resource/ and parameter prob in 2.0.3

2002-10-09 Thread Robin Wyles

Hi All,

I am having problems passing sitemap parameters to resources in cocoon
2.0.3. Below are some sitemap snippets that illustrate what I am trying to
achieve. For example, if the uri home is requested then the home
resource is called which in turn calls the nodePage resource, which uses
the originally requested uri as a parameter to generate the correct page.

These resources/pipelines worked fine under 2.0.2, but under 2.0.3 the src
for the generate in the nodePage resource is resolved to docs/.xml - the
parameter is empty. I have tried using {1}, {../../1} and various other
combinations, and have also tried passing named sitemap parameters with
string values in them as a test - these also fail. It seems that I just
cannot pass parameters from a pipeline to the resource.

Is this still possible under 2.0.3? If so can someone tell what has changed,
so I can get this working again!

[..]

map:resource name=nodePage
map:act type=debug
map:parameter name=action value={../1} /
/map:act
map:act type=navigation
map:parameter name=action value=set /
map:parameter name=nextPage value={../1} /
map:parameter name=onError value={../1} /
/map:act
map:generate type=file src=docs/{../1}.xml /
map:call resource=XHTML /
/map:resource

map:resource name=home
map:act type=security
map:parameter name=action value=isLoggedOn /
map:call resource=securityFailure/
/map:act
map:call resource=nodePage/
/map:resource

[..]

map:match pattern=*
map:call resource={1}/
/map:match

[..]

Thanks in advance,

Robin Wyles


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

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Saving/Retrieving Session or Request parameters in sitemap

2002-03-06 Thread Robin Wyles

Hi All...

I am new to Cocoon 2 and am currently prototyping a login/authentication
routine. I am using SessionIsValidAction to check if the user is logged in,
and if this fails they are redirected to the login page, the
DatabaseAuthenticatorAction is then used to check the user's submitted login
details against values stored in a database. This all works great.

Now I would like to be able to save the original request URI before the
SessionIsValidAction is called so I can then re-direct the user to when the
DatabaseAuthenticatorAction is successful. Here are the pipeline fragments
that control this:

!-- Check if user is logged in --
   map:match pattern=app/*.xml*
   map:act type=session-isvalid
   !-- user is logged in --
   map:generate type=file src=app/{../1}.xml /
   map:transform src=app/default.xsl /
   map:serialize /
   /map:act
   !-- use is not logged in - redirect to login --
   map:generate type=file src=app/login.xml /
   map:transform src=app/default.xsl /
   map:serialize /
   /map:match

!-- Do login --
   map:match pattern=app/sign-in*
   map:act set=checkUser
   map:parameter name=descriptor
value=app/users_descriptor.xml /
   !-- Re-direct to original requestURI here --
   /map:act
   !-- User cannot be authenticated - back to login --
   map:generate type=file src=app/login.xml /
   map:transform src=app/default.xsl /
   map:serialize /
   /map:match

Can I do this using the default set of actions that come with Cocoon 2? I
know that I can set a session attribute using the sessionPropagatorAction,
but how do I read it again? I also know I can read a request parameter using
the RequestParamAction but how do I set a request parameter?

I would like to do this within the sitemap rather than resorting to XSP if
possible.

Thanks in advance,

Robin Wyles 


-
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Saving/Retrieving Session or Request parameters in sitemap

2002-03-06 Thread Robin Wyles

Thanks a lot for your help Matthew, that seems just what I need...

Robin


on 6/3/02 1:50 pm, Matthew Langham at [EMAIL PROTECTED] wrote:

 All this is already there :-). Ok, it is not yet in a released version of
 Cocoon - but easy enough to get hold of.
 
 Check out the scratchpad and dive into the sunrise/sunshine authentication
 components etc. that we committed a couple of weeks ago.
 
 Check out my tutorial on authentication here:
 http://www.need-a-cake.com/stories/2002/02/28/usingTheSunriseComponents.html
 
 And this document sunshine-contexts.xml in the scratchpad. This shows you
 how to store and retrieve data in a session context as xml etc.
 
 Best regards
 
 Matthew
 
 --
 Open Source Group   sunShine - Lighting up e:Business
 =
 Matthew Langham, SN AG, Klingenderstrasse 5, D-33100 Paderborn
 Tel:+49-5251-1581-30  [EMAIL PROTECTED] - http://www.s-und-n.de
 Weblogging at: http://www.need-a-cake.com
 =
 
 
 
 
 -Original Message-
 From: yuryx [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 06, 2002 2:25 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Saving/Retrieving Session or Request parameters in sitemap
 
 
 Robin Wyles wrote:
 
 Hi All...
 
 I am new to Cocoon 2 and am currently prototyping a login/authentication
 routine. I am using SessionIsValidAction to check if the user is logged in,
 and if this fails they are redirected to the login page, the
 DatabaseAuthenticatorAction is then used to check the user's submitted
 login
 details against values stored in a database. This all works great.
 
 Now I would like to be able to save the original request URI before the
 SessionIsValidAction is called so I can then re-direct the user to when the
 DatabaseAuthenticatorAction is successful. Here are the pipeline fragments
 that control this:
 
 !-- Check if user is logged in --
 map:match pattern=app/*.xml*
 map:act type=session-isvalid
 !-- user is logged in --
 map:generate type=file src=app/{../1}.xml /
 map:transform src=app/default.xsl /
 map:serialize /
 /map:act
 !-- use is not logged in - redirect to login --
 map:generate type=file src=app/login.xml /
 map:transform src=app/default.xsl /
 map:serialize /
 /map:match
 
 !-- Do login --
 map:match pattern=app/sign-in*
 map:act set=checkUser
 map:parameter name=descriptor
 value=app/users_descriptor.xml /
 !-- Re-direct to original requestURI here --
 /map:act
 !-- User cannot be authenticated - back to login --
 map:generate type=file src=app/login.xml /
 map:transform src=app/default.xsl /
 map:serialize /
 /map:match
 
 Can I do this using the default set of actions that come with Cocoon 2? I
 know that I can set a session attribute using the sessionPropagatorAction,
 but how do I read it again? I also know I can read a request parameter
 using
 the RequestParamAction but how do I set a request parameter?
 
 I would like to do this within the sitemap rather than resorting to XSP if
 possible.
 
 Thanks in advance,
 
 Robin Wyles
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 see http://java.sun.com/products/servlet/2.2/javadoc/ and
 http://xml.apache.org/cocoon/apidocs/index.html
 
 Regards.
 Yury.
 
 
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]