cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <aschrijv...@hippo.nl>
Subject RE: Access component in JXTemplate
Date Mon, 11 Sep 2006 11:58:20 GMT

> Hello,
> Ive a problem with accessing a component. Maybe someone can help me:
> 
> The component is defined in cocoon.xconf with:
> <component class="de.cocoon.hibernate.HibernateFactory"
> role="de.cocoon.persistantfactory.PersistenceFactory"/>
> 
> and I can access it in the flowscript with:
> var factory = 
> cocoon.getComponent(Packages.de.cocoon.persistantfactory.Persi
> stenceFactory.ROLE);
> 
> Now I want to access it in an JXTemplateGenerator in the sitemap:
> The call at the moment is:
>        <map:generate type="jx" src="blocks.xml">
>           <map:parameter name="contextPath" 
> value="{request:contextPath}"/>
>           <map:parameter name="sitemapAsBase"
> value="{baselink:SitemapBaseLink}"/>
>           <map:parameter name="requestAsBase"
> value="{baselink:RequestBaseLink}"/>
>           <map:parameter name="base-url" value="{global:base-url}"/>
>         </map:generate>
> 
> but in blocks.xml I only have request, session, context and so on. So
> how can i access it there? Is there a parameter for the cocoon object?

Suppose yo uwant to access your de.cocoon.persistantfactory.PersistenceFactory, right? You
can just add an inputModule, that looksup your de.cocoon.hibernate.HibernateFactory, and returns
what you are asking for. Look at other inputModules, shouldn't be to hard,

Regards Ard

> Thanks a lot
> Wotan von Klass
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message