Changeset 19430 for gli


Ignore:
Timestamp:
2009-05-13T14:14:42+12:00 (15 years ago)
Author:
oranfry
Message:

correcting for whether to copy building to index

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

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r19404 r19430  
    8989
    9090    /** This indicates whether a minimal or complete build is required.
    91         Minimal means do everything with the -incremental flag. Complete means do everything with -removeold */
     91        Minimal means do everything with the -incremental flag. Complete means do everything with -removeold
     92        Note: This stores preceisely whether the user selected the minimal or full build radio button.
     93        Its value does not indicate anything about what gli eventually chose as a result of that "suggestion" */
    9294    static private boolean isCompleteBuild = false;
    9395
     96    /** These remember which scripts were run for the last build.
     97        true indicated 'full-' prefix, false indicates 'incremental-' prefix to the given perl script (import.pl or buildcol.pl)
     98        Note: This stores what gli did, regardless of whether minimal or full was requested by the user */
     99    static private boolean importWasFull = false;
     100    static private boolean buildcolWasFull = false;
    94101
    95102    /** Constructor. Loads a certain collection configuration file, which is parsed into a DOM. This model is then registered with the command information managers, each of whom knows how to, and provides controls to, alter certain commands.
     
    225232    }
    226233
     234    public static void setImportWasFull( boolean wasFull ) {
     235        importWasFull = wasFull;
     236    }
     237    public static boolean importWasFull() {
     238        return importWasFull;
     239    }
     240    public static void setBuildcolWasFull( boolean wasFull ) {
     241        buildcolWasFull = wasFull;
     242    }
     243    public static boolean buildcolWasFull() {
     244        return buildcolWasFull;
     245    }
     246
    227247    /**
    228248     * What exactly does this do?
  • gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java

    r19404 r19430  
    189189    }
    190190    else {
    191         String buildType = (new CollectionMeta( CollectionDesignManager.collect_config.getBuildType() )).getValue(CollectionMeta.TEXT);
    192         if ( !CollectionDesignManager.isCompleteBuild() && buildType.equals( BuildTypeManager.BUILD_TYPE_LUCENE ) ) {
     191       
     192        if ( !CollectionDesignManager.isCompleteBuild() && CollectionDesignManager.index_manager.isLucene() ) {
    193193            command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "incremental-buildcol.pl");
     194            CollectionDesignManager.setBuildcolWasFull(false);
    194195        } else {
    195196            command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "full-buildcol.pl");
    196         }
    197     }
     197            CollectionDesignManager.setBuildcolWasFull(true);
     198        }
     199    }
     200
    198201    command_parts_list.add("-gli");
    199202    command_parts_list.add("-language");
     
    10471050    }
    10481051    else {
    1049         String cmdPrefix = CollectionDesignManager.isCompleteBuild() ? "full-" : "incremental-";
     1052        String cmdPrefix = null;
     1053        if ( CollectionDesignManager.isCompleteBuild() ) {
     1054            cmdPrefix = "full-";
     1055            CollectionDesignManager.setImportWasFull( true );
     1056        } else {
     1057            cmdPrefix = "incremental-";
     1058            CollectionDesignManager.setImportWasFull( false );
     1059        }
    10501060        command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + cmdPrefix + "import.pl");
    10511061    }
     
    15361546    else if(event.getType() == GShell.BUILD && event.getStatus() == GShell.OK) {
    15371547           
    1538         if ( CollectionDesignManager.isCompleteBuild() ) {
     1548        if ( CollectionDesignManager.buildcolWasFull() ) {
    15391549            if(installCollection()) {
    15401550            // If we have a local library running then ask it to add our newly create collection
Note: See TracChangeset for help on using the changeset viewer.