<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2062789433050926004</id><updated>2024-09-12T01:26:45.545-05:00</updated><category term="Envers"/><category term="Grails"/><title type='text'>Just call it a feature...</title><subtitle type='html'>Sharing my adventures in software engineering</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-6957798961526581362</id><published>2012-10-31T21:31:00.001-05:00</published><updated>2012-10-31T21:31:11.853-05:00</updated><title type='text'>Un-follow All Twitter Followings</title><content type='html'>&lt;div&gt;
My Twitter account was hacked. &amp;nbsp;I&#39;m think I read about a Twitter breach at some time, or maybe I had a weak password. &amp;nbsp;I also ignored the weird follower &amp;amp; following emails I was getting. &amp;nbsp;Its my own fault, but I just wasnt worried about it.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I decided to check out a new Twitter App on Android today. &amp;nbsp;When I logged in, I saw all kinds of weird posts that I hadnt made, followers I&#39;d never heard of, and over 1k of people I was following - I think I was following 2 people when I had previously checked.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So I changed my password, deleted the bogus tweets and then moved on to address the 1k of people I was following. &amp;nbsp;Turns out, this is kind of difficult. &amp;nbsp;There are some pay apps you can do it with, or you can click through all of the people and unfollow. &amp;nbsp;Awesome....&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I had an idea. &amp;nbsp;Since the twitter page will load all of my people as I scroll, I could write something that walked the DOM and handled this issue for me. &amp;nbsp;I assumed Twitter had jQuery installed, so I opened up Firebug&#39;s console and hacked it together.&lt;br /&gt;
&lt;br /&gt;
Here is the Javascript :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;$(&quot;span.button-text.following-text&quot;).each(function(iIndex, oElement){
    var oElement = $(oElement);
    if (oElement.css(&quot;display&quot;) != &quot;none&quot;){
        oElement.click();
    }
})&lt;/pre&gt;
&lt;br /&gt;
The script will only click on the buttons with &quot;Following&quot; in the text, so you dont have to scroll all the buttons into view at once. &amp;nbsp;You also dont have to worry about it toggling the buttons.&lt;br /&gt;
&lt;br /&gt;
Done. &amp;nbsp;If anyone from Twitter reads this, it would be nice if you guys provided a feature for this. &amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/6957798961526581362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/6957798961526581362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/6957798961526581362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/6957798961526581362'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2012/10/un-follow-all-twitter-followings.html' title='Un-follow All Twitter Followings'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-9129698373681355723</id><published>2012-01-03T22:15:00.000-06:00</published><updated>2012-01-03T22:15:30.083-06:00</updated><title type='text'>New Year, New Gig</title><content type='html'>Its a new year and I&#39;ve started at a new job.  Not just a new job, but new job using new technology located in a new state far enough away to have a new climate.  Fun Stuff right?&lt;br /&gt;
&lt;br /&gt;
Since this is a technology blog, I&#39;m going to speak to that.  I will no longer be using Grails in my daily work life.  My new job has me dealing with both Java and .NET web applications.  I still intend to keep up with Grails, but realistically I wont be paying as much attention as before.  Regarding my Grails plugins, I plan to maintain the jQuery-UI plugin up.  The YUI plugin will probably die off unless someone asks me for it.&lt;br /&gt;
&lt;br /&gt;
To be honest, I&#39;m not sure how much I&#39;ll be able to write about my new work - I have to ask my boss.   In the mean time, I should have more time for side projects and code adventures - so I&#39;ll share those instead.</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/9129698373681355723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/9129698373681355723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/9129698373681355723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/9129698373681355723'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2012/01/new-year-new-gig.html' title='New Year, New Gig'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-1680695768074931728</id><published>2011-09-25T13:46:00.001-05:00</published><updated>2011-09-26T20:35:56.993-05:00</updated><title type='text'>Simplifying External TagLibs with Proxies</title><content type='html'>I am the proud author of the &lt;a href=&quot;http://grails.org/plugin/jqueryui-widget&quot;&gt;jQuery-UI-Widget&lt;/a&gt;&amp;nbsp;Grails Plugin.&amp;nbsp; &amp;nbsp;I built this plugin to enable Grails developers the ability to create jQuery-UI widgets without dealing with JavaScript directly. &amp;nbsp; This allows Grails developers to use the resources they are familiar with while still building cool, rich User Interface components.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This post isnt about my plugin. &amp;nbsp;Instead, its about how engineers can better utilize plugins like mine. &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;One of the challenges I&#39;ve faced when leading a team of developers is this... How can I enforce all components of a certain type are built the same way, especially when I dont control the construction of the component itself. &amp;nbsp;A non-abstract example of this issue is this... Developers on my team are all creating jQuery-UI AutoCompletes via the TagLib. &amp;nbsp;How do I ensure all the AutoComplete configuration properties are the same?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The answer is simple. &amp;nbsp;You require all instantiations of the component to go through your own code. &amp;nbsp;This is called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Proxy_pattern&quot;&gt;Proxy Pattern&lt;/a&gt;. &amp;nbsp;In practice, you create a wrapper that your developers call. &amp;nbsp;This wrapper is responsible for setting the standard configuration properties for the component and creating the component itself. &amp;nbsp;The ability to override or further customize the component can be easily implemented as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Lets look at an example using a custom Grails Tag and my jQuery-UI-Widget plugin. &amp;nbsp;I&#39;m going to encapsulate the jQuery-UI AutoComplete in my own tag.&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;def myautocomplete = { attrs, body -&amp;gt;

 // grab the id
 def id = attrs.remove(&quot;id&quot;)

 // create a config to pass to taglib
 def acConfig = [:]
 // pass the id along to the config
 acConfig.id = id
 // throughput the widget config or create a new one
 acConfig.config = attrs.remove(&quot;config&quot;) ?: [:]
 // enforce the delay property 
 acConfig.config.delay = 200 
 // set the minLength property if not overridden by instance config
 acConfig.config.minLength = acConfig.minLength ?: 1 

 //call the jquery-ui taglib
 out &amp;lt;&amp;lt; jqueryui.jquiAutoComplete(acConfig, body)

}
&lt;/pre&gt;&lt;br /&gt;
This Tag is a Proxy to the jQuery-UI TagLib&#39;s jquiAutoComplete tag.  The config is passed along to the target tag after any defaults are set.  Doing this allows me to enforce a standard for our application&#39;s jQuery-UI Widgets.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;&lt;mytags:myAutoComplete
        id=&quot;ac1&quot;
        config=&quot;${[
            minLength : 1,
            source : createLink(controller: &#39;autoComplete&#39;, action: &#39;searchStockByCompanyJSON&#39;).toString()
        ]}&quot;&gt;
&lt;/mytags:myAutoComplete&gt;
&lt;/pre&gt;&lt;br /&gt;
Thats is.  The idea is pretty simple overall, but flexible enough to allow my team to build the Widgets we need for our application.  I&#39;ve applied this approach to jQuery-UI Widgets, YUI2 Widgets and DataTables.</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/1680695768074931728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/1680695768074931728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/1680695768074931728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/1680695768074931728'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2011/09/simplifying-external-taglibs-with.html' title='Simplifying External TagLibs with Proxies'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-4983869078372933010</id><published>2011-09-06T21:54:00.000-05:00</published><updated>2012-10-31T21:25:03.065-05:00</updated><title type='text'>Extending jQuery-UI Widgets</title><content type='html'>I recently needed to extend the jQuery-UI AutoComplete Widget for a few custom features.  The act of extending the Widget was relatively easy, but its not the entire story.  Simply extending the jQuery-UI Widget will cause you to lose native functionality.  Here is what I&#39;m talking about...&lt;br /&gt;
&lt;br /&gt;
Say I want to extend the jQuery-UI Widget...&lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;$.widget(&quot;ui.myAC&quot;, $.ui.autocomplete, {
    myMethod : function(){
    },
    myOverride : function(){
        self.myOverride()
    }
});
&lt;/pre&gt;
&lt;br /&gt;
Doing this allows me to instantiate my custom widget...&lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;$(&quot;#myInput&quot;).myAC({});
&lt;/pre&gt;
&lt;br /&gt;
However... the following wont work.  &lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;$(&quot;#myInput&quot;).myAC(&quot;search&quot;, &quot;%&quot;);
&lt;/pre&gt;
&lt;br /&gt;
Calling the widgets public methods will fail.  A little debugging shows me that jQuery-UI doesnt think that method exists.  Hmm... I extended a jQuery-UI Widget, but I lost the native methods.  Boo!&lt;br /&gt;
&lt;br /&gt;
Since jQuery-UI Widget extension has changed recently, Google didnt provide me with an obvious answer.  However, I kept stumbling upon this thing called a Bridge.&lt;br /&gt;
&lt;br /&gt;
Lets try it...&lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;$.widget.bridge(&quot;myAC&quot;, $.ui.myAC);
&lt;/pre&gt;
&lt;br /&gt;
Woot!  I now have access to the native methods.  Now my custom widget is fully functional.&lt;br /&gt;
&lt;br /&gt;
I could attempt to explain all the different things $.widget.bridge does for us, but I&#39;d do a poor job.  Here are some folks that have already explained it.&lt;br /&gt;
&lt;a href=&quot;http://www.erichynds.com/jquery/using-jquery-ui-widget-factory-bridge/&quot;&gt;Eric Hynds&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://alexsexton.com/?p=51&quot;&gt;Alex Sexton&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/4983869078372933010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/4983869078372933010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/4983869078372933010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/4983869078372933010'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2011/09/extending-jquery-ui-widgets.html' title='Extending jQuery-UI Widgets'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-1861875606445197532</id><published>2011-08-01T22:51:00.002-05:00</published><updated>2011-08-05T06:01:50.107-05:00</updated><title type='text'>Grails Plugins and Default Configs</title><content type='html'>I&#39;ve been working on Grails plugins for jQueryUI and YUI2. &amp;nbsp;One of my ideas was to use a default config within my plugin, which the plugin consumer could override and modify the config values for their usage.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Unfortunately, Grails doesn&#39;t provide this feature by default. &amp;nbsp;You can use the plugin&#39;s &lt;i&gt;Config.groovy&lt;/i&gt; for settings when you test, but it doesnt work when the plugin is being ran from an app. &amp;nbsp;Unless... &amp;nbsp;you do the following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Lets say your creating the next awesome plugin. &amp;nbsp;We&#39;ll call it &lt;b&gt;Foo&lt;/b&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1. &amp;nbsp;Create a groovy config file that is unique to your plugin. &amp;nbsp;Mine is &lt;i&gt;FooConfig.groovy&lt;/i&gt;.  Inside, put your config values.&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;brush:groovy&quot;&gt;fooConfig {
  fooVar = &quot;Hello World&quot;
}&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;2. &amp;nbsp;Load your new config via the&amp;nbsp;&lt;i&gt;FooGrailsPlugin.groovy&lt;/i&gt;&amp;nbsp;file. &amp;nbsp;This code is a modified version of the code found in&amp;nbsp;&lt;a href=&quot;http://www.grails.org/plugin/spring-security-core&quot;&gt;Spring-Security-Core&lt;/a&gt; plugin. &amp;nbsp;Thanks Burt.&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;def doWithSpring = {
  mergeConfig(application)
}&lt;/pre&gt;&lt;pre class=&quot;brush:groovy&quot;&gt;private void mergeConfig(GrailsApplication app) {
  ConfigObject currentConfig = app.config.grails.fooConfig
  ConfigSlurper slurper = new ConfigSlurper(Environment.getCurrent().getName());
  ConfigObject secondaryConfig = slurper.parse(app.classLoader.loadClass(&quot;FooConfig&quot;))

  ConfigObject config = new ConfigObject();
  config.putAll(secondaryConfig.fooConfig.merge(currentConfig))

  app.config.grails.fooConfig = config;
}
&lt;/pre&gt;&lt;br /&gt;
3. &amp;nbsp;Finally, we need to make our plugin config reload when a config is changed elsewhere in the application.&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;def onConfigChange = { event -&amp;gt;
  this.mergeConfig(application)
}
&lt;/pre&gt;&lt;br /&gt;
Thats it.  Thats all I had to do.  Now I can use default configs within my plugin and allow my plugin consumers to customize.  Fun Stuff.&lt;br /&gt;
&lt;br /&gt;
Here is an example of customization...&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;grails.fooConfig.fooVar = &quot;I&#39;ve been updated!&quot;
&lt;/pre&gt;&lt;br /&gt;
&lt;strike&gt;Full Disclosure : I havent tested this in a deployed WAR yet.&lt;/strike&gt;&lt;br /&gt;
Works from run-war.&lt;br /&gt;
&lt;br /&gt;
Referenced Links&lt;br /&gt;
&lt;a href=&quot;http://grails.1312388.n4.nabble.com/Reading-configuration-in-plugin-td2714411.html&quot;&gt;Post 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://grails.1312388.n4.nabble.com/plugin-oriented-architecture-configuration-td3405629.html&quot;&gt;Post 2&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/1861875606445197532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/1861875606445197532' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/1861875606445197532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/1861875606445197532'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2011/08/grails-plugins-and-default-configs.html' title='Grails Plugins and Default Configs'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-8862539032592144741</id><published>2011-06-13T22:09:00.000-05:00</published><updated>2011-06-13T22:09:14.316-05:00</updated><title type='text'>Debugging Grails Controllers &amp; Closures in IntelliJ</title><content type='html'>We&#39;re using IntelliJ at work for our Grails development. &amp;nbsp;IntelliJ is a solid IDE with great Grails support. &amp;nbsp;I should have no complaints... but this one issue has been nagging at me. &amp;nbsp;When using IntelliJ to debug Grails, I couldn&#39;t use the&amp;nbsp;&lt;a href=&quot;http://www.jetbrains.com/idea/webhelp/debug-tool-window-watches.html&quot;&gt;Watch Window&lt;/a&gt;&amp;nbsp;to interrogate a Controller Action&#39;s arguments.&lt;br /&gt;
&lt;br /&gt;
Setting a watch variable to &lt;i&gt;params&lt;/i&gt; or &lt;i&gt;request&lt;/i&gt; in the following action closure yields...&lt;br /&gt;
&lt;b&gt;Cannot find local variable &#39;params&#39;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;def myAction = {
}
&lt;/pre&gt;&lt;br /&gt;
Of course, if we set the params argument to a reference, then we can interrogate it.  So we know the object is there... so what gives?&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;def myAction = {
  def myParams = params
  def myRequest = request
}
&lt;/pre&gt;&lt;br /&gt;
The answer is simple and opaque at the same time.  Closures aren&#39;t methods.  I&#39;m guilty of forgetting this and Grails is great about hiding this fact from us. &amp;nbsp;However, IntelliJ isn&#39;t that smart. &amp;nbsp;When debugging in IntelliJ, we have ask the Closure the right question. &lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;this.getProperty(&quot;params&quot;)
&lt;/pre&gt;&lt;br /&gt;
Ah Ha!  There is my params argument in IntelliJ. &amp;nbsp;Now I can stop writing &lt;i&gt;println&lt;/i&gt; everywhere...&lt;br /&gt;
&lt;br /&gt;
More info on Closures&lt;br /&gt;
&lt;a href=&quot;http://groovy.codehaus.org/Closures+-+Formal+Definition&quot;&gt;Formal Definition&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://groovy.codehaus.org/Closures+-+Informal+Guide&quot;&gt;Informal Guide&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/8862539032592144741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/8862539032592144741' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/8862539032592144741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/8862539032592144741'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2011/06/debugging-grails-controllers-closures.html' title='Debugging Grails Controllers &amp; Closures in IntelliJ'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2062789433050926004.post-3911606851619017004</id><published>2011-05-19T23:00:00.000-05:00</published><updated>2011-05-19T23:00:06.436-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Envers"/><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><title type='text'>Grails, Envers and Blob</title><content type='html'>We&#39;ve added &lt;a href=&quot;http://www.jboss.org/envers&quot;&gt;Hibernate Envers&lt;/a&gt; to our Grails project. &amp;nbsp;Thus far, Envers has handled all our object versioning requirements... &amp;nbsp;Until we tried to use a Blob.   &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;@Audited
class Data {
&amp;nbsp; &amp;nbsp; Blob data
}
&lt;/pre&gt;&lt;br /&gt;
org.hibernate.MappingException : Type not supported for auditing: org.hibernate.type.BlobType, on entity Data, property &#39;data&#39;.&lt;br /&gt;
&lt;br /&gt;
What is the solution? &amp;nbsp;Envers does not throw an exception for a Byte Array, so replace Blob with it. &amp;nbsp;However, MySQL will map the Byte Array to a &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/blob.html&quot;&gt;TinyBlob&lt;/a&gt;, which may not work for you. &amp;nbsp;You can modify this by updating the &lt;a href=&quot;http://grails.org/doc/latest/ref/Database%20Mapping/column.html&quot;&gt;GORM DSL&lt;/a&gt; on the domain.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:groovy&quot;&gt;@Audited
class Data {
&amp;nbsp; &amp;nbsp; byte[] data
&amp;nbsp; &amp;nbsp; static mapping = {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data sqlType: &#39;blob&#39;
&amp;nbsp; &amp;nbsp; }
}
&lt;/pre&gt;&lt;br /&gt;
This resolved the problem for us.</content><link rel='replies' type='application/atom+xml' href='http://swestfall.blogspot.com/feeds/3911606851619017004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2062789433050926004/3911606851619017004' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/3911606851619017004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2062789433050926004/posts/default/3911606851619017004'/><link rel='alternate' type='text/html' href='http://swestfall.blogspot.com/2011/05/grails-envers-and-blob.html' title='Grails, Envers and Blob'/><author><name>Stephen Westfall</name><uri>http://www.blogger.com/profile/15349045339065499153</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>