Before creating a new hack proposal I want to collect opinions about the
following issue.
In the configuration directory of MMBase are currently some things which are
not to be considered 'configuration' at all. The most clear example is the
'dtd' subdirectory.
I want to propose to make 'resources' of this. This is very easy to do:
I changed XMLEntityResolver and now after failing to find the DTD
in config/dtd, it simply opens it using getResourceAsStream("/dtd"+dtdName).
I can now place the dtd's in WEB-INF/classes/dtd. Of course I can also
place them in mmbase.jar now if I want to.
I want to ask, before collecting negative votes because of this, what you
find a good directory for these kind of 'non-class' resources. I think it
must at least be prefixed with 'org/mmbase', for example:
WEB-INF/classes/org/mmbase/resources/dtd
And perhaps we should even consider moving the dtd's from the 'config'
module to the 'mmbase' (src) module of CVS.
XMLEntity still will check the config dir first, so there will be even two
ways to override the dtds from the mmbase.jar (but why would you want
something like that, it only makes sense if you also replace the
functionality in mmbase.jar): placing the file in config/dtd or in
WEB-INF/classes/org/mmbase/resources/dtd
The same thing also applies for certain XML's in the config directory, for
example the xml's in the 'databases' subdirectory. It is also possible to
fetch those as resources. This is a little bit more work (e.g. the new
DatabaseLookup class must be changed to work with InputSources rather then
with Files), so I have not done this yet, but I'll be glad to if this is
considerd to be a good idea.
The advantage of all this is that the configuration directory of the distro
can be cleaned up, and there stay only files in it in which you actually
could want to change something in (applications, builders, modules,
security, log). And the risk of a failing startup of MMBase because of
missing resources is minimized, because if you have the jar, you have the
right resources which are associated with it, too.
Michiel
--
Michiel Meeuwissen
Mediapark, C 107 tel. +31 (0)35 6772979