Archiv für August 2009
Null-Constraint bei MySQL entfernen
30. Aug
Bevor ich die Syntax vergesse:
ALTER TABLE my_table MODIFY some_column varchar(255) NULL;
Make your Grails app show content
29. Aug
There is a great way to show content from inside your Grails app: Write the content in Wordpress and let the Wordpress plugin for Grails pull the content into the app:
The Wordpress plugin provides tags for pulling content from wordpress for display in grails. ehcache is used to cache wordpress content for a 5 minute period.
Configuration is a piece of cake:
wordpress.url='http://myblog.wordpress.org/xmlrpc.php' wordpress.blogId=0 wordpress.username='myapp' wordpress.password='grailsrocks'
Then, display a list of your Wordpress categories:
<wordpress:getCategories />
or display the latest posts by saying:
<wordpress:getRecentPosts count="5" />
And so on… Read the full story on the plugin page at grails.org.
Perf4J plugin for Grails logs the time
29. Aug
A new plugin for Grails is in the oven and is still baking. However, the first rumours got out of the bakery.
Perf4J is to System.currentTimeMillis() as log4j is to System.out.println().
Using Perf4J, you will be able to stop the time for a Grails code block, like this:
withStopwatch("myCriticalCodeBlock") { // code to be profiled with tag "myCriticalCodeBlock" }
You can also log the time for a service method, automatically, choose one or more of these alternatives:
static profiled = true static profiled = ['testMethod1', 'testMethod3'] static profiled = { testMethod1() testMethod2(tag: "tm2") testMethod3(message: "only message") testMethod4(tag: "tm4", message: "this is testMethod4()") }
Got the taste of it? Read the full story about the upcoming plugin and enjoy!
Powerful asserts in Groovy 1.7-beta
25. Aug
This will make every TDD/Groovy enthusiast happy: Groovy 1.7 will contain powerful assertions. This assertion here
assert new File('foo.bar') == new File('example.txt')
will yield this output:
Caught: Assertion failed: assert new File('foo.bar') == new File('example.txt') | | | foo.bar | example.txt false
Isn’t that cool?
Read more about the new Features in Groovy 1.7.
GAE: Datenbank ohne Aggregatfunktionen
23. Aug
Google App Engine ist eine massiv skalierbare Umgebung – schön, doch Google hat dafür einige Designentscheidungen getroffen (treffen müssen?), die das Leben für Applikationen u.U. etwas schwer machen können. Z.B. fehlen in GAE’s Persistenzschicht die Aggregatfunktionen (sum, avg, min, max, …), die jede übliche relationale Datenbank mitbringt.
In Marcel Overdijks Blog gibt es dazu eine interessante Diskussion.
Released OpenID plugin V0.2 for Grails
22. Aug
Today, I released version 0.2 of the OpenID plugin for Grails (really easy to use plugin by original author Marcel Overdijk). The changes I made today:
- Fixed a bug that caused a MissingPropertyException when user typed an OpenID that did not have a valid provider address
- Fixed a bug that caused a NullPointerException when user’s OpenID contained syntactical errors
- Simplified code in the controller so that it is now independent of the configured URL mapping
You can find more information about the plugin on the plugin’s Wiki page.
VMWare will SpringSource kaufen
10. Aug
VMWare, der Anbieter von Virtualisierungssoftware, hat die Absicht, SpringSource zu kaufen. Das ist ein profitabler Deal für beide Seiten, da bin ich sicher. Gratulation an die Leute, die uns seit Jahren Spring zur Verfügung stellen! Rod Johnson’s Blog ist heute (wohl angesichts dieser Neuigkeiten) zusammengebrochen: “Error establishing a database connection”.
“Soft assertions” in Groovy
04. Aug
Ted Naleid hat einen guten Artikel über Unit-Testing mit Soft Assertions geschrieben.


