Re: Wildcard Parameters in Sitemap

2001-08-20 Thread Piroumian, Konstantin

Hi!

skip

 map:match pattern=protected/**
 map:act type=session-is-valid
   map:act type=session-validator
 map:parameter name=descriptor
value=context://mmsc//descriptors/login-params.xml/
 map:parameter name=validate
value=username/
 map:aggregate element=site
map:part src=cocoon:/{1}-screen.xml element=screen/
map:part src=docs/lookandfeel.xml element=lookandfeel/
 /map:aggregate
 map:transform type=i18n
   map:parameter name=src value=docs/translations.xml/
 /map:transform
 map:serialize/
   /map:act
   map:redirect-to session=true uri=login/
 /map:act
 map:redirect-to session=false uri=startsession/
 /map:match


 Question 2:
 In the above example what would be the difference in using a single '*'
 instead of '**', I tried both and they seem to do the same thing.

Not exactly. ** goes down by the directory tree and * does not. E.g.:
*.jpg matches all JPG files in the current directory
**.jpg matches all JPG files in the current and sub-directories


 Question 3:
 In the above example the line:

 map:parameter name=descriptor
 value=context://mmsc//descriptors/login-params.xml/

 The value string as to have the prefix :'//mmsc//' which is actually the
 root application name. I don't think it should have to appear anywhere
 in this sitemap. Why can't I say:

 map:parameter name=descriptor
  value=descriptors/login-params.xml/

 or is there something like 'context:' that gives me
 'context://mmsc//' ?

There's something wrong. You don't need the application name when you are
using context:// protocol. Try this:

 map:parameter name=descriptor
 value=context:///descriptors/login-params.xml/

I use a rather old version of C2 and this works for me too:

 map:parameter name=descriptor
 value=context://descriptors/login-params.xml/

'descriptors' directory must be in the context root (in your case:
%TOMCAT_HOME%\webapps\mmsc).



 Thanks,

 --
 Mark Miller
 Web Architect
 Logica
 819-3646



Best regards,

Konstantin Piroumian
Sr. Software engineer

Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: [EMAIL PROTECTED]
http://www.protek.com

-
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]




Wildcard Parameters in Sitemap

2001-08-17 Thread Mark Miller

Question 1:

Consider the two following map components, noting the position of {1}:

This one works:

map:match pattern=protected/**
map:aggregate element=site
   map:part src=cocoon:/{1}-screen.xml element=screen/
   map:part src=docs/lookandfeel.xml
 element=lookandfeel/
/map:aggregate
map:act type=session-is-valid
  map:act type=session-validator
map:parameter name=descriptor
 value=context://mmsc//descriptors/login-params.xml/
map:parameter name=validate
 value=username/
map:transform type=i18n
   map:parameter name=src value=docs/translations.xml/
/map:transform
map:serialize/
  /map:act
  map:redirect-to session=true uri=login/
/map:act
map:redirect-to session=false uri=startsession/
/map:match

This one does not bind the * to the {1} parameter. Why?

map:match pattern=protected/**
map:act type=session-is-valid
  map:act type=session-validator
map:parameter name=descriptor
   value=context://mmsc//descriptors/login-params.xml/
map:parameter name=validate
   value=username/
map:aggregate element=site
   map:part src=cocoon:/{1}-screen.xml element=screen/
   map:part src=docs/lookandfeel.xml element=lookandfeel/
/map:aggregate
map:transform type=i18n
  map:parameter name=src value=docs/translations.xml/
/map:transform
map:serialize/
  /map:act
  map:redirect-to session=true uri=login/
/map:act
map:redirect-to session=false uri=startsession/
/map:match


Question 2:
In the above example what would be the difference in using a single '*' 
instead of '**', I tried both and they seem to do the same thing.

Question 3:
 In the above example the line:

map:parameter name=descriptor
value=context://mmsc//descriptors/login-params.xml/

The value string as to have the prefix :'//mmsc//' which is actually the 
root application name. I don't think it should have to appear anywhere 
in this sitemap. Why can't I say:

map:parameter name=descriptor
 value=descriptors/login-params.xml/

or is there something like 'context:' that gives me
'context://mmsc//' ?


Thanks,

-- 
Mark Miller
Web Architect
Logica
819-3646


-
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: Wildcard Parameters in Sitemap

2001-08-17 Thread Vadim Gritsenko

Mark,

 
 Question 1:
 
 Consider the two following map components, noting the position of {1}:
 
 This one works:
 
 map:match pattern=protected/**
 map:aggregate element=site
map:part src=cocoon:/{1}-screen.xml element=screen/
map:part src=docs/lookandfeel.xml
  element=lookandfeel/
 /map:aggregate
 map:act type=session-is-valid
   map:act type=session-validator
 map:parameter name=descriptor
  value=context://mmsc//descriptors/login-params.xml/
 map:parameter name=validate
  value=username/
 map:transform type=i18n
map:parameter name=src value=docs/translations.xml/
 /map:transform
 map:serialize/
   /map:act
   map:redirect-to session=true uri=login/
 /map:act
 map:redirect-to session=false uri=startsession/
 /map:match
 
 This one does not bind the * to the {1} parameter. Why?
 
 map:match pattern=protected/**
 map:act type=session-is-valid
   map:act type=session-validator
 map:parameter name=descriptor
value=context://mmsc//descriptors/login-params.xml/
 map:parameter name=validate
value=username/
 map:aggregate element=site
map:part src=cocoon:/{1}-screen.xml element=screen/

Use {../../1}. Actions also can return parameters  - but you need parameter from the 
matcher.


map:part src=docs/lookandfeel.xml element=lookandfeel/
 /map:aggregate
 map:transform type=i18n
   map:parameter name=src value=docs/translations.xml/
 /map:transform
 map:serialize/
   /map:act
   map:redirect-to session=true uri=login/
 /map:act
 map:redirect-to session=false uri=startsession/
 /map:match
 
 
 Question 2:
   In the above example what would be the difference in using a single '*' 
 instead of '**', I tried both and they seem to do the same thing.

* matches files, ** matches paths. The difference is that * do not matches /.


 
 Question 3:
In the above example the line:
 
 map:parameter name=descriptor
   value=context://mmsc//descriptors/login-params.xml/
 
 The value string as to have the prefix :'//mmsc//' which is actually the 
 root application name. I don't think it should have to appear anywhere 
 in this sitemap. Why can't I say:
 
 map:parameter name=descriptor
  value=descriptors/login-params.xml/
 
 or is there something like 'context:' that gives me
 'context://mmsc//' ?
 
 
 Thanks,
 
 -- 
 Mark Miller
 Web Architect
 Logica
 819-3646
 
 

-
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]