Application Configuration Plugin

1 vote
Dependency:
compile ":application-configuration:0.1"

 Documentation  Source  Issues

Summary

Grails plugin that expose a Conf class to get/put string values based on string keys: Conf.valueGet("website-motto").

Installation

grails install-plugin application-configuration

Description

Avoid to create again a Conf class to get/put key->value runtime application configuration information.

Usage

Import

import net.forkwait.Conf
Import only where you use it

Put/Get

After the plugin was installed a Conf class will be available to store and retrieve strings:

Conf.valuePut("header","Welcome to this company website!")
def websiteHeader = Conf.valueGet("header")
or
def websiteHeader = Conf.valueGet("header", "default value if isn't present")
You can store integer, duble, etc and converting them after get. Also objects in json format...everything you want. If the single parameter get is used and the key isn't present, null is returned. The put operation return the inserted value.

Future

  • Caching level
  • list/edit view
  • transaction on put