[Hippo-cms7-user] Dynamically changing the plugin configuration
Frank van Lankvelt
f.vanlankvelt at onehippo.com
Sun Apr 3 19:06:03 CEST 2011
On Sun, Apr 3, 2011 at 3:25 PM, Jeroen Reijn <j.reijn at onehippo.com> wrote:
> Hi all,
> I was playing around with the CMS plugin framework and I was wondering if
> it's correct, when I say that I can't programmatically change the plugin
> This is the error I'm getting:
> CMS 2011-04-03 15:04:09,036 ERROR
> java.lang.UnsupportedOperationException: null
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> Caused by: java.lang.UnsupportedOperationException
> at java.util.AbstractMap.put(AbstractMap.java:186)
> when i do config.put("SOME_ID", "SOME_VALUE"); where config is
> IPluginConfig from the constructor of my plugin.
> I noticed it's using an AbstractMap, but apparently the put method is not
> implemented as stated by .
> that is correct; you're not looking at the directly modifiable jcr nodes
corresponding to the configuration, but at a decorator that makes sure that
variables are replaced.
Is there perhaps another way of doing this? My use case is that I would like
> to insert a dynamic variable into the plugin config, which can be used by
> another component to which it delegates.
> I'm not sure what you mean. Is this configuration of a plugin that's
instantiated by the one making the change? In that case, you can create a
JavaPluginConfig (it has a copy constructor). This implementation is
The typical pattern is to look up the IClusterConfig and create a
clustercontrol out of it using a parameter map (ipluginconfig itself). The
parameter map is then the javapluginconfig that can be modified in the
plugin that instantiates the cluster.
> Hippo-cms7-user mailing list and forums
Hippo Europe • Amsterdam Oosteinde 11 • 1017 WT Amsterdam • +31 (0)20
USA • San Francisco 755 Baywood Drive, Second Floor • Petaluma, CA. 94954
• +1 877 414 4776 (toll free)
Canada • Montréal 5369 Boulevard St-Laurent #430 • Montréal QC H2T
1S5 • +1 (514) 316 8966
www.onehippo.com • www.onehippo.org • info at onehippo.com
This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Hippo-cms7-user