<?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: JAVA API - Get node description in different locale in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104998#M29737</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;if I try to cast the property&lt;/P&gt;&lt;P&gt;MLText versionFolderDescriptionML =&lt;BR /&gt;(MLText) nodeService.getProperty(mainDocumentNodeRef, ContentModel.PROP_DESCRIPTION);&lt;/P&gt;&lt;P&gt;we receve&amp;nbsp;&lt;/P&gt;&lt;P&gt;"java.lang.ClassCastException: java.lang.String cannot be cast to org.alfresco.service.cmr.repository.MLText"&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 17:55:15 GMT</pubDate>
    <dc:creator>nenadteo</dc:creator>
    <dc:date>2020-03-26T17:55:15Z</dc:date>
    <item>
      <title>JAVA API - Get node description in different locale</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104997#M29736</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;in Alfresco Community v5.1.e we are executing the query in the custom Java based web script and then we take the metadata from the documents returned.&lt;/P&gt;&lt;P&gt;Users using different language settings in Browser which affects values for cm:description property.&lt;/P&gt;&lt;P&gt;Even if we specify in Locale in SearchParameters.java&lt;/P&gt;&lt;PRE&gt;SearchParameters sp = new SearchParameters();
sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
sp.addLocale(Locale.GERMAN);&lt;BR /&gt;sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);&lt;BR /&gt;String query = "TYPE: "xyz:publishedDocument"&lt;BR /&gt;sp.setQuery(query);&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;we do not receive the German version of cm:description property of document.&lt;/P&gt;&lt;P&gt;If we call this GET webscript from Browser always Browser's language settings will be taken, so if English is set in Browser, we won't receive the cm:description values which were set in German, but if German is set in Browser we receive it. So somehow the searchService ignores explicite Locale settings in Java API and always uses Browsers settings.&lt;/P&gt;&lt;P&gt;Do you know where is the problem and how to force searchService to use Locale settings in SearchParameters?&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:22:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104997#M29736</guid>
      <dc:creator>nenadteo</dc:creator>
      <dc:date>2020-03-26T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: JAVA API - Get node description in different locale</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104998#M29737</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;if I try to cast the property&lt;/P&gt;&lt;P&gt;MLText versionFolderDescriptionML =&lt;BR /&gt;(MLText) nodeService.getProperty(mainDocumentNodeRef, ContentModel.PROP_DESCRIPTION);&lt;/P&gt;&lt;P&gt;we receve&amp;nbsp;&lt;/P&gt;&lt;P&gt;"java.lang.ClassCastException: java.lang.String cannot be cast to org.alfresco.service.cmr.repository.MLText"&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 17:55:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104998#M29737</guid>
      <dc:creator>nenadteo</dc:creator>
      <dc:date>2020-03-26T17:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: JAVA API - Get node description in different locale</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104999#M29738</link>
      <description>&lt;P&gt;I found solution on this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/a/31110305" target="_blank" rel="nofollow noopener noreferrer"&gt;https://stackoverflow.com/a/31110305&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 09:11:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/104999#M29738</guid>
      <dc:creator>nenadteo</dc:creator>
      <dc:date>2020-03-27T09:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: JAVA API - Get node description in different locale</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/105000#M29739</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/80315"&gt;@nenadteo&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Great that you found a solution &amp;amp; thanks for posting it - will help other users.&lt;/P&gt;
&lt;P&gt;Thanks again,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 09:44:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/java-api-get-node-description-in-different-locale/m-p/105000#M29739</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-03-27T09:44:50Z</dc:date>
    </item>
  </channel>
</rss>

