cancel
Showing results for 
Search instead for 
Did you mean: 

Set the default value for language attribute in hmc

Former Member
0 Kudos

We need to set the default value for language attribute for customized type in hmc.

    <deployment table="CustomKwrdRedir" typecode="10001" />
    <attributes>
           <attribute qualifier="name" type="java.lang.String">
                  <description>Name</description>
                  <persistence type="property" />
           </attribute>

           <attribute qualifier="page" type="SolrAbstractKeywordRedirect">
                  <description>Stores the Redirect page</description>
                  <persistence type="property" />
           </attribute>

           <attribute qualifier="keywords" type="solrFacetSearchKeywordRedirectList">
                  <description>Stores the list of keywords having the same Redirect</description>
                  <persistence type="property" />
           </attribute>
    <attribute type="Language" qualifier="sessionLanguage">
                  <modifiers read="true" write="true" optional="true" search="true" />
                  <!-- <defaultvalue>de.hybris.platform.jalo.c2l.C2LManager.getInstance().getLanguageByIsoCode("English")</defaultvalue> -->
                               <persistence type="property" />
                               </attribute>
    </attributes>
    </itemtype>

The above declaration is not working. We know this can be set using the initdefaultinterceptor. But is there any better approach to do it.

Appreciate the help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dhakshayani ,

The way you has selected to set the default language seems correct. please make sure to put the correct IsoCode (en or en_US) as listed down in the code below.

  <attribute type="Language" qualifier="sessionLanguage">
                       <modifiers read="true" write="true" optional="true" search="true" />
                        <defaultvalue>de.hybris.platform.jalo.c2l.C2LManager.getInstance().getLanguageByIsoCode("en")</defaultvalue>
                                    <persistence type="property" />
                                    </attribute>

Former Member
0 Kudos

How to refer custom models created in place of 'de.hybris.platform.jalo.c2l.C2LManager.getInstance().getLanguageByIsoCode("en")'. Is that possible?

Answers (0)