cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved] AMP with ResourceBundle example?

lyamamot
Champ in-the-making
Champ in-the-making
I've been trying to build an AMP module for Alfresco Labs 3b that includes a resource bundle for my model properties that show up in the web client, but it just doesn't seem to work. Does anybody have an example of an AMP where this works? Here are the relevant bits of code:

config/alfresco/module/com_Xxx/module-context.xml:

<bean id="my_dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
    <property name="models">
        <list><value>alfresco/module/com_Xxx/models/myModel.xml</value></list>
    </property>
    <property name="labels">
        <list><value>alfresco.module.com_Xxx.models.myModel</value></list>
    </property>   
</bean>

My model file (myModel.xml) is in config/alresco/module/com_Xxx/models, as is my resource bundle, myModel.properties. I have a web-client-config-custom.xml with entries similar to:

<alfresco-config>
    <!– Add type properties to the property sheet. –>
    <config evaluator="node-type" condition="xx:myType">
        <property-sheet>
            <show-property name="xx:myProp" display-label-id="xx_myType.property.xx_myProp.propName" />
        </property-sheet>
    </config>
</alfresco-config>

The properties show up when I view the details of a particular piece of content, but my custom keys are all like $$xx_myType.property.xx_myProp.propName$$ and I see errors in the Tomcat log about failing to find the I18N message string key.
1 REPLY 1

lyamamot
Champ in-the-making
Champ in-the-making
Hmm, I answered my own question. It turns out from reading AWC-1149 that one should not use the "labels" property in "dictionaryBootstrap" but instead, specify the required resource bundles with ResourceBundleBootstrap:


<bean id="bootstrapExtraBundlesBean" class="org.alfresco.web.app.ResourceBundleBootstrap">
    <property name="resourceBundles">
        <list>
            <value>alfresco.module.com_Xxx.models.myModel</value>
        </list>
    </property>
</bean>