You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Oleg Dulin <du...@olegdulin.com> on 2003/10/23 15:48:20 UTC

Refering to parts of the URI using a matcher

Dear Distinguished Colleagues:

I need to do the following:

Given URIs like these:

/foo/bar/baz/bom/bim.xml/some/other/stuff
/foo/bar/blah/boom.xml/some/other/stuff

I need to write a match like this:

<map:match pattern="/foo/**/*.xml/some/other/stuff">

and then refer to the parts of the "**" and "*.xml" parts of the match 
using "{1}" and "{2}.xml" respectively.

Is it possible? How?

Regards,
Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Form Validation

Posted by Jian Dai <ja...@comcast.net>.
Hi, Christ:

Here attached a sample of my problem. 

Here is the decription file

++++++++++++++++++++

<?xml version="1.0"?>

<root>
  <parameter name="username" type="string" max-len="30"
     nullable="no"/>
  <parameter name="password" type="string" max-len="30"
     nullable="no"/>

  <constraint-set name="check">
   <validate name="username"/>
   <validate name="password"/>
  </constraint-set>
</root>


++++++++++++++++++++

This is a simple login form, I have two fields (username and password). 
If I gave the validate value for this two fields, I expect
<form-val:is-error /> return false. But actually I had are
<form-val:is-error name="username" /> return false (no error) and 
<form-val:is-error name="password" /> return false (no error) but
<form-val:is-error /> return true (has ERROR!). 

I did further search and found <form-val:notpresent /> return true in 
this case. 

Since I only have two attributes in this case, I do not know why I was 
in such a weird situation. 

Many thanks in advance for nice help. 

Jian

-----Original Message-----
From: Christian Haul [mailto:haul@informatik.tu-darmstadt.de]
Sent: Sunday, October 26, 2003 5:45 AM
To: users@cocoon.apache.org
Subject: Re: Form Validation


Jian Dai wrote:
> Hi, all,
> 
> I have a problem with I use form validation logical sheet. 
> 
> I set up a descriptor file and constraint set. In my form, I 
> have every parameters in constraint set validated. But I still
> get <form-value:notpresent-error /> in general form. (If I define a
> name, than I do not have such error. 
> 
> Is there anybody has a clue about it?

Could you post a sample that shows the problem? (input, output + 
expected output)

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form Validation

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Jian Dai wrote:
> Hi, all,
> 
> I have a problem with I use form validation logical sheet. 
> 
> I set up a descriptor file and constraint set. In my form, I 
> have every parameters in constraint set validated. But I still
> get <form-value:notpresent-error /> in general form. (If I define a
> name, than I do not have such error. 
> 
> Is there anybody has a clue about it?

Could you post a sample that shows the problem? (input, output + 
expected output)

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Form Validation

Posted by Jian Dai <ja...@comcast.net>.
Hi, all,

I have a problem with I use form validation logical sheet. 

I set up a descriptor file and constraint set. In my form, I 
have every parameters in constraint set validated. But I still
get <form-value:notpresent-error /> in general form. (If I define a
name, than I do not have such error. 

Is there anybody has a clue about it?

Many thanks in advance for the nice help. 

Jack


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Configuring ChainMetaModule in sitemap?

Posted by Mathias Wiegard <Ma...@student.uni-ulm.de>.
Thanks for this hint! Do I have to configure the ChaineMetaModule in the
cocoon.xconf or is it possible to also configure it in the
"map:pipeline/map:component-configurations"-section?
 
Mat


> Von: Tony Collen <co...@umn.edu>
> Antworten an: users@cocoon.apache.org
> Datum: Fri, 24 Oct 2003 11:22:31 -0500
> An: users@cocoon.apache.org
> Betreff: Re: Default value for input modules?
> 
> mathias.wiegard@student.uni-ulm.de wrote:
> 
>> Hi,
>> I don't want to extend Java Code. Isn't there any possibility to do this on
>> the sitemap? How would the example in this Email for xsp look like on the
>> sitemap?
>> Best regards,
>> Mat
> 
> Mathias,
> 
> check out your WEB-INF/cocoon.xconf file, where the ChainMetaModule is
> located, that should give you
> an idea of how you can get a module to "fall back" to other modules, or
> defaults.
> 
> 
> Tony
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Default value for input modules?

Posted by Tony Collen <co...@umn.edu>.
mathias.wiegard@student.uni-ulm.de wrote:

 > Hi,
 > I don't want to extend Java Code. Isn't there any possibility to do this on
 > the sitemap? How would the example in this Email for xsp look like on the
 > sitemap?
 > Best regards,
 > Mat

Mathias,

check out your WEB-INF/cocoon.xconf file, where the ChainMetaModule is located, that should give you 
an idea of how you can get a module to "fall back" to other modules, or defaults.


Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Default value for input modules?

Posted by Tony Collen <co...@umn.edu>.
mathias.wiegard@student.uni-ulm.de wrote:

> Hi,
> I want to use the "request-param" input module on the sitemap to define a 
> parameter's value. My question is: is it possible to "initialize" this 
> parameter with an default value? I saw something in the documentation under 
> "modules" for xsp but not for the sitemap:
> ...
> <input:get-attribute module="request-param" as="string" name="module" 
> default="John Doe"/>
> ...


Mathias,

You might want to check out the DefaultsModule, as well as the 
ChainMetaModule.  They will allow you to setup a default values to "Fall 
back" to in case the main module (in this case request-param) can't get 
a value.


Regards,

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Default value for input modules?

Posted by ma...@student.uni-ulm.de.
Hi,
I want to use the "request-param" input module on the sitemap to define a 
parameter's value. My question is: is it possible to "initialize" this 
parameter with an default value? I saw something in the documentation under 
"modules" for xsp but not for the sitemap:
...
<input:get-attribute module="request-param" as="string" name="module" 
default="John Doe"/>
...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Refering to parts of the URI using a matcher

Posted by Oleg Dulin <du...@olegdulin.com>.
Same problem...

Note that I also have things like:


<map:match pattern="/foo/**">

which come later in the pipeline to ensure proper prioritization.

Oleg

Geoff Howard wrote:

> Oleg Dulin wrote:
> 
>> Joerg:
>>
>>>> <map:match pattern="/foo/**/*.xml/some/other/stuff">
>>>>
>>>> and then refer to the parts of the "**" and "*.xml" parts of the 
>>>> match using "{1}" and "{2}.xml" respectively.
>>
>>
>>
>>> What's the problem? It's exactly as you wrote it.
>>
>>
>>
>> The problem is that as long as i have 
>> pattern="/foo/**/some/other/stuff" the match is triggered. As soon as 
>> I change it to "/foo/**/*.xml/some/other/stuff" I start getting 404 
>> Not Found
> 
> 
> try "/foo**/*.xml/some/other/stuff"
> 
> you probably don't always have something between those slashes.
> 
> Geoff
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Refering to parts of the URI using a matcher

Posted by Geoff Howard <co...@leverageweb.com>.
Oleg Dulin wrote:
> Joerg:
> 
>>> <map:match pattern="/foo/**/*.xml/some/other/stuff">
>>>
>>> and then refer to the parts of the "**" and "*.xml" parts of the 
>>> match using "{1}" and "{2}.xml" respectively.
> 
> 
>> What's the problem? It's exactly as you wrote it.
> 
> 
> The problem is that as long as i have pattern="/foo/**/some/other/stuff" 
> the match is triggered. As soon as I change it to 
> "/foo/**/*.xml/some/other/stuff" I start getting 404 Not Found

try "/foo**/*.xml/some/other/stuff"

you probably don't always have something between those slashes.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Refering to parts of the URI using a matcher

Posted by Oleg Dulin <du...@olegdulin.com>.
Joerg:

>> <map:match pattern="/foo/**/*.xml/some/other/stuff">
>>
>> and then refer to the parts of the "**" and "*.xml" parts of the match 
>> using "{1}" and "{2}.xml" respectively.

> What's the problem? It's exactly as you wrote it.

The problem is that as long as i have pattern="/foo/**/some/other/stuff" 
the match is triggered. As soon as I change it to 
"/foo/**/*.xml/some/other/stuff" I start getting 404 Not Found

Oleg





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Refering to parts of the URI using a matcher

Posted by Joerg Heinicke <jh...@virbus.de>.
Oleg Dulin wrote:
> Dear Distinguished Colleagues:
> 
> I need to do the following:
> 
> Given URIs like these:
> 
> /foo/bar/baz/bom/bim.xml/some/other/stuff
> /foo/bar/blah/boom.xml/some/other/stuff
> 
> I need to write a match like this:
> 
> <map:match pattern="/foo/**/*.xml/some/other/stuff">
> 
> and then refer to the parts of the "**" and "*.xml" parts of the match 
> using "{1}" and "{2}.xml" respectively.
> 
> Is it possible? How?
> 
> Regards,
> Oleg

What's the problem? It's exactly as you wrote it.

Joerg

-- 
System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org