cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Reijn" <j.re...@hippo.nl>
Subject RE: Test Session attribute exists from the sitemap
Date Wed, 03 Jan 2007 15:33:02 GMT
Grzegorz,

you are right. It's kind of a hacky way, but if you want to have a quick solution and don't
want to dive into the code I guess it's the fastest solution.

Regards,

Jeroen Reijn

-----Original Message-----
From: Grzegorz Kossakowski [mailto:grek@tuffmail.com]
Posted At: Wednesday, January 03, 2007 3:05 PM
Posted To: Cocoon User List
Conversation: Test Session attribute exists from the sitemap
Subject: Re: Test Session attribute exists from the sitemap


Jeroen Reijn napisaƂ(a):
> Hi Olivier,
>
> you can use the SessionAttribute input module to select the attribute and use the parameter
selector to see if the attribute has a value.
>
> http://cocoon.apache.org/2.1/userdocs/parameter-selector.html
>
> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/SessionAttributeModule.html
>
> Kind regards,
>   
Isn't it that parameter-selector selects on _value_ of parameter but on
not existence? Non-existing session attr will have '' value AFAIR so it
could be used in "hacky" way:

<map:select type="parameter">
        <map:parameter name="parameter-selector-test" value="{session-attr:YOURATTR}"/>
      
        <!--YOURATTR does not exist or has null value or is just empty string -->
        <map:when test="">
          <!-- do something -->
        </map:when>
      
	<!-- YOURATTR exists -->
        <map:otherwise>
          <map:transform src="all_others.xsl"
        </map:otherwise>

</map:select>

-- 
Best regards
Grzegorz Kossakowski

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

Mime
View raw message