Changeset 23144
- Timestamp:
- 2010-10-17T14:43:08+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/cgi-bin/talkback-transfer.pl
r23142 r23144 20 20 sub get_infodb_type 21 21 { 22 my ($ collect_home,$collect) = @_;22 my ($opt_site,$collect_home,$collect) = @_; 23 23 24 print STDERR "*** Need to implement extracting infodb_type from collect.cfg\n"; 25 return "gdbm"; 24 my $out = "STDERR"; 25 26 $collect = &colcfg::use_collection($opt_site, $collect, $collect_home); 27 28 if ($collect eq "") { 29 print STDERR "Error: failed to find collection $collect in $collect_home\n"; 30 print STDOUT "Content-type:text/plain\n\n"; 31 print STDOUT "ERROR: Failed to find collection $collect\n"; 32 exit 0; 33 34 } 35 36 # Read in the collection configuration file. 37 my ($config_filename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 38 my $collectcfg = &colcfg::read_collection_cfg ($config_filename, $gs_mode); 39 40 return $collectcfg->{'infodbtype'}; 26 41 } 27 42 … … 29 44 sub oid_to_docxml_filename 30 45 { 31 my ($ collect_home,$collect,$docid) = @_;46 my ($opt_site,$collect_home,$collect,$docid) = @_; 32 47 33 my $infodb_type = get_infodb_type($ collect_home,$collect);48 my $infodb_type = get_infodb_type($opt_site,$collect_home,$collect); 34 49 35 # Obtain the collect and archive dir36 my $archive _dir = &util::filename_cat($collect_home,$collect,"archives");50 # Obtain the collect and archives dir 51 my $archives_dir = &util::filename_cat($collect_home,$collect,"archives"); 37 52 38 53 # Obtain the doc.xml path for the specified docID 39 54 my $arcinfo_doc_filename 40 55 = &dbutil::get_infodb_file_path($infodb_type, "archiveinf-doc", 41 $archive _dir);56 $archives_dir); 42 57 my $doc_rec_string 43 58 = &dbutil::read_infodb_entry($infodb_type, $arcinfo_doc_filename, … … 48 63 # The $doc_xml_file is relative to the archives, so now let's get the 49 64 # full path 50 my $archives_dir = &util::filename_cat($collect_home,$collect,"archives");51 65 my $doc_xml_filename = &util::filename_cat($archives_dir,$doc_xml_file); 52 66 … … 68 82 my $oid = $gsdl_cgi->param('oid'); 69 83 my $collect = $gsdl_cgi->param('collect'); 84 my $site = $gsdl_cgi->param('site'); 70 85 71 86 # sanity check … … 78 93 my $uniq_prefix = "$collect-$oid"; 79 94 80 my $docxml_filename = oid_to_docxml_filename($ collect_home,$collect,$oid);95 my $docxml_filename = oid_to_docxml_filename($site,$collect_home,$collect,$oid); 81 96 82 97 my $talktoUploadURL = $gsdl_cgi->param('talktoUpload');
Note:
See TracChangeset
for help on using the changeset viewer.