What is the proper way to install changes to .nxftl configuration templates?
I want to enable soft-deletes as described at Deleting Documents. I have been able to manually perform the edit to
default-repository-config.xml.nxftl and have confirmed that it works, but now I wish to store this configuration change in our configuration management system to ensure that our servers are automatically deployed with it.
As I see it there are at least two options:
- Overwrite the
common-base/nxserver/config/default-repository-config.xml.nxftlfile with an edited version of my file when the server configuration is deployed.
- Configure the repository in our site-specific custom templates.
The second option seems more correct to me, but is there a way to add that one configuration option to the repository configuration that already exists in
common-base from my own configuration template, or must I still copy the contents of that
default-repository-config.xml.nxftl file no matter where I load the repository configuration from?
Thanks for any insight.
I ended up doing a variation of Julien Carsique's first suggestion, basically embedding
sed '/<indexing>/i <softDelete enabled=\"true\" />' \ /var/lib/nuxeo/server/templates/common-base/nxserver/config/default-repository-config.xml.nxftl \ > /nuxeo/templates/local/conf/default-repository-config.xml.nxftl
in our deployment script.
As they say, crude but effective.
As said Damien, the first option should be banned. Based on the second option (no change on the original files, use of a custom configuration template), you can:
- Duplicate and customize
default-repository-config.xml.nxftl. You will use the configuration templates system to overwrite the default contribution provided by Nuxeo. The server will only read your file. Keeping it in sync can be done by applying a diff patch to the copy of the original file for every release.
- Write your own contribution, not necessarily duplicating the whole original one: depending on your needed changes to
default-repository-config.xml.nxftl, you may be able to write a custom component in a
custom-repository-config.xml.nxftlusing the SQLRepositoryService's capabilities of merge and update.
About the soft-delete case, I didn't check if it was possible to contribute that option in a standalone XML component, in addition to the default configuration… that would be easier. Else, when a full overwrite of the default contribution is required, only for a few fields, it's worth to suggest an improvement to Nuxeo with a parameterized option easing a service customization.
The second option is by far the best. Il you need to add things to the default-reposiroty-config.xml.nxftl file, the you have to override it. If you just need to change some configuration values, then you can do it in you nuxeo.conf file or in the nuxeo.default file of your site-specific custom template.
default-repository-config.xml.nxftlchanges in a later Nuxeo release in ways that are not relevant to me?