grails

Securing Jersey RESTful services with spring-security-core using jaxrs plugin

I'm needing to implement some RESTful webservices for a client in a Grails app and I want to use the jaxrs plugin but I am having a heck of a time finding information on how to implement security that isn't realm based (tomcat-users.xml). I am using the spring-security-core plugin and I'd like to utilize it to authenticate against my we...

Grails background-thread, Quartz

I'm developing a football manager website, but I can't figure out how to use properly the background-thread plugin and Quartz plugin (there is no much docs). My problem is.. I have a Controller of a Match class, with a function that I need to start at some time. With quartz I have tried to create a job but then I cannot call directly the...

How to use tnsnames.ora in Grails DataSource?

I'm trying to connect to a load-balanced virtual host specified in tnsnames.ora in my Grails application in DataSource.groovy, with no luck - it (obviously) throws an "Unknown Host Specified" exception. The tnsnames entry looks like this someServiceName = (DESCRIPTION_LIST = (FAILOVER=ON) (LOAD_BALANCE=ON) (DESCRIPTION = ...

How to use LDAP plugin on Grails?

Hi Gurus I'm starting a new project on Groovy and Grails. I'm now working on the authentication part and as we have an LDAP server I want to work the authentication using LDAP. I began setting my environment, I'm using SpringSource Tool Suite and Grails 1.3.5. When I started working with the authentication part I installed two plugins: ...

[Startup] Java Backend and Rails Frontend

I have a startup considering building a Java backend and a Rails frontend. The Java backend will take care of creating a caching layer for the database and offer other additional services. The Rails frontend will mostly be for creating the webapp and monitoring tools. What startups/companies out there are using this kind of setup? What ...

Grails with JAX-RS vs UrlMappings for RESTful Services

I started out looking at the JAX-RS plugin for grails and thought that was the way to go mainly because it was based on JSR-311 and I figure following standards is usually the smart thing to do. However, using Grail's UrlMappings it seems I basically achieve the same thing. I figure I'm missing something, however, we aren't doing anyth...

Best solution architecture for user notifications in Java/Grails environment?

Hello, I am building a community website using Grails and I want to implement user notifications exactly like stackoverflow.com. For instance, user will get notified for new events ('You have new comments', 'one of your favorite has changed'...) either by email or in his mailbox anytime he returns to the website. I suppose that this is...

How to set uniqueness at DB level for a one-to-many association?

My problem is simple but I could not find any GORM syntax for this. Consider the following class: class Article { String text static hasMany = [tags: String] static constraints= { tags(unique: true) //NOT WORKING } } I want to have one unique tag name per article defined in my constraints but I cannot make it with the ...

Grails quartz->thread

This is my Trigger that calls a matchService... class TestJob { def matchService static triggers = { cron name: 'firstThread', cronExpression: "0 0/1 12-13 ? * THU" } def group = "threadGroup" def execute() { matchService.playMatch() println "run thread: " + String.format('%tH:%<tM:%<tS.%<tL',System.current...

Is it possible to reference a Java app from a Grails app?

Hi, We have a Java/Spring/Hibernate codebase which is the core to our pretty large platform. We also have quite a few separate Java webapps (Struts or Spring MVC) running alongside which reference the core system, pulling in the applicationContext and services from it. We have a requirement to build another webapp that also references ...

Grails: Saving nested objects using XML data binding.

I'm creating a REST service in Grails to accept data from a python script. The python script generates an XML representation of the object graph and submits it to the controller. Things work great for my flat objects, but I can't figure out how to handle the case where a domain object contains a Set of children objects. For unrelated ...

Mailing with attachment

I have my application sending mail on click of a link./ Any way that i can customize this app to send mail with an attachment. Belwo is my controller code and service code Controller code def list = { params.max = Math.min(params.max ? params.int('max') : 10, 100) [challengeInstanceList: Challenge.list(params), challengeInst...

Grails searchable plugin

My application is using the grails searchable plugin, using compass underneath. The tables begin indexed is about 36 mb, and is building indexes of about 350 mb. This is small in most peoples books. If we delete the indexes and start the grails application, the index files are rebuild as expected, but then after about a day of running...

Can't create grails Criteria query containing a belongsTo relation

Hi all, I've been trying to create a criteria builder containing a belongsTo relation and have yet to succeed. Consider the following model: class Msg { ... static belongsTo = [user: User] ... } class User { ... Organisation organisation ... } I'm trying to make the following query: Msg.createCriteria()....

How do I inject new tags into a TagLib?

Lets assume that I have the following configuration in my conf/InjectionConfig.groovy file: x { a = { attrs, body -> out << "hello" } b = { attrs, body -> out << "goodbye" } } and that I have a simple taglib such as class XTagLib { static namespace = "x" } What I want to do is that when I type <x:a /> to any of my view...

Event Registry design pattern ?

I have a list of events that i need to fire when a user takes an action and an event manager that fires these events. Originally i used to fire the events explicitly in this way EventManager.publish(new SendNotificationEvent()) Then i wanted to change that to something like EventManager.publishSendNotificationEvent() To do that,...

How to get a list parameter from a grails view

In my view I have the following: <g:hiddenField name='expandableEducationList[${edIdx}]._deleted' value='false'/> <button onclick="dojo.byId('expandableEducationList[${edIdx}]._deleted').value='true'; getContainer(this, 'tr').style.display='none'" style="width:auto;" iconClass="minusIconS...

How do you mock out a static method of a domain object in Grails?

have a Grails domain object that has a custom static function to grab data from the database class Foo { /* member variables, mapping, constraints, etc. */ static findByCustomCriteria(someParameter, List listParameter) { /* code to get stuff from the database... */ /* Return value is a map ...

Grails paginating multiple tables

I'm trying to paginate through 2 tables on 1 gsp using 2 g:paginate tags. Hitting the paginate button on 1 table paginates both tables because both paginate tags are using the same 'max' and 'offset' params. How can I paginate through 1 table without paginating the other table? Thanks in advance. ...

Does it make sense to use ant build with a grails application?

If I understand correctly, the purpose of groovy and grails are to execute without (visible) compilation. However, I have inherited some old grails code that I can't build any more. I can see the advantages of having a build.xml file for special purposes, but, considering that the programming nature of Grails is to run on the fly, does...