Custom config for deploying plugins
Is there a way to have an external xml configuration file for plugins? I followed the guide here: http://doc.nuxeo.com/display/Studio/Deploy+your+plugin+manually and deployed my plugin just fine with the xml config inside the jar file, but this doesn't help me much if I need to change config parameters based on where I'm deploying. (I created a new authentication plugin that needs a config parameter pointing towards our login api, which might be different depending on the install).
If anyone is looking for this answer later I figured it out finally: thank you guys for your help!
Answer: The authentication plugin also used an authentication chain which needed to be extended in the jar file while the xml contribution for the authenticator could exist externally.
In the plugin jar at OSGI-INF/extensions/nameofmyauthenticator.xml
<?xml version="1.0"?> <component name="com.ikanow.infinit.e.nuxeo.auth.MyAuthenticator"> <extension target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService" point="chain"> <authenticationChain> <plugins> <plugin>MY_AUTH</plugin> <plugin>FORM_AUTH</plugin> </plugins> </authenticationChain> </extension> <extension target="org.nuxeo.ecm.platform.login.LoginPluginRegistry" point="plugin"> <LoginPlugin name="MyLoginPlugin" class="com.my.MyLoginPlugin"> <enabled>true</enabled> </LoginPlugin> </extension> </component>
Then externally place the contrib for the authenticator only in NUXEOINSTALL/nxserver/config/my-auth-config.xml (named XXX-config.xml as stated by Florent (thanks!))
<?xml version="1.0"?> <component name="com.ikanow.infinit.e.nuxeo.auth.MyAuthenticatorConfig"> <require>org.nuxeo.ecm.platform.ui.web.auth.defaultConfig</require> <extension target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService" point="authenticators"> <authenticationPlugin name="MY_AUTH" enabled="true" class="com.my.MyAuthenticator"> <loginModulePlugin>MyLoginPlugin</loginModulePlugin> <parameters> <parameter name="MyLoginURL">http://www.my.com/</parameter> <parameter name="MyAPIURL">http://www.my.com/api/</parameter> </parameters> </authenticationPlugin> </extension> </component>
I was trying to place all the extension point information (login plugin and authentication chain) outside in the /config folder. It would load my extension but not implement the authentication chain so I was still receiving some log messages about my authenticator initializing but it wasn't being used when going to nuxeo. By just putting the authenticator contribution out there, it started working properly.
Thanks for the help everyone, hopefully this helps someone in the future.
These pages might help you to find the information you need. They have been very helpful resources for me.
or if you are using the Fast Track version
as well as this page.
Hope that helps!
You can put your contribution files inside
nxserver/config with a name ending in