As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hello,
Is it possible to override the resource file "invitation-service.properties" from my plugin (amp)?
It is used when a user is invited to a library and I want to do changes in the body of the message and support more languages
Thanks
Jamil
Can you just change the file and update the information appropriately?
# InviteSender messages invitation.invitesender.email.subject=Alfresco {0}: You have been invited to join the {1} site invitation.invitesender.email.role.SiteManager=Site Manager invitation.invitesender.email.role.SiteCollaborator=Site Collaborator invitation.invitesender.email.role.SiteContributor=Site Contributor invitation.invitesender.email.role.SiteConsumer=Site Consumer
The file is embeded inside the alfresco-repository-6.1.jar. How I can change it and preserve the auto update of ACS?
I tried to add the properties to my amp and define the new path inside the boostrap-context.xml but nothing changed and ACS keeps using the file from the repository jar
<property name="labels"> <list> <!-- Bootstrap Resource Bundles for the content model types, aspects, properties etc --> <value>alfresco/module/${project.artifactId}/messages/invitation-service.properties</value> </list> </property>
any idea?
First of all, I've always seen the resource labels list without the .properties :
<property name="labels"> <list> <!-- Bootstrap Resource Bundles for the content model types, aspects, properties etc --> <value>alfresco/module/${project.artifactId}/messages/invitation-service</value> </list> </property>
But looking at alfresco-repository, there's a file invitation-service-context.xml:
https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/invitation-service-context.xml
Here, there's a bean definition to take the messages from a path:
<bean id="invitationResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent"> <property name="resourceBundles"> <list> <value>alfresco.messages.invitation-service</value> </list> </property> </bean>
I think you could override this bean in your bootstrap-context.xml file, and point the location of this invitation-service.properties file to your custom location.
Hope it helps.
As mentioned by jljwoznica
You should not worry about overriding the file at all. You can simply override the keys/values in your custom property file in your custom module. Using the same key would simply replace the ootb value for the key with the value you have conigured.
For example:
If you want to change the OOTB property from invitation-service.properties:
invitation.invitesender.email.subject=Alfresco {0}: You have been invited to join the {1} site
you can simply override the property in your property file which is in your custom amp. for example if you have "your-module-messages.properties" file in your custom module. you can add the above given key in your custom file.
invitation.invitesender.email.subject= Your Project {0}: You have been invited to join the {1} site, Please use the link.
And your custom property file would be configured like:
<bean id="mycustom.module.resources" class="org.alfresco.i18n.ResourceBundleBootstrapComponent"> <property name="resourceBundles"> <list> <value>alfresco/module/${project.artifactId}/messages/your-module-messages</value> </list> </property> </bean>
It works. Thank you
One more question please
When the other _xx properties version will be used by ACS? I have always the english default version used
Changing the language on the client Share is working well but on the server (ACS) how it works? (email templates, properties etc..)
Am I missing something?