Colin,

I'm busy evaluating your ejbmerge plugin.
I've got it up and running and it's a nice concept.
At first sight this could be a solution for me, but i did notice
something that will cause some problems for me:
1) if a tag is mentioned in the configfile (XMLMerger.xml) then there's
a test if it already appears in the targetfile. If so, it won't be
copied to the target file (again). This works fine for tags that only
appear once in the sourcefile (ejb-jar.xml), like <enterprise-beans>.
When i want to merge some <resource-refs>, which are related to my
entity beans, i have tell de XMLMerger (via the config file) that i want
to expand my <entity>-bean configuration. There is no
<resource-refs>-tag in my original source ejb-jar.xml. 
Can i do this with the standard plugin ?

One solution, of course, is to make sure that the required tags are
already (as placeholders) in the source file. But still, i will have tot
replace (override it via the config file) the whole <resource-refs>
section, so adding a single <resource-ref> to the already present ones
won't work, i guess.

2) I want to override/merge a ''specific'' entity of session bean (or
whatever 'element' in my ejb-jar.xml. I guess that current
XMLMerger.java util will have to be extended to do something like:
source-element=config-element AND it's source attribute-'ID'=the
config's attribute-'ID'.

I know that you've made the plugin for merging serveral ejb.jars (and
their DD's) together. And for that case, it does the job (very wel, i
must add). I my case, i need some extra.
What i most certainly like about the plugin is that the source ejb-jar
deliverable is there, ready to use, which fits nice in the whole maven
thinking.

What do you think about the stated 'problems' ?
-wil-

-----Oorspronkelijk bericht-----
Van: MacLeod, Colin [mailto:[EMAIL PROTECTED] 
Verzonden: woensdag 24 maart 2004 16:44
Aan: Maven Users List
Onderwerp: Re: AW: EJB Deployment descriptor configuration

Hi Wim,

> 1) XMLMerger.xml
> -a) tag <enterprise-beans>: in my original Dep. Descripter there's an
> entity bean with no resource refs (refs to Datasources e.g.). Is it
> possible to put the <resource-ref> tags somewhere in de XMLMerger.xml
so
> that they get merged with the earlier <entity>-info. Here's an
example:

Well the way it works is that every tag which is in the XMLMerger.xml
file will be merged. If a tag does not appear, it will be appended
within 
one of the "to be merged" tags.

Using this

    <file name="ejb-jar.xml">
        <ejb-jar>
            <description/>
            <display-name/>
            <enterprise-beans/>
            <relationships/>
            <assembly-descriptor/>
        </ejb-jar>
    </file>

for the ejb-jar will cause the contents of the ejb-jar/description,
ejb-jar/display-name, ejb-jar/enterprise-beans, etc to be appended
from one ejb jar to the next.


Likewise for jboss,

    <file name="jboss.xml">
        <jboss>
            <enterprise-beans/>
            <resource-managers/>
        </jboss>
    </file>

causes the contents of ejb-jar/enterprise-beans and
ejb-jar/resource-managers from one ejb jar to be appended to the next


> -c) what about 'overriding' tags ?

Well I did do this with the attribute merge="false".
        <jbosscmp-jdbc>
            <defaults merge="false">
                <datasource>java:/portalDS</datasource>
                <datasource-mapping>PostgreSQL 7.2</datasource-mapping>
                <create-table>false</create-table>
                <remove-table>false</remove-table>
            </defaults>

Basically, this tells the program not to merge the contents but to use
those explicity listed, so any defaults will be ignored from the DDs
to be merged.

> 2) what 'license agreement' is there on your plugin ?

The whole project is GPL.
Does this do what you want it to?

Cheers,
Colin
__________________________________________________
Colin MacLeod
[EMAIL PROTECTED]
ivata.org - open source enterprise groupware


On 24 March, at 2:54 PM, you wrote:

Hi Colin,

I haven't test it yet (had some meeting first), sorry.
But i did take a look at the openportal/ejb/src/xml/XMLMerger.xml
already.
I like the concept, but some questions though:
1) XMLMerger.xml
-a) tag <enterprise-beans>: in my original Dep. Descripter there's an
entity bean with no resource refs (refs to Datasources e.g.). Is it
possible to put the <resource-ref> tags somewhere in de XMLMerger.xml so
that they get merged with the earlier <entity>-info. Here's an example:

======================================================
Original ejb-jar.xml (extraction):
...
      <entity >
         <display-name>AuthenticationMethodEJB</display-name>
         <ejb-name>sfc/AuthenticationMethodEb</ejb-name>
 
<local-home>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationM
ethodEbLocalHome</local-home>
 
<local>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationMethod
EbLocal</local>

 
<ejb-class>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationMe
thodEbBMP</ejb-class>
         <persistence-type>Bean</persistence-type>
 
<prim-key-class>be.schaubroeck.prj.sfc.ejb.aa.authentication.Authenticat
ionMethodEbPK</prim-key-class>
         <reentrant>False</reentrant>        
      </entity>
...
=======================================================
XMLMerger.xml (somewhere in this file. There things i like to merge for
that particular entity bean or for all entity beans ...)

<XMLMerger>
    <file name="ejb-jar.xml">
        <ejb-jar>
                <enterprise-beans>
                <entity>
                        <ejb-name>sfc/AuthenticationMethodEb</ejb-name>
                  <!-- #################################################
-->
                  <!-- Things to merge ... -->    
                           <resource-ref >
                        <res-ref-name>jdbc/mySQL</res-ref-name>
                            <res-type>javax.sql.DataSource</res-type>
                            <res-auth>Container</res-auth>
                         </resource-ref>
                  <!-- #################################################
-->  
                </entity>
        </file>
</ejb-jar>

=========================================================
RESULT:
...
      <entity >
         <display-name>AuthenticationMethodEJB</display-name>
         <ejb-name>sfc/AuthenticationMethodEb</ejb-name>
 
<local-home>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationM
ethodEbLocalHome</local-home>
 
<local>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationMethod
EbLocal</local>

 
<ejb-class>be.schaubroeck.prj.sfc.ejb.aa.authentication.AuthenticationMe
thodEbBMP</ejb-class>
         <persistence-type>Bean</persistence-type>
 
<prim-key-class>be.schaubroeck.prj.sfc.ejb.aa.authentication.Authenticat
ionMethodEbPK</prim-key-class>
         <reentrant>False</reentrant>
           <!-- ################################################# -->  
           <resource-ref >
                        <res-ref-name>jdbc/mySQL</res-ref-name>
                    <res-type>javax.sql.DataSource</res-type>
                    <res-auth>Container</res-auth>
         </resource-ref>  
         <!-- ################################################# -->

      </entity>
...
=========================================================

-b) Same question for the jboss.xml.
-c) what about 'overriding' tags ?

2) what 'license agreement' is there on your plugin ?


thanks again !
-wil-


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


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

Reply via email to