【问题标题】:IBM Filenet P8 : How can i get the localized display names of choice list itemsIBM Filenet P8:如何获取选择列表项的本地化显示名称
【发布时间】:2014-10-06 22:29:55
【问题描述】:

我正在使用以下代码 sn-p 来检索特定选项列表的选项项

           Map<Serializable, Serializable> items = new HashMap<Serializable, Serializable>();                   
           Iterator<Choice> choiceIterator = choiceList.get_ChoiceValues().iterator();
           while(choiceIterator.hasNext()){
               Choice choice = choiceIterator.next();
                if(choice.get_ChoiceType() == ChoiceType.INTEGER){
                    itemKey = choice.get_ChoiceIntegerValue();
                }else{
                    itemKey = choice.get_ChoiceStringValue();
                }
                items.put(itemKey, ((LocalizedStringImpl)choice.get_DisplayNames().get(0)).get_LocalizedText());
            }

但是get_LocalizedText() 方法只是获取区域设置为en_us 的值。那么如果我想获取其他语言环境,例如ar_eg,该怎么办?

提前致谢。

【问题讨论】:

    标签: filenet-p8 filenet filenet-content-engine


    【解决方案1】:

    您需要在 LocalizedString 对象上调用 get_LocaleName() 方法并确定这是否是您正在寻找的正确语言环境。这是示例代码:

                LocalizedStringList lsList = choice.get_DisplayNames();
                Iterator<LocalizedString> dit= lsList.iterator();
                boolean lnFound = false;
                while(dit.hasNext())
                {
                    LocalizedString ls = dit.next();
                    String ln = ls.get_LocaleName();
                    String lt = ls.get_LocalizedText();
                    if(_locale.equalsIgnoreCase(ln))
                    {
                        ls.set_LocalizedText(_value);
                        lnFound = true;
                    }               
                }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-12
      相关资源
      最近更新 更多