You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by 許議中 <jo...@erp.tw> on 2007/02/04 09:00:03 UTC

How to read an input field of form in sitemap

Hi!

I've a simple form

         <form action="type4-search" method="post">
           <select name="keyno">
           <xsl:for-each select="option">
             <option>
               <xsl:attribute name="value"><xsl:value-of select="optionno"/></xsl:attribute>
               <xsl:value-of select="optionname"/>
             </option>
           </xsl:for-each>
           </select>
           <input type="hidden" name="locale" value="$locale"/>
           <input type="hidden" name="username" value="$username"/>
           <input type="submit" name="submit" value="搜索"/>
         </form>

how to get the local and username in type4-search sitemap like

			<map:match pattern="*-search">
				<map:generate src="itemtype/{1}search.xsp" type="serverpages">
          <map:parameter name="keyno" value="{request-param:keyno}"/>
				</map:generate>
				<map:transform src="itemtype/{1}search.xsl">
          <map:parameter name="locale" value="{request-param:locale}"/>
          <map:parameter name="username" value="{request-param:username}"/>
        </map:transform>
				<map:act type="locale">
					<map:transform type="i18n">						
						<map:parameter name="locale" value="{request-param:locale}"/>
					</map:transform>
				</map:act>
				<map:serialize type="html"/>
			</map:match>

here {request-param:locale} does not work.

Best Regards

johnson


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


Re: Get any Path in CocoonContext

Posted by "Steven D. Majewski" <sd...@virginia.edu>.
Not sure exactly which path the OP wants, but look also at the  
ContextPath module:

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
modules/input/ContextPathModule.html

> ContextPathModule provides a real filesystem path for a virtual  
> context-relative path. If this mapping cannot be performed (e.g.  
> Cocoon is running in a .war file), null will be returned. Compared  
> to the RealPathModule this module is able to provide the "real"  
> absolute path even if the application is mounted outside the webapp  
> tree of Cocoon.
>
> Note: the primary use for this is to support external code that  
> wants a filesystem path. For example, The FOP 0.20.x serializer  
> doesn't like relative image paths, and doesn't understand Cocoon  
> URLs (context:, cocoon: etc). So we pass the *2fo.xsl stylesheet a  
> real filesystem path to where we keep our images:
>
> A absolute path argument like {contextpath:/resources} will be  
> resolved from the root context path (ie. COCOON_HOME/build/webapp)  
> whereas a relative path attribute like {contextpath:./resources}  
> will be resolved from the location of the sitemap that uses it. If  
> that sitemap is mounted outside the usual COCOON_HOME/build/webapp  
> the path resolved with this modules points to the correct location.

So, for example, if I add a line for {realpath:./sitemap.xmap}  to  
the cocoon samples sitemap for the
realpath module, I get:


./sitemap.xmap	/usr/local/java/jakarta-tomcat-5.0.28/webapps/cocoon/./ 
sitemap.xmap

which points to the root cocoon sitemap. If I change that to  
{contextpath:./sitemap.xmap},
I get the sitemap for the current request:


./sitemap.xmap   /usr/local/java/jakarta-tomcat-5.0.28/webapps/cocoon/ 
samples/modules/./sitemap.xmap


So if you want to pass the path for a work or temp directory that is  
in your project,
use contextpath: -- it will work even if your project is mounted  
outside of cocoon.


[ Without getting into the history of how these things grew, I'm not  
sure why there should
   even be two different modules here. And the naming makes it even  
more confusing, since
   you expect that something called RealPathModule would actually  
give you a "real" path! ]


-- Steve Majewski / UVA Alderman Library


On May 1, 2007, at 4:16 PM, Alexander Daniel wrote:

> The RealPath input module provides the functionality you are  
> looking for. For more information see
> - http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
> modules/input/RealPathModule.html
> - If you have installed the standard Cocoon 2.1.10 distribution in  
> Tomcat: http://localhost:8080/cocoon/samples/modules/realpath.html
>
> Alex
>
> On 01.05.2007, at 20:16, rachid harradi wrote:
>
>> hello together,
>>
>> i have a question about getting path in javaflow or flowscript.
>>
>> i produce many documents in cocoonApplication i will save it in  
>> any filesystem. i have the relativ from filesystem
>>
>> is a possible to get any Context from tomcat server.xml like
>>
>> <Context path"/name" docbas="z:/.../name" ..>
>>
>> in cocoonApplication?
>>


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


Re: Get any Path in CocoonContext

Posted by Alexander Daniel <al...@gmx.at>.
The RealPath input module provides the functionality you are looking  
for. For more information see
- http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/ 
modules/input/RealPathModule.html
- If you have installed the standard Cocoon 2.1.10 distribution in  
Tomcat: http://localhost:8080/cocoon/samples/modules/realpath.html

Alex

On 01.05.2007, at 20:16, rachid harradi wrote:

> hello together,
>
> i have a question about getting path in javaflow or flowscript.
>
> i produce many documents in cocoonApplication i will save it in any  
> filesystem. i have the relativ from filesystem
>
> is a possible to get any Context from tomcat server.xml like
>
> <Context path"/name" docbas="z:/.../name" ..>
>
> in cocoonApplication?
>
>
>
>
>
> -- 
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
>
> ---------------------------------------------------------------------
> 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


Get any Path in CocoonContext

Posted by rachid harradi <ra...@gmx.net>.
hello together,

i have a question about getting path in javaflow or flowscript.

i produce many documents in cocoonApplication i will save it in any filesystem. i have the relativ from filesystem 

is a possible to get any Context from tomcat server.xml like

<Context path"/name" docbas="z:/.../name" ..>

in cocoonApplication?




 
-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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


RE: How to read an input field of form in sitemap

Posted by Jasha Joachimsthal <j....@hippo.nl>.
Shouldn't your xsl contain curly braces?

<input type="hidden" name="locale" value="{$locale}"/>
           <input type="hidden" name="username" value="{$username}"/>

-----Original Message-----
From:	??? [mailto:johnson@erp.tw]
Sent:	Sun 2/4/2007 9:00 AM
To:	cocoon-users
Cc:	
Subject:	How to read an input field of form in sitemap

Hi!

I've a simple form

         <form action="type4-search" method="post">
           <select name="keyno">
           <xsl:for-each select="option">
             <option>
               <xsl:attribute name="value"><xsl:value-of select="optionno"/></xsl:attribute>
               <xsl:value-of select="optionname"/>
             </option>
           </xsl:for-each>
           </select>
           <input type="hidden" name="locale" value="$locale"/>
           <input type="hidden" name="username" value="$username"/>
           <input type="submit" name="submit" value="??"/>
         </form>

how to get the local and username in type4-search sitemap like

			<map:match pattern="*-search">
				<map:generate src="itemtype/{1}search.xsp" type="serverpages">
          <map:parameter name="keyno" value="{request-param:keyno}"/>
				</map:generate>
				<map:transform src="itemtype/{1}search.xsl">
          <map:parameter name="locale" value="{request-param:locale}"/>
          <map:parameter name="username" value="{request-param:username}"/>
        </map:transform>
				<map:act type="locale">
					<map:transform type="i18n">						
						<map:parameter name="locale" value="{request-param:locale}"/>
					</map:transform>
				</map:act>
				<map:serialize type="html"/>
			</map:match>

here {request-param:locale} does not work.

Best Regards

johnson


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