cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <alexander.klimetsc...@mindquarry.com>
Subject Re: URLs in blocks?
Date Fri, 06 Apr 2007 12:18:56 GMT
Lally Singh schrieb:
> Of course, sorry -- too much late night hacking.
> 
> I've got a class I'm setting up with a Spring bean.  E.g:
>  <bean id="orgChart"
>         class="edu.vt.iddl.meval.org.spring2007.OrgChart2007"
>         >
>            <!-- an XML file describing the organization chart -->
>                <property name="orgFile">
>                        
> <value>cocoon:block:/resources/orgChart207.xml</value>
>                </property>
> 
>   </bean>
> 
> I'm not sure about either the format for this URI, which should refer
> to a block-private XML file (nor even exactly where to put those,
> would they be COB-INF?), nor how to resolve such a URI into a proper
> filename at runtime.

Are you using blockServlets (blocks-fw) or the new servlet-services [1] of 
Cocoon 2.2 in trunk? If yes, the URL would be either

block:<connection-name>:/resources/orgChart207.xml (blocks-fw)

or

servlet:<connection-name>:/resources/orgChart207.xml (servlet-services).

This URL would call the sitemap configured in the servlet behind 
<connection-name> and it is typically placed in COB-INF. That sitemap must 
have a matcher that matches on resources/orgChart207.xml and retrieves the 
file, eg. from the file system under COB-INF.

But as far as I know, you cannot simply put a reference inside a property 
value in the Spring bean - you will have to use Cocoon's 
CocoonSourceResolver inside your class to actually get the content of the 
file from the url string.

If you use cocoon 2.1 there is only the cocoon: protocol 
(cocoon:/resources/orgChart207.xml) which asks the one and only sitemap 
(which might have sub-sitemaps mounted) for the file (matching and resolving 
the same as described above). But I am only using 2.2, so I could be wrong 
here...

Alex


[1] http://wiki.apache.org/cocoon/ServletService

-- 
Alexander Klimetschek
http://www.mindquarry.com


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


Mime
View raw message