Hi Tullio,

To start with, I would take a look at the Modules section of the Technical
Guide here: 
http://documentation.magnolia-cms.com/technical-guide/modules.html

In addition, take a look at the Configuration Mechanism section of the
Technical Guide here:
http://documentation.magnolia-cms.com/technical-guide/configuration-mechanis
ms.html


Without knowing exactly what your requirements are, I would suggest adding
your properties to your module descriptor rather than magnolia.properties.
It keeps things a bit more easy to manage and makes updating to future
versions of Magnolia easier.

If you take this approach, you should be able to add your properties to your
module descriptor file.  As discussed in the Technical Guide, your module
descriptor is just an xml file that goes under your modules
resources/META-INF/magnolia directory. For instance, if your module's name
is foobar, then you would have the following:

my-module-foobar
  +- src
       +- main
            +- java
            +- resources
                 +- META-INF
                      +- magnolia
                           |- foobar.xml

Within your module descriptor (foobar.xml) you define your module class,
version handler, dependencies on other modules, and your properties.  For
example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "module.dtd">
<module>
  <name>foobar</name>
  <displayName>${project.name}</displayName>
  <description>${project.description}</description>
  <moduleClass>my.company.module.foobar.FoobarModule</moduleClass>
  
<versionHandler>my.company.module.foobar.setup.FoobarModuleVersionHandler</v
ersionHandler>
  <version>${project.version}</version>
  <properties>
    <property>
      <name>myPropertyName</name>
      <value>myPropertyValue</value>
    </property>
  </properties>
  <dependencies>
    <dependency>
      <name>standard-templating-kit</name>
      <version>1.3.5/*</version>
    </dependency>
    <dependency>
      <name>extended-templating-kit</name>
      <version>1.3.5/*</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <name>theme-pop</name>
      <version>1.3.5/*</version>
      <optional>false</optional>
    </dependency>
  </dependencies>
</module>

You can use the moduleClass to load and set properties when the module
starts up.  Have a look at magnolia-module-samples for implementation
examples.

HTH,
Matt


> From: Tullio Bettinazzi <[email protected]>
> Reply-To: Magnolia User-List <[email protected]>
> Date: Sat, 27 Nov 2010 01:42:56 -0800
> To: <[email protected]>
> Subject: Re[magnolia-user] ading properties
> 
> 
> 
> In my module I need to read some external parameter.
> I tried to find the way to read magnolia.properties, but I was'nt able to
> find the way.
> I tried to add some parameters to my module but, again, I wasn't able.
> Could You suggest me the way or, at least, some documentation about ?
> Tks
> Tullio
> -- 
> View this message in context:
> http://old.nabble.com/Reading-properties-tp30317530p30317530.html
> Sent from the Magnolia - User mailing list archive at Nabble.com.
> 
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to