grails

Grails CXF plugin Webservice

Hi, I was wondering what is the best way to handle a request for an update on an existing entity (e.g. a Person) when receiving the request as a webservice request. In my project I have a Person domain class and I would like to expose CRUD operations as webservice operation through the CXF plugin. So I make a PersonService, and expose...

groovy / grails / hibernate - configure set to be fetched eagerly

We are configuring hibernate with grails using the domain classes. Added: static hasMany = [image:Image] static fetchMode = [image:"eager"] However, when I pull the object graph each image is not loaded. Please advise. Thanks. ...

Can I run a single unit test from the command line for a Grails project?

I've been running my Grails unit tests by typing grails test-app :unit, which runs all unit tests. Is there a way to specify a single test? Edit: So far, everyone is basically saying the same thing, but when I do that, no tests are run. Any more thoughts? Conclusion: OK, I was using the name of the test class, rather than the name ...

What technologies are there for formatted, structured data input and output?

I am working on a project here that ingests internal resumes from people at my company, strips out the skills and relevant content from them and stores it in a database. This was all done using docx4j and Grails. This required the resumes to first be submitted via a template that formatted everything just right so that the ingest tool kn...

Grails/Hibernate: Null Pointer Exception on versioning

Working with a legacy codebase in Grails. Under some conditions (we're unclear exactly what) we get a mysterious NPE, stack trace as below, while doing a findBy. So far we're sort of stymied; this appears in several fora for Hibernate but the responses seem to come down to "something is wrong with your schema." It would be wonderful t...

Using the output from g.render in Grails controller

Hi, I am rendering two GSP templates in a controller. The first template is rendered as follows: String couponspage = (g.render(template: "availableCoupons", contentType:"text/html", model : [:]))?.toString() I include the results of the first template in the model to the call to render the second template as follows: render(templat...

How can I convert a PDF into a web-browsable image?

I need to create an online viewer which converts PDF files into browsable images, like http://view.samurajdata.se/. I would like to do this in Grails. Does Grails have any plugins for this? ...

In grails, how do I get a reference to all current sessions?

I'd like to list all current sessions in an Admin Controller in grails. What's the easiest way to get a reference to e.g. a Collection of sessions from the controller? ...

Criteria for SELECT bla1, bla2 FROM foo

I want a criteria that only selects bla1 and bla2 from all attributes of a given domain Foo.findAll() or def c = Foo.createCriteria() def results = c {} have: SELECT * FROM foo results = List of all attributes of given domain foo want SELECT bla1,bla2 FROM foo written as Criteria def c = Foo.createCriteria() def results = c {...

Grails - Quartz

Hi, I am trying to use the Quartz plugin for Grails to schedule a job in a web app I am working on. Using the RAMstore worked fine, but I need the job to persist in our SQLServer database, which has caused problems... I have changed the jdbcStore variable in QuartzConfig.groovy to true, set def volatility = false in the job file, and...

Grails bootstrap on integration tests

Hi, Im trying to insert some test data into my database, for which a class called BootStrapTest does the work. In my BootStrap.groovy file its called like this environments { test { println "Test environment" println "Executing BootStrapTest" new BootStrapTest().init() ...

Spring Security Grails Plugin working with existing Database Schema?

I recently ran into a situation where I wanted to implement Grails + Spring Security over an existing database schema. The Database already had a users table, a roles based table and the relationship roles+user table. I am able to map the users domain to the existing schema.. but where I am running into problems is when trying to tie...

Grails controllers and domains

I just had a quick question as I'm still learning grails. I have a controller class that just reads a text file and loads a list with information. I'm wanting to populate one of my domains through this list. Am I able to do it like this? For instance, I have a bookController, the controller does something like //psuedocode import book...

asyncRequest, YUI 2.7, status=404 not understandable behaviour

hi, I'm using YUI to talk to server on Grails framework. Using asyncRequest, I successfully passed a parameter to my server and have the server println the result. However, the callback function still insists "not found" on the statusText. Could some one enlighten me on what might be wrong with my code? thanks! var deleteCallback ...

JDB debugging of Groovy/Grails code

I'm attempting to debug some issues in some (rather bletcherous) Grails code that I inherited. I'm a relative noob in Groovy and Grails although an old Java guy. Here's the problem: I have this thing running with jconsole and jdb hooks in, but it's tough to use the debugger because so much of the code is in closures. So, for example, ...

Grails, groovy: combine GORM dynamic methods - findAllBy and OrderBy

assuming the following example: I have a User class and a Item class and a user can have many items 1) Is there a combined dynamic method to get all the items for a user and also sort them after a Property? I have a controller action that gets the items for a user and send them to the view, and the view will render them all with < g:e...

Java/Grails library for Twitter: JTwitter, Twitter4J or Grails plugin?

I'm looking to integrate a new app (to be built, probably in Grails) with Twitter and found there are (at least) 3 libraries to use. JTwitter, Twitter4J and a Grails plugin. Any opinions on the pros and cons of each are appreciated. I'll mark this as a community wiki as there's no single answer expected. ...

Grails Liquibase plugin and Taggable plugin

Perhaps this is a shot in the dark but I am attempting to use the Grails Liquibase plugin and it appears as though there is a compatibility issue with the Taggable plugin. The Taggable plugin works by implementing Taggable on the domain classes which you want to be taggable. When I try to run the Liquibase command grails generate-change...

Multiple Groovy jars in my war file

Hi there, I noticed that my Grails war has two Groovy jars in it: groovy-1.7-rc-2.jar and groovy-all-1.7.4.jar -- What could be causing this? I took a look at my plugin dependencies, and BuildConfig but didn't find anything... ...

Service configured in spring/resources.groovy does not have a Hibernate session

We have an application with a plugin which contains a service: public class TaskService { public void doSomething( Task task ) { // do something with task task.save(); } } This works fine. For our "special" customer with his special requirements we have a second application which contains the plugin from th...