grails

How to create a new directory in grails application to store jasper report files those can be downloaded by user

孤街醉人 提交于 2020-01-06 12:39:45
问题 I want to create a new directory to store all pdf reports generated by jasper reports and they should be accessible to users to download as well For example: I am exporting the a file called "pdfreport20110804788.pdf".when i put this file in that directory .i set certain things in controller method and i need the file created to be returned from the groovy method where the new directory is created and its is exported as pdf file so that file should be returned to the controller calling method

Grails Events Push plugin not getting a response from server event

♀尐吖头ヾ 提交于 2020-01-06 12:35:09
问题 I have been trying to get the grails events push plugin to work but cant seem to get response data from the server when the savedToDo event is called. I can see the logs in my console for the data coming to the server and executing the service code, but the client doesnt seem to be getting back a response. My code is as follows : MyService.groovy package eventspush import grails.converters.JSON import grails.events.* class MyService { //will receive client events from 'saveTodo' topic

Grails Events Push plugin not getting a response from server event

心不动则不痛 提交于 2020-01-06 12:35:07
问题 I have been trying to get the grails events push plugin to work but cant seem to get response data from the server when the savedToDo event is called. I can see the logs in my console for the data coming to the server and executing the service code, but the client doesnt seem to be getting back a response. My code is as follows : MyService.groovy package eventspush import grails.converters.JSON import grails.events.* class MyService { //will receive client events from 'saveTodo' topic

Is Java 1.8.0 required for Grails 2.4.3?

北城以北 提交于 2020-01-06 09:06:12
问题 Is Java 1.8.0 required for Grails 2.4.3? Grails doc found here says java 1.6.0 and above but I am facing issues with my newly created grails app using java 1.7.0_21. Thanks! 回答1: Is Java 1.8.0 required for Grails 2.4.3? No. 1.8 is definitely not required by 2.4.3. It is supported, but not required. ...but I am facing issues with my newly created grails app using java 1.7.0_21 Without knowing the specifics of the issues you are facing I can't say how to resolve them but if you can update to

Grails FindBy* with an inteface property

穿精又带淫゛_ 提交于 2020-01-06 08:46:26
问题 I have a class like class Account { BigDecimal balance = 0 SortedSet transactions AccountOwner owner static constraints = { } static hasMany = [transactions:Transaction] } when I try to query the Account like def account = Account.findByOwner(user) I get this error | Failure: testSave(br.com.fisgo.financial.AccountControllerTests) | org.springframework.dao.InvalidDataAccessResourceUsageException: Cannot query [br.com.fisgo.financial.Account] on non-existent property: owner at org.grails

Configuring Spring Security without the plugin web.xml problems

家住魔仙堡 提交于 2020-01-06 08:41:17
问题 I'm currently building a Grails 1.3.5 app. It uses an existing model layer (shared code - no GORM) and I've successfully configured the tomcat jndi connections for it in conf/spring/resources.xml and all is working well. However I'm having problems when I try and configure Spring security. I'm NOT using the spring security plugin because I want to use the xml security config from another project we already have running. This uses Spring 3 security. I've followed the following steps on various

Testing custom constraints in Grails App

风格不统一 提交于 2020-01-06 08:33:32
问题 I have the following as my unit test: void testCreateDealer() { mockForConstraintsTests(Dealer) def _dealer= new Dealer( dealerName:"ABC", Email:"abc-motors@global.com", HeadOffice:"", isBranch:false) assertFalse _dealer.validate() } But when I run the test I get the following error: No signature of method: static com.myCompany.Dealer.findByDealerNameIlike() is applicable for argument types: (java.lang.String) values: [ABC] I use some custom constraints in my domain class. How Can I test this

httpSession in Grails

爷,独闯天下 提交于 2020-01-06 08:18:41
问题 I need to access the domain class User of the current session. The following code works: class RatingController { def rate = { def rating = params.rating def artist = Artist.get( params.id ) def user = User.get(1) user.addToRatings(new Rating(artist:artist, rating:rating)) user.save() render(template: "/artist/rate", model: [artist: artist, rating: rating]) } } But instead of explicitly get the user with ID equal 1 (User.get(1)) I need to access the user of the current session. I tried the

Adding functionality to Grails restfulcontroller

回眸只為那壹抹淺笑 提交于 2020-01-06 08:07:11
问题 I'm having a very simple restful controller, which looks like this: class PersonController extends RestfulController<Person> { static responseFormats = ['json', 'xml'] PersonController() { super(Person) } } However, now I want to add a search option to this. What is the Grails way of making this possible? I thought of adding the following: def search(Map params) { println params } But that makes Grails (2.3) crash (| Error Fatal error during compilation org.apache.tools.ant.BuildException:

Grails creating routines

我只是一个虾纸丫 提交于 2020-01-06 08:04:16
问题 Let's say, i have a specific information in the database that needs to be sent for a specific user by email in a specific time of the day. a) How can i create a routine in Grails, which is basically an action that is always running - without being associated with any event? Let's say, every hour that action is runned. I was thinking about something like this: while(true){ ... myCodeHere ... wait 30minutes } Will this actually work? Without too much processing? And how can i have an action