grails-plugin

Grails: Adding to or modifying grails plugins

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 01:43:52
问题 There's a plugin that I would like to add features since it is not quite usable (in a practical way). Do you create a new plugin or is it allowed to update the existing one? 回答1: You should be able to add to an existing one. Ideally the plugin's page on the plugin portal ( http://grails.org/plugins/) should have a link to the source which is usually in subversion or git. If it's in Subversion or a private GIT repo you might have to email the grails developer list ( http://grails.org/Mailing

Why is this method returning null even though the underlying controller is mocked using Spocks' Mock()?

自作多情 提交于 2019-12-12 01:28:41
问题 import grails.plugin.spock.* class EventControllerSpec extends ControllerSpec { def "Creating a breadcrumb from an event"() { given: "I have a named event" def eventController = Mock(EventController) def event = Mock(Event) event.title >> 'Space-Journey with Sprock and the Crew' event.title == 'Space-Journey with Sprock and the Crew' when: "I create a breadcrumb from it" def eventCrumb = eventController.createCrumb("Event", "show", "1", event.title) /* private Map createCrumb (String

TestDataConfig.groovy not found, build-test-data plugin proceeding without config file

本小妞迷上赌 提交于 2019-12-12 01:15:29
问题 I am getting the following error when including in Mixin Build in unit tests: TestDataConfig.groovy not found, build-test-data plugin proceeding without config file it works like charm in the integration tests but not part of unit tests. I mean, 'build' plugin works itself in unit test but the 'TestDataConfig' is not populating default values Thank You 回答1: First you should verify the version from build-test-data in your BuildConfig.groovy test ":build-test-data:2.0.3" Second, check your test

Multiple scheduler using grail quartz plugin

余生颓废 提交于 2019-12-12 00:41:55
问题 I am using grails quartz plugin to implement scheduling in our app. I've created one scheduler with QuartzConfig.groovy props, which is Clustered scheduler. I want one more scheduler in the same app for Non-Clustered scheduling. How can I achieve this using same grails quartz plugin. 回答1: I do this creating a new scheduler bean in resources.groovy: newQuartzScheduler(org.springframework.scheduling.quartz.SchedulerFactoryBean) { Properties properties = new Properties() properties.setProperty(

Configuring Logging for Grails Standalone App Runner

。_饼干妹妹 提交于 2019-12-11 16:08:39
问题 I am writing a Grails app and would like to use the Grails Standalone App Runner that packages your Grails app into a fat JAR with an embedded Tomcat container. I would like to configure logging for the embedded Tomcat container will use to store and read SSL certs from. I want to specify log levels for different catalina components, and also replace log4j with logback using SyslogAppender . How/where do I make such configurations? Is this documented anywhere? 回答1: If you want to replace

grails - how to make filter recognize values from datePicker using Grails Calendar Plugin?

天涯浪子 提交于 2019-12-11 16:04:44
问题 I was using regular datePicker from grails but I decided it was easier to use a textField with a calendar next to it and I was recommended to use Grails-UI. My problem is that now, when I click to apply the filters, they do not work. Somehow they are not being recognized. Any help would be greatly appreciated. Here is the code for the controller: def searchResults = { def fromCal if(params?.lastUpdatedD) { fromCal = Calendar.getInstance() fromCal.setTime(params?.lastUpdatedD) fromCal.set

How do I configure installation of plugins in Grails 3.0.4?

∥☆過路亽.° 提交于 2019-12-11 13:57:53
问题 I'm porting an application from Grails 2.4.2 to Grails 3.0.4, and I'm having problems with some plugins that were installed previously. Specifically one that is referenced in a GSP page. The particular plugin is called google-visualizer, and I've found some info here: https://github.com/bmuschko/grails-google-visualization/blob/master/grails-app/views/formatter/index.gsp However, I am clueless as to how to install this. I have not found the particular jar file in any maven repo, so I can't

What is the best way to generate HTML mail templates for the Grails mail plugin?

巧了我就是萌 提交于 2019-12-11 13:32:11
问题 With the Grails Mail plugin you can either send plain text or html mails. When sending html mails like this: sendMail { to "fred@g2one.com" subject "Hello John" html(view: htmlTemplate, model: args) } It is recommended to make css inline in mail html, because it will be accepted by more mail clients. The problem is, that these html files are hard to read and maintain. Is there a way to generate these mail templates in a smarter way than writing inline css? What is a best practice to generate

Grails + Mongo: GORM mysteriously thinks a object referenced by an embedded field has a changed propery

别说谁变了你拦得住时间么 提交于 2019-12-11 12:30:09
问题 I have a domain class called Form which has an embedded field called union of type Organization which is embedded. Organization has the field createdByUser . User has a field organization of type Organization added by AST transformation. So, whenever i try to save a Form object, it tries to change the user reference by createdByUser to an organization id of 1 for mysterious reasons. 来源: https://stackoverflow.com/questions/30714307/grails-mongo-gorm-mysteriously-thinks-a-object-referenced-by

Grails read from existing DB

寵の児 提交于 2019-12-11 12:17:14
问题 I want to fetch data from already existing database from another project into my Grails project and list the data. Should I be creating a domain controller for the already existing db? I know how to create domain-controller and use data migration plugin to update db but none of the books I read had any information on how to setup and read from an existing database. I'm using MySQL for my database. 回答1: Use the Reverse Engineer plugin to create domain classes from your existing database: http: