Ignore:
Timestamp:
2004-02-24T11:10:50+13:00 (20 years ago)
Author:
kjdon
Message:

sql database name is now a combination of site name and coll name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS3Retrieve.java

    r6517 r6871  
    111111    this.short_service_info.appendChild(dcr_service);
    112112
    113     if (!database.setDatabase(this.cluster_name)) {
    114         System.err.println("GS3Search Error: Could not open SQL database!");
     113    // open the database for querying
     114    // the database name is a combination of site name and collection name
     115
     116    // check that site_home is set
     117    if (this.site_home == null || this.site_home.equals("")) {
     118        System.err.println("GS3Retrieve Error: site_home is not set, so cannot work out the site name and cannot determine the database name");
    115119        return false;
    116120    }
    117 
     121    String site_name = this.site_home.substring(this.site_home.lastIndexOf(File.separator)+1);
     122    if (site_name.equals("")) {
     123        System.err.println("GS3Retrieve Error: Cannot extract the site name from site home: "+this.site_home);
     124        return false;
     125    }
     126    if (!database.setDatabase(site_name+"_"+this.cluster_name)) {
     127        System.err.println("GS3Retrieve Error: Could not open SQL database!");
     128        return false;
     129    }
     130   
    118131        // now do the classifier browse service
    119132 
Note: See TracChangeset for help on using the changeset viewer.