Changeset 14522
- Timestamp:
- 2007-09-17T13:16:23+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r14204 r14522 3323 3323 //Convert default index 3324 3324 convertDefaultIndex (from, to, search); 3325 convertIndexOptions(from, to, search); 3325 3326 } 3326 3327 // Convert levels for mgpp/lucene. This method is called by converIndex() when mgpp indexer is detected. … … 3388 3389 search.appendChild (default_level); 3389 3390 3391 } 3392 // Convert indexoptions for mg/mgpp/lucene. This method is called by convertIndex(). 3393 private void convertIndexOptions (Document from, Document to, Element search) { 3394 Element source = from.getDocumentElement (); 3395 Element index_option = XMLTools.getNamedElement (source, 3396 StaticStrings.INDEXOPTIONS_ELEMENT, 3397 StaticStrings.NAME_ATTRIBUTE, StaticStrings.INDEXOPTIONS_STR); 3398 if (index_option == null) { 3399 return; 3400 } 3401 //Debugging purposes 3402 if (index_option.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.FALSE_STR)) { 3403 DebugStream.println ("There should be an IndexOption element which is assigned 'true': possible bug."); 3404 } 3405 Element indexOptionEl = to.createElement(StaticStrings.INDEXOPTION_STR); 3406 NodeList option_elements = index_option.getElementsByTagName (StaticStrings.OPTION_ELEMENT); 3407 int num_elements = option_elements.getLength (); 3408 // Don't output anything if no index 3409 if(num_elements == 0) { 3410 return ;// 3411 } 3412 search.appendChild (indexOptionEl); 3413 3414 for(int k = 0; k < num_elements; k++) { 3415 Element e = (Element) option_elements.item (k); 3416 String name_att = e.getAttribute(StaticStrings.NAME_ATTRIBUTE); 3417 Element optionEl = to.createElement(StaticStrings.OPTION_STR); 3418 optionEl.setAttribute(StaticStrings.NAME_ATTRIBUTE, name_att); 3419 indexOptionEl.appendChild(optionEl); 3420 } 3421 3390 3422 } 3391 3423 // Append the element son to the element mother in the appropriate position.
Note:
See TracChangeset
for help on using the changeset viewer.