grails

UI Integration sample required of Spring Security Plugin of Grails

Hi All... I have been working with grails application and for security purpose used the spring security core. Now with that they are also providing the UI stuffs of security. So I have installed the plugin from http://grails.org/plugin/spring-security-ui in the project where I have configured spring security core too. Now I have not f...

Grails: Splitting a string that contains a pipe

Hi, Im trying to split a string. Simple examples work groovy:000> print "abc,def".split(","); [abc, def]===> null groovy:000> Instead of a comma, I need to split by pipes, but i'm not getting the desired result. groovy:000> print "abc|def".split("|"); [, a, b, c, |, d, e, f]===> null groovy:000> Of course, my first choice would be...

Grails: Updating a single object in a domain, ".save" Vs ".executeUpdate"

I'm wondering what the most efficient way of updating a single value in a domain class from a row in the database. Lets say the domain class has 20+ fields def itemId = 1 def item = Item.get(itemId) itemId.itemUsage += 1 Item.executeUpdate("update Item set itemUsage=(:itemUsage) where id =(:itemId)", [usageCount: itemI...

How do I make a jQuery script work on Grails??

How do I make a jQuery function work with Grails?? I installed the jQuery plugin and added grails.views.javascript.library="jquery" at the end of conf/Config.groovy And when I trigger the function I get an error saying Object Expected I checked the code and is fine, you can check it out here: http://www.jsfiddle.net/dCy6f/ When I wr...

Grails GORM question

Hi, I have two domain classes: class A { String Name ... } class B { A request B response ... } How can I get a list of unique As that are present as "requests" in B ? I tried def g = A.findAll("from A as e, B as r where e=r.request") But I have problems extracting the resulting objects. Thanks ...

Telling GORM not to persist a property

Is there a way of telling GORM not to persist a property? I'm planning to define a confirm password property on my User class that I'll use for validation, but shouldn't be persisted. Thanks. ...

Grails Sorting Issue

Hi, I have a grails app developed. Herein, I have a page which accepts data and as per the data . goes to the list action, fires an sql, populates the data into reconciliationInstance object and displays it in list.gsp. In my list.gsp, I have, <g:sortableColumn property="access" title="${message(code: 'reconciliationInstance.acces...

Which language/Framework/CMS to use for content-based, easily updatable web application?

Hi All, I am an experienced Java developer and have developed many enterprise applications. Recently I decided to develop a website that has lots of images and videos. The website should also be easily updatable and all type of contents (e.g. images, videos, songs) should be uploaded. I searched a lot on this forum and other pla...

Apply Server Side Javascript Validation in Grails

Hi All... I am working on grails project where I need to apply server side validations. For client side validations I have created basic validation.js file which contains all the javascript functions. Now what should be the ideal way to achieve the server side validation using Ajax, to achieve the validations like Record Duplication c...

How can I have a common user for Multitenant grails application?

Hi, I want to develop a multitenant grails application using grails plugin multitenant. I plan to have individual dbschema per tenant as per the requirement(backup and data security). Also I have a special case where a set of common users need to have access to data of all the tenants. With single database I hope it is easier to do. But...

Grails: Querying Associations causes groovy.lang.MissingMethodException

Hi, I've got an issue with Grails where I have a test app with: class Artist { static constraints = { name() } static hasMany = [albums:Album] String name } class Album { static constraints = { name() } static hasMany = [ tracks : Track ] static belongsTo = [artist: Artist] String name } class Track { static constraints...

Grails: sum of field within criteria builder

I'm at a loss of how to create a running sum of particular field after creating a criteria within a controller I'm currently creating a set of set of records using: def b = Tapes.createCriteria() def yesterday = b.list(sort: 'migratedDate', order: 'asc') { between ("migratedDate", dat.minus(1), dat) } and counti...

grails console and creating/testing classes

I know I can create a class using: grails create-domain-class book This will create a class file in my project that I can then access via the console. My question is 'how can I create a use a class in the console itself that I can then save()?' If I type the following in the console I get an error: class Tree { String name ...

Grails spring security / Acegi. Custom User + Password expired management.

Hi, I'm working on a grails legacy project. A domain class called User exists. It contains password, username, roles, etc. This project uses Spring Security for role management. I would like to add expiration of credentials ( force the User to renew its password). I've modified the User class. Not it implements the UserDetails interf...

Grails urls mapping

what the urls mapping processing order for the grails framework "/$object/$id/$collection" "/$object/$id/bar/list" "/foo/$id/bar/list" Which one will execute first. I'm getting unexpected behavior where the generic mapping seems to execute first ...

grails Acegi: How to check for expired password

Hi everyone. This is a branch from this question. Branched out because the original purpose of that question was something else. I'm looking for the easiest way to check if a password is expired. A password will expire if its older than N days, where N is a value stored in another table. My User class looks like this: Security config...

Does it make sense to create a RESTful service that I can send a binary file to?

As the question states - I want to send a binary file to a webservice. Does it make sense to think of this in a REST kind of way? Does it make sense to "POST" binary data, and how would you set up the receiving web service? I am working in grails, and I am trying to set up a service that will allow one web service to pass it a file, and...

Technologies to use for a project done in a small startup company

About the project It's a RIA project where lots of widgets are needed specifically: trees tables layouts etc. My primary targets with the project are: get first version done very fast(this is most important) make the app run very fast(this is also very important) to be accessible also on mobile phones(which have slow processors) ...

Using EasyB in Grails

Hi there folks, It's probably going to be one of the lame and novice level questions but I'm struggling with it for some time and it's still not working. I have a HomeController: package example class HomeController { def index = { [ message: "Hello, world!" ] } } Now I've installed easyb plugin: grails install-p...

Verify ifAnyGranted from a TagLib

Hi everyone, How I can verify that "at least one of the roles is granted" from a TagLib? So, I want to use something like: <sec:ifAnyGranted roles="ROLE_ADMIN,ROLE_SUPERVISOR"> but from the groovy file of my TagLib. I am using Spring Security Core plugin. Thanks in advance! ...