Ignore:
Timestamp:
2005-08-24T15:14:01+12:00 (19 years ago)
Author:
kjdon
Message:

fixes to make the config file save only if it has changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java

    r10345 r10556  
    2727package org.greenstone.gatherer.cdm;
    2828
     29import org.greenstone.gatherer.Gatherer;
    2930import org.greenstone.gatherer.Configuration;
    3031import org.greenstone.gatherer.util.Codec;
     
    161162     */
    162163    public void setValue(String raw_value) {
     164    // we need to check if the value has changed
     165    String current_value = XMLTools.getValue(element);
     166    String new_value = Codec.transform(raw_value, Codec.TEXT_TO_DOM);
     167    if (!current_value.equals(new_value)) {
    163168    // Only raw html text can be given to setValue so we need to encode it
    164     XMLTools.setValue(element, Codec.transform(raw_value, Codec.TEXT_TO_DOM));
    165     text = null; // Reset text
    166     // And determine if this makes the metadata assigned
    167     setAssigned(raw_value != null && raw_value.length() > 0);
     169        XMLTools.setValue(element, new_value);
     170        text = null; // Reset text
     171        // And determine if this makes the metadata assigned
     172        setAssigned(raw_value != null && raw_value.length() > 0);
     173        Gatherer.c_man.configurationChanged();
     174    }
    168175    }
    169176
Note: See TracChangeset for help on using the changeset viewer.