Ignore:
Timestamp:
2004-11-29T17:08:52+13:00 (20 years ago)
Author:
mdewsnip
Message:

Now remove invalid characters from metadata values when they are entered. This prevents the problem of writing out XML files with invalid characters, which are barfed on when reading them back in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r8635 r8695  
    6464import org.greenstone.gatherer.util.TreeSynchronizer;
    6565import org.greenstone.gatherer.util.Utility;
    66 
    67 
    68 /** Provides a view of controls for the editing of metadata. It makes use of several other important components such as a GTree, GTable and MetadataValueTree. While much of the gui content is left to these components, the EnrichPane is resposible for actioning metadata edit requests, listing for mouse clicks within its scope and other data functionality (such as providing a list of the selected files).
     66import org.greenstone.gatherer.util.XMLTools;
     67
     68
     69/** Provides a view of controls for the editing of metadata.
    6970 */
    7071public class EnrichPane
     
    10941095    public String getSelectedValue()
    10951096    {
    1096         return metadata_value_text_field.getText().replaceAll("\\\\", MetadataValueTreeNode.METADATA_VALUE_TREE_NODE_HIERARCHY_TOKEN);
     1097        String metadata_value_raw = metadata_value_text_field.getText();
     1098        String metadata_value = XMLTools.removeInvalidCharacters(metadata_value_raw);
     1099        return metadata_value.replaceAll("\\\\", MetadataValueTreeNode.METADATA_VALUE_TREE_NODE_HIERARCHY_TOKEN);
    10971100    }
    10981101
Note: See TracChangeset for help on using the changeset viewer.