<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Java Needs Message Resources from Data Dictionary in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257041#M210171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still unable to locate ANY resources in the docs or wiki related to the MessageService and *how* I might use it to retrieve messages from a bundle in the data dictionary. It doesn't appear to resolve messages from alfresco-global.properties and I'm looking for a list of the message bundles it would search through….or how/where these should be specified. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In digging into this a bit deeper, I'm seeing that DictionaryRepositoryBootstrap's initMessages() method has NO side-effects. It creates a new List&amp;lt;String&amp;gt; 'resourceBundleBaseNames' but doesn't actually return it or set them anywhere. I can see my bundles being discovered, but then…nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume this method should be calling a messageService.registerResourceBundle here, though when I attempted this by overriding the class, it still didn't work. Is anyone doing this who can give me a pointer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2012 20:16:53 GMT</pubDate>
    <dc:creator>pjaromin</dc:creator>
    <dc:date>2012-10-18T20:16:53Z</dc:date>
    <item>
      <title>Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257038#M210168</link>
      <description>I've written a custom Java-based Aspect that sends an email. I'm able to retrieve the FreeMarker template from the Data Dictionary just fine, but would also like to use message resources for the "Subject" of the email.Because this should be customizable for each tenant in a multi-tenant environment,</description>
      <pubDate>Wed, 05 Sep 2012 13:11:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257038#M210168</guid>
      <dc:creator>pjaromin</dc:creator>
      <dc:date>2012-09-05T13:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257039#M210169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can use the &lt;/SPAN&gt;&lt;A href="http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/i18n/MessageService.html" rel="nofollow noopener noreferrer"&gt;MessageService&lt;/A&gt;&lt;SPAN&gt; to retrieve localised strings from tenant aware message bundles in the data dictionary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 10:19:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257039#M210169</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2012-09-06T10:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257040#M210170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had tried using MessageService and got 'null' back with every trial. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've used the message resources console to try and load new resources (which reports that they loaded), I've tried various names of bundle files, etc. Whenever I debugged the process I can see only empty caches and bundles in the MessageService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've searched the code for examples of it to copy from but to no avail and confess I haven't worked out how MessageService is supposed to be retrieving the messages from the Data Dictionary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have a working example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 10:33:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257040#M210170</guid>
      <dc:creator>pjaromin</dc:creator>
      <dc:date>2012-09-06T10:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257041#M210171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm still unable to locate ANY resources in the docs or wiki related to the MessageService and *how* I might use it to retrieve messages from a bundle in the data dictionary. It doesn't appear to resolve messages from alfresco-global.properties and I'm looking for a list of the message bundles it would search through….or how/where these should be specified. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In digging into this a bit deeper, I'm seeing that DictionaryRepositoryBootstrap's initMessages() method has NO side-effects. It creates a new List&amp;lt;String&amp;gt; 'resourceBundleBaseNames' but doesn't actually return it or set them anywhere. I can see my bundles being discovered, but then…nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume this method should be calling a messageService.registerResourceBundle here, though when I attempted this by overriding the class, it still didn't work. Is anyone doing this who can give me a pointer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 20:16:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257041#M210171</guid>
      <dc:creator>pjaromin</dc:creator>
      <dc:date>2012-10-18T20:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257042#M210172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure about the mt part of your posting :mrgreen: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I usually use the I18util class to read message bundles.&amp;nbsp;&amp;nbsp; There will be lots of examples in the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also alfresco-global.properties is not a message bundle.&amp;nbsp; I suggest when experimenting you use an existing message first.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 08:34:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257042#M210172</guid>
      <dc:creator>mrogers</dc:creator>
      <dc:date>2012-10-19T08:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Java Needs Message Resources from Data Dictionary</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257043#M210173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I18NUtil doesn't look like it retrieves messages from the Data Dictionary. The message service *does* and then falls back to the I18NUtil if it can't find them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However message bundles dropped into the Data Dictionary and loaded manually with the console (&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp&lt;/A&gt;&lt;SPAN&gt;) aren't re-registered and available after a server restart until I again reload them with the console. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The DictionaryRepositoryBootstrap class appears to be responsible for this, and in fact does locate any bundles placed in /Company Home/Data Dictionary/Messages. But it doesn't actually do anything with them except adding them to a local list that's never returned from the initMessages() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe this is a bug, but there's also a chance that I've left out some key step or am misunderstanding how this is supposed to work. By adding the following line to org.alfresco.repo.dictionary.DictionaryRepositoryBoostrap (line 62) of the initMessages method it works …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; if (!resourceBundleBaseNames.contains(bundleBaseName))&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resourceBundleBaseNames.add(bundleBaseName);&lt;BR /&gt;+&amp;nbsp;&amp;nbsp; messageService.registerResourceBundle(storeRef + repositoryLocation.getPath() + "/cm:" + bundleBaseName);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something else that needs to happen for these dynamic loaded message resources to be re-loaded upon server restart?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Patrick&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 16:21:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-java-needs-message-resources-from-data-dictionary/m-p/257043#M210173</guid>
      <dc:creator>pjaromin</dc:creator>
      <dc:date>2012-10-19T16:21:20Z</dc:date>
    </item>
  </channel>
</rss>

