I have secured my Grails app using the ACEGI plugin and am using annotations on my controller methods to prompt the user to login.
My app has a static HTML front page with a login link on it which redirects to the login/auth page. On a successful login I want to load my own custom page for the authenticated user, called person/mainpa...
I'm trying to derive the class instance of a groovy class from the name of string.
For example, I'd like to do some code along these lines:
def domainName
domainName = "Patient"
// but following line doesn't work, domainName is a String
def domainInstance = domainName.get(1);
...
I'm considering reading the body of a tag to determine what variables the tag should send to the body.
e.g, here's the GSP
<g:get_domain_info id="${patientInstance?.id}" >
<tr class="prop">
<td valign="top" class="name"> ${firstNameLabel}</td>
<td valign="top" class="value"> ${firstNameValue}</td>
</tr>
</g:get_domain_info>...
I have 2 domain objects with a one-to-many relationship. Just as an example:
Class Author{
static hasMany = [posts: Post]
}
Class Post{
Author author
}
In the database the post table has a field called author_id. In my application, I have a bunch of author ids that I want to associate with posts. I can do this by first querying th...
I'm making a web application with Grails. I've got a list with data that must be included on JavaScript to perform some dynamic load on drop-list. Basically, I'm getting a two level list from the server, then the first level is presented on a drop box. When the user selects an option, the list associated to this option is presented on a...
Hi,
I got this
"javax.jdo.JDOFatalUserException: Error in meta-data for don.Comment.id: Cannot have a java.lang.String primary key and be a child object (owning field is don.Post.comments).
NestedThrowables:"
when running my grails + app-engine webapp
How can I fix this?
class Comment.groovy
import javax.jdo.annotations.*;
@Persi...
Hi,
is there a simple way to get previous state's URL (or flowExecutionKey is sufficient) in Grails web flow? I can get current flowExecutionKey from request['flowExecutionKey'].
Or alternatively is there a way to say that you want to go to the previous state in flow (to unwind your path in graph).
And I don't want to use the standard...
Hello,
I'm having problems rendering an XML file parsed via XMLSlurper to an XML variable.
Below is my code.
def userFile =new File("test.xml")
def xml= new XmlSlurper().parse(userFile)
render xml
The problem is I cannot see the xml being rendered into my flex app.
...
I'm implementing an ArtefactHandler and I want to be able to create artefacts from Scripts (to support a legacy format). I don't want to make all Scripts into artefacts, but just those in a particular subdirectory of grails-app, say grails-app/foo/.
I'm stuck at trying to figure out the path of the artefact from my ArtefactHandler's isA...
I am building a grails-app with IntelliJ 9.0 and I am a huge fan of the CTR+TAB shortcut that switches between active editors.
However, by default, IntelliJ keeps ONLY 10 active editors opened at the same time. It is clearly not enough for me.
Do you know, if possible, how I can configure my IDE to have more active editors opened at th...
Hi,
I'm writing a tag that essentially needs to dump an arbitrary domain class for the fields requested via parameters to the tag. This works fine if the field is a normal attribute. But, if it's a "hasMany" relationship, what are my options?
In other words, how do I check if a string passed as a parameter to the tag corresponds to a ...
Hi there,
do you have any experience integrating Grails application with ServiceMix? I mean for example exposing and/or embedding Grails applications within ServiceMix. Any ideas are very much welcome!
Thanks!
...
I am downloading a file through Grails, and am recording the fact that this file has been downloaded by this user, with code like:
class MyController {
private void recordTrackDownload() {
def d = new Download(session.user, "/path/to/file")
d.save()
}
def download = {
def f = new File("/path/to/file...
I created a grails 1.2.0 project using the acegi plugin 0.5.2 which works very well.
To integrate the project into our companies build infrastructure I need to build it via maven. So I converted it to a maven project using the grails maven integration which worked quite well too.
There is one problem: I have a Java class CustomUserDe...
I am building a multi-languages grails website and I need to get the ordinal suffix of a number for several languages like English, French, Spanish, German and Italian.
I believe that this issue is quite common for multi-languages website owners. I have found this article that provides a solution but it is English only.
For instance:
...
I'm trying to get transactions working within a Grails service, but I'm not getting the results I'm expecting. Can someone tell me if I'm doing something wrong, if my assumptions are off?
My domain class:
class Account {
static constraints = {
balance(min: 0.00)
}
String companyName
BigDecimal balance = 0.00
Boolean...
This question is in two parts, first part is about clearing a list and second part is about assigning an owner to an object.
I have a one-to-many relationship between two domain objects in my model in Grails. The relationship looks like this...
class Person {
static hasMany = [authorities: Role, locations: Location]
}
class Loca...
Hi!
I have a Grails application with a -simplified - domain class which looks like this:
class Capacity {
static constraints = {
month(blank:false, nullable:false)
company(blank:false, nullable:false)
}
Date month
Company company
String note
...
}
The pair month-company must be unique. (I.e. they should b...
This one has been driving me crazy today. Since upgrading to Grails 1.2 and Weblogic 10.3 the default root mapping for "/" stopped working. Here's what I have...
I have this URL mapping:
"/"(controller:"IGive", action:"index" )
I have a controller named IGiveController with an index closure
def index = {
render "foo"
}
When ...
It is possible to use Adobe Flash as view in Grails project? I want that all logic: model and controller was written on Grails, and use Adobe Flash. It's will be perfect to have some link on examples.
...