You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by "Eisert, Wolfram (ext.)" <Wo...@Dresdner-Bank.com> on 2002/03/14 15:23:38 UTC

[PROPOSAL] Globals in conf files

Hi,

I bring up this thread once again in order to hear your
opinion about defining globals in conf-file.

Following situation: In our cocoon application we want to
create our business logic as avalon components.

For this business logic we have the need for a view truly
global parameters (like to determine whether operation-mode
is test or production).

We came up that the best place for this globals could be
the context of the ComponentManager (ECM used by cocoon) -
but within cocoon you cannot modify the ECM-context from
outside :-(.

A possible solution would be to add a new feature to ECM
to read context attributes from a special area in conf-file
within configure-method of ECM?

Berin came up with the following suggestion to define
globals in conf-files:
   <context><!-- can be renamed to "global" or whatever -->
      <!-- defaults to string -->
     <entry name="version" value="1.0.3"/>
     <entry name="work-dir" value="/tmp/application/${version}/"
            type="java.io.File"/>
       <!-- Type must accept 1 string in constructor -->
   </context>

Attached you find a patch for ECM using the newly created
ContextUtility (in excalibur scratchpad) to add globals to
context in such way.
(see also
http://marc.theaimsgroup.com/?l=avalon-dev&m=101567749709660&w=2)


Adding this new feature to ECM would allow user to easily add
context-infos through conf-file without the need to have control
over the ComponentManager.

But then the conf-file wouldn't any longer be as free in format
as it is now. The <context/>-tag had to be reserved for special
use.


What do you think about this all?

Many thanks in advance,

Wolfram