Changeset 6100


Ignore:
Timestamp:
2003-12-03T09:38:12+13:00 (20 years ago)
Author:
cs025
Message:

Added generic GS2 textfile handler, classifier tables to database

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/util
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/util/GS3SQLConnection.java

    r6016 r6100  
    177177      // create document table
    178178      GS3SQLCreateTable docTable = new GS3SQLCreateTable("document");
    179       docTable.addProperty("DocID", 64);
    180       docTable.setPrimaryKey("DocID");
    181       docTable.addProperty("DocType", 64);
     179      docTable.addProperty("DocID", 64);   // The document identifer, unique in collection
     180      docTable.setPrimaryKey("DocID");     // ...which is also the primary key
     181      docTable.addProperty("DocType", 64); // The document type - used to regenerate the
     182                                           // correct Document object type.
    182183      statement = this.connection.createStatement();
    183       System.out.println(docTable.toString());
    184184      statement.execute(docTable.toString());
    185185     
     
    187187      GS3SQLCreateTable structureMap = new GS3SQLCreateTable("structure");
    188188      structureMap.addAutoPrimaryKey("StructureRef");
    189       structureMap.addProperty("DocID", 64);        // a 'foreign key' in effect - but not treated
    190       // as such for efficiency reasons
    191       structureMap.addProperty("StructureID", 64);  // this identifier
    192       structureMap.addProperty("StructureType", 64);         // the type of the structure
    193       structureMap.addProperty("Label", 128);       // the label of the structure
     189      structureMap.addProperty("DocID", 64);          // a 'foreign key' in effect - but not treated
     190                                                      // as such for efficiency reasons
     191      structureMap.addProperty("StructureID", 64);    // this identifier
     192      structureMap.addProperty("StructureType", 64);  // the type of the structure
     193      structureMap.addProperty("Label", 128);         // the label of the structure
    194194      statement.execute(structureMap.toString());
    195195   
     
    199199      sectionMap.addProperty("StructureRef", GS3SQLField.INTEGER_TYPE);
    200200      sectionMap.addProperty("DocID", 64);        // a 'foreign key' in effect - but not treated
    201       // as such for efficiency reasons
    202       sectionMap.addProperty("ParentType", 64);     // the type of the parent - document or section
    203       sectionMap.addProperty("ParentRef", 64);      // the parent sql reference identifier
    204       sectionMap.addProperty("SectionID", 64);      // this identifier
    205       sectionMap.addProperty("DivisionType", 64);           // the type of the section
     201                                                  // as such for efficiency reasons
     202      sectionMap.addProperty("ParentType", 64);   // the type of the parent - document or section
     203      sectionMap.addProperty("ParentRef", 64);    // the parent sql reference identifier
     204      sectionMap.addProperty("SectionID", 64);    // this identifier
     205      sectionMap.addProperty("DivisionType", 64); // the type of the section
    206206      sectionMap.addProperty("LabelOrder", 64);   // the order of the section
    207207      sectionMap.addProperty("ShortLabel", 128);  // the short label of the section
    208208      sectionMap.addProperty("UserLabel", 255);   // the long label of the section
    209       System.out.println(sectionMap.toString());
    210209      statement.execute(sectionMap.toString());
    211210
     
    232231      metadataSection.addProperty("MetaID", 64);  // in and of itself...
    233232      metadataSection.addProperty("GroupID", 64); // the 'name' property
    234       System.out.println(metadataSection.toString());
    235233      statement.execute(metadataSection.toString());
    236234     
     
    284282     
    285283      //   create admin table...etc.
     284
     285      //
     286      // END OF METS TABLES
     287      //
     288
     289      //
     290      // BEGINNING OF GSDL TABLES
     291      //
     292      GS3SQLCreateTable classifiers = new GS3SQLCreateTable("classifiers");
     293      classifiers.addAutoPrimaryKey("ClassifyRef");
     294      classifiers.addProperty("ClassifyID");
     295      classifiers.addProperty("ParentID");
     296      classifiers.addProperty("Name");
     297      classifiers.addProperty("Description");
     298      statement.execute(classifiers.toString());
     299
     300      GS3SQLCreateTable classDocs = new GS3SQLCreateTable("classdocuments");
     301      classDocs.addProperty("ClassifyRef", GS3SQLField.INTEGER_TYPE);
     302      classDocs.addProperty("DocID");
     303      statement.execute(classDocs.toString());
     304
     305      GS3SQLCreateTable classData = new GS3SQLCreateTable("classdata");
     306      classData.addProperty("ClassifyRef", GS3SQLField.INTEGER_TYPE);
     307      classData.addProperty("Label");
     308      classData.addProperty("Value");
     309      statement.execute(classData.toString());
     310
     311      //
     312      // END OF GSDL TABLES
     313      //
     314
    286315    }
    287316    catch (SQLException ex)
Note: See TracChangeset for help on using the changeset viewer.