[open-ils-commits] r16829 - in trunk: . Open-ILS/src/perlmods/OpenILS/Application Open-ILS/src/perlmods/OpenILS/WWW (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jun 29 14:11:00 EDT 2010
Author: miker
Date: 2010-06-29 14:10:55 -0400 (Tue, 29 Jun 2010)
New Revision: 16829
Modified:
trunk/
trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
improve browse support; correct thinkos in new holdings fleshing code; improve generated MODS XML (remove some namespace prefixes)
Property changes on: trunk
___________________________________________________________________
Name: bzr:revision-info
- timestamp: 2010-06-01 15:02:18.358000040 -0400
committer: Mike Rylander <miker at esilibrary.com>
properties:
branch-nick: trunk
+ timestamp: 2010-06-29 14:10:55.191999912 -0400
committer: Mike Rylander <miker at esilibrary.com>
properties:
branch-nick: trunk
Name: bzr:file-ids
- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm 3271 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:Open-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FWWW%2FSuperCat%2FFeed.pm
Open-ILS/web/js/dojo/openils/BibTemplate.js 13010 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk%2FOpen-ILS%2Fweb%2Fjs%2Fdojo%2Fopenils%2FBibTemplate.js
+ Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 3034 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:Open-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FApplication%2FSuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 3165 at dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:Open-ILS%2Fsrc%2Fperlmods%2FOpenILS%2FWWW%2FSuperCat.pm
Name: bzr:revision-id:v4
- 11741 phasefx at batrepo-20091014063041-ama3i5s87ziqohxo
11742 phasefx at batrepo-20091014063644-pn3a6urkw3uxgr6n
12108 phasefx at batrepo-20091120084700-lavt73oserscgalf
12166 jason at esilibrary.com-20091202233906-g8kh2kh3qmmz66r1
12184 jason at esilibrary.com-20091204161020-0dqezh01c05btffh
12198 jason at esilibrary.com-20091208140008-eofwdbn2u8dxk2kk
12199 jason at esilibrary.com-20091208155412-4qdzy8sgs51vm0yq
12215 jason at esilibrary.com-20091209133642-bp8mb3tc5vpoc1ij
12220 jason at esilibrary.com-20091209143447-i1st1to8ln4hhwyb
12231 jason at esilibrary.com-20091209221438-vv4crqppm8ajj3dr
12804 jason at esilibrary.com-20100324194046-jza2ic2dlpq8txhc
12946 miker at esilibrary.com-20100402183612-8xznj35wfohk7zyu
12955 miker at esilibrary.com-20100403141037-h8d57ryrmkkg9yhb
12971 miker at whirly-20100405202254-aztbsf3p3eey9e8e
12997 miker at esilibrary.com-20100408154146-zodwuxxizwf0y449
13010 miker at miker-msi-20100409021618-5f0ohbg5cgi5pai0
13014 miker at esilibrary.com-20100409135406-mitf09aw1srnps3g
13022 miker at esilibrary.com-20100412144909-fc4bx1n80ac0z8ox
13023 miker at esilibrary.com-20100412145629-92g9jts2k8yqsm38
13152 miker at esilibrary.com-20100503010126-67i6kclipxip27du
13153 miker at esilibrary.com-20100503010322-3ri56680p7bf4o26
13161 miker at esilibrary.com-20100504150623-34h9t5p64cd52swu
13163 miker at esilibrary.com-20100504180646-77rxefvetqkiyo3s
13164 miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk
13175 miker at esilibrary.com-20100506194925-xg5folqttvehr2np
13306 miker at esilibrary.com-20100601190218-nf7sqyxzgsylm94f
+ 11741 phasefx at batrepo-20091014063041-ama3i5s87ziqohxo
11742 phasefx at batrepo-20091014063644-pn3a6urkw3uxgr6n
12108 phasefx at batrepo-20091120084700-lavt73oserscgalf
12166 jason at esilibrary.com-20091202233906-g8kh2kh3qmmz66r1
12184 jason at esilibrary.com-20091204161020-0dqezh01c05btffh
12198 jason at esilibrary.com-20091208140008-eofwdbn2u8dxk2kk
12199 jason at esilibrary.com-20091208155412-4qdzy8sgs51vm0yq
12215 jason at esilibrary.com-20091209133642-bp8mb3tc5vpoc1ij
12220 jason at esilibrary.com-20091209143447-i1st1to8ln4hhwyb
12231 jason at esilibrary.com-20091209221438-vv4crqppm8ajj3dr
12804 jason at esilibrary.com-20100324194046-jza2ic2dlpq8txhc
12946 miker at esilibrary.com-20100402183612-8xznj35wfohk7zyu
12955 miker at esilibrary.com-20100403141037-h8d57ryrmkkg9yhb
12971 miker at whirly-20100405202254-aztbsf3p3eey9e8e
12997 miker at esilibrary.com-20100408154146-zodwuxxizwf0y449
13010 miker at miker-msi-20100409021618-5f0ohbg5cgi5pai0
13014 miker at esilibrary.com-20100409135406-mitf09aw1srnps3g
13022 miker at esilibrary.com-20100412144909-fc4bx1n80ac0z8ox
13023 miker at esilibrary.com-20100412145629-92g9jts2k8yqsm38
13152 miker at esilibrary.com-20100503010126-67i6kclipxip27du
13153 miker at esilibrary.com-20100503010322-3ri56680p7bf4o26
13161 miker at esilibrary.com-20100504150623-34h9t5p64cd52swu
13163 miker at esilibrary.com-20100504180646-77rxefvetqkiyo3s
13164 miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk
13175 miker at esilibrary.com-20100506194925-xg5folqttvehr2np
13306 miker at esilibrary.com-20100601190218-nf7sqyxzgsylm94f
13533 miker at esilibrary.com-20100629181055-xsdvq3z3mhylm0vb
Name: bzr:text-parents
- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm svn-v4:dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:14178
Open-ILS/web/js/dojo/openils/BibTemplate.js miker at esilibrary.com-20100504182041-0s81n6j3dxb14hrk
+ Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm svn-v4:dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:16765
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm svn-v4:dcc99617-32d9-48b4-a31d-7c20da2025e4:trunk:16761
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2010-06-29 18:08:14 UTC (rev 16828)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2010-06-29 18:10:55 UTC (rev 16829)
@@ -1672,6 +1672,7 @@
# ... and a MODS clone to populate, with guts removed.
my $mods = $_parser->parse_string($master)->documentElement;
+ $mods->setNamespace('http://www.loc.gov/mods/', undef);
$mods->setNamespace( "http://www.loc.gov/mods/", "mods", 1 );
($mods) = $mods->findnodes('//mods:mods');
$mods->removeChildNodes;
@@ -1679,11 +1680,11 @@
# Add the metarecord ID as a (locally defined) info URI
my $recordInfo = $mods
->ownerDocument
- ->createElement("mods:recordInfo");
+ ->createElement("recordInfo");
my $recordIdentifier = $mods
->ownerDocument
- ->createElement("mods:recordIdentifier");
+ ->createElement("recordIdentifier");
my ($year,$month,$day) = reverse( (localtime)[3,4,5] );
$year += 1900;
@@ -1740,23 +1741,23 @@
my $relatedItem = $mods
->ownerDocument
- ->createElement("mods:relatedItem");
+ ->createElement("relatedItem");
$relatedItem->setAttribute( type => 'constituent' );
my $identifier = $mods
->ownerDocument
- ->createElement("mods:identifier");
+ ->createElement("identifier");
$identifier->setAttribute( type => 'uri' );
my $subRecordInfo = $mods
->ownerDocument
- ->createElement("mods:recordInfo");
+ ->createElement("recordInfo");
my $subRecordIdentifier = $mods
->ownerDocument
- ->createElement("mods:recordIdentifier");
+ ->createElement("recordIdentifier");
my $subid = $map->source;
$subRecordIdentifier->appendTextNode(
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-06-29 18:08:14 UTC (rev 16828)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-06-29 18:10:55 UTC (rev 16829)
@@ -364,7 +364,7 @@
if (!$format) {
my $body = "Content-type: application/xml; charset=utf-8\n\n";
- if ($uri =~ m{^tag:[^:]+:([^\/]+)/(\d+)(?:\[([0-9,]+)\])?(?:/(.+))?}o) {
+ if ($uri =~ m{^tag:[^:]+:([^\/]+)/([^\/[]+)(?:\[([0-9,]+)\])?(?:/(.+))?}o) {
$id = $2;
$paging = $3;
$lib = uc($4);
@@ -453,20 +453,21 @@
return Apache2::Const::OK;
}
- if ($uri =~ m{^tag:[^:]+:([^\/]+)/(\d+)(?:\[([0-9,]+)\])?(?:/(.+))?}o) {
+ my $scheme;
+ if ($uri =~ m{^tag:[^:]+:([^\/]+)/([^\/[]+)(?:\[([0-9,]+)\])?(?:/(.+))?}o) {
+ $scheme = $1;
$id = $2;
$paging = $3;
($lib,$depth) = split('/', $4);
$type = 'record';
- $type = 'metarecord' if ($1 =~ /^metabib/o);
- $type = 'isbn' if ($1 =~ /^isbn/o);
- $type = 'call_number' if ($1 =~ /^call_number/o);
- $type = 'acp' if ($1 =~ /^asset-copy/o);
- $type = 'acn' if ($1 =~ /^asset-call_number/o);
- $type = 'auri' if ($1 =~ /^asset-uri/o);
- $type = 'authority' if ($1 =~ /^authority/o);
+ $type = 'metarecord' if ($scheme =~ /^metabib/o);
+ $type = 'isbn' if ($scheme =~ /^isbn/o);
+ $type = 'acp' if ($scheme =~ /^asset-copy/o);
+ $type = 'acn' if ($scheme =~ /^asset-call_number/o);
+ $type = 'auri' if ($scheme =~ /^asset-uri/o);
+ $type = 'authority' if ($scheme =~ /^authority/o);
$command = 'retrieve';
- $command = 'browse' if ($type eq 'call_number');
+ $command = 'browse' if (grep { $scheme eq $_ } qw/call_number title author subjet topic authority.title authority.author authority.subject authority.topic series item-age/);
}
if ($paging) {
@@ -489,8 +490,8 @@
my $ou_types = $actor->request( 'open-ils.actor.org_types.retrieve' )->gather(1);
my $lib_depth = $depth || (grep { $_->id == $lib_object->ou_type } @$ou_types)[0]->depth;
- if ($type eq 'call_number' and $command eq 'browse') {
- print "Location: $root/browse/$base_format/call_number/$lib/$id\n\n";
+ if ($command eq 'browse') {
+ print "Location: $root/browse/$base_format/$scheme/$lib/$id\n\n";
return 302;
}
@@ -583,7 +584,7 @@
my $method = "open-ils.supercat.$type.$base_format.$command";
my @params = ($id);
- push @params, $lib, $flesh_feed, $paging if ($base_format eq 'holdings_xml');
+ push @params, $lib, $lib_depth, $flesh_feed, $paging if ($base_format eq 'holdings_xml');
my $req = $supercat->request($method, at params);
my $data = $req->gather();
@@ -1340,8 +1341,12 @@
my $base = $cgi->url;
my $host = $cgi->virtual_host || $cgi->server_name;
- my $year = (gmtime())[5] + 1900;
+ my ($year,$month,$day) = reverse( (localtime)[3,4,5] );
+ $year += 1900;
+ $month += 1;
+ my $tag_prefix = sprintf("tag:open-ils.org,$year-\%0.2d-\%0.2d", $month, $day);
+
my $flesh_feed = parse_feed_type($type);
$type =~ s/(-full|-uris)$//o;
@@ -1362,11 +1367,12 @@
#my $rec = $record->id;
my $rec = $record;
- my $item_tag = "tag:$host,$year:biblio-record_entry/$rec/$lib";
- $item_tag = "tag:$host,$year:isbn/$rec/$lib" if ($search eq 'isbn');
+ my $item_tag = "$tag_prefix:biblio-record_entry/$rec/$lib";
+ $item_tag = "$tag_prefix:metabib-metarecord/$rec/$lib" if ($search eq 'metarecord');
+ $item_tag = "$tag_prefix:isbn/$rec/$lib" if ($search eq 'isbn');
$item_tag .= "/$depth" if (defined($depth));
- $item_tag = "tag:$host,$year:authority-record_entry/$rec" if ($search eq 'authority');
+ $item_tag = "$tag_prefix:authority-record_entry/$rec" if ($search eq 'authority');
my $xml = $supercat->request(
"open-ils.supercat.$search.$type.retrieve",
More information about the open-ils-commits
mailing list