Patrick Heiden wrote:
Hi Andre!

<snip/>

It is actually possible to import beans etc from other files.

See http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-basics
Section 3.2.2.1. Composing XML-based configuration metadata

You would write something like:

<import resource="classpath://services.xml"/>

Do you mean that this should be put inside 
META-INF/cocoon/spring/someContext.xml? That is what would make sense to me.

Yes, exactly.


The service.xml would then sit in your standalone jar which can therefore also be tested outside of cocoon and can also be used in other environments than cocoon (as if there is anything else worth considering...). The services.xml would define beans, transactions, etc in the regular way. I have typically a few of includes.

Other beans you have made yourself that are typical to cocoon would be defined in xml files placed in the designated subdirectories (META-INF/cocoon/spring.)

You still need to include a dependency in the pom of each block that uses your domain jar, because you would need the jar for deployment. The issue that remains to be looked into is that a number of blocks may require the same setup for transactions. The definitions for this probably would need to be defined globally.

This is a bit condusing to me, because I would define my transactions inside my 
domain-model-appCtx and let cocoon-controller (e.g. flowscript) transparently 
use them. So there already are 'global' defined transactions.

Sorry, I was apparently not clear. I use facades that sit on top of the domain layer. My flow scripts just deal with these facades. These facades are made transaction aware. You do exactly the same. Currently, I have just one spring conf file (in the jar) that defines the transaction management for the domain. I am just not entirely clear whether the transactions are truly global or just local within a block. If they are local than I would need to include the same transaction definitions in a number of blocks. If they are truly global, than just one block would need to include the transactions, I presume.


Greetings,
Patrick


--
Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
    the Dep. of Biochemistry | Email: [EMAIL PROTECTED]
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
NordProt                     | WWW: www.nordprot.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to