Hi, in the CVS, in OPAC, a biblio can be seen in 3 formats : * standard format (as previously) * MARC format (almost like in librarian interface in 2.0.0) * "ISDB" format. The ISBD format is done through a systempreference, so each library can define it's own "ISBD". Some french librarians will take care of the UNIMARC ISBD format, but if MARC21 libraries want a MARC21 ISBD, someone must write the systempref. The systempref variable has the following format : * any field is coded like this : [xxxFFFSyyy] where xxx are up to 3 digits BEFORE the field, FFF the field number, S the subfield code, yyy up to 3 digits AFTER the field. * things outside [] are kept as is (including HTML) * repeatable fields are manages. * for security reason you can't put template variable (otherwise something like <!-- TMPL_VAR name="password" --> could give you the DB password ;-) Example : [200a /][200f - ][(200g] in UNIMARC will give : ================== Title /Author - (copyrightdate) ================== I agree it's now a 100% ISBD format (because separators after and between repeted fields are not managed exactly like in this syntax), but it's OK for most cases -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
Paul et al, Here's the latest version of the script (the other one had some serious syntax errors :-)). I still get the following error when I run it and marc_word is not getting populated. Is the MARCaddword subroutine not working properly or am I confused about how to use it? 'sentence' is just the 'subfieldvalue' in marc_subfield_table, right? #!/usr/bin/perl -w use lib '/usr/local/koha/intranet/modules/'; use strict; use C4::Context; use C4::Biblio; my $dbh=C4::Context->dbh; #FIXME: for now tag 100 is hardcoded; eventually I plan #to derive a list of tags (and subfields?) from an outfile my $tag="100"; my $query="SELECT bibid,tag,tagorder,subfieldid,subfieldorder,subfieldvalue FROM marc_subfield_table WHERE tag=? LIMIT 0,20"; my $sth=$dbh->prepare($query); $sth->execute($tag); while (my $data=$sth->fetchrow_hashref()){ MARCaddword($dbh,$data->{'bibid'},$data->{'tag'},$data->{'subfieldid'},$data->{'subfieldorder'},$data->{'subfieldvalue'}); } $dbh->disconnect();
Paul et al, OK, I think I've got a marc_word rebuild script working finally ... as long as subfieldvalue in marc_subfield_table is the same as 'sentence' in the MARCaddword subroutine. However, I have been getting an internal server error from apache as well as some strange errors in the opac-error_log when I do a search using the new opac MARC search. I assume they are related to recent changes in the code and constitute bugs but I thought I'd better check and make sure that it's not a data problem first. Here are the errors: [Tue Jun 8 23:41:14 2004] [error] [client 24.208.182.186] Premature end of script headers: /usr/local/koha/opac/cgi-bin/opac-search.pl DBD::mysql::st execute failed: Unknown column 'frameworkcode' in 'where clause' at /usr/local/koha/intranet/modules//C4/Biblio.pm line 230. DBD::mysql::st fetchrow failed: fetch() without execute() at /usr/local/koha/intranet/modules//C4/Biblio.pm line 231. DBD::mysql::st execute failed: Unknown column 'frameworkcode' in 'where clause' at /usr/local/koha/intranet/modules//C4/Biblio.pm line 234. DBD::mysql::st fetchrow failed: fetch() without execute() at /usr/local/koha/intranet/modules//C4/Biblio.pm line 236. DBD::mysql::st execute failed: Unknown column 'hidden' in 'field list' at /usr/local/koha/intranet/modules//C4/Biblio.pm line 244. DBD::mysql::st fetchrow failed: fetch() without execute() at /usr/local/koha/intranet/modules//C4/Biblio.pm line 254. Q : select distinct m1.bibid from biblio,biblioitems,marc_biblio,marc_word as m1 where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and (m1.word like 'Chorao%' and m1.tag+m1.subfieldid in ('100a')) order by biblio.title at /usr/local/koha/intranet/modules//C4/SearchMarc.pm line 170. Can't use an undefined value as a HASH reference at /usr/local/koha/intranet/modules//C4/SearchMarc.pm line 266. [Tue Jun 8 23:41:29 2004] [error] [client 24.208.182.186] Premature end of script headers: /usr/local/koha/opac/cgi-bin/opac-search.pl BTW: here is the final build_marc_word script: #!/usr/bin/perl -w use lib '/usr/local/koha/intranet/modules/'; use strict; use C4::Context; use C4::Biblio; my $dbh=C4::Context->dbh; my @tags=(100, 245); foreach my $tag (@tags) { my $query="SELECT bibid,tag,tagorder,subfieldid,subfieldorder,subfieldvalue FROM marc_subfield_table WHERE tag=? limit 0,20"; my $sth=$dbh->prepare($query); $sth->execute($tag); while (my $data=$sth->fetchrow_hashref()){ MARCaddword($dbh,$data->{'bibid'},$data->{'tag'},$data->{'tagorder'},$data->{'subfieldid'},$data->{'subfieldorder'},$data->{'subfieldvalue'}); } } $dbh->disconnect(); NPL is compiling a list of important tags to index and I'll add those when I have the complete list and commit the script to CVS... Thanks, Joshua
Paul et al,
Here's the latest version of the script (the other one had some serious syntax errors :-)). I still get the following error when I run it and marc_word is not getting populated. Is the MARCaddword subroutine not working properly or am I confused about how to use it? 'sentence' is just the 'subfieldvalue' in marc_subfield_table, right?
#!/usr/bin/perl -w use lib '/usr/local/koha/intranet/modules/'; use strict; use C4::Context; use C4::Biblio; my $dbh=C4::Context->dbh; #FIXME: for now tag 100 is hardcoded; eventually I plan #to derive a list of tags (and subfields?) from an outfile my $tag="100";
my $query="SELECT bibid,tag,tagorder,subfieldid,subfieldorder,subfieldvalue FROM marc_subfield_table WHERE tag=? LIMIT 0,20"; my $sth=$dbh->prepare($query); $sth->execute($tag); while (my $data=$sth->fetchrow_hashref()){ MARCaddword($dbh,$data->{'bibid'},$data->{'tag'},$data->{'subfieldid'},$data->{'subfieldorder'},$data->{'subfieldvalue'}); } $dbh->disconnect();
------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org _______________________________________________ Koha-devel mailing list Koha-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/koha-devel
participants (2)
-
Joshua Ferraro -
Paul POULAIN