Hi Barton,
Control-number is the index on 001. 001 should have the number and 003
the MarcOrgCode, that's why it's stripped from $w for search. I don't
know about OCLCs practices, so can't tell how numbers are handled there.
The examples here show a number with ocm in 001:
http://www.loc.gov/marc/bibliographic/bd001.html
The description for $w
(http://www.loc.gov/marc/bibliographic/bd76x78x.html) doesn't have a
matching example:
"System control number of the related record preceded by the MARC code,
enclosed in parentheses, for the agency to which the control number
applies."
Hope this helps,
Katrin
On 24.05.2018 21:15, Barton Chittenden wrote:
I'm working on generating links for 7XX linking fields in XSLT,
a-la Bug 15140 - Add MARC21 776 to OPAC and staff display
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15140).
This Takes the 773$w, and uses the XSLT template
'extractControlNumber' which strips the leading MARCOrgCode, e.g. turning
(OCoLC)2776588 into 2776588 ... and then the search URL is
/cgi-bin/koha/opac-search.pl?q=Control-number:2776588
<http://opac-search.pl?q=Control-number:2776588>
The problem is that 2776588 isn't the actual OCLC number -- The
formatting rules are here:
https://help.oclc.org/Metadata_Services/OCLC-MARC_records/Content_designators_for_bibliographic_data/20Bibliographic_record_control_fields
In short: 0-8 digits: 0 pad to 8 digits, prepend 'ocm':
2776588 -> ocm02776588
9 digits, prepend 'ocn'
> 9 digits, prepend 'on'
I tried formatting the search with a leading '*':
/cgi-bin/koha/opac-search.pl?q=Control-number:*2776588
<http://opac-search.pl?q=Control-number:*2776588>
as well as with leading and trailing '*'
/cgi-bin/koha/opac-search.pl?q=Control-number:*2776588*
<http://opac-search.pl?q=Control-number:*2776588*>
Neither of these worked.
Formatting the control number according to the OCLC rules above did work:
/cgi-bin/koha/opac-search.pl?q=Control-number:ocm02776588
<http://opac-search.pl?q=Control-number:ocm02776588>
So I have three questions:
1) Is there a way to format a Control-number search that doesn't force
me to generate the control number according to the OCLC rules above?
2) If not, does anyone have pointers about how to
* Test for (OCoLC) ->
* Test length of control number
* < 9 -> 0 pad to 8 digits, prepend 'ocm'
* 9 -> prepend 'ocn'
* > 9 -> prepen 'on'
3) Are there other control number formatting rules for
other MARCOrgCodes?
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/