Patrick Heiden wrote:
Hello again!

So following your advised discussion, I am able to create the whole domainmodel 
as standalone .jar and add this as dependency to webapp-block, right? Of course 
I also have to put the domain-appCtx.xml into the META-INF/cocoon/spring 
directory. If I would do so, are all other blocks automatically aware of my 
domain.jar, or do I have to put the dependency to every blocks pom.xml wich is 
going to use it (besides testing!)?

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"/>

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.

Andre.



Thank you,
Patrick
-------- Original-Nachricht --------
Datum: Thu, 20 Mar 2008 13:24:29 +0200
Von: Andre Juffer <[EMAIL PROTECTED]>
An: users@cocoon.apache.org
Betreff: Re: [HELP]: blocks and domainmodel

Patrick,

some time ago I raised a similar question:

http://www.mail-archive.com/users@cocoon.apache.org/msg40943.html

The discussion there may be helpful to you as well.

Andre.

Patrick Heiden wrote:
Hello together!

I'm trying to find a 'best' way to integrate my
domainmodel/businesslayer into cocoon 22 block-semantics. Imagine a rich 
domainmodel with several
package-specific services presented to the client as facade (decoupling
persistence and the like). Development of the domainmodel is kept outside for
testing-purposes and so on. How should I integrate a 'finished' domainmodel
into cocoon-22 blocks?
Several blocks use different parts of the model, of course, and the
usage is triggered through a main-controller-block. Following the discussions
within this mailing-list so far, I am able to imagine, that I could spread
my domainmodel to different blocks, but this is not what I want to achieve.
Should there be a 'domain'-block, wich contains all domain-beans/objects
and from wich other blocks can get access to the domain?
Maybe my problem is, that there is no archetype for such an integrated
dev-environment (or my thoughts about using the given ones is somewhat
incomplete). I would like a structure like the following:
myProject
+ domain
   + ...
+ dao
   + ...
+ web
   + cocoon-blocks

Or is it the best way to build the domain totally seperate and add the
domain.jar as dependency to my blocks?
Any hints possible based on my short description?

Best 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]



--
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