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?
Jamil
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:
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?
Jamil
You can very well create localized properties. e.g.
your-module-messages_en.properties
your-module-messages_es.properties
your-module-messages_fr.properties
your-module-messages_de.properties
your-module-messages_it.properties
your-module-messages_ja.properties
...... etc.
All you need to do is to keep the localized values for the keys you are using.
E.g. for spanish version of properties file: "your-module-messages_es.properties"
Key will be same but value would be in spanish.
invitation.invitesender.email.subject= Su proyecto {0}: ha sido invitado a unirse al sitio {1}. Utilice el enlace.
Same way you can use the same key for other versions of properties files.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.