示例#1
0
 /**
  * Gets the JSON string for new a field
  *
  * @param personBean
  * @param locale
  * @param bundleName
  * @return
  */
 @Override
 public String getDefaultSettingsJSON(TPersonBean personBean, Locale locale, String bundleName) {
   StringBuilder stringBuilder = new StringBuilder();
   JSONUtility.appendILabelBeanList(
       stringBuilder,
       FieldConfigJSON.JSON_FIELDS.OPTION_SETTINGS_LISTS,
       getLists(null, locale, null));
   return stringBuilder.append(getLocalizationJSON(locale, bundleName)).toString();
 }
示例#2
0
 /**
  * Gets the specific JSON string for a field
  *
  * @param configID ID of the direct or nearest fallback configuration
  * @param treeConfigIDTokens a decoded node
  * @param personBean
  * @param locale
  * @param bundleName
  * @return
  */
 @Override
 public String getSettingsJSON(
     Integer configID,
     TreeConfigIDTokens treeConfigIDTokens,
     TPersonBean personBean,
     Locale locale,
     String bundleName) {
   TOptionSettingsBean optionSettingsBean =
       OptionSettingsBL.loadByConfigAndParameter(configID, parameterCode);
   StringBuilder stringBuilder = new StringBuilder();
   if (optionSettingsBean != null) {
     JSONUtility.appendIntegerValue(
         stringBuilder,
         FieldConfigJSON.JSON_FIELDS.OPTION_SETTINGS_LIST_PREFIX
             + "[0]."
             + FieldConfigJSON.JSON_FIELDS.OPTION_SETTINGS_LIST,
         optionSettingsBean.getList());
   }
   JSONUtility.appendILabelBeanList(
       stringBuilder,
       FieldConfigJSON.JSON_FIELDS.OPTION_SETTINGS_LISTS,
       getLists(treeConfigIDTokens.getProjectID(), locale, configID));
   return stringBuilder.append(getLocalizationJSON(locale, bundleName)).toString();
 }