cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <je...@media.demon.co.uk>
Subject Using Selectors
Date Mon, 17 Sep 2001 13:21:25 GMT
Dear All,

I am trying to use the RequestSelector, without much luck so far.

Can anyone confirm that <a> it works and <b> I am using it correctly.


(sub)Sitemap snippet:

	setup

		<map:selectors default="browser">
			<!-- tests value of incoming form param 'crudlet.login.action' -->
			<map:selector name="form-submitted"
src="org.apache.cocoon.selection.RequestSelectorFactory">
				<map:parameter name="parameter-name" value="crudlet.login.action"/>
			</map:selector>
		</map:selectors>

	usage

		<map:resource name="do-login">
			<map:select type="form-submitted"> <!-- **** test not working **** -->
				<map:when test="login">
					<!-- do a bunch of stuff -->
				</map:when>
				<map:otherwise> <!-- a login form was not submitted -->
					<map:act type="session-propagator">
						<map:parameter name="crudlet.login.state" value="timeout"/>
						<map:parameter name="crudlet.login.target" value="{target}"/>
					</map:act>
					<map:redirect-to resource="login-fs"/>
				</map:otherwise>
			</map:select>
			<map:redirect-to resource="login-fs"/>
		</map:resource>

This outputs code to my sitemap_xmap.java that appears it would not work
(See the "null"s):


  private boolean form_submittedSelect (String pattern,
                                        Map objectModel, Parameters param) {
    String compareToString = null;
    if (param == null) {
      compareToString = (String) XSPRequestHelper.getParameter(objectModel,
                        "null",null);
    } else {
      compareToString = (String) XSPRequestHelper.getParameter(objectModel,
                        param.getParameter("state-key","null"), null);
    }
    return compareToString != null && compareToString.equals (pattern);
  }

 It does not appear to be picking up my request param name in the config.


Any suggestions?


thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

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


Mime
View raw message