Ignore:
Timestamp:
2009-01-12T11:18:22+13:00 (15 years ago)
Author:
kjdon
Message:

updated the rtl-gli branch with files from trunk. Result of a merge 14807:18318

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/collection/Collection.java

    r13819 r18358  
    6262    /** A reference to the import ScriptOptions. */
    6363    public ScriptOptions import_options;
     64    /** A reference to the schedule ScriptOptions */
     65    public ScriptOptions schedule_options;
    6466    /** true if an error has occurred during construction */
    6567    public boolean error = false;
     
    8688    /** The name of the import element. */
    8789    static final private String IMPORT = "Import";
     90    /** The name of the schedule element. */
     91    static final private String SCHEDULE = "Schedule";
     92    /** The name of the export element. */
     93    static final private String EXPORT = "Export";
    8894    /** The name of the imported attribute. */
    8995    static final private String IMPORTED = "imported";
     
    111117    }
    112118    // Finally create all of the child managers that are directly dependant on a collection
    113     build_options = new ScriptOptions(getBuildValues(), "buildcol.pl");
    114     import_options = new ScriptOptions(getImportValues(), "import.pl");
     119
     120    if (Configuration.fedora_info.isActive()) {
     121        build_options = new ScriptOptions(getValues(BUILD), "g2f-buildcol.pl");
     122        import_options = new ScriptOptions(getValues(IMPORT), "g2f-import.pl");
     123    }
     124    else {
     125        build_options = new ScriptOptions(getBuildValues(), "buildcol.pl");
     126        import_options = new ScriptOptions(getImportValues(), "import.pl");
     127        schedule_options = new ScriptOptions(getScheduleValues(), "schedule.pl");
     128    }
    115129    }
    116130   
     
    334348   
    335349
     350    /** Method to retrieve the current import/build/export/whatever options associated with this Collection. */
     351    private Element getValues(String val_type) {
     352    Element values_element = null;
     353    try {
     354        Element document_element = document.getDocumentElement();
     355        Element config_element = (Element) XMLTools.getNodeFromNamed(document_element, BUILD_CONFIG);
     356        values_element = (Element) XMLTools.getNodeFromNamed(config_element, val_type);
     357        config_element = null;
     358        document_element = null;
     359    }
     360    catch (Exception error) {
     361        DebugStream.printStackTrace(error);
     362    }
     363    return values_element;
     364    }
     365
    336366   
    337367    /** Method to retrieve the current build options associated with this Collection. */
     
    349379    }
    350380    return build_values_element;
     381    }
     382
     383    private Element getScheduleValues() {
     384    Element schedule_values_element = null;
     385    try {
     386        Element document_element = document.getDocumentElement();
     387        Element build_config_element = (Element) XMLTools.getNodeFromNamed(document_element, BUILD_CONFIG);
     388        schedule_values_element = (Element) XMLTools.getNodeFromNamed(build_config_element, SCHEDULE);
     389        build_config_element = null;
     390        document_element = null;
     391    }
     392    catch (Exception error) {
     393        DebugStream.printStackTrace(error);
     394    }
     395    return schedule_values_element;
    351396    }
    352397   
Note: See TracChangeset for help on using the changeset viewer.