@@ -, +, @@
https://github.com/fredericd/coce
- CoceHost - URL of Coce server
- CoceProviders - Ordered list of requested providers. For example
gb,aws,ol, will return the first available URL from those providers.
- If a book cover is not available from a provider, but is available
from another one, Koha will be able to display a book cover, which
isn't the case now
- Since URLs are cached, it isn't necessary for each book cover to
request, again and again, the provider, and several of them if
necessary.
- Amazon book covers are retrieved with Amazon Product Advertising
API, which means that more covers are retrieved (ISBN13).
- Apply this patch, and test with 'Bootstrap' themes
- You can verify that nothing has changed on OPAC result and detail
page, since new syspref haven't been filled
- Install Code: https://github.com/fredericd/coce
Or ask me directly for the URL of a Coce server
- In sysprefs, tab Enhanced content, modify:
CoceHost -- enter the URL of your Coce server
CoceProviders -- fill with: gb,aws,ol
- Do a search. On result page, and detail page, you will see cover
images originating from the 3 providers: fly over the image to see its
URL. Try to compare with a Koha with just GoogleJacket or Amazon cover
to confirm that you have more images. Verify that it's quick, and even
quicker for cached images URLs.
- Check that Browse Shelf functionnality works properly.
- The ID sent to Coce is EAN or ISBN. Try with various type of biblios. DVD
have often EAN, but no ISBN.
- You can try with those sysprefs:
CoceProviders: aws,gb
CoceHost: http://coce.tamil.fr:8080
and this EAN (or ISBN): 3333297517744
=> OPACAmazonCoverImages enabled doesn't display a cover because, it's a DVD
=> Coce find and display the DVD cover.
---
C4/ShelfBrowser.pm | 2 +
installer/data/mysql/sysprefs.sql | 2 +
installer/data/mysql/updatedatabase.pl | 15 ++++++++
.../admin/preferences/enhanced_content.pref | 9 +++++
.../bootstrap/en/includes/opac-bottom.inc | 9 +++++
.../bootstrap/en/includes/shelfbrowser.inc | 6 ++-
.../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 14 +++++++
.../opac-tmpl/bootstrap/en/modules/opac-results.tt | 10 +++++
koha-tmpl/opac-tmpl/bootstrap/js/coce.js | 43 ++++++++++++++++++++++
9 files changed, 109 insertions(+), 1 deletion(-)
create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/coce.js
--- a/C4/ShelfBrowser.pm
+++ a/C4/ShelfBrowser.pm
@@ -73,6 +73,7 @@ to take into account.
print $_->{browser_normalized_upc};
print $_->{browser_normalized_oclc};
print $_->{browser_normalized_isbn};
+ print $_->{browser_normalized_ean};
}
# This is the information required to scroll the browser to the next left
@@ -228,6 +229,7 @@ sub GetShelfInfo {
$item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
$item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
$item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
+ $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
push @valid_items, $item;
}
return @valid_items;
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -87,6 +87,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'),
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
+('CoceHost', NULL, NULL, 'Coce server URL', 'Free'),
+('CoceProviders', NULL, NULL, 'Coce providers, for example aws,gb', 'Free'),
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'),
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'),
--- a/installer/data/mysql/updatedatabase.pl
+++ a/installer/data/mysql/updatedatabase.pl
@@ -9585,6 +9585,21 @@ if ( CheckVersion($DBversion) ) {
SetVersion ($DBversion);
}
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
+ VALUES('CoceHost', NULL, 'Coce server URL', NULL,'Free')
+ });
+ $dbh->do(q{
+ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
+ VALUES('CoceProviders', NULL, 'Coce Providers, for example: aws,gb', NULL,'Free')
+ });
+ print "Upgrade to $DBversion done (Bug 9580 - Cover image from Coce, a remote image URL cache)\n";
+ SetVersion($DBversion);
+}
+
+
=head1 FUNCTIONS
=head2 TableExists($table)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
@@ -337,3 +337,12 @@ Enhanced Content:
- "Show items from the OverDrive catalog of library #"
- pref: OverDriveLibraryID
- .
+ Coce Cover images cache:
+ -
+ - Coce server URL
+ - pref: CoceHost
+ class: url
+ -
+ - Providers
+ - pref: CoceProviders
+ - 'separated by comma, for example: aws,gb. Leave empty not to activate this service.'
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc
@@ -165,6 +165,15 @@ $.widget.bridge('uitooltip', $.ui.tooltip);
//]]>
[% END %]
+[% IF Koha.Preference('CoceProviders') %]
+
+
+[% END %]
+
[% IF OpenLibraryCovers %]