Changeset 14634


Ignore:
Timestamp:
2007-10-08T21:23:20+13:00 (17 years ago)
Author:
xiao
Message:

add two methods to write in and out the plugout element which is used by flax collection building

File:
1 edited

Legend:

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

    r14522 r14634  
    5656    static final private String ENCODING = "UTF-8";
    5757    static final private String NEWLINE_ELEMENT = "NewLine";
     58    static final private String PLUGOUT_ELEMENT = "plugout";//used by building flax collections
    5859   
    5960    static private Document document;
     
    25352536        toElement.appendChild (to_element);
    25362537    }
     2538    private void doPlugoutElement (Document to, Element from) {
     2539        Element toElement = to.getDocumentElement ();
     2540       
     2541        Node plugout_element = XMLTools.getChildByTagName (from, PLUGOUT_ELEMENT);
     2542        if (plugout_element == null) {
     2543            return; // such an element not found
     2544        }
     2545       
     2546        Element to_element = XMLTools.duplicateElement (to, (Element)plugout_element, true);
     2547        toElement.appendChild (to_element);
     2548    }
     2549    private void convertPlugoutElement (Document from, Document to) {
     2550        Element toElement = to.getDocumentElement ();
     2551       
     2552        Node plugout_element = XMLTools.getChildByTagName (from.getDocumentElement (), PLUGOUT_ELEMENT);
     2553        if (plugout_element == null) {
     2554            return; // such an element not found
     2555        }
     2556       
     2557        Element to_element = XMLTools.duplicateElement (to, (Element)plugout_element, true);
     2558        toElement.appendChild (to_element);
     2559    }   
    25372560    private void doDefaultIndexLanguage (Document to, Node searchNode) {
    25382561        Element toElement = to.getDocumentElement ();
     
    36653688        doReplaceListRef (dOc, fromElement);
    36663689        doOAIElement (dOc, fromElement);
     3690        doPlugoutElement (dOc, fromElement);
    36673691       
    36683692    }
     
    38663890        convertReplaceListRef (dOc, skeleton);
    38673891        convertOAIElement(dOc, skeleton);
     3892        convertPlugoutElement(dOc, skeleton);
    38683893       
    38693894        return skeleton;
Note: See TracChangeset for help on using the changeset viewer.