On Fri, 2007-11-02 at 11:21 +0100, Thorsten Scherler wrote: 
> Hi all,
> 
> I am looking for the input module which returns the properties which I
> have configured in 
> myBlock/src/main/resources/META-INF/cocoon/properties/test.properties
> 
> I found out that I can use the properties in my sitemap as:
> {global:myProp}
> but I am using 
> http://forrest.apache.org/pluginDocs/plugins_0_80/org.apache.forrest.plugin.output.inputModule/
> "...The generator contacts the input module and gets an iterator of all
> attribute names. This iterator will be then used to receive the values
> of the key..."
> 
> It seems that the generator can connect to the input module "global" but
> it returns
> <properties input-module="global"/>
> meaning it seems that the getAttributeNames(...) does not work well for
> the corresponding module.
> 
> Which is the class for the global input module in 2.2? 
> 

I found it: SettingsInputModule
and like I thought:

public Iterator getAttributeNames(Configuration modeConf, Map
objectModel)
    throws ConfigurationException {
        return IteratorUtils.EMPTY_ITERATOR;
    }

Changing this to 
public Iterator getAttributeNames(Configuration modeConf, Map
objectModel)
    throws ConfigurationException {
        final Settings settings =
(Settings)WebAppContextUtils.getCurrentWebApplicationContext().getBean(Settings.ROLE);
        return settings.getPropertyNames().iterator();
    }

works like a charm.

salu2

> salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


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

Reply via email to