* @see se.ucr.element.StandardVariable#createJournalHTML(se.ucr.element.ElementParameter)
*/
@Override
public String createJournalHTML(ElementParameter elemParam) {
StringBuffer out = new StringBuffer();
FetchData fetch = elemParam.getFetch();
// if this variable exists in fetch and it is not empty print the value
if (fetch.containsValue(this.getName())
&& !"".equals(fetch.getValueAsString(this.getName()))) {
// print value with stylesheet
out.append("<span");
if (getStylesheet() != null && getStylesheet().length() != 0) {
out.append(" class=\"").append(getStylesheet()).append("\"");
}
out.append(">");
String value;
try {
value = fetch.getValueAsString(this.getName());
// change to br for linebreaks
value = value.replaceAll("%0D%0A", "<br/>");
// decode the rest
value = URLDecoder.decode(value, "iso-8859-1");
} catch (UnsupportedEncodingException uee) {
Logger.getLogger(TextAreaVariable.class).log(Level.WARN,
"Unable to decode value", uee);
value = fetch.getValueAsString(this.getName()).replaceAll(
"%0D%0A", "<br/>");
}
out.append(value);
out.append("</span>");