Is it possible to view your Grails configuration (i.e. properties in your Config.groovy) anyway at all at runtime via JMX (or any other way)?
Before going off writing something to do this, I just wanted to check what is the grails way to do this?
Thanks in advance
Related
I've a rest-api-plugin in grails 3.3.9 that has a couple of gson views for rendering the controller methods. When I include this plugin in another new grails project either the gson views are not called at all or they cannot be found (depending on wether I am using render/respond and specifiying the view).
I've tried specifying plugin in the render call but this doesn't help. I can see the gson files in the included plugin. In the new rest-api profile project, when the view is specified in the plugin it looks like DefaultGroovyPageLocator is trying to find something like .json.gsp and nothing is looking for .gson (not sure if something should be?).
Any ideas as to how I might sort this?
Thanks.
...DefaultGroovyPageLocator is trying to find something like .json.gsp and nothing is looking for .gson
If that is true that nothing is looking for .gson, that is a bug. Please report an issue at https://github.com/grails/grails-views/issues and we can investigate. Thanks.
I have a Grails application with outsourced (in a separate Grails Plugin) domain objects and would like to use the domain objects in a Java application.
If this is possible, how to do that?
Thanks
In order to use them as domain classes, you need GORM-plugin to be installed somehow in your java code. Without the plugin the domain classes lose their "active record" aspect and can be used only as POJOs.
I can barely imagine how to do that w/o lot of pain
You need to define your custom hbm.xml hibernate mapping files. See hibernate doc
I would like to know how to register JNDI datasources dynamically with the multi-tenant-core-plugin in the single-tenant mode. I searched for nearly two weeks and found some hints how to do it, like the JndiTemplate or the BeanBuilder. But I wasn't able to figure it out ..
I would appreciate if someone could help me..
Some information to this:
Grails 1.3.7,
Hibernate 1.3.7
Tomcat 1.3.7
Multi-tenant-core plugin 1.0.0
It would be really nice to register a customer with his own datasource on the fly without stopping the program and adding him in the grails.naming.entries and in the DatasourceTenantMap... I know that there is a domain class DataSourceTenantMap.groovy :
class DataSourceTenantMap {
String dataSource
Integer mappedTenantId
static constraints = {}
}
but I have to register more than just the mappedTenantId and the datasource. Therefore I tried to bind a BasicDataSource with JndiTemplate or the NamingManager. But it hadn't worked..
If more information are needed, please ask for them!
I'm posting this as an answer as I can't figure out how to do a comment. (meaning, I don't see an "Add comment" link, above).
I have had the same issue with Grails 2.0.3
See: Grails 2 multiple dynamic datasources in services
I am perhaps a little further ahead, because I am injecting the datasource bean - ie, I have exactly the same scenario - but it's not getting picked up by Grails.
The problem is universal and I was hoping somebody on the grails team with insight would answer:
Multitenant Application running as a service should allow for addition of another tenant at runtime. That means, if I want to tell the app that there's a brand new tenant database that it should use, I should be able to do that at runtime, instead of bouncing the app.
I'm trying to include Grails applications into a Liferay portlet. I tried the Grails Liferay Portlets Plugin but it did not work for me at all.
Does anybody know any other possibilities? Which do you think is the best and why?
We had our Grails project integrated with Liferay at one point but it was a mess. Inevitably we pulled it out of Liferay and we were able to use Grails properly again. In our instance the question became, why are we using Liferay and do we really need it?
Now if you have a requirement for Liferay you might try simply using Spring Portlet support and use parts of Grails you like but not fully integration. Spring Portlets with Groovy were much easier and cleaner to do. If you simply want Grails goodies for services etc. you can try deploying a Grails WAR on the same tomcat and expose services to your portlets through REST, Hessian, Burlap or some other easy service serialization mechanism in Spring/Grails. In this case you have a Liferay UI app that calls your Grails services.
Once again, try some options, then decide if you truly need (or have) to use Liferay. With advances in Javascript UI packages, I'm not sure 'portlet' spec apps are as appealing as they once were and the word 'portal' is something that sounds good to management but inevitably means little to what needs to be implemented.
I'm writing a Grails app which I'd like 3rd parties to augment at runtime. Ideally they would be able to add a JAR/WAR to the webapp directory which contains new domain, controller and service classes, new views, and other content.
Is there a simple way to do this within grails? Would it be simplest to create a startup script which copies the new classes etc. into the relevant directories and then updates grails.xml and web.xml?
You will be able to do this in version 2 of grails in which plugins will be also OSGI plugins http://jira.codehaus.org/browse/GRAILS/fixforversion/15421
It seems that the Grails plugins will actually fit quite well for this: http://www.grails.org/Understanding+Plugins
A plugin can do just about anything... One thing a plugin cannot do though is modify the web-app/WEB-INF/web.xml or web-app/WEB-INF/applicationContext.xml files. A plugin can participate in web.xml generation, but not modify the file or provide a replacement. A plugin can NEVER change the applicationContext.xml file, but can provide runtime bean definitions