示例#1
0
 /**
  * Gets the string value to be stored by lucene
  *
  * @param value the value of the field
  * @param workItemBean the lucene value might depend on other fields of the workItem
  * @return
  */
 @Override
 public String getLuceneValue(Object value, TWorkItemBean workItemBean) {
   try {
     return Html2Text.getNewInstance().convert((String) value);
   } catch (Exception e) {
     LOGGER.info("Converting to plain text failed with " + e);
     LOGGER.debug("The original text is: " + (value == null ? "null" : value.toString()));
     return (String) value;
   }
 }
示例#2
0
 /**
  * Get the ISO show value for locale independent exporting to xml typically same as show value,
  * date and number values are formatted by iso format
  *
  * @param fieldID
  * @param parameterCode
  * @param value
  * @param workItemID
  * @param localLookupContainer
  * @param locale
  * @return
  */
 @Override
 public String getShowISOValue(
     Integer fieldID,
     Integer parameterCode,
     Object value,
     Integer workItemID,
     LocalLookupContainer localLookupContainer,
     Locale locale) {
   try {
     TagReplacer replacer = new TagReplacer(Locale.getDefault());
     replacer.setContextPath(Constants.BaseURL);
     return Html2Text.getCustomInstance().convert(replacer.formatDescription((String) value));
   } catch (Exception e) {
     LOGGER.info("Converting to ISO text failed with " + e);
     LOGGER.debug("The original text is: " + (value == null ? "null" : value.toString()));
     return (String) value;
   }
 }