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/DocumentSQLWriter.java

    r5800 r5944  
    2525    // put the document into the database
    2626    try {
    27     if (document.getID() != null)
     27      if (document.getID() != null)
    2828      { //tag = XMLTools.addAttribute(tag, "OBJID", document.getID().toString());
    29       GS3SQLInsert insert = new GS3SQLInsert("document");
     29    GS3SQLSelect select = new GS3SQLSelect("document");
     30    select.addField("*");
     31    select.setWhere(new GS3SQLWhere(new GS3SQLWhereItem("DocID", "=", document.getID().toString())));
     32    connection.execute(select.toString());
     33   
     34    ResultSet results = connection.getResultSet();
     35
     36    if (results == null ||
     37        !results.first())
     38    { GS3SQLInsert insert = new GS3SQLInsert("document");
    3039      insert.addValue("DocID", document.getID().toString());
     40      insert.addValue("DocType", document.getDocumentType());
    3141
    32       System.out.println(insert.toString());
    3342      connection.execute(insert.toString());
     43    }
    3444      }
    3545    } catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.