cancel
Showing results for 
Search instead for 
Did you mean: 

Extending webclient.properties I18N messages

simon
Champ in-the-making
Champ in-the-making
Hi Alf,

I'm building my own LoginBean here, well, extending the Alfresco LoginBean and tweaking some code that is, and today I added some messages to show to the end users:
Utils.addErrorMessage(Application.getMessage(fc, MSG_ERROR_WRONG_PATH));
I want to make this as flexible as possible, supporting I18N if needed but more importantly I don't want these messages overwritten with the next Alfresco update.

So, where should I put my messages? I added some lines to the webclient.properties but this is certainly not the right way to do this. Can I add some webclient.properties file to the extensions folder? Or could I add this file to my application jar archive (this would be the best place if you ask me)?

BTW, I'm using Alfresco 1.2 Enterprise and Tomcat.

Thanks!
5 REPLIES 5

simon
Champ in-the-making
Champ in-the-making
No comments on this?

gavinc
Champ in-the-making
Champ in-the-making
Hi Simon,

No, currently you have to add them to webclient.properties.

I'm literally working on the solution to this as we speak, in 1.3 you will have a webclient-custom.properties (or something similar) to add custom strings to.

simon
Champ in-the-making
Champ in-the-making
Thanks Gavin.

Good to know that you are making progress here. Would be nice if we could just add this new properties file to our packages (e.g. a JAR file) without changing the Alfresco configuration. Making plugins for Alfresco will be easier.

gavinc
Champ in-the-making
Champ in-the-making
OK, I have just checked in a change to SVN that will allow custom properties files to be used.

With the change you can place a webclient.properties in the alfresco.extension package (this can be in a JAR if you like) and it will be used for string lookups (if present). This will be used for any strings that are defined outside of JSP files i.e. in config files or in our JSF components.

Strings that are looked up on the JSP page will need to add some extra code to the JSP page.

On your custom JSP add the following line:


<f:loadBundle basename="alfresco.extension.webclient" var="custom"/>

This will then allow you to reference your custom properties file, for example:


<h:outputText value="#{custom.your_string_id}" />

You can do this with any resource bundle so you don't HAVE to use webclient.properties, you can use any name you like.

Also just to be clear, it's only the web client config XML files i.e. web-client-config-custom.xml and the JSPs that can not currently be placed in a JAR file.

simon
Champ in-the-making
Champ in-the-making