grails

Questions about implementing Domain class relationships & constraints in Grails.

Using ArgoUML, I very quickly created this trivial representation of a few Domain classes (Person, Store, Product) and their relationships. I'm struggling with the implementation of the relationships. Below was my initial approach for the Person domain, but it seems that I am missing something important. class PersonToPerson { ...

Can anyone recommend an existing java file repository

that will allow my users to edit word documents locally in Word and have them saved back to the server when finished. The project will be Grails based and I'm looking at things like WebDav but I would need security features that won't allow one user to access another users documents. And unfortunately the test I ran opening a word docu...

How do I display command errors using Grails RemoteFunction Template rendering?

I have a template that renders a list of things. I have a submitToRemote Button on this template that then pops up another template overlayed. inside template2: Now I have it working nicely. If the template2 submits correctly, the action renders template1 and all is well. The problem is what happens if when submitting template2, the c...

DB column order creation in Grails

Hi, I have this domain class: class Requestmap { String url String configAttribute static constraints = { url(blank: false, unique: true) configAttribute(blank: false) } } Its DB Table corresponds to Column | Type | Modifiers ------------------+------------------------+----...

How to access the URL that Acegi has stored for after the login form in Grails

I'm integrating Gigya with a web app running Acegi. I have it working that the client side Gigya can authenticate an existing user and then skip the login form post and hit a controller method to inform the server securly that the user authentication has been performed by Gigya. Using the following code in my controller I'm able to tel...

compass.cfg.xml path in grails project with searchable plugin

I installed searchable in my grails project. As I already had the java POJO classes I want to use compass for the mapping customisation. However, it seams that the Searchable.groovy looks for a file compass.cfg.xml at the root of my classpath. This folder is my PROJECT_HOME folder. I also tried to put him at /src/java or in grails-app fo...

Mocking the "save" method on domain classes

I'm having hard time mocking the save instance method in my unit tests in Grails 1.3.3. I've created a simple domain class named Person, it has one property (nullable) called "name". package tutorial class Person { String name static constraints = { name nullable: true } } In my test I'm trying to do something ...

Grails cannot find plugin provided view after modifying controller

I created a grails plugin in which some domain classes, controllers and views were added. After creating the plugin, I imported it in a grails application by using "grails.plugin.location.'...' = '.....'" in BuildConfig.groovy. Everything is okay when the application starts up. And, everything is nice when online modifying the view GSP...

Displaying Grails Field Errors

Does anybody know how I could get the fieldError to print out in the example below. for each item with an error, I would like to print custom error messages that I have defined in the messages.properties file at the moment all this does is print the default error codes item.errors?.allErrors?.each{ println it.toString() }; I have ...

groovy.xml.MarkupBuilder disable PrettyPrint

I'm using groovy.xml.MarkupBuilder to create XML response but it creates prettyprinted result which is unneeded in production. def writer = new StringWriter() def xml = new MarkupBuilder(writer) def cities = cityApiService.list(params) xml.methodResponse() { resultStatus() { r...

Grails - How can I get a single error message

Hi, How can I get a single error message from a command object in grails? all the examples I see are using similar to commandObject.errors.allErrors() but nothing if I only want the single error message to read into the controller and subsequently passed to the view. Any ideas? ...

Confusion with Grails development database

I'm staring a toy project with Grails, but I'm having some trouble regarding the HSQLDB database. My DataSource.groovy file is the default one: environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:hsqldb:mem:devDB" loggin...

Grails cascading behavior

Hi, I am stuck at this problem. The code looks ok to me(obviously I am missing something. The question is what it is?) I have a Project class def class project{ ... Manager manager } This is Person and Manager class definition def class Person{ String firstName String lastName } def class Manager extends Person{ ...

Tomcat and Jetty differences when running Grails apps

Hi, has anybody worked with a Grails application in production in Jetty and Tomcat and has noticed any important differences ? I started having out of memory problems with tomcat 6.0.24 that were fixed when I updated to 6.0.26, and I was wondering if Jetty had that kind of issues too. ...

How to filter a particular class when i have a inheritance ?

Hi, I have this code : class A { String name } class B extends A{ } class C extends A{ } class D{ A a } D d = new D(); d.a = new B() D d2 = new D(); d.a = new C() My query : D.createCriteria().list(...){ A{ eq "a","test" } } But in my result I would have only the element matching with B class not C class. Is it p...

How to easily implement "who is online" in Grails or Java Application ?

I am building a community website in grails (using Apache Shiro for security and authentication system) and I would like to implement the feature "who is online?". This url http://cksource.com/forums/viewonline.php (see snapshot below if you do not have acess to this Url) gives an example of what I would like to achieve. How can I do ...

Will CompassGps roll back if the transaction is rolled back?

If CompassGps mirroring is used with Hibernate, what happens if the database transaction rolls back? Will the changes to the index be rolled back (assuming file store for the index)? It seems like if the Lucene index is stored on the disk it won't be automatically rolled back, unless Compass is smart enough to handle that for you. FWI...

grails app root context

I have a test grails app setup with a context of "/testapp". When I add a link in my gsp that references / it does not go to the root of my grails.app.context, but to the root of my grails.serverURL property. For example given a link with href "/css/main.css" I would expect that this link would actually look in localhost:8080/testapp/c...

Grails - Very Simple Set Collection Value Not Working

Controller for a Bug: this is the create method for a bug, I printed out bugInstance.activities and it had my activity object in it def create = { def bugInstance = new Bug() def activity = new Activity(description:"created") bugInstance.properties = params bugInstance.addToActivities(activity) ...

flash message grails

How to hold a flash message even after 2 consecutive redirects? I set my flash message in my controller and there are 2 redirects happening because of a plugin which i cannot control.But still I want the flash message to be retained. I can only think of populating the message in the session.Any new ideas? help needed ...