cancel
Showing results for 
Search instead for 
Did you mean: 

how to add a resource bundle

tfaudot
Champ in-the-making
Champ in-the-making
Hello everyone,

I'm quite new to this kind of architecture and I was wondering how to do something so please excuse my question which I'm sure is something trivial  Smiley Indifferent

I would like to import a personalized resource bundle like the messages in alfresco and be able to use it in my jsp by using the #{my_bundle.my_string} as it is done with the messages #{msg.product_name} for example.

How can I do it?

thanks!
4 REPLIES 4

zaizi
Champ in-the-making
Champ in-the-making
Download the Alfresco SDK and go through the Custom Login example. It has a working example.

Basically;

1. Create webclient.properties in tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/webclient.properties
2. Load the bundle in your JSP;

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

3. Use it in your JSP;

<h:outputText value="#{customMsg.hello_world}"/>

tfaudot
Champ in-the-making
Champ in-the-making
Thanks I found this code one hour ago but I've struggling with it since… because my properties file will be placed in a "config" folder at the same level alfresco is deployed… (I can't change this path, it's a constraint…)

so basically:
/myAlfresco
    • config
  • mypropertyfiles.properties

  •   
  • css
  •   
  • images
  •   
  • jsp
  •   
  • WEB-INF
  •   
What is the proper way to access my file then? I can't find the good path 😞

steve
Champ in-the-making
Champ in-the-making
Hi,

New message bundles/files go into the alfresco extension location.
In tomcat, this would be tomcat\shared\classes\alfresco\messages (or anywhere on your classpath in the directory structure 'classes\alfresco\messages')

Steve

tfaudot
Champ in-the-making
Champ in-the-making
I know that these files should be under /classes but I don't have a choice, my files are under tomcat/webapps/myalfresco/config/…
So how do I get to them in the basename attribute of the f:loadBundle tag?
thanks!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.