Hi,
I'm looking for a good solution for managing static data in a Grails app, i.e. data in infrequently changing tables such as a list of countries.
My requirements are:
Should be easy to internationalize the data
Should provide a means of loading the static data into the database (e.g. from an XML file) when running the unit/integra...
I am just starting out with Grails, obviously. I've created my domain class and controller, added my own logic to the controller, and everything is working properly -- as long as nothing goes wrong.
My custom controller action looks like this:
def create = {
try
{
// Get the parameters.
def uid=params["uid"]
...
Hi,
I need to insert dummy data on test environtment so that I can run unit test on it but I don't know how to declare it on BootStrap (just for testing, not for all environtment)
can you help me ? thank you in advance
...
I want to create bar charts similar to web server logs. I have events in my database which all took place at a certain moment, I would like to grab all these events and then chart how many occurred each day, week, month, whatever on a bar (column) graph.
For example I want to chart how many visitors I had in a month in 31 columns, each ...
I have a domain class in Grails with a field journeyDate. journeyDate is defined like this:-
Date journeyDate
then in my list.gsp I display the date like this:-
${fieldValue(bean:journeyInstance, field:'journeyDate')}
And it is displayed in the following format:-
2009-08-19 17:12:00.0
does anyone know how I can format this on the l...
I am using the Quartz plugin in Grails. Is there a configuration that I can use to disable the job, without commenting out or deleting the whole file?
...
Hi,
I have the following query which id like to sorty by "raceDate" and by "raceNo" asc. I can figure out how to sort by one field, but not by two, any ideas?
def list = {
params.max = Math.min( params.max ? params.max.toInteger() : 20, 100)
params.offset = params?.offset?.toInteger() ?: 0
params.sort = "raceDate"
...
Hi folks,
I have the following domain class in my grails project:
class Vacation {
Date start
Date end
User vacationer
static constraints = {
start(validator: {return (it >= new Date()-1)})
}
}
Is it possible to add a validator that requires end to be equal or greater than start?
Cheers
...
I'm trying to write an integration test for a Service which uses a gateway to send requests to a queue. The gateway is wired up to the queue using spring integration in resources.xml:
<gateway
service-interface="WebRequestService"
id="webRequestGateway"
default-request-channel="queueChannel" ...
I already set up MySQL connection pool in Glassfish using JNDI. I only execute one query at a time but use the same sql instance. Everything seems to work fine except creating temporary tables and use them. In short, even though after I create a temporary table, insert query does not work since the table does not exist. Are there any con...
The reference doc says that the size constraint:
"Uses a Groovy range to restrict the size of a collection or number or the length of a String."
When I put a size constraint on an integer, I get a warning "Property [prop] of domain class TheClass has type [java.lang.Integer] and doesn't support constraint [size]. This constraint will n...
I have an existing Spring application with a Swing interface. It interfaces using Spring Security into an LDAP system, with no User table, no Role table, no security tables whatsoever. I want to use the Acegi plugin, however, it demands I have a USER table. How can I override the plugin to indicate I don't want this. In fact, I already c...
Grails question: Confused about using a package to hold domain classes.
I'm using Netbeans on Mac to check out Grails.
When I create domain classes without using a package holding it, I can just go to localhost:8080/gTunes and the expected .gsp page is rendered properly.
However when I use a package (com.g2one.gtunes) to hold a domai...
After installing Grails 1.1.1 and adding Replication (org.mysql.jdbc.ReplicationDriver) it appears that my BackgroundQueue is clogging up.
Question 1: How do I determine "why" my BackgroundQueue is clogged? (I define Clogged as having all available thread stuck, and not accepting any new "work").
Question 2: What is the "defined way" ...
I'm trying to follow some of the introduction to Grails tutorials and am at the point where I want to try to see if I can use a debugger in Eclipse with my Grails applications. My grails application runs fine when I use the command to execute, but when I tried to use the Eclipse run configuration, I get the following error:
Exception in...
After repeatedly hearing good things about the Grails support in NetBeans and being frustrated by eclipse's lack thereof, I've decided to give it a try, but now said support doesn't seem to exist:
I've downloaded the bunde containing NetBeans 6.7 along with the latest Java 5 JDK from Sun
The About box says: NetBeans IDE 6.7 (Build 2009...
I'm trying to access a site via their JSON export.
The URL is: http://neotest.dabbledb.com/publish/neotest/f820728c-4451-41f6-b346-8cba54e52c6f/projects.jsonp
I'm using HTTPBuilder to try and accomplish this in Groovy, but am having trouble. I used the example code from http://groovy.codehaus.org/HTTP+Builder to come up with this:
...
Hi all
Wonder if anyone has come accross this problem. I have created a demo portlet using the grails portlet and liferay plugins.
After installing the grails plugins in a project i simply ran the following commands
grails create-portlet MyFirst
grails generate-portlet-views MyFirst
grails liferay-deploy
The portlet deploys fine. H...
I'm trying to create a a custom constraint. I've put the logic in a service:
class RegExpManagerService {
boolean transactional = false
def messageSource
def lookupRegexp(regExpression,Locale locale) {
def pattern = messageSource.getMessage( regExpression,null,locale )
return pattern
}
def testRegex...
When running a custom environment with grails via grails -Dgrails.env=custom run-app it appears that the auto reload / hot deploy is turned off, does anyone know how to arbitrarily enable this for any given environment, not just dev, which appears to be the only env where it is actually on by default?
...