grails-plugin

How To Call A Taglib As A Function In A Domain Class

て烟熏妆下的殇ゞ 提交于 2019-11-29 18:34:17
问题 I need to call the Static Resources Plugin (http://www.grails.org/Static+Resources+Plugin) from my domain class. This works perfectly in a controller: def tstLink = resourceLinkTo(dir:"docs/${identifier}",file:originalFileName) but in a domain class I get Exception Message: No signature of method: static org.maflt.ibidem.Item.resourceLinkTo() is applicable for argument types: (java.util.LinkedHashMap) values: [[dir:docs/19e9ea9d-5fae-4a35-80a2-daedfbc7c2c2, file:2009-11-12_1552.png]] I assume

Is there an equivalent to the Bootstrap class in a Plugin

一笑奈何 提交于 2019-11-29 18:20:01
问题 Is there an a way to initialise some data in a Plugin. I am modulizing my code and it would be nice to have something like the bootstrap in the Plugin but I cannot find it. Nor can I find references using the Google. 回答1: BootStrap.groovy is excluded by default from a plugin zip, but you can create a MyPluginBootStrap.groovy (name doesn't matter, just can't be BootStrap) and that'll be packaged and run along with the application's BootStrap. 来源: https://stackoverflow.com/questions/2994379/is

Grails spring security fails to present the login page due to a redirect loop

拥有回忆 提交于 2019-11-29 16:40:44
I have upgraded my current spring security plugins to spring-security-core-2.0-RC2 spring-security-ui-1.0-RC1 PROBLEM and I noticed that my login screen no longer shows up. In Chrome it says This page has a redirect loop STEPS TO RECREATE THE PROBLEM So I have tried to create a brand new application called Test to try to isolate the problem. First, I installed the security and security-ui plugins by adding the following entries in the BuildConfig.groovy : compile ":spring-security-core:2.0-RC2" compile ":spring-security-ui:1.0-RC1" Second I ran the quick start command as follows: grails s2

How do disable log4j plugin in grails?

前提是你 提交于 2019-11-29 16:30:39
问题 It appears the Grails 2.1 log4j plugin resets the log4j configuration during initialization of the grails application (see stack trace below). at org.apache.log4j.LogManager.resetConfiguration(LogManager.java:233) at org.apache.log4j.LogManager$resetConfiguration.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime

Grails: is it possible to exclude a plugin dependency of another plugin?

只谈情不闲聊 提交于 2019-11-29 14:32:04
I have a grails 2.2.2 app, and have decided to use cache-ehcache plugin. The problem is that this plugin depends on the cache plugin with version 1.0.0 and my application has the cache plugin version 1.0.1 (i think it is the default for grails 2.2.2). Therefore when i try to compile the app i always get the same message: You currently already have a version of the plugin installed [cache-1.0.1]. Do you want to update to [cache-1.0.0]? [y,n] I have to answer this question every time i compile the application. I tried to change the project plugin dependency to cache-1.0.1 in .grails/2.2.2/my

Is it possible to exclude grails plugin from production environment?

爷,独闯天下 提交于 2019-11-29 14:27:34
问题 I would like to use certain plugin in development environment, but would like to exclude this plugin from production and from generated war. What is the easiest way to accomplish this? 回答1: Yes, using plugin scopes. From http://grails.org/1.1+Release+Notes: Plugins can now be scoped using either the environment or predefined build scopes: def environments = ['dev', 'test'] def scopes = [excludes:'war'] The plugins will only load in those environments and will not be packaged into the WAR file

How do I configure logging for a grails plugin?

家住魔仙堡 提交于 2019-11-29 13:49:18
I'm creating my first grails plugin and I don't know where the logging should be configured. In a normal grails app, there is a conf/Config.groovy file for that, but for a plugin there is none. Is there another way to achieve this ? I would like to see debug messages when I launch my plugin unit and integration tests... Thanks in advance. Philippe The create-plugin script doesn't create a Config.groovy but if you create one yourself it will be used. Don't copy one from an existing app since it'll be cluttered with stuff that isn't applicable, just create a log4j closure and whatever other

Avoid cyclic reference inheritance in grails

不打扰是莪最后的温柔 提交于 2019-11-29 10:26:59
I have a big project written in Grails 2.3.8. Sometimes when I deploy it using my CI I got this message: Unable to complete the scan for annotations for web application [/ProjectName##1152] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector] I have already increased the Xss settings, but it's clear, but maybe I'm wrong, that there is a cyclic

jquery-ui autocomplete in grails

ぃ、小莉子 提交于 2019-11-29 08:16:33
Can anyone give me the complete steps to work with jquery-ui autocomplete. I am using grails 2.0.1. I need a complete example including code for controller and views. Thanks in advance. At first you need to add in your main.gsp (in head) this to lines <g:javascript library="jquery"/> <g:javascript library="jquery-ui"/> the plugin will downloaded automatically. and for complete example you can use this link http://jay-chandran.blogspot.com/2011/09/using-grails-with-jquery-autocomplete.html you should really try to do this yourself and then ask a question about how something works or why

Quartz job triggering from Config.groovy

淺唱寂寞╮ 提交于 2019-11-29 05:17:05
I have the following Quartz job running in my application: class ScraperJob { def scraperService static triggers = { cron name: 'scraperTrigger', cronExpression: "0 0 * * * ?" // run every minute } def execute(){ try { scraperService.storing() log.info "${new Date()} - Scraping went smoothly." } catch(IOException) { // Connexion problem log.error "${new Date()} - Method: parsing >> Connexion down or interrupted while parsing !" } catch(SAXException) { // Any SAXParser exception log.error "${new Date()} - Method: parsing >> Parser error." } finally { // if not closed, the application crashes