Ignore:
Timestamp:
2003-07-25T16:38:55+12:00 (21 years ago)
Author:
jmt12
Message:

Fixed bug where no metadata was being extracted from the archives unless it was already specified in the extracted metadata set. (a test during inserting a new element was comparing to 'ex' and was, not surprisingly, failing).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/GreenstoneArchiveParser.java

    r4674 r5039  
    3939import java.net.*;
    4040import java.util.*;
     41import org.greenstone.gatherer.Configuration;
    4142import org.greenstone.gatherer.Gatherer;
    4243import org.greenstone.gatherer.collection.Collection;
     
    6263    public GreenstoneArchiveParser(GShellProgressMonitor progress, GShell shell) {
    6364    // We can only extract metadata if an extracted metadata set exists in our collection.
    64     if(Gatherer.c_man.msm.getSet("") != null) {
     65    if(Gatherer.c_man.msm.getSet(Utility.EXTRACTED_METADATA_NAMESPACE) != null) {
    6566        this.shell = shell;
    6667        // Determine the collection archive directory.
     
    7475            // Then extract the metadata from it.
    7576            if(document_file.exists()) {
    76             extractMetadata(document_file);
     77            int count = extractMetadata(document_file);
    7778            // Display a pretty progress message.
    78             shell.fireMessage(GShell.IMPORT, shell.typeAsString(GShell.IMPORT) + "> " + Gatherer.dictionary.get("GShell.Extracted", document_directories[i].getName()), GShell.OK);
     79            String[] args = new String[2];
     80            args[0] = document_directories[i].getName();
     81            args[1] = String.valueOf(count);
     82            shell.message(GShell.IMPORT, shell.typeAsString(GShell.IMPORT) + "> " + Gatherer.dictionary.get("GShell.Extracted", args), GShell.OK);
     83            args = null;
    7984            progress.increment();
    8085            }
     
    115120                ElementWrapper element = Gatherer.c_man.msm.getElement(name);
    116121                if(element == null) {
    117                 MetadataSet extracted_mds = Gatherer.c_man.msm.getSet("ex");
     122                MetadataSet extracted_mds = Gatherer.c_man.msm.getSet(Utility.EXTRACTED_METADATA_NAMESPACE);
    118123                if(extracted_mds != null) {
    119                     element = extracted_mds.addElement(name);
     124                    element = extracted_mds.addElement(name, Gatherer.config.interface_language);
    120125                }
    121126                }
Note: See TracChangeset for help on using the changeset viewer.