Changeset 5650


Ignore:
Timestamp:
2003-10-16T11:21:20+13:00 (21 years ago)
Author:
jmt12
Message:

In order to work around the [ and ] problem, toString is format is now passed an argument to specifiy whether you want a raw text string, DOM string or Greenstone safe string.

File:
1 edited

Legend:

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

    r5590 r5650  
    3737import org.greenstone.gatherer.cdm.DOMProxyListEntry;
    3838import org.greenstone.gatherer.msm.MSMUtils;
     39import org.greenstone.gatherer.util.Codec;
    3940import org.w3c.dom.*;
    4041/** This class encapsulates all the information about a format command from the collection configuration. This includes both the 'general' formatting commands, and the commands targetted at specific classifiers or classification component types. This class is, unfortunately, the most complex in terms of DOM model support, since we have to maintain a live reference to any classifier this format applies to. We temporarily use the feature name as the format name attribute but since the order of classifiers can change, this of course gets horribly out of date. Before the CollectionDesignManager saves the CollectionConfiguration it calls a method in the FormatManager to force all of the Formats to update their name attributes.
     
    229230    String value = "Error";
    230231    if(element != null) {
    231         value = MSMUtils.getValue(element);
     232       value = MSMUtils.getValue(element);
     233       // Decode into text
     234       value = Codec.transform(value, Codec.DOM_TO_TEXT);
    232235    }
    233236    return value;
     
    291294        }
    292295        // Encode
    293 
     296        value = Codec.transform(value, Codec.TEXT_TO_DOM);
    294297        // Store in DOM
    295298        MSMUtils.setValue(element, value);
     
    312315        }
    313316        else {
    314         temp.append("\"");
    315         temp.append(MSMUtils.getValue(element));
    316         temp.append("\"");
     317           temp.append("\"");
     318           // Retrieve the DOM encoded value, decode and then append
     319           value = MSMUtils.getValue(element);
     320           value = Codec.transform(value, Codec.DOM_TO_TEXT);
     321           temp.append(value);
     322           temp.append("\"");
    317323        }
    318324        text = temp.toString();
Note: See TracChangeset for help on using the changeset viewer.