Changeset 14635


Ignore:
Timestamp:
2007-10-09T09:57:18+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

    r14634 r14635  
    25362536        toElement.appendChild (to_element);
    25372537    }
    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     }   
    25602538    private void doDefaultIndexLanguage (Document to, Node searchNode) {
    25612539        Element toElement = to.getDocumentElement ();
     
    29102888       
    29112889        import_element.appendChild (plugin_list_element);
     2890       
     2891        //do the plugout element (used by building flax collections)
     2892        Node plugout = XMLTools.getChildByTagNameIndexed (from.getDocumentElement (), PLUGOUT_ELEMENT, 0);
     2893        if (plugout != null) {
     2894            Element to_element = XMLTools.duplicateElement (to, (Element)plugout, true);
     2895            import_element.appendChild (to_element);
     2896        }
     2897       
    29122898        to.getDocumentElement ().appendChild (import_element);
    29132899    }
     2900
    29142901    //Handle 'searchType' of collectionConfig.xml. In the internal structure, its also called 'searchType', eg. plain, form
    29152902    private void convertSearchType (Document from, Document to) {
     
    36313618        }
    36323619        if (importNode != null) {
    3633             Node pluginListNode = XMLTools.getChildByTagNameIndexed ((Element)importNode, StaticStrings.PLUGINLIST_STR, 0);
    3634            
     3620            //do plugin list nodes
     3621            Node pluginListNode = XMLTools.getChildByTagNameIndexed ((Element)importNode, StaticStrings.PLUGINLIST_STR, 0);           
    36353622            if (pluginListNode == null) {
    3636                 System.out.println ("There is no plugin set.");
     3623                System.out.println ("There is no pluginlist set.");
    36373624            }
    36383625            if (pluginListNode != null) {
    36393626               
    36403627                doPlugin (dOc, pluginListNode);
     3628            }
     3629           
     3630            //do the plugout element (used by building flax collections)
     3631            Node plugout = XMLTools.getChildByTagNameIndexed ((Element)importNode, PLUGOUT_ELEMENT, 0);
     3632            if (plugout != null) {
     3633                Element to_element = XMLTools.duplicateElement (dOc, (Element)plugout, true);
     3634                toElement.appendChild (to_element);
    36413635            }
    36423636        }
     
    36883682        doReplaceListRef (dOc, fromElement);
    36893683        doOAIElement (dOc, fromElement);
    3690         doPlugoutElement (dOc, fromElement);
    36913684       
    36923685    }
     
    38803873        convertBuildType (dOc, skeleton);
    38813874        convertIndex (dOc, skeleton);
    3882         convertPlugin (dOc, skeleton);
     3875        convertPlugin (dOc, skeleton);//also do the plugout element
    38833876        convertClassifier (dOc, skeleton);
    38843877        convertSubcollectionIndexes (dOc, skeleton);
     
    38903883        convertReplaceListRef (dOc, skeleton);
    38913884        convertOAIElement(dOc, skeleton);
    3892         convertPlugoutElement(dOc, skeleton);
    3893        
     3885
    38943886        return skeleton;
    38953887    }
Note: See TracChangeset for help on using the changeset viewer.