Ignore:
Timestamp:
2003-11-24T14:26:35+13:00 (20 years ago)
Author:
cs025
Message:

Index document type, metadata extensions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/GMLRecogniser.java

    r5800 r5944  
    88public class GMLRecogniser implements RecogniserInterface
    99{
    10     DocumentList listRepository;
     10  DocumentList listRepository;
    1111
    12     public GMLRecogniser(DocumentList listRepository)
    13     {   this.listRepository = listRepository;
    14     }
     12  public GMLRecogniser(DocumentList listRepository)
     13  { this.listRepository = listRepository;
     14  }
    1515
    16     public boolean parseDocument(METSFile file)
    17     {
    18         String MIMEType = file.getMIMEType();
    19         if (MIMEType == null ||
    20               MIMEType.equals("text/xml")) {
    21             URL location = file.getLocation();
    22             return this.parseDocument(location);
    23         }
    24         return false;
    25     }
     16  public boolean parseDocument(METSFile file)
     17  {
     18    String MIMEType = file.getMIMEType();
     19    if (MIMEType == null ||
     20    MIMEType.equals("text/xml")) {
     21      URL location = file.getLocation();
     22      return this.parseDocument(location);
     23    }
     24    return false;
     25  }
    2626
    27     public boolean parseDocument(URL url)
    28     {   if (url.toString().startsWith("file://")) {
    29             String fileName = url.toString().substring(7);
    30             if (fileName.endsWith(".gml"))
    31           {
    32                 System.out.println("Posting GML Document " + fileName);
    33             GMLDocument doc = new GMLDocument(url);
    34             this.listRepository.addDocument(doc);
    35               // TODO: spawn knowledge of children too...
    36 //              System.out.println(doc.getDocumentText());
    37               return true;
    38             }
    39         }
    40         else {
    41             // TODO: get Mime type remotely, and then proceed if required
    42         }
    43         return false;
    44     }
     27  public boolean parseDocument(URL url)
     28  { if (url.toString().startsWith("file://")) {
     29      String fileName = url.toString().substring(7);
     30      if (fileName.endsWith(".gml"))
     31      {
     32    System.out.println("Posting GML Document " + fileName);
     33    GMLDocument doc = new GMLDocument(url);
     34    this.listRepository.addDocument(doc);
     35    // TODO: spawn knowledge of children too...
     36    //              System.out.println(doc.getDocumentText());
     37    return true;
     38      }
     39    }
     40    else {
     41      // TODO: get Mime type remotely, and then proceed if required
     42    }
     43    return false;
     44  }
    4545}
Note: See TracChangeset for help on using the changeset viewer.