Changeset 13819


Ignore:
Timestamp:
2007-01-26T12:26:34+13:00 (17 years ago)
Author:
shaoqun
Message:

added a skimfile switch in collection's .col file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/Collection.java

    r13748 r13819  
    7272    /** The document around which this collection class is based. */
    7373    private Document document;
    74     /** The file the collection is in (the file may not actually exist, such in the case of a legacy collection)! */
    75     private File file;
     74
     75     /** The file the collection is in (the file may not actually exist, such in the case of a legacy collection)! */
     76     private File file;
    7677    /** The name of the argument element. */
    7778    static final private String ARGUMENT = "Argument";
     
    8788    /** The name of the imported attribute. */
    8889    static final private String IMPORTED = "imported";
     90      /** The name of the imported attribute. */
     91    static final private String SKIM_FILE = "skimfile";
     92     
    8993
    9094    /** Constructor. */
     
    9296    this.file = collection_xml;
    9397    // Try to load this collections details.
    94     document = XMLTools.parseXMLFile(collection_xml);
     98        document = XMLTools.parseXMLFile(collection_xml);
    9599    // If that fails load the default settings for a collection.
    96100    if(document == null) {
     
    253257    return getTitle();
    254258    }
     259 
     260    public boolean toSkimFile(){
     261     Element document_element = document.getDocumentElement();
     262     NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
     263          for(int i = 0;  i < arguments.getLength(); i++) {
     264          Element argument_element = (Element) arguments.item(i);
     265              if(argument_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(SKIM_FILE)) {
     266          String skimfile = XMLTools.getValue(argument_element);
     267          if (skimfile !=null && skimfile.trim().toLowerCase().equals("false")){
     268              return false;
     269          }
     270          }
     271         
     272      }
     273     
     274      return true;
     275    }
     276
    255277   
    256278    /** Get the value of a collection argument. */
     
    309331    return result;
    310332    }
     333
     334   
     335
    311336   
    312337    /** Method to retrieve the current build options associated with this Collection. */
Note: See TracChangeset for help on using the changeset viewer.