示例#1
0
 @Override
 public Map<String, String> convertMapFromPageConfig(
     Map<String, String> properties,
     TPersonBean user,
     Locale locale,
     Integer entityId,
     Integer entityType,
     List<LabelValueBean> errors) {
   Map<String, String> map =
       super.convertMapFromPageConfig(properties, user, locale, entityId, entityType, errors);
   String tql = properties.get("tql");
   if (tql == null || tql.length() == 0) {
     String localizedErr =
         LocalizeUtil.getParametrizedString(
             "common.err.required",
             new Object[] {BasePluginDashboardBL.getText("myTqlView.tql", locale)},
             locale);
     errors.add(new LabelValueBean(localizedErr, "params.tql"));
   } else {
     List<ErrorData> criteriaErrors = new ArrayList<ErrorData>();
     TqlBL.luceneQuery(tql, false, locale, null, criteriaErrors);
     if (!criteriaErrors.isEmpty()) {
       StringBuilder sb = new StringBuilder();
       for (int i = 0; i < criteriaErrors.size(); i++) {
         sb.append(ErrorHandlerJSONAdapter.createMessage(criteriaErrors.get(i), locale) + "</BR>");
       }
       errors.add(new LabelValueBean(sb.toString(), "params.tql"));
     }
   }
   return map;
 }