100 likes | 110 Views
Enhance OpenSearch with an accessible human-readable bibliography view through customization for Evergreen bookbags. Steps involve creating HTML stylesheets and modifying Perl modules. Additionally, make changes to SuperCat module for additional functionality and update OPAC Bookbags for the new view. Check out the implementation patch for details.
E N D
Evergreen Customization 5 hours and 5k later
Goal: Create a human-readable bibliography view in OpenSearch and make it accessible from Evergreen bookbags Steps: 1. Create htmlBibliography xml stylesheet 2. Add feed to perl modules 3. Add bibliography view option to bookbags
Add HTML Bibliography Stylesheet Copy the htmlcard xml stylesheet file to htmlBibliography xml stylesheet. Edit htmlbibliography stylesheet: • remove linked text • edit page style • edit marc tag information as necessary
Edit Perl Modules Edit feed.pm Add reference to htmlbibliography stylesheet Edit supercat.pm add htmlbibliography-full format tags and feed references. SuperCat adds links to the feeds themselves after the raw MARCXML is transformed, it modifies the output to add the extra links.
feed.pm Changes +package OpenILS::WWW::SuperCat::Feed::htmlbibliography;+use base 'OpenILS::WWW::SuperCat::Feed::htmlcard';++sub new {+ my $class = shift;+ my $self = $class->SUPER::new;+ $self->{xsl} = "/MARC21slim2HumanBibliography.xsl";+ return $self;+}++package OpenILS::WWW::SuperCat::Feed::htmlbibliography::item;+use base 'OpenILS::WWW::SuperCat::Feed::htmlcard::item';++ package OpenILS::WWW::SuperCat::Feed::marctxt; use base 'OpenILS::WWW::SuperCat::Feed::marcxml';
SuperCat.pm Changes - push @$list, 'htmlholdings','html', 'marctxt';+ push @$list, 'htmlholdings','html', 'marctxt', 'htmlbibliography';+ <format name='htmlbibliography-full' type='text/html'/>+ <format name='htmlbibliography-full' type='text/html'/>- qw/opac html htmlholdings marctxt/+ qw/opac html htmlholdings marctxt htmlbibliography/+ $feed->link(bibliography => $base . "/htmlbibliography-full/$id" => 'text/html'); + $feed->link(htmlbibliography => $base . "/htmlbibliography-full/$rtype/$axis/$limit/$date" => 'text/html');+ $feed->link(+ 'htmlbibliography-full' =>+ $base . "/$version/$org/htmlbibliography-full/$class?searchTerms=$terms&searchSort=$sort&searchSortDir=$sortdir&searchLang=$lang" =>+ 'text/html'+ );+ $feed->link( 'unapi-server' => $unapi);
More SuperCat.pm Changes - $type = 'marcxml' if (($type eq 'htmlholdings') || ($type eq 'marctxt'));+ $type = 'marcxml' if (($type eq 'htmlholdings') || ($type eq 'marctxt') || ($type eq 'htmlbibliography'));+ $node->link(bibliography => $feed->unapi . "?id=$item_tag&format=htmlbibliography-full" => 'text/html');
Add View from OPAC Bookbags • Create myopac.bibliography entity in opac.dtd • Add entity to myopac_bookbags.xml • Set link attributes in myopac.js
Opac.dtd +<!ENTITY myopac.bibliography "(Bibliography)"> myopac.js + link = $n(row, 'myopac_bb_published_bibliography');+ link.setAttribute('href', buildExtrasLink( 'feed/bookbag/htmlbibliography-full/'+cont.id(), false)); + link.setAttribute('target', '_blank' );+ unHideMe(link); myopac_bookbags.xml + <a name='myopac_bb_published_bibliography' class='classic_link hide_me'>&myopac.bibliography;</a>
See it in action Patch for implementation: http://evergreen-server.mohawkcollege.ca/opac/extras/access09-EG-hackfest.bibliography.tgz