cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get localized label for an aspect

tico
Champ in-the-making
Champ in-the-making
Hello you all,

I ma not able to get the localized label for an aspect.

I wrote the resource file my-messages.properties:

my.aspect.title=Ma chaine de charactères

my-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

<!– Registering contacts model (aspects and types) –>
   <bean id="my.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
     <property name="models">
         <list>
             <value>alfresco/extension/myModel.xml</value>
         </list>
     </property>
   </bean>

   <bean id="ldapResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
           <value>alfresco.messages.my-messages</value>
        </list>
      </property>
   </bean>
</beans>

myModel.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!– Definition du model contacts –>
<model name="my:mymodel"
       xmlns="http://www.alfresco.org/model/dictionary/1.0">
      
   <description>my model</description>
   <author>Eric GRAMMATICO</author>
   <version>1.O</version>


     <imports>
         <!– Import Alfresco Dictionary Definitions –>
         <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
         <!– Import Alfresco Content Domain Model Definitions –>
         <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
      </imports>


   <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="http://www.csill.fr/model/ldap/1.0" prefix="my"/>
   </namespaces>

   <!– Type and Aspect definitions go here –>
   
<aspects>
   <aspect name="my:text">
         <title>Text String</title>
         <properties>
            <property name="my:textString">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
</aspects>

</model>



web-client-config-custom.xml:

<alfresco-config>
  
<!– Liste des properties affichées par aspect –>
<config evaluator="aspect-name" condition="my:text">
   <property-sheet>
      <show-property
         name="my:textString"
         display-label-id="my.aspect.title"
         />
   </property-sheet>
</config>

</alfresco-config>

The web client displays ''$$my.aspect.title$$:' as label for the aspect, and the following error is in my catalina.out:
18:01:01,052 WARN  [web.app.ResourceBundleWrapper] Failed to find I18N message string key: my.aspect.title


Any advice is welcome,

Thanks and regards.
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
By adding

display-label-id="my.aspect.title"

to your web-client-confg-custom.xml file you are telling the webclient to override the display label defined in the model i.e. in your my-messages.properties file. Try removing the display-label-id attribute from the client config.

Just so you know why you get the error, as the attribute is present the web client is looking for your label in a webclient.properties in alfresco.extension, it's not there hence the error you quote.

tico
Champ in-the-making
Champ in-the-making
Thanks Gavin, that worked.

What if I am developping an alfresco Module, I believe it will conflict with an other webclient.properties from an other module. How could I manage this issue ?

thanks and regards.

gavinc
Champ in-the-making
Champ in-the-making
This is indeed an issue/limitation, this has already been raised as an issue in JIRA: http://issues.alfresco.com/browse/AWC-1149

tico
Champ in-the-making
Champ in-the-making
Thanks Gavin, I have voted for it…