Changeset 20445


Ignore:
Timestamp:
08/31/09 11:01:21 (12 years ago)
Author:
kjdon
Message:

removed show_extracted_namespace form toSTring and metadataToString - we now always output ex. namespace

File:
1 edited

Legend:

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

    r20440 r20445  
    211211   
    212212   
    213     static public String toString (Element command_element, boolean show_extracted_namespace) {
     213  static public String toString (Element command_element) {
    214214        String command_element_name = command_element.getNodeName ();
    215215        if(command_element_name.equals (StaticStrings.CLASSIFY_ELEMENT)) {
     
    241241        }
    242242        else if(command_element_name.equals (StaticStrings.COLLECTIONMETADATA_ELEMENT)) {
    243             return metadataToString (command_element, show_extracted_namespace);
     243      return metadataToString (command_element);
    244244        }
    245245        else if(command_element_name.equals (StaticStrings.COLLECTIONMETADATA_CREATOR_ELEMENT)) {
    246             return metadataToString (command_element, show_extracted_namespace);
     246      return metadataToString (command_element);
    247247        }
    248248        else if(command_element_name.equals (StaticStrings.COLLECTIONMETADATA_MAINTAINER_ELEMENT)) {
    249             return metadataToString (command_element, show_extracted_namespace);
     249            return metadataToString (command_element);
    250250        }
    251251        else if(command_element_name.equals (StaticStrings.COLLECTIONMETADATA_PUBLIC_ELEMENT)) {
    252             return metadataToString (command_element, show_extracted_namespace);
     252            return metadataToString (command_element);
    253253        }
    254254        else if (command_element_name.equals (StaticStrings.BUILDTYPE_ELEMENT)) {
    255             return metadataToString (command_element, show_extracted_namespace);
     255            return metadataToString (command_element);
    256256        }
    257257        else if(command_element_name.equals (StaticStrings.PLUGIN_ELEMENT)) {
     
    678678    }
    679679   
    680     static private String metadataToString (Element command_element, boolean text_value) {
     680    static private String metadataToString (Element command_element) {
    681681        // lets first check the value - if its empty, don't bother sticking it in the config file
    682682        String value_str = XMLTools.getValue (command_element);
     
    714714        name_str = null;
    715715       
    716         // The value string we retrieved will be encoded for xml, so we now decode it - to text if text_value set. This parameter was originally show_extracted_namespace, but sincethis is only true for 'toString()' commands from within the CDM, its good enough to determine if this toString() will be used to display on screen, or write to collect.cfg
    717         if(text_value == CollectionMeta.TEXT) {
    718             value_str = Codec.transform (value_str, Codec.DOM_TO_TEXT);
    719         }
    720         else {
    721             value_str = Codec.transform (value_str, Codec.DOM_TO_GREENSTONE);
    722         }
     716    // decode the value from XML to a form for config file
     717    value_str = Codec.transform (value_str, Codec.DOM_TO_GREENSTONE);
    723718       
    724719        // We don't wrap the email addresses in quotes, nor the other special metadata
     
    37563751            // (which just get commented out if unassigned -- a side effect of MG & MGPP compatibility)
    37573752            else if (!command_element.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.FALSE_STR) || command_element.getNodeName ().equals (StaticStrings.INDEXES_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEX_DEFAULT_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEXOPTIONS_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEXOPTION_DEFAULT_ELEMENT)) {
    3758                 String command;
    3759                 if (command_element.getNodeName ().equals (StaticStrings.FORMAT_ELEMENT)) {
    3760                     // Format statements we write out with ex. still present
    3761                     command = toString (command_element, true);
    3762                 }
    3763                 else {
    3764                     command = toString (command_element, false);
    3765                 }
     3753          String command = toString(command_element);
     3754//                 if (command_element.getNodeName ().equals (StaticStrings.FORMAT_ELEMENT)) {
     3755//                     // Format statements we write out with ex. still present
     3756//        command = toString (command_element); //, true);
     3757//                 }
     3758//                 else {
     3759//        command = toString (command_element);//, false);
     3760//                 }
    37663761               
    37673762                if (command != null && command.length ()> 0 ) {
Note: See TracChangeset for help on using the changeset viewer.