You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Ole Ersoy <ol...@gmail.com> on 2007/07/10 00:17:41 UTC

Re: [ApacheDS] [Maven] How can we have one authoritative copy of the server.xml file?

Here's an EMF way:

1) Create an EMF Model of the server's configuration
2) Set defaults the mirror the server's current defaults
3) Have this model in it's own EMF model project

Now whenever another project (Installer, Triplesec, ...) needs an instance of the server.xml with the defaults it can just serialize the model to where the server.xml document needs to be.  If custom settings need to be made, just make them on the model, and then serialize.  A simple mojo could be created to handle this, which would make the server.xml always be updated automatically in all projects that the mojo is plugged into.  This would also update all server.xml files, whenever the configuration model is updated.

Cheers,
- Ole



Alex Karasulu wrote:
> Hi all,
> 
> I'm fed up with having to apply changes between the server.xml file in 
> the server-main project
> to the server-installers project which also contains a server.xml file 
> in it and vice versa.  Some
> times there are slight differences in these files and diffs get out of 
> wack so I cannot tell which
> file is the most up to date.
> 
> I'd like to centralize and have a single authoritative copy in all of 
> the ApacheDS project.  I'd like
> to make maven reuse this same server.xml where ever it may be needed.  
> There is no XML
> artifact (packaging type in Maven jargon). If there was then we could 
> create a module with a
> dependency on this server.xml and reuse it all over without having to 
> worry about keeping
> multiple copies in sync.  This is an even greater issue in Triplesec btw 
> so it's a problem worth
> solving.
> 
> Does anyone know or recommend a way we can use some Maven magic to solve 
> this problem?
> 
> Thanks,
> Alex
> 

Re: [ApacheDS] [Maven] How can we have one authoritative copy of the server.xml file?

Posted by Ole Ersoy <ol...@gmail.com>.
Oh - One more thing.  I was focusing primarily on the server.xml syncing in the last explanation, but there is another benefit.  A eclipse model configuration editor can is also generated, when selecting "Generate All".  Thus whenever the model changes, this code is automatically updated as well....LS would probably want to update the default generated editor.  With a few extra code generation templates, this could also be automated.  Thus the server configuration editor is always generated and up to date.

Now if we decided to do it, then we might as well just use the DAS to store the model configuration entries in the DIT, since the integration is "Free".  Thus whenever the model changes, the DIT integration is taken care of as well.  Developers would only have to deal with instances of the EMF Model "Beans" when working with the server configuration model instance.

Cheers,
- Ole



David Jencks wrote:
> 
> On Jul 9, 2007, at 6:17 PM, Ole Ersoy wrote:
> 
>> Here's an EMF way:
>>
>> 1) Create an EMF Model of the server's configuration
>> 2) Set defaults the mirror the server's current defaults
>> 3) Have this model in it's own EMF model project
>>
>> Now whenever another project (Installer, Triplesec, ...) needs an 
>> instance of the server.xml with the defaults it can just serialize the 
>> model to where the server.xml document needs to be.  If custom 
>> settings need to be made, just make them on the model, and then 
>> serialize.  A simple mojo could be created to handle this, which would 
>> make the server.xml always be updated automatically in all projects 
>> that the mojo is plugged into.  This would also update all server.xml 
>> files, whenever the configuration model is updated.
> 
> I don't know much about EMF, but how is this better than having a 
> project that just pops the server.xml into a jar file, and any project 
> that needs the server.xml extracts it?  It seems to me that the EMF 
> solution just ties you to eclipse with no actual benefit.  What am I 
> missing?
> 
> thanks
> david jencks
> 
>>
>> Cheers,
>> - Ole
>>
>>
>>
>> Alex Karasulu wrote:
>>> Hi all,
>>> I'm fed up with having to apply changes between the server.xml file 
>>> in the server-main project
>>> to the server-installers project which also contains a server.xml 
>>> file in it and vice versa.  Some
>>> times there are slight differences in these files and diffs get out 
>>> of wack so I cannot tell which
>>> file is the most up to date.
>>> I'd like to centralize and have a single authoritative copy in all of 
>>> the ApacheDS project.  I'd like
>>> to make maven reuse this same server.xml where ever it may be 
>>> needed.  There is no XML
>>> artifact (packaging type in Maven jargon). If there was then we could 
>>> create a module with a
>>> dependency on this server.xml and reuse it all over without having to 
>>> worry about keeping
>>> multiple copies in sync.  This is an even greater issue in Triplesec 
>>> btw so it's a problem worth
>>> solving.
>>> Does anyone know or recommend a way we can use some Maven magic to 
>>> solve this problem?
>>> Thanks,
>>> Alex
> 
> 

Re: [ApacheDS] [Maven] How can we have one authoritative copy of the server.xml file?

Posted by Ole Ersoy <ol...@gmail.com>.
SNIP
> 
> I don't know much about EMF, but how is this better than having a 
> project that just pops the server.xml into a jar file, and any project 
> that needs the server.xml extracts it?  

Now the model is decoupled from it's default serialization.  If we use EMF, we can update the model (XML Schema, Ecore, Java Interface Annotations - Other 3rd party tools such as class diagrams), and regenerate the xml default representation and the model code.  Thus everything related to the model is always generated from a single source.

> It seems to me that the EMF 
> solution just ties you to eclipse with no actual benefit.  What am I 
> missing?

I think the tight coupling with the model is the primary benefit.  If EMF were used, we could easily change the configuration model and generate the corresponding XML Schema, default serialization server.xml instance, etc.  There are lots of other goodies that come with the EMF API, that open up many other possibilities, but as far as keeping server.xml in sync everywhere this is the primary benefit.

Cheers,
- Ole

Re: [ApacheDS] [Maven] How can we have one authoritative copy of the server.xml file?

Posted by David Jencks <da...@yahoo.com>.
On Jul 9, 2007, at 6:17 PM, Ole Ersoy wrote:

> Here's an EMF way:
>
> 1) Create an EMF Model of the server's configuration
> 2) Set defaults the mirror the server's current defaults
> 3) Have this model in it's own EMF model project
>
> Now whenever another project (Installer, Triplesec, ...) needs an  
> instance of the server.xml with the defaults it can just serialize  
> the model to where the server.xml document needs to be.  If custom  
> settings need to be made, just make them on the model, and then  
> serialize.  A simple mojo could be created to handle this, which  
> would make the server.xml always be updated automatically in all  
> projects that the mojo is plugged into.  This would also update all  
> server.xml files, whenever the configuration model is updated.

I don't know much about EMF, but how is this better than having a  
project that just pops the server.xml into a jar file, and any  
project that needs the server.xml extracts it?  It seems to me that  
the EMF solution just ties you to eclipse with no actual benefit.   
What am I missing?

thanks
david jencks

>
> Cheers,
> - Ole
>
>
>
> Alex Karasulu wrote:
>> Hi all,
>> I'm fed up with having to apply changes between the server.xml  
>> file in the server-main project
>> to the server-installers project which also contains a server.xml  
>> file in it and vice versa.  Some
>> times there are slight differences in these files and diffs get  
>> out of wack so I cannot tell which
>> file is the most up to date.
>> I'd like to centralize and have a single authoritative copy in all  
>> of the ApacheDS project.  I'd like
>> to make maven reuse this same server.xml where ever it may be  
>> needed.  There is no XML
>> artifact (packaging type in Maven jargon). If there was then we  
>> could create a module with a
>> dependency on this server.xml and reuse it all over without having  
>> to worry about keeping
>> multiple copies in sync.  This is an even greater issue in  
>> Triplesec btw so it's a problem worth
>> solving.
>> Does anyone know or recommend a way we can use some Maven magic to  
>> solve this problem?
>> Thanks,
>> Alex