Changeset 9137


Ignore:
Timestamp:
2005-02-22T15:40:26+13:00 (19 years ago)
Author:
kjdon
Message:

a colleciton now has build_options and import_options instead of just one

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java

    r8812 r9137  
    4848import org.greenstone.gatherer.Gatherer;
    4949import org.greenstone.gatherer.cdm.SearchTypeManager;
    50 import org.greenstone.gatherer.collection.BuildOptions;
    5150import org.greenstone.gatherer.collection.Collection;
    5251import org.greenstone.gatherer.shell.GBasicProgressMonitor;
     
    519518    Collection current_collection = Gatherer.c_man.getCollection();
    520519    if (current_collection != previous_collection && !Gatherer.c_man.isImporting()) {
    521         this.options_pane = new OptionsPane(current_collection.build_options);
     520        this.options_pane = new OptionsPane(current_collection.import_options, current_collection.build_options);
    522521        if (previous_collection != null) {
    523522        // clear the log
     
    627626        // Set removeold automatically.
    628627        if(Gatherer.c_man.ready() && Gatherer.c_man.built()) {
    629         Gatherer.c_man.getCollection().build_options.setImportValue("removeold", true, null);
     628        Gatherer.c_man.getCollection().import_options.setValue("removeold", true, null);
    630629        }
    631630        // Call CollectionManagers method to build collection.
     
    664663        build_monitor.reset();
    665664        // Set removeold automatically.
    666         Gatherer.c_man.getCollection().build_options.setImportValue("removeold", true, null);
     665        Gatherer.c_man.getCollection().import_options.setValue("removeold", true, null);
    667666        // Remove the collection lock.
    668667        //Gatherer.g_man.lockCollection(false, false);
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r9045 r9137  
    4949import org.greenstone.gatherer.Gatherer;
    5050import org.greenstone.gatherer.cdm.Argument;
    51 import org.greenstone.gatherer.collection.BuildOptions;
     51import org.greenstone.gatherer.collection.ScriptOptions;
    5252import org.greenstone.gatherer.collection.Collection;
    5353import org.greenstone.gatherer.collection.CollectionManager;
     
    8383    private ArrayList current_controls;
    8484
    85     /** The <strong>BuildOptions</strong> data object contains all the option settings we wish to persist between Gatherer sessions (and thus is stored in <strong>Collection</strong>). */
    86     private BuildOptions build_options = null;
     85    /** The <strong>ScriptOptions</strong> data object contains all the option settings we wish to persist between Gatherer sessions (and thus is stored in <strong>Collection</strong>). */
     86    private ScriptOptions build_options = null;
     87    private ScriptOptions import_options = null;
    8788
    8889    private FileEntry file_entry = null;
     
    9697
    9798    /** The default constructor creates the few session length options, but either retrieves the rest from the current collection, or creates a default set of options. */
    98     public OptionsPane(BuildOptions build_options) {
     99    public OptionsPane(ScriptOptions import_options, ScriptOptions build_options) {
    99100    this.build_options = build_options;
     101    this.import_options = import_options;
    100102    this.current_controls = new ArrayList();
    101103    this.writing_documents = new Vector();
     
    127129    ArrayList build_arguments = new ArrayList();
    128130    int current_mode = Configuration.getMode();
    129     int total_build_argument_count = build_options.getBuildArgumentCount();       
     131    int total_build_argument_count = build_options.getArgumentCount();
     132       
    130133    for(int i = 0; i < total_build_argument_count; i++) {
    131134        // Retrieve the argument so we know how to format the control.
    132         Argument argument = build_options.getBuildArgument(i);
     135        Argument argument = build_options.getArgument(i);
    133136        if(!argument.isHiddenGLI() && argument.getModeLevel() <= current_mode) {
    134137        // Now attempt to retrieve any existing value for this argument.
    135         boolean enabled = build_options.getBuildValueEnabled(argument.getName());
    136         String value = build_options.getBuildValue(argument.getName());
     138        boolean enabled = build_options.getValueEnabled(argument.getName());
     139        String value = build_options.getValue(argument.getName());
    137140        ArgumentControl argument_control = new ArgumentControl(BUILD, argument, enabled, value);
    138141        build_arguments.add(argument_control);
     
    187190    ArrayList import_arguments = new ArrayList();
    188191    int current_mode = Configuration.getMode();
    189     int total_import_argument_count = build_options.getImportArgumentCount();       
     192    int total_import_argument_count = import_options.getArgumentCount();       
    190193    for(int i = 0; i < total_import_argument_count; i++) {
    191194        // Retrieve the argument so we know how to format the control.
    192         Argument argument = build_options.getImportArgument(i);
     195        Argument argument = import_options.getArgument(i);
    193196        if(!argument.isHiddenGLI() && argument.getModeLevel() <= current_mode) {
    194197        // Now attempt to retrieve any existing value for this argument.
    195         boolean enabled = build_options.getImportValueEnabled(argument.getName());
    196         String value = build_options.getImportValue(argument.getName());
     198        boolean enabled = import_options.getValueEnabled(argument.getName());
     199        String value = import_options.getValue(argument.getName());
    197200        ArgumentControl argument_control = new ArgumentControl(IMPORT, argument, enabled, value);
    198201        import_arguments.add(argument_control);
     
    573576        if(!enable && value == null) {
    574577        if(type == BUILD) {
    575             build_options.removeBuildValue(name);
     578            build_options.removeValue(name);
    576579        }
    577580        else {
    578             build_options.removeImportValue(name);
     581            import_options.removeValue(name);
    579582        }
    580583        }
     
    582585        else {
    583586        if(type == BUILD) {
    584             build_options.setBuildValue(name, enable, value);
     587            build_options.setValue(name, enable, value);
    585588        }
    586589        else {
    587             build_options.setImportValue(name, enable, value);
     590            import_options.setValue(name, enable, value);
    588591        }
    589592        }
  • trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r9095 r9137  
    504504    if(type == IMPORT || type == BUILD) {
    505505        if(type == IMPORT) {
    506         out_name = (String) Gatherer.c_man.getCollection().build_options.getImportValue("out");
     506        out_name = (String) Gatherer.c_man.getCollection().import_options.getValue("out");
    507507        }
    508508        else {
    509         out_name = (String) Gatherer.c_man.getCollection().build_options.getBuildValue("out");
     509        out_name = (String) Gatherer.c_man.getCollection().build_options.getValue("out");
    510510        }
    511511        if(out_name != null && out_name.length() > 0) {
Note: See TracChangeset for help on using the changeset viewer.