<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Modularizing Groovy Config Files With a Dash of Meta-Programming</title>
	<atom:link href="http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/</link>
	<description>Groovy, Grails and OS X tips and tricks</description>
	<lastBuildDate>Sat, 31 Jul 2010 11:43:17 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lee Wexler</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-2676</link>
		<dc:creator>Lee Wexler</dc:creator>
		<pubDate>Tue, 11 May 2010 11:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-2676</guid>
		<description>(Sorry hit submit too early -- here is the included file)

&#039;ComposedConfig&#039; is exactly how you have specified.

******************************************************
TudGrailsConfig.groovy
******************************************************

        grails.mime.file.extensions = true
        grails.mime.use.accept.header = false
        grails.mime.types = [html: [&#039;text/html&#039;, &#039;application/xhtml+xml&#039;],
                xml: [&#039;text/xml&#039;, &#039;application/xml&#039;],
                text: &#039;text-plain&#039;,
                js: &#039;text/javascript&#039;,
                rss: &#039;application/rss+xml&#039;,
                atom: &#039;application/atom+xml&#039;,
                css: &#039;text/css&#039;,
                csv: &#039;text/csv&#039;,
                all: &#039;*/*&#039;,
                json: [&#039;application/json&#039;, &#039;text/json&#039;],
                form: &#039;application/x-www-form-urlencoded&#039;,
                multipartForm: &#039;multipart/form-data&#039;
        ]
        grails.views.default.codec = &quot;none&quot; // none, html, base64
        grails.views.gsp.encoding = &quot;UTF-8&quot;
        grails.converters.encoding = &quot;UTF-8&quot;
        grails.enable.native2ascii = true</description>
		<content:encoded><![CDATA[<p>(Sorry hit submit too early &#8212; here is the included file)</p>
<p>&#8216;ComposedConfig&#8217; is exactly how you have specified.</p>
<p>******************************************************<br />
TudGrailsConfig.groovy<br />
******************************************************</p>
<p>        grails.mime.file.extensions = true<br />
        grails.mime.use.accept.header = false<br />
        grails.mime.types = [html: ['text/html', 'application/xhtml+xml'],<br />
                xml: ['text/xml', 'application/xml'],<br />
                text: &#8216;text-plain&#8217;,<br />
                js: &#8216;text/javascript&#8217;,<br />
                rss: &#8216;application/rss+xml&#8217;,<br />
                atom: &#8216;application/atom+xml&#8217;,<br />
                css: &#8216;text/css&#8217;,<br />
                csv: &#8216;text/csv&#8217;,<br />
                all: &#8216;*/*&#8217;,<br />
                json: ['application/json', 'text/json'],<br />
                form: &#8216;application/x-www-form-urlencoded&#8217;,<br />
                multipartForm: &#8216;multipart/form-data&#8217;<br />
        ]<br />
        grails.views.default.codec = &#8220;none&#8221; // none, html, base64<br />
        grails.views.gsp.encoding = &#8220;UTF-8&#8243;<br />
        grails.converters.encoding = &#8220;UTF-8&#8243;<br />
        grails.enable.native2ascii = true</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Wexler</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-2674</link>
		<dc:creator>Lee Wexler</dc:creator>
		<pubDate>Tue, 11 May 2010 11:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-2674</guid>
		<description>This looks like exactly what I am looking for, but I am having trouble making it work (at least in grails 1.3, groovy 1.7).


I think I have copied your approach pretty faithfully, but get the following exception.  My config files are below

groovy.lang.MissingPropertyException: No such property: grails for class: TudgrailsConfig
	at TudgrailsConfig.run(TudgrailsConfig.groovy:9)


******************************************************
Config.groovy
******************************************************
import com.tudor.web.tudgrails.TudgrailsConfig

class Config extends ComposedConfig {

    def run() {

        includeScript(TudgrailsConfig)


        // ----------------
        // Grails Misc
        //-------------------
        grails.project.groupId=&#039;com.tudor.application.research&#039;
   


********************************</description>
		<content:encoded><![CDATA[<p>This looks like exactly what I am looking for, but I am having trouble making it work (at least in grails 1.3, groovy 1.7).</p>
<p>I think I have copied your approach pretty faithfully, but get the following exception.  My config files are below</p>
<p>groovy.lang.MissingPropertyException: No such property: grails for class: TudgrailsConfig<br />
	at TudgrailsConfig.run(TudgrailsConfig.groovy:9)</p>
<p>******************************************************<br />
Config.groovy<br />
******************************************************<br />
import com.tudor.web.tudgrails.TudgrailsConfig</p>
<p>class Config extends ComposedConfig {</p>
<p>    def run() {</p>
<p>        includeScript(TudgrailsConfig)</p>
<p>        // &#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        // Grails Misc<br />
        //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        grails.project.groupId=&#8217;com.tudor.application.research&#8217;</p>
<p>********************************</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Wexler</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-2675</link>
		<dc:creator>Lee Wexler</dc:creator>
		<pubDate>Tue, 11 May 2010 11:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-2675</guid>
		<description>This looks like exactly what I am looking for, but I am having trouble making it work (at least in grails 1.3, groovy 1.7).


I think I have copied your approach pretty faithfully, but get the following exception.  My config files are below

groovy.lang.MissingPropertyException: No such property: grails for class: TudgrailsConfig
	at TudgrailsConfig.run(TudgrailsConfig.groovy:9)


******************************************************
Config.groovy
******************************************************
import com.tudor.web.tudgrails.TudgrailsConfig

class Config extends ComposedConfig {

    def run() {

        includeScript(TudgrailsConfig)


        // ----------------
        // Grails Misc
        //-------------------
        grails.project.groupId=&#039;com.tudor.application.research&#039;
   


********************************</description>
		<content:encoded><![CDATA[<p>This looks like exactly what I am looking for, but I am having trouble making it work (at least in grails 1.3, groovy 1.7).</p>
<p>I think I have copied your approach pretty faithfully, but get the following exception.  My config files are below</p>
<p>groovy.lang.MissingPropertyException: No such property: grails for class: TudgrailsConfig<br />
	at TudgrailsConfig.run(TudgrailsConfig.groovy:9)</p>
<p>******************************************************<br />
Config.groovy<br />
******************************************************<br />
import com.tudor.web.tudgrails.TudgrailsConfig</p>
<p>class Config extends ComposedConfig {</p>
<p>    def run() {</p>
<p>        includeScript(TudgrailsConfig)</p>
<p>        // &#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        // Grails Misc<br />
        //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
        grails.project.groupId=&#8217;com.tudor.application.research&#8217;</p>
<p>********************************</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-2658</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Wed, 28 Apr 2010 05:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-2658</guid>
		<description>@Mick, did you really put it in grails-app/config or grails-app/conf?

grails-app/config wouldn&#039;t be in your classpath.

Also, did you try the ComposedConfigScript that I have at the end of the post?  I can&#039;t quite be sure from your message, but I think you might be trying the example above that I say would be nice, but doesn&#039;t actually work.</description>
		<content:encoded><![CDATA[<p>@Mick, did you really put it in grails-app/config or grails-app/conf?</p>
<p>grails-app/config wouldn&#8217;t be in your classpath.</p>
<p>Also, did you try the ComposedConfigScript that I have at the end of the post?  I can&#8217;t quite be sure from your message, but I think you might be trying the example above that I say would be nice, but doesn&#8217;t actually work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mick Knutson</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-2656</link>
		<dc:creator>Mick Knutson</dc:creator>
		<pubDate>Tue, 27 Apr 2010 12:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-2656</guid>
		<description>I put my class in grails-app/config/ConfigSupport

Then in Config.groovy:

def configSupport = new ConfigSlurper().parse( ConfigSupport )
assert configSupport != null

grails.config = grails.config.merge(configSupport)
//ConfigurationHolder.setConfig(configSupport)



The config I am pulling in is .\grails-app\utils\com\comcast\uivr\divr\util
PromptProperties.groovy:

prompt{
    prompt_test_cfg = &quot;test&quot;
}

//assert grails.config.application.configuration.version == &quot;3.0.1&quot;
assert configSupport.prompt.prompt_test_cfg == &quot;test&quot;


I even tried moving ConfigSupport into .\grails-app\utils\com\comcast\uivr\divr\util as well but I can not get it to work</description>
		<content:encoded><![CDATA[<p>I put my class in grails-app/config/ConfigSupport</p>
<p>Then in Config.groovy:</p>
<p>def configSupport = new ConfigSlurper().parse( ConfigSupport )<br />
assert configSupport != null</p>
<p>grails.config = grails.config.merge(configSupport)<br />
//ConfigurationHolder.setConfig(configSupport)</p>
<p>The config I am pulling in is .\grails-app\utils\com\comcast\uivr\divr\util<br />
PromptProperties.groovy:</p>
<p>prompt{<br />
    prompt_test_cfg = &#8220;test&#8221;<br />
}</p>
<p>//assert grails.config.application.configuration.version == &#8220;3.0.1&#8243;<br />
assert configSupport.prompt.prompt_test_cfg == &#8220;test&#8221;</p>
<p>I even tried moving ConfigSupport into .\grails-app\utils\com\comcast\uivr\divr\util as well but I can not get it to work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-1763</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 11 Aug 2009 22:29:54 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-1763</guid>
		<description>Sound great! 1+ for increased flexibility :)</description>
		<content:encoded><![CDATA[<p>Sound great! 1+ for increased flexibility :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-1710</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Mon, 03 Aug 2009 13:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-1710</guid>
		<description>@Chris subclassing ConfigSlurper would only work for the plugins/config files that are under your control.  If you don&#039;t control the code that&#039;s actually doing the slurping, then the subclassed ConfigSlurper wouldn&#039;t get used (unless I&#039;m missing something that you&#039;re suggesting).

The thing that actually made me want to do this in the first place was the acegi/spring security plugin.

We have 5 apps currently that all share very similar spring security settings but we wanted the ability to vary a couple of the property without doing a copy/paste of the entire config file. 

This solution lets us do this, we includeConfig on the default config that&#039;s in a shared config file used across all projects.  Then tweak the config file for the places that differ slightly.</description>
		<content:encoded><![CDATA[<p>@Chris subclassing ConfigSlurper would only work for the plugins/config files that are under your control.  If you don&#8217;t control the code that&#8217;s actually doing the slurping, then the subclassed ConfigSlurper wouldn&#8217;t get used (unless I&#8217;m missing something that you&#8217;re suggesting).</p>
<p>The thing that actually made me want to do this in the first place was the acegi/spring security plugin.</p>
<p>We have 5 apps currently that all share very similar spring security settings but we wanted the ability to vary a couple of the property without doing a copy/paste of the entire config file. </p>
<p>This solution lets us do this, we includeConfig on the default config that&#8217;s in a shared config file used across all projects.  Then tweak the config file for the places that differ slightly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Broadfoot</title>
		<link>http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming/comment-page-1/#comment-1707</link>
		<dc:creator>Chris Broadfoot</dc:creator>
		<pubDate>Mon, 03 Aug 2009 06:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=60#comment-1707</guid>
		<description>or you could probably subclass ConfigSlurper to provide this functionality yourself.</description>
		<content:encoded><![CDATA[<p>or you could probably subclass ConfigSlurper to provide this functionality yourself.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
