<?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>Question Re: Retrieve Multilingual text for a Attribute in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300025#M3727726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pankaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting strings such as "?????" in the console has to do with the encoding you use for your application in eclipse (it should show ok in your browser - if you have the relevant fonts installed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enable eclipse to show character sets other then ASCII you need to :&lt;/P&gt;&lt;P&gt;1. go to "Run Configuration" for your app (press the dropdown menu next to the green "play" button to see it).&lt;/P&gt;&lt;P&gt;2. navigate to the "common" tab (the last one)&lt;/P&gt;&lt;P&gt;3. under "Encoding" choose "other" and in the drop down choose "UTF-8"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is a screen from my machine after I did it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/501734" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Jul 2014 07:21:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-07-20T07:21:43Z</dc:date>
    <item>
      <title>Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaq-p/10300019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please help me in retrieving the multilingual string for a attribute of Taxonomy table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 09:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaq-p/10300019</guid>
      <dc:creator>pankaj001</dc:creator>
      <dc:date>2014-05-08T09:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300020#M3727721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to retrieve the values in all the available languages(multilingual) for a attribute from Taxonomy table via Java API. Can anyone please provide me some helpful pointers. I am able to retrieve attribute value only in&amp;nbsp; English[US].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 09:47:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300020#M3727721</guid>
      <dc:creator>pankaj001</dc:creator>
      <dc:date>2014-06-04T09:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300021#M3727722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pankaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two possible ways to achieve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. When creating a user context use the region that you want to present the values in like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;EM&gt;new UserSessionContext("MDSName", "RepositoryName","Region", "UserName");&lt;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where "Region" is replaced by the wanted region(i.e. French [FR], English [US], etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use the method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;EM&gt;com.sap.mdm.extension.data.RecordEx.getAttributeDisplayValue(FieldId taxonomyFieldId, AttributeId attrId, int regionalLayer)&lt;/EM&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the needed regionLayer (&lt;EM&gt;CURRENT, INHERITED&lt;/EM&gt; or &lt;EM&gt;PRIMARY_INHERITED&lt;/EM&gt; – notice that &lt;EM&gt;CURRENT&lt;/EM&gt; will return null if no value exists in the chosen language).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method returns an array of strings (in case it's a multi value attribute) that are the attribute's value(s) in the language you used when creating the session context.&lt;/P&gt;&lt;P&gt;Check the method's Javadoc for more info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Log in with any language and use the &lt;EM&gt;MdmValueFormatter&lt;/EM&gt; class to get to the required value like in this code snippet:&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&lt;EM&gt;RetrieveLimitedRecordsExCommand retCom= &lt;STRONG&gt;new&lt;/STRONG&gt;RetrieveLimitedRecordsExCommand(context);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;retCom.setResultDefinition(resultDefinition);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;retCom.setSearch(search);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;retCom.execute();&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//In this instance I retrieved only one (known) record here&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;RecordEx record = (RecordEx) retCom.getRecords().getRecord(0); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;//The (Categories table)record that is pointed to by the lookup field value&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;EM&gt;Record[] lookupRecord = record.findLookupRecords(categoryFieldId);&amp;nbsp; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;RetrieveAttributeLinksCommand attrLinksCom = new RetrieveAttributeLinksCommand(context);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;attrLinksCom.setTaxonomyTableId(_repositorySchema.getTableId("CATEGORIES"));&lt;/P&gt;
&lt;P&gt;attrLinksCom.setRecordId(lookupRecord[0].getId());&lt;/P&gt;
&lt;P&gt;attrLinksCom.execute();&lt;/P&gt;
&lt;P&gt;AttributeProperties[] attributeProps = attrLinksCom.getAttributes();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/* This creates the French [FR] region properties, for runtime usage you can either 1. use UserSessionContext.getRegion() if you logged in with&lt;/P&gt;
&lt;P&gt;* the needed language,&lt;/P&gt;
&lt;P&gt;* 2. Prepare an enum of the locales used in your repository (easiest and best way to preserve performance)&lt;/P&gt;
&lt;P&gt;* 3. Use&amp;nbsp; GetRepositoryRegionListCommand to get all of the regions in your repository and use the one you need according to the region code.&lt;/P&gt;
&lt;P&gt;*/&lt;/P&gt;
&lt;P&gt;RegionProperties frRegion = new RegionProperties("French [FR]", Locale.FRENCH, "fre___");&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;for(int atrId=0; atrId&amp;lt;attributeProps.length; atrId++){&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Gets the value from the current attribute according to index atrId&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MdmValue attrVal = record.getAttributeValue(categoryFieldId, attributeProps[atrId].getId());&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Uses MdmValueFormatter helper class to format the value so that it appears in the language defined by the region supplied&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String[] formattedValues = MdmValueFormatter.formatAttributeValue(attributeProps[atrId], attrVal, frRegion,&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: helvetica, arial; font-size: 11.818181991577148px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MetadataManager.getInstance().getRepositoryDimensions(context));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 12pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now &lt;EM&gt;String[] formattedValues&lt;/EM&gt; will contain all of the values(if multi valued, only one if not) of this attribute in the language specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 08:34:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300021#M3727722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-16T08:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300022#M3727723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your response &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Do we need to use first 3 characters for all the region code? for eg. "ger___" for German .... "chi___" for Chinese?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 06:47:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300022#M3727723</guid>
      <dc:creator>pankaj001</dc:creator>
      <dc:date>2014-07-18T06:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300023#M3727724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we format the text for Attribute name. Below is the code to retrieve the Attribute Name.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;attributeProps[a].getName().get("chi___");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where &lt;EM&gt;attributeProps&lt;/EM&gt; is the list of all the attribute. I am getting "????" as the output. How can i format these text in Chinese?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 06:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300023#M3727724</guid>
      <dc:creator>pankaj001</dc:creator>
      <dc:date>2014-07-18T06:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300024#M3727725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pankaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you need to use the language codes as you described (i.e. "ger___" - notice there are 3 underscores "_").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand you can use commands such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetRepositoryRegionListCommand and GetRepositoryInheritedRegionListCommand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get the regions you need from the repository in runtime.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jul 2014 07:08:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300024#M3727725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-20T07:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300025#M3727726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pankaj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting strings such as "?????" in the console has to do with the encoding you use for your application in eclipse (it should show ok in your browser - if you have the relevant fonts installed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enable eclipse to show character sets other then ASCII you need to :&lt;/P&gt;&lt;P&gt;1. go to "Run Configuration" for your app (press the dropdown menu next to the green "play" button to see it).&lt;/P&gt;&lt;P&gt;2. navigate to the "common" tab (the last one)&lt;/P&gt;&lt;P&gt;3. under "Encoding" choose "other" and in the drop down choose "UTF-8"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is a screen from my machine after I did it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/501734" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Dan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jul 2014 07:21:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300025#M3727726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-20T07:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve Multilingual text for a Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300026#M3727727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot find "Encoding" under Common Tab of Run Configuration. I am using NWDS 7.01.05.&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 08:16:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/retrieve-multilingual-text-for-a-attribute/qaa-p/10300026#M3727727</guid>
      <dc:creator>pankaj001</dc:creator>
      <dc:date>2014-07-21T08:16:28Z</dc:date>
    </item>
  </channel>
</rss>

