if (!force) {
// file must be updated, test if file exist
File inFile = new File(inFileXmlFields);
if (inFile.exists()) {
// File exist, use digester to get RTFContextFields
RTFContextFields oldFields = DigesterRTFContextFields
.getRTFContextFields(inFile);
// Get the description of the fields
newFields.setDescription(oldFields.getDescription());
// Get the map of the source XML fields
Map oldContextFieldsMap = oldFields.getMergeFieldsMap();
// Loop for New ContextFields
for (Iterator iter = newFields.getMergeFields().iterator(); iter.hasNext();) {
RTFContextField newField = (RTFContextField) iter.next();
// Test if oldContextFieldsMap contains this field
RTFContextField oldField = (RTFContextField)oldContextFieldsMap.get(newField.getName());
if (oldField != null) {
// Update description
newField.setDescription(oldField.getDescription());
}
}
// Get the map of the source XML fields
Map oldContextBookmarksMap = oldFields.getBookmarksMap();
// Loop for New ContextFields
for (Iterator iter = newFields.getBookmarks().iterator(); iter.hasNext();) {
RTFContextBookmark newBookmark = (RTFContextBookmark) iter.next();
// Test if oldContextFieldsMap contains this bookmark
RTFContextBookmark oldBookmark = (RTFContextBookmark)oldContextBookmarksMap.get(newBookmark.getType());