Changeset 24293

Show
Ignore:
Timestamp:
20.07.2011 14:44:25 (9 years ago)
Author:
sjm84
Message:

GLI will now decode several HTML entities when before they are displayed in the Enrich panel (this is a reversal of what the EmbeddedMetadataPlugin? does to protect these characters when used in format statements).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataValueTableModel.java

    r23433 r24293  
    153153    } 
    154154 
    155     if (col == 2) { 
    156         return metadata_value_table_entry.getFullValue(); 
     155    if (col == 2) 
     156    { 
     157        return decodeHTMLEntities(metadata_value_table_entry.getFullValue()); 
    157158    } 
    158159 
    159160    return null; 
    160     } 
    161  
     161    } 
     162     
     163    public String decodeHTMLEntities(String text) 
     164    { 
     165        text = text.replace("(", "("); 
     166        text = text.replace(")", ")"); 
     167        text = text.replace(",", ","); 
     168        text = text.replace("&amp;#60;", "<"); 
     169        text = text.replace("&amp;#62;", ">"); 
     170        text = text.replace("&amp;#91;", "["); 
     171        text = text.replace("&amp;#93;", "]"); 
     172        text = text.replace("&amp;#123;", "{"); 
     173        text = text.replace("&amp;#125;", "}"); 
     174        return text; 
     175    } 
    162176 
    163177    public boolean isCellEditable(int row, int col)