case RTF_ELEMENT_PAGE:
lastPage = (RTFPage) element;
break;
case RTF_ELEMENT_USERPROPERTY:
RTFUserProperty userProperty = (RTFUserProperty) element;
String userPropertyName = userProperty.getName();
if (userPropertyName != null
&& userPropertyName.startsWith("$")) {
RTFContextField rtfUserProperty = (RTFContextField) contextFieldsMap
.get(userPropertyName);
boolean userPropertyIsList = isList(rtfUserProperty);
if (userPropertyIsList) {
String userPropertyNameWithListInfo = rtfUserProperty
.getListInfo();
// User property is list
// Add item_ after $
// Manage \propname
String userPropertyContent = userProperty
.getRTFContentOfSimpleElement();
if (userPropertyName.startsWith("$"))
userPropertyName = userPropertyName.substring(1);
String newUserpropertyName = getObjectValueList(
userPropertyName, userPropertyNameWithListInfo,
true);
if (newUserpropertyName.startsWith("$"))
newUserpropertyName = newUserpropertyName
.substring(1);
userPropertyContent = userPropertyContent.replaceAll(
userPropertyName, newUserpropertyName);
// Add # foreach and send with #end
userPropertyContent = getForeach(userPropertyName,
userPropertyNameWithListInfo)
+ userPropertyContent + getMacroEndForEach();// "#end";
// Manage \staticval
String userPropertyValue = userProperty.getValue();
if (userPropertyValue.startsWith("$"))
userPropertyValue = userPropertyValue.substring(1);
String newUserPropertyValue = getObjectValueList(
userPropertyValue,
userPropertyNameWithListInfo, true);
if (newUserPropertyValue.startsWith("$"))
newUserPropertyValue = newUserPropertyValue
.substring(1);
userPropertyContent = userPropertyContent.replaceAll(
userPropertyValue, newUserPropertyValue);
userProperty.replaceElement(userPropertyContent);
}
}
String userPropertyContent = userProperty
.getRTFContentOfSimpleElement();
userProperty.replaceElement(userPropertyContent);
break;
/*
* case RTF_ELEMENT_ANNOTATION: // TODO : manage start/end loop and