Search Results

Search found 645 results on 26 pages for 'grails enthu'.

Page 10/26 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Grails GIS Application

    - by Steve Wall
    Hello, I'm working on an internal IT application monitoring outages for a network with a national footprint in the US. I'm considering overlaying outages by region on a map. Showing outage areas in red for example. The user clicks on the outage area displaying drill down information. The technology stack includes Grails/JBoss/Linux. Are there frameworks that provide the mapping/GIS layer of the display on which I could overly my domain specific information? I've looked into the Google Map API, but am unable to leverage it as this operates behind a firewall. Any ideas? Thanks in advance, Steve

    Read the article

  • How to specify Java Option (System Property) for embedded Tomcat while running Grails App?

    - by hko19
    Specifically, I want to have my grails app under development to connect to an Oracle db defiined by an tnsnames.ora file. I have the tnsnames.ora file located in c:\drivers\Network\ on my PC. When I run the grails app via "grails run-war", the db connection string defined in the tnsnames.ora file doesn't seem to be picked up: grails prod run-war -Dserver.port=62215 -Doracle.net.tns_admin=C:\drivers\Netowrk\ It seems the name-value pair of oracle.net.tns_admin is not being passed to the JVM used by the the embedded Tomcat that comes with Grails 1.2.0. If not, what is the proper way of specify it, or pass any JAVA_OPTS to the underlying JVM?

    Read the article

  • How to display image in grails GSP?

    - by Walter
    I'm still learning Grails and seem to have hit a stumbling block. Here are the 2 domain classes: class Photo { byte[] file static belongsTo = Profile } class Profile { String fullName Set photos static hasMany = [photos:Photo] } The relevant controller snippet: class PhotoController { ..... def viewImage = { def photo = Photo.get( params.id ) byte[] image = photo.file response.outputStream << image } ...... } Finally the GSP snippet: <img class="Photo" src="${createLink(controller:'photo', action:'viewImage', id:'profileInstance.photos.get(1).id')}" /> Now how do I access the photo so that it will be shown on the GSP? I'm pretty sure that profileInstance.photos.get(1).id is not correct. Thanks!!

    Read the article

  • Seed data for grails application

    - by bsreekanth
    Hello, What is the best way to load seed (initial or test) data into grails application. I'm considering 3 options 1. Putting everything in *BootStrap.groovy files. This is tedious if the domain classes and test data are many. 2. Write custom functionality to load it through xml. May not be too difficult with the excellent xml support by groovy, but lot of switch statements for different domain classes. 3. Use Liquibase LoadData api. I see you can load the data fairly easy from csv files. Choice 3 seems the easiest. But, I'm not familiar with Liquibase. Is it good in this scenario, or only used for migration, db changes etc. If anyone could provide a better sol, or point to an example with Liquibase, it would be great help.. thanks...

    Read the article

  • Grails: Problem with nested associations in criteria builder

    - by Mr.B
    I have a frustrating problem with the criteria builder. I have an application in which one user has one calendar, and a calendar has many entries. Seems straightforward enough, but when I try to get the calendar entries for a given user, I can't access the user property (MissingMethodException). Here's the code: def getEntries(User user) { def entries = Entries.createCriteria().list() { calendar { user { eq("user.id", user.id) } } } } I have even tried the following variation: def getEntries(User user) { def entries = Entries.createCriteria().list() { calendar { eq("user", user) } } } That did not raise an exception, but didn't work either. Here's the relevant parts of the domain classes: class Calendar { static belongsTo = [user: User] static hasMany = [entries: Entries] ... } class User { Calendar calendar ... } class Entry { static belongsTo = [calendar: Calendar] ... } When Googling I came across a similar problem noted in early 2008: http://jira.codehaus.org/browse/GRAILS-1412 But according to that link this issue should have been solved long ago. What am I doing wrong?

    Read the article

  • Setting encoding in Grails controller's render method

    - by Philippe
    Hello, I'm trying to build an RSS feed using Grails and Rome. In my controller's rss action, my last command is : render(text: getFeed("rss_2.0"), contentType:"application/rss+xml", encoding:"ISO-8859-1 ") However, when I navigate to my feed's URL, the header is : <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> ... Does anyone have a clue about WHY the encoding is UTF-8 when I set it to ISO-8859-1 in the render method ??? Thanks for your help !

    Read the article

  • How to mock/stub calls to message taglib in Grails controller

    - by Dave
    I've got a Grails controller which relies on the message taglib to resolve an i18n message: class TokenController { def passwordReset = { def token = DatedToken.findById(params.id); if (!isValidToken(token, params)) { flash.message = message(code: "forgotPassword.reset.invalidToken") redirect controller: 'forgotPassword', action: 'index' return } render view:'/forgotPassword/reset', model: [token: token.token] } } I've written a unit test for the controller: class TokenControllerTests extends ControllerUnitTestCase { void testPasswordResetInvalidTokenRedirect() { controller.passwordReset() assert... } } Since the message taglib is called in the controller I get a MissingMethodException: groovy.lang.MissingMethodException: No signature of method: TokenController.message() is applicable for argument types: (java.util.LinkedHashMap) values: [[code:forgotPassword.reset.invalidToken]] Does anyone know the best way to get around this issue in a unit test? Ideally I would like to perform assertions on the message but right now I'd be happy if the test just ran! Thanks

    Read the article

  • Proper snowball analyzer configuration when using Grails Searchable Plugin

    - by Wirsbro
    To improve stemming we want to switch from the default analyzer to snowball, however, having a lot of difficulty with the proper settings and would appreciate any help. In Environment: - Sun's Java 1.6.16 - Grails 1.2.2 - Searchable Plug-In 0.5.5 Config.groovy: Have tried both settings: compassSettings = ['compass.engine.analyzer.stemmed.type': 'snowball', 'compass.engine.analyzer.stemmed.name': 'English'] compassSettings = ['compass.engine.analyzer.snowball.type': 'snowball', 'compass.engine.analyzer.snowball.name': 'English', 'compass.engine.analyzer.search.type': 'snowball', 'compass.engine.analyzer.search.name': 'English'] Search.groovy - The Invocation: def searchResult = searchableService.search(params.q, withHighlighter: { highlighter, index, sr if (!sr.highlights) { sr.highlights = [] } try { sr.highlights[index] = highlighter.fragments("content")[0..2].join(" ") } catch (IndexOutOfBoundsException ex) { sr.highlights[index] = highlighter.fragment("content") } }) def suggestion = searchableService.suggestQuery(params.q) if (suggestion != params.q) { searchResult.suggestedQuery = suggestion }

    Read the article

  • user table with javaDB and Hibernate from within grails

    - by Ralf
    let's see if I can ask this in an understandable way... I started with grails and created a domain class called user. As far as I understand, Hibernate is used to map this domain class to the database. This works pretty fine with hsqldb. Now I tried to switch to javaDB and get an error message because the table is called "user" (which seems to be a reserved word for javaDB). So a statement like create table user ... will result in an error message. create table "user" ... works, but Hibernate seems not put put the table name in quotes. How can I configure Hibernate to use quotes in order to make it work with my table name? PS: yes, I know, I could map the domain class to another table name... :-)

    Read the article

  • user table with javaDB and hybernate from within grails

    - by Ralf
    let's see if I can ask this in an understandable way... I started with grails and created a domain class called user. As far as I understand, hybernate is used to map this domain class to the database. This works pretty fine with hsqldb. Now I tried to switch to javaDB and get an error message because the table is called "user" (which seems to be a reserverd word for javaDB). So a statement like create table user ... will result in an error message. create table "user" ... works, but hybernate seems not put put the table name in quotes. How can I configure hybernate to use quotes in order to make it work with my table name? PS: yes, I know, I could map the domain class to another table name... :-)

    Read the article

  • Scaffolding Web Services in Grails

    - by Dan
    I need to implement a web app, but instead of using relational database I need to use different SOAP Web Services as a back-end. An important part of application only calls web services and displays the result. Since Web Services are clearly defined in form of Operation: In parameters and Return Type it seems to me that basic GUI could be easily constructed just like in the case of scaffolding based on Domain Entities. For example in case of SearchProducts web service operation I need to enter search parameters as input, so the search page can be constructed. Operation will return a list of products, so I need a page that will display this list in some kind of table. Is there already some library in grails that let you achieve this. If not, how would you go about creating one?

    Read the article

  • grails Sql error

    - by Srinath
    Hi, I was getting issue wen using new Sql method in grails . import groovy.sql.Sql def datasource def organization_config = new Sql(dataSource) def orgs = organization_config.rows("select o.organizationId,o.name from organization o ") session.setAttribute("org_results", orgs); The application is running but getting these errors when restart tomcat server. SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: groovy.sql.GroovyRowResult java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: groovy.sql.GroovyRowResult Can any one please tell me wy this is coming . thanks in advance, sri..

    Read the article

  • grails metaprogramming

    - by Don
    Hi, My understanding is that there are two obvious places in a Grails app where one can do meta-programming: The init closure of Bootstrap.groovy The doWithDynamicMethods closure of a plugin The meta-programming I'm referring to here should be visible throughout the metaprogramming, typical examples include adding (or replacing) methods of 3rd party classes. String.metaClass.myCustomMethod = { /* implementation omitted */ } The disadvantage of (1), is that the metaprogramming won't be applied when the application is dynamically reloaded. The disadvantage of (2) is that I need to create and maintain an entire plugin just for the sake of a little metaprogramming. Is there a better place to do this kind of metaprogramming? Thanks, Don

    Read the article

  • Problem authenticating with shiro in grails app

    - by xain
    I have a grails 1.2 app and I want to use declarative security in order to restrict accesses based on roles. I decided to try shiro, installed the plugin, but when I try to authenticate, the message "Invalid username and/or password" shows up in the header. I check the db entry and the user is there with the sha'ed password. No messages are shown neither in the console nor in the stacktrace file. I added "warn 'org.jsecurity'" to Config.groovy with no results. Any hints/tricks to troubleshoot this ?

    Read the article

  • Grails searchable plugin

    - by Don
    Hi, In my Grails app, I'm using the Searchable plugin for searching/indexing. I want to write a Compass/Lucene query that involves multiple domain classes. Within that query when I want to refer to the id of a class, I can't simply use 'id' because all classes have an 'id' property. Currently, I work around this problem by adding the following property to a class Foo public Long getFooId() { return id } static transients = ['fooId'] Then when I want to refer to the id of Foo within a query I use 'fooId'. Is there a way I can provide an alias for a property in the searchable mapping rather than adding a property to the class?

    Read the article

  • Grails Remote Function and Ajax

    - by WaZ
    I am trying to list addresses and onChange event I send the address ID and return a list of users. <g:select name="AddressID" from="${address}" optionKey="id" optionValue="address" onchange="${ remoteFunction(action:'testMe', params:'\'id=\' + this.value' ,update:'show' )}"> </g:select> I call this div "show". <div id="show"> <g:each in="${users}" status="i" var="C"> <h3>${C}</h3> </g:each> </div> However, when I click the item on the list box I get the following error: description The requested resource (/MyTest/WEB-INF/grails-app/views/test/testMe.jsp) is not available. My understanding of an update attribute inside a remoteFunction is that it is the name of the div which gets refreshed after the remoteFunction call is compeleted. Thanks.

    Read the article

  • Grails: JSONP callback without id and class in JSON file

    - by Klaas
    Hi, I am working on a REST based interface where people get a json file. The client needs to access the file from another Domain. I use jsonp which works so far. My problem is the rendering in Grails. At the moment I use the 'as JSON' to marshalling the object: render "${params.jsoncallback}(${user as JSON})" The Json file getting to the client inclused all attributes, incluing the id and class, which I do not want to have in there. In case it is not jsonp, I do it this way, which works great: render(contentType:'text/json'){ userName user.userName userImage user.userImage : : } So how do I get the id and class attributes out of the json when rendering "user as JSON"? Any idea? best regards, Klaas

    Read the article

  • Batch update records in Grails

    - by UltraVi01
    I have to calculate a "total" for each user based on individual actions -- that is, a User hasMany Actions and each Action has a point. So I need to basically get a sum of all the points on all the actions. Actions are added and subtracted regularly. Since this can be a rather heavy operation, it's not feasible that I execute the "total" each time I need it. Therefore, I am thinking of running the operation once a day for each user and storing the total points on the User as an int. Because I have thousands of users, I am trying to figure out the best way to do this. Should I basically iterate through all the users and call User.save() each time, or is there some kind of batch update mechanism I can use in Grails / GORM?

    Read the article

  • How can I disable Hibernate-cache logs?

    - by Mulone
    Hi guys, My Grails app log is being flooded with thousands of messages like: 2010-05-21 18:54:08,261 [30462143@qtp-19943008-38] DEBUG hibernate.EhCache - key: ga_event value: 5220206380077056 This is my log4j config: // log4j configuration log4j = { // Example of changing the log pattern for the default console // appender: // appenders { console name:'stdout',layout:pattern(conversionPattern: '%c{2} %m%n') rollingFile name:'applog', file: logDirectory+"/${appName}_main.log", maxFileSize:'10MB' //'null' name:'stacktrace' file name: 'stacktrace', file: logDirectory+"/${appName}_stacktrace.log", layout: pattern(conversionPattern: '%c{2} %m%n') } error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages', // GSP 'org.codehaus.groovy.grails.web.sitemesh', // layouts 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping 'org.codehaus.groovy.grails.web.mapping', // URL mapping 'org.codehaus.groovy.grails.commons', // core / classloading 'org.codehaus.groovy.grails.plugins', // plugins 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration 'org.springframework', 'org.hibernate', stacktrace: "stacktrace" warn 'org.mortbay.log' root { debug 'stdout', 'applog' additivity = true } } Any idea on how to disable that log? Cheers

    Read the article

  • Grails Duplicate Exception handling

    - by Srinath
    Hi, How to catch duplicate key exceptions in Grails . when trying to save existing integer for a unique column constraint, the error is generating while saving/updating a record . Also used try{ object.save(flush:true) }catch(org.springframework. dao.DataIntegrityViolationException e){ println e.message }catch(org.hibernate.exception.ConstraintViolationException ex){ println e.message }catch(Exception e){ println e.message } But unable to catch this issue . 23:41:13,265 ERROR [JDBCExceptionReporter:101] Duplicate entry '1' for key 2 23:41:13,281 ERROR [AbstractFlushingEventListener:324] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) Could you please share the solution to solve this .

    Read the article

  • [grails] attaching multiple files to a domain class

    - by Emyr
    I've seen various Grails plugins which allow easier handling of file uploads, however these tend only to support a single file per form-submit. I'd like a multi-attach form where as soon as you pick one file, an extra field and button is added using JS (various sites do it like this). Do you know of any good plugins which provide elegant uploading of multiple files without excessive coding? A progress bar either per-file of for the whole process would also be very nice. I don't know to what extent I can allow GORM to handle a java.io.File field (or in this case a Collection<File>).

    Read the article

  • Grails domain class initialization

    - by Don
    Hi, My Grails app has the following Spring bean defined in spring/resources.groovy calendarService(CalendarService) { bean -> bean.initMethod = "init" } This method looks something like: class CalendarService { void init() { User.findByEmail("[email protected]") } } When I call the dynamic finder findByEmail I get a MissingMethodException. My guess is that I'm trying to call this method too early, i.e. before the domain classes have had the dynamic finders added to their metaclass. One solution would be to call CalendarService.init() myself from Bootstrap.init, rather than instructing Spring to call it, but is there a better solution? Thanks, Don

    Read the article

  • Best practices for using Hg with Grails?

    - by leeand00
    What should I check in/not check in? Since many of the files are sometimes auto-generated I'm not entirely sure how to handle this using version control...does it have something to do with tags? For instance in ANT, I know not to check-in my target/bin directories...but Grails adds another level of confusion to this...since some of code is generated and some of it is not. (It may become clearer as I go...but it seems to be that there needs to be some way of being able to tell what was just generated and what was modified by a developer so that it needs to be placed in version control)

    Read the article

  • How to configure grails and shiro to mark cookies secure?

    - by j4y
    I'm using Grails 2.2.4 with the Shiro plugin (v1.1.4) and would like to mark the cookies as secure so the session information won't be sent over http. This is the attribute I want to set: securityManager.sessionManager.sessionIdCookie.secure = true The shiro source says to use the Grails bean property override mechanism, which is grails-app/conf/spring/resources.groovy How can I override just the one setting? // If the legacy 'security.shiro.filter.config' option is set, // use our custom INI-based filter... if (application.config.security.shiro.filter.config) { log.warn "security.shiro.filter.config option is deprecated. Use Grails' bean property override mechanism instead." 'filter-class'('org.apache.shiro.grails.LegacyShiroFilter') 'init-param' { 'param-name'('securityManagerBeanName') 'param-value'('shiroSecurityManager') }

    Read the article

  • Configuration for log4j to log ERROR level to a DB table

    - by firnnauriel
    Using the default config of a fresh Grails project, how do i change it so that ONLY error level messages will go to 'Message' table? // log4j configuration log4j = { // Example of changing the log pattern for the default console // appender: // //appenders { // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') //} error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages', // GSP 'org.codehaus.groovy.grails.web.sitemesh', // layouts 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping 'org.codehaus.groovy.grails.web.mapping', // URL mapping 'org.codehaus.groovy.grails.commons', // core / classloading 'org.codehaus.groovy.grails.plugins', // plugins 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration 'org.springframework', 'org.hibernate', 'net.sf.ehcache.hibernate' warn 'org.mortbay.log' } Thanks for any leads on this.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >