Hi!

i try to migrate an old cocoon application (started with 2.0, and was migrated to 2.1 at least partly, will say with least possible efford...)

As a matter of fact, i try to modularize our application and with that i run in some problems.

So long we had a central cocoon.xconf, and in that one we configured some data sources, which was afterwards used in the whole application. While modularizing, i know that would be best to equip each of my new blocks with its own data sources. but nevertheless, i like the idea of configuring the database accesses in a central place, so i do not have to run through all blocks to check if they get informed of the change.

Now i do not really know how to configure these sources in the new cocoon world, i did not find something like the cocoon.xconf in the archetype sample block, and i do not want to blindly copy the whole old configuration file. It seems that a lot of configuration which was once written in this xconf file is no longer necessary.

Will that work if i take the data source configuration from the old file (and just this part), create a new cocoon.xconf, and place that, yes, where in my new central block do i place it? I would guess under src/main/resources/META-INF/cocoon/xconf/

And if i want to access a data source defined in the central block let us say from another block named target, i would have to do as follows:

- reference central in the block-service-service.xml of target block
- access the source i.e. from the sitemap of target block with something like that:
 <map:match pattern="apps">
   <map:generate src="apps-sql.xml" />
    <map:transform type="sql" label="debug">
<map:parameter name="use-connection" value="servlet:central:<name_of_datasource>" />
      <map:parameter name="show-nr-of-rows" value="true" />
      <map:parameter name="clob-encoding" value="UTF-8" />
    </map:transform>
    <map:transform src="apps2html.xsl" />
    <map:serialize type="html" />
  </map:match>

Here i could probably need some help with the string of parameter "use-connection". What i wrote in there is a wild guess.

I know much text and many questions, but as they all are connected to each other, i decided to post them in one.

I tried to figure this out by reading the documentation, but did not succeed :-( Any hint is appreciated.

Best regards

--
Søren D. Krum
Systemutvikler/system developer
UNINETT FAS
+ 47 73557859

There are 10 different kind of people in the world, those who understand binary 
and those who don't


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

Reply via email to