Skip to content
Abhishek-Tejpaul edited this page Sep 25, 2010 · 17 revisions

Grails-Dynamic-Config-Plugin

This plugin is created using Grails 1.3.4 and gives your application the ability to dynamically change the config properties as defined in Config.groovy.

This plugin is useful in situations where you need to make run-time changes in the behavior of your application through config properties.

**NOTE: You need not re-deploy or restart your application after making the config property changes through this plugin. **

###Features###

  • Dynamic (on-the-run) changes to your Config properties.

  • Addition of new config property at the run-time.

  • Supports various data types as values for the config property (Integer, Boolean, String, Float, Long, Double).

  • Persists config properties in the database at the time of bootstrap. The properties are persisted ONLY if there is no already persisted object of ConfigProperty domain class.

###User Guide###

  1. Install the plugin using the following command:** grails install-plugin http://github.com/IntelliGrape/Grails-Dynamic-Config-Plugin/raw/master/grails-dynamic-config-0.1.zip**

  2. To use the plugin just goto the URL: //configProperty, where you will find the CRUD to create, edit or delete all of the config properties present in Config.groovy.

It is as simple as this :-)

DISCLAIMER: As of now, the plugin DOES NOT support the persistence of List as well as Closure values from the Config.groovy, though the persistence of List values is planned to be supported soon.

IMPORTANT: In the current version, no security feature is implemented. You need to protect access to configProperty controller using a Grails Filter or whatever other security mechanism that you use in your application to manage access.

Please feel free to come up with new enhancements or suggestions and e-mail us at aman@intelligrape.com.

FAQs:

Ques: I am getting the following error on application starup after I iinstall the plugin :

org.hibernate.DuplicateMappingException: duplicate import: ConfigProperty refers to both com.myapp.ConfigProperty and 
org.grails.plugins.dynamicConfig.ConfigProperty (try using auto-import="false")

Ans: The plugin uses the domain class ConfigProperty, so if your application uses the domain class with the same name, either rename your domain class or change its database mapping.

Clone this wiki locally