Changeset 12224


Ignore:
Timestamp:
2006-07-14T09:39:49+12:00 (18 years ago)
Author:
mdewsnip
Message:

Changed the way place styles are determined, to work around an oddity in the way these are stored in the database.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/perllib/plugins/CICPlug.pm

    r12219 r12224  
    229229
    230230
     231# This array must match the values in the tblArchTypes table
     232my @place_styles_array = (
     233    "American colonial",
     234    "Federal",
     235    "Greek revival",
     236    "Italianate",
     237    "Gothic revival",
     238    "Romanesque revival",
     239    "Victorian",
     240    "Beaux-Arts classicism",
     241    "Colonial revival",
     242    "Mission/Mission revival",
     243    "Modern/pre-WWII",
     244    "Modern/post-WWII",
     245    "Postmodern",
     246    "Contemporary",
     247    "Regionalist/Vernacular",
     248    "Other"
     249);
     250
     251
    231252my $place_functions_mapping = {
    232253    "academic department building" => "",
     
    496517
    497518    # Prepare SQL statement for getting the Place building styles
    498     my $place_styles_sql_statement = "SELECT Architectural_Classification FROM tblArchTypes,ArchPlace WHERE tblArchTypes.ArchType_ID=ArchPlace.ArchType_ID AND Entry_ID=?";
     519    my $place_styles_sql_statement = "SELECT ArchType_ID FROM ArchPlace WHERE Entry_ID=?";
    499520    my $place_styles_sql_handle = $dbh->prepare($place_styles_sql_statement);
    500521    $place_styles_sql_handle->{LongReadLen} = 65536;
     
    578599    $place_styles_sql_handle->execute($place_id) or die "Could not execute SQL statement.";
    579600    while (my $place_styles_match_hashref = $place_styles_sql_handle->fetchrow_hashref()) {
    580         my $place_style = $place_styles_match_hashref->{"Architectural_Classification"};
     601        # The ArchType_ID is actually an index into the tblArchType table, NOT a link
     602        my $place_style_index = $place_styles_match_hashref->{"ArchType_ID"};
     603        my $place_style = $place_styles_array[$place_style_index];
    581604        push(@{$place_style_to_ids_mapping{$place_style}}, $place_doc_obj->get_OID());
    582605        &new_metadata_entry($place_doc_obj, "Style", $place_style);
Note: See TracChangeset for help on using the changeset viewer.