grails-plugin

Grails 2.1.1 - How to develop a plugin with an AstTransformer?

只愿长相守 提交于 2019-12-12 15:15:35
问题 I want to replace the auto injected log object, which is of type org.apache.commons.logging.Log with an object of type org.slf4j.Logger , so that I can use it properly with Logback. Therefore I need to create a ...Transformer class (written in Java) - that's what I got from Graeme Rocher over at the "grails-user" mailing list. I'm also aware that I have to pack this ...Transformer class within a plugin and make it a *.jar archive which I can load within the lib/ folder of the plugin. But I

Disable Grails plugin

无人久伴 提交于 2019-12-12 10:39:28
问题 In my Grails app, I want to prevent the Searchable plugin from loading when running my unit tests. I tried doing this using the following code in the Bootstrap class def grailsApplication def init = {servletContext -> def currentEnv = grails.util.Environment.current.name if (currentEnv == 'test') { def doNothing = {println "Searchable is disabled"} // This returns null! def searchablePluginClass = grailsApplication.getClassForName("SearchableGrailsPlugin") searchablePluginClass.metaClass

Grails Spring Security Core Plugin - adding flash message to login page

笑着哭i 提交于 2019-12-12 09:07:33
问题 I am using the Grails Spring Security Core Plugin to secure a certain action using the following annotation. @Secured(['IS_AUTHENTICATED_REMEMBERED']) This causes the action to redirect to my login page if the user is not logged in. Once they are logged in they are then redirected to the original action. How can I add a flash message to the login page in this scenario, i.e. flash.message = "You must be logged in to submit a news story" To clarify, I would only want the message to be displayed

Mongodb Aggregation framework for grails 1.3.7

感情迁移 提交于 2019-12-12 06:14:21
问题 How can I use Aggregation framework in Grails 1.3.7. At the moment i can't migrate into new version of grails. I have tried grails mongodb plugin 1.0.0.GA but it is using old java driver and gmongo libs. I have also tried to add dependencies for new libs/jars in build-config.groovy but still it is giving me error at runtime for aggregate method. Any help is highly appreciated. 回答1: In your BuildConfig.groovy put this dependencies { compile "org.mongodb:mongo-java-driver:2.10.1" runtime "com

Fetching LDAP attribute memberof inside Grails Spring application

不问归期 提交于 2019-12-12 04:22:21
问题 I am stuck possibly at a very stupid question, trying to implement LDAP role based authentication/authorization in a Grails application (bookstore) using spring-security-core and spring-security-ldap plugins. I created a custom UserDetailsContextMapper and trying to map my LDAP role with application role. However, the memberof attribute is never returned in the attributes. UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection authorities) { Attributes attributes

Complex search across grails domain classes

亡梦爱人 提交于 2019-12-12 03:54:34
问题 I want to be able to do complex searches on grails objects. This is presently implemented using stored procedures on my site that build up a SQL query and parses all of those results. Will something like the searchable plugin allow me to simplify this task? My guess is not, since it mostly is doing text based searching. The stored procedures are quite complex, and hard to change. Our users are employees, and the queries have to do with amounts of job experience and who they were working for,

Grails application is not running after installing Grails activiti plugin

人走茶凉 提交于 2019-12-12 03:42:33
问题 i have found grails activity plugin Here and following this document to getting started with this plugin . on running the application after installing the plugin i am getting following error | Running Grails application Activiti Process Engine with Spring Security Initialization ... Activiti Process Engine Initialization... Configuring Spring Security Core ... ... finished configuring Spring Security Core | Error 2012-07-07 14:02:45,500 [pool-7-thread-1] ERROR context.GrailsContextLoader -

Grails Render PDF Plugin returns NullPointerException

我怕爱的太早我们不能终老 提交于 2019-12-12 03:22:59
问题 I'm trying to render a pdf file with render plugin. My controller code is: def toPDF(){ DomainClass domainClass = DomainClass.get(params.id) try{ renderPdf(template: "/domainClass/pdf", model: [domain: domainClass], filename: System.currentTimeMillis().toString() + "_" + domainClass.id.toString() + ".pdf") }catch(e){ redirect action: "error" } } In development mode, it works properly. But in production, this action throws NullPointerException 2015-01-30 11:51:40,393 [http-apr-8080-exec-48]

grails kickstart plugin KickstartFilters how to prevent password information on logs

和自甴很熟 提交于 2019-12-12 02:26:58
问题 I am using Grails version 2.2.4 and I have installed kickstart plugin as compile ":kickstart-with-bootstrap:0.9.6". BuildConfig.groovy plugins { runtime ":hibernate:$grailsVersion" runtime ":jquery:1.8.3" runtime ":resources:1.1.6" compile ":kickstart-with-bootstrap:0.9.6" build ":tomcat:$grailsVersion" runtime ":database-migration:1.3.2" compile ':cache:1.0.1' } I found "KickstartFilters.groovy" filter with following directory structure plugin -> kickstart-with-bootstrap:0.9.6 -> conf ->

Why does Grails not recognize BuildStandalone?

寵の児 提交于 2019-12-12 01:56:04
问题 I have a Grails app (2.3.6) that uses the Grails Build Standalone plugin. The myapp/grails-app/conf/BuildConfig.groovy : plugins { runtime ":resources:1.2.7" compile 'org.grails.plugins:gson:1.1.4' compile ":standalone:1.2.3" build ":release:3.0.1" runtime ":cached-resources:1.0" compile ":cache-headers:1.0.4" } When I go to myapp and run grails build-standalone myapp.jar --tomcat I get: $ grails build-standalone myapp.jar --tomcat |Loading Grails 2.3.6 |Configuring classpath |Running pre