예제 #1
0
 /**
  * Creates the file upload JSON string for a template
  *
  * @param success
  * @param existingTemplates
  * @return
  */
 public static String createFileSelectJSON(
     boolean success, List<LabelValueBean> existingTemplates, String selectedTemplate) {
   StringBuilder sb = new StringBuilder();
   sb.append("{");
   JSONUtility.appendBooleanValue(sb, JSONUtility.JSON_FIELDS.SUCCESS, success);
   sb.append(JSONUtility.JSON_FIELDS.DATA).append(":{");
   JSONUtility.appendStringValue(sb, "docxTemplateList", selectedTemplate);
   JSONUtility.appendLabelValueBeanList(sb, "existingTemplates", existingTemplates);
   sb.append("}");
   sb.append("}");
   return sb.toString();
 }