Browsing articles from "January, 2008"
Jan
31
2008

Using searchable across domain classes

Mike has done some great sleuthing on how to use Grails uber-cool searchable plugin to search a domain class based on properties of a nested class. This is exactly what I’ve been looking for! Gravl supports multiple blogs per install, and when you are viewing my blog, I want those seaches to be constrained to fulltext search of just *my* blog, not all the data in the blog db. My data model is 1:M from [...]

Jan
29
2008

Gravl: Funky Image Preview and Inplace Editing

I’ve been having fun implementing my first cut at Image/File management for Gravl, and along the way I’ve learnt about LightBox and the Scriptaculous InPlaceEditor stuff. First up, I needed a way of doing an image preview, so I could see what all of those PNGs really meant. Lightbox gives you a great way of “overlaying” the preview image as a popup without the need to refresh the page. Very snazzy. I followed the instructions [...]

Jan
23
2008

Gravl: Autocompleting and Funky Timelines

If you haven’t had a chance to play with the RichUI plugin, you’ve got to take it for a spin – it’s just fantastic. I’ve been meaning to implement autocomplete for Gravl tags on new blog entries, and with the RichUI plugin (which uses Yahoo Autocomplete under the hood) it’s a total snack. First you declare the RichUI taglibs in your gsp file (note: I’m using the undocumented delimChar setting so that I separate multiple [...]

Jan
22
2008

Gravl: Fulltext Search Redux with Searchable

Thanks to a fantastic tip from Karl on yesterday’s post, I’ve got the searchable plugin up and running on my Grails-RC3 install! Here’s the fix from Karl: i‘ve got a working Searchable-0.4-SNAPSHOT wo. npe, this is working with the RCs too. In the plugin‘s java directory u need to slightly modify the org/codehaus/groovy/grails/plugins/searchable/compass/SearchableCompassUtils.java file. Here is the “patched” version: http://rafb.net/p/prsZip92.html (nopaste url) So I patched my version, and I’m up and running. Getting Gravl converted [...]

Jan
21
2008

Gravl: Adding Fulltext Search

I’ve just finished adding fulltext search to Gravl, and, while is still needs some more CSS tweaks, it’s working just great. I took the chance to have a good look at the Searchable plugin and it looks awesome! Sadly, it just kept NPEing at me and complaining that it couldn’t find java.lang.Class! Perhaps it’s a victim of the RC-flux, no doubt it will resurface as 1.0 settles in. Anyways, I ripped the SearchService out of [...]

Jan
17
2008

Gravl: Referers, Geocoding, Charts

Continuing my obsession with the power of Grails filters, it was time to add some referer tracking and ipaddress Geocoding to Gravl to see where people are coming from. So I created a new RefererFilters class in conf and I was up and running. I already had a little CacheService happening, so I created a new 24 hour cache, scooped up some interesting browser header data, and squirrelled it away for later: // Scoop up [...]

Jan
14
2008

Gravl: Implementing Security on the Cheap…

Grails Filters open up a whole new world of opportunity for jumping into the request pipeline to do your own custom processing. I’m really excited about getting Referer tracking real soon now, since I’ve learned the basics of Filters when I implemented Gravl’s very basic security model. The Grails community is working on some first class plugins for Acegi and JSecurity, but for if your security model is coarse grain (authenticated users can do this, [...]

Jan
11
2008

Gravl: Mind the dust, we’re live with 0.1

Things are likely to be a little rough around the edges over this way… but welcome to the first live edition of Gravl! A few days ago my Pebble blog data become corrupt, so I was very motivated to get a rough and ready version of Gravl up and going. The code is fairly scrappy around the edges, and there will be issues (particularly not sure which browers will work with the Ajax comment magic [...]

Jan
9
2008

Gravl: CriteriaBuilder

Dynamic finders rock! But if you’re querying across tricky many-to-many joins, you might want to take advantage of GORM’s extremely powerful query DSL, criteriaBuilder. Criteria wraps Hibernate’s powerful Restrictions API, and gives you a wealth of expressiveness. For the Gravl archive, I wanted a “by tag” archive option, so you could see just the “groovy-related” archive. Because blog entries have a many to many with blog tags, dynamic finders weren’t going to get me there. [...]

Jan
8
2008

Gravl: Screencast, Command objects, Custom Validators, Pagination

Ok. My comment system is now pretty closed to being done, so it’s time to screencast some progress. Here’s a sample of comments in a Gravl Screencast (4mb) I though it might be a good chance to demonstrate command objects, the basic Grails Ajax tags and their usage, and how to handle errors nicely. I’ve added a Ajax “Preview” feature so you can see your comment markup before you post them. I’m using Command objects [...]

Pages:12»

Glen Smith

About Glen

Co-author Grails in Action