cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oscar Picasso <oscgoo...@yahoo.com>
Subject Re: Getting the prefix URI form within a subsitemap
Date Thu, 08 Jan 2004 13:33:52 GMT
Thanks for your tip. 

I don't use XSP that much but it's useful to see that
you too are using workaroung. So I can stop digging
into the docs for some hidden method :)


--- Jan Hoskens <jh@schaubroeck.be> wrote:
> Hello,
> 
> I had the same problem to find the prefix in a
> subsitemap. I did not find a
> simple way to retreive it, but I just managed to
> develop a workaround in
> XSP:
> 
> (This is just a fragment, I'm using own tags and
> stuff that I replaced here)
> 
> <?xml version="1.0"?>
> <xsp:page
>  xmlns:xsp="http://apache.org/xsp"
>  >
> 
>  <xsp:structure>
>  
>
<xsp:include>org.apache.cocoon.environment.Environment</xsp:include>
> 
>
<xsp:include>org.apache.cocoon.components.CocoonComponentManager</xsp:includ
> e>
>  </xsp:structure>
> <html>
>     <body>
>         <xsp:logic>
>         try{
>             CocoonComponentManager m =
> (CocoonComponentManager)manager;
>             Environment env =
> m.getCurrentEnvironment();
>            
> <p><xsp:expr>env.getURIPrefix()</xsp:expr></p>
>         } catch(Exception e){
>             <p>e.toString()</p>
>         }
> </xsp:logic>
> </body>
> </html>
> </xsp:page>
> 
> This is just an xsp page that shows the prefix, if
> you create an XSPaction
> and save the result in a variable, you can pass it
> anywhere.
> I just found this and haven't tested it in all
> situations yet, but it seems
> to work.
> 
> Hope this helps;-)
> 
> Bye,
> 
> Jan
> ----- Original Message ----- 
> From: "Oscar Picasso" <oscgoogle@yahoo.com>
> To: <users@cocoon.apache.org>
> Sent: Thursday, January 08, 2004 5:53 AM
> Subject: Getting the prefix URI form within a
> subsitemap
> 
> 
> > Hi,
> >
> > I am trying to retrieve the prefix URI from inside
> a
> > subsitemap.
> >
> > Let say I have:
> > +-- webapps
> >      +-- cocoon
> >          +-- my-app
> >
> > I would like to retrieve dynamically the string
> > "my-app" to construct some uris inside my
> generator.
> >
> > From what I have seen only the request object
> store
> > url/uri like strings and I have not seen
> 'prefix-uri'
> > or something like that.
> >
> > It would be convenient. Did I miss something?
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus"
> Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> >
> >
>
---------------------------------------------------------------------
> > 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
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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


Mime
View raw message