Changeset 14204


Ignore:
Timestamp:
2007-06-29T13:16:23+12:00 (17 years ago)
Author:
xiao
Message:

modify to write the OAI element into the internal structure and write it back to collectionConfig.xml as well.

File:
1 edited

Legend:

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

    r14037 r14204  
    24332433        toElement.appendChild (language_indexes);
    24342434    }
    2435     // Handling both earchType and search format statement
     2435    // Handling both searchType and search format statement
    24362436    private void doSearchFormat (Document to, Node searchNode) {
    24372437        //There are two elements called <format> in <search>: one is for searchType; another is for format statement
     
    25112511       
    25122512        Element to_element = XMLTools.duplicateElement (to, (Element)replace_element, true);
     2513        toElement.appendChild (to_element);
     2514    }
     2515    private void doOAIElement (Document to, Element from) {
     2516        Element toElement = to.getDocumentElement ();
     2517       
     2518        Node oai_element = XMLTools.getChildByTagName (from, StaticStrings.OAI_ELEMENT);
     2519        if (oai_element == null) {
     2520            return; // such an element not found
     2521        }
     2522       
     2523        Element to_element = XMLTools.duplicateElement (to, (Element)oai_element, true);
     2524        toElement.appendChild (to_element);
     2525    }
     2526    private void convertOAIElement (Document from, Document to) {
     2527        Element toElement = to.getDocumentElement ();
     2528       
     2529        Node oai_element = XMLTools.getChildByTagName (from.getDocumentElement (), StaticStrings.OAI_ELEMENT);
     2530        if (oai_element == null) {
     2531            return; // such an element not found
     2532        }
     2533       
     2534        Element to_element = XMLTools.duplicateElement (to, (Element)oai_element, true);
    25132535        toElement.appendChild (to_element);
    25142536    }
     
    36103632        doDisplayFormat (dOc, fromElement);
    36113633        doReplaceListRef (dOc, fromElement);
     3634        doOAIElement (dOc, fromElement);
    36123635       
    36133636    }
     
    36153638   
    36163639    public void saveCollectionConfigXML (File collect_cfg_file, Document doc) {
    3617         //In this method, the file collect_cfg_file must be 'collectionConfig.xml' instead of 'collect.cfg'
     3640        //In this method, the file collect_cfg_file must be 'collectionConfig.xml'
    36183641       
    36193642       
     
    38103833        convertDisplayFormat (dOc, skeleton);
    38113834        convertReplaceListRef (dOc, skeleton);
     3835        convertOAIElement(dOc, skeleton);
    38123836       
    38133837        return skeleton;
Note: See TracChangeset for help on using the changeset viewer.