[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9c92ac7d5fca16f668232bc94ef969209a71951e

Evergreen Git git at git.evergreen-ils.org
Mon Aug 17 12:39:14 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  9c92ac7d5fca16f668232bc94ef969209a71951e (commit)
       via  7008535f27347bdd23ebca68ed75afdbe9661b8d (commit)
       via  bc44b326c603f0d730275f6f5bbb18459d1c064b (commit)
       via  5866795d8f73fb384974dfeb1816071ab9707525 (commit)
       via  389f904b4701821f948fea1f2e3e37abc2cdb1f2 (commit)
      from  8d14cfb562d8e72e25a7d90cbb5370bf904ccf1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9c92ac7d5fca16f668232bc94ef969209a71951e
Author: Ben Shum <bshum at biblio.org>
Date:   Mon Aug 17 12:38:39 2015 -0400

    LP#1435938: Add release note for clear Added Content cache link
    
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Client/clear-added-content-cache.txt b/docs/RELEASE_NOTES_NEXT/Client/clear-added-content-cache.txt
new file mode 100644
index 0000000..7c63721
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Client/clear-added-content-cache.txt
@@ -0,0 +1,6 @@
+Link in catalog to clear Added Content cache
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+On the catalog's record summary page, there is now a link for staff that
+allow them to forcibly clear the cache for the Added Content for that
+record. This is helpful for if the Added Content retrieved the wrong
+cover jacket art, summary, etc. and caches the wrong result.

commit 7008535f27347bdd23ebca68ed75afdbe9661b8d
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Jun 10 12:41:45 2015 -0400

    LP#1435938: Set no_cache on AC clear response
    
    So that the clearing itself isn't cached.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
index ba770d1..a1f1767 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
@@ -134,6 +134,7 @@ sub handler {
     return Apache2::Const::NOT_FOUND unless $handler and $type and $format and $cachekey;
 
     if ($type eq "clearcache") {
+        $r->no_cache(1); # Don't cache the clear cache info
         return $AC->clear_cache($format, $cachekey);
     }
 

commit bc44b326c603f0d730275f6f5bbb18459d1c064b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Mar 24 11:13:36 2015 -0400

    LP#1435938: Wrap auth check around clearcache URLs
    
    Only allow staff to clear the cache values.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in
index 771ed62..1144f4c 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache/eg_vhost.conf.in
@@ -52,6 +52,12 @@ OSRFTranslatorConfig @sysconfdir@/opensrf_core.xml
     allow from all
 </Location>
 
+# Lock clearing cache down to STAFF_LOGIN
+<Location /opac/extras/ac/clearcache/>
+    PerlAccessHandler OpenILS::WWW::AccessHandler
+    PerlSetVar OILSAccessHandlerPermission "STAFF_LOGIN"
+</Location>
+
 # Autosuggest for searches
 <Location /opac/extras/autosuggest>
     SetHandler perl-script
diff --git a/Open-ILS/examples/apache_24/eg_vhost.conf.in b/Open-ILS/examples/apache_24/eg_vhost.conf.in
index c6ce1c7..851db16 100644
--- a/Open-ILS/examples/apache_24/eg_vhost.conf.in
+++ b/Open-ILS/examples/apache_24/eg_vhost.conf.in
@@ -52,6 +52,12 @@ OSRFTranslatorConfig @sysconfdir@/opensrf_core.xml
     Require all granted 
 </Location>
 
+# Lock clearing cache down to STAFF_LOGIN
+<Location /opac/extras/ac/clearcache/>
+    PerlAccessHandler OpenILS::WWW::AccessHandler
+    PerlSetVar OILSAccessHandlerPermission "STAFF_LOGIN"
+</Location>
+
 # Autosuggest for searches
 <Location /opac/extras/autosuggest>
     SetHandler perl-script

commit 5866795d8f73fb384974dfeb1816071ab9707525
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Mar 24 10:37:41 2015 -0400

    LP#1435938: Add link to clear cache from staff client
    
    New functionality isn't all that useful without an access point, after all.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index 2accfff..618a887 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -83,6 +83,13 @@
                      [% l('Permalink') %]
                 </a>
             </div>
+            [%- IF ctx.is_staff %]
+            <div class="rdetail_aux_utils clear_addedcontent_cache">
+                <a href="[% ctx.media_prefix %]/opac/extras/ac/clearcache/all/r/[% ctx.bre_id | uri %]" class="no-dec" target="_blank">
+                     [% l('Clear AddedContent Cache') %]
+                </a>
+            </div>
+            [%- END %]
         </div>
     </div>
 </div>

commit 389f904b4701821f948fea1f2e3e37abc2cdb1f2
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Mar 24 10:28:32 2015 -0400

    LP#1435938: AddedContent: Add "clearcache" functionality
    
    Intended use: When staff edit a record's identifiers they can manually clear
    the AddedContent cashe.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
index cd24243..ba770d1 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent.pm
@@ -45,6 +45,15 @@ my $error_countdown; # current consecutive errors countdown
 # is attempted after lookups have been disabled
 my $error_retry_timeout;
 
+# Cache Types/Formats for clearing purposes
+my %cachetypes = (
+    jacket => ['small','medium','large'],
+    toc => ['html','json','xml'],
+    anotes => ['html','json','xml'],
+    excerpt => ['html','json','xml'],
+    reviews => ['html','json','xml'],
+    summary => ['html','json','xml'],
+);
 
 sub child_init {
 
@@ -124,6 +133,10 @@ sub handler {
 
     return Apache2::Const::NOT_FOUND unless $handler and $type and $format and $cachekey;
 
+    if ($type eq "clearcache") {
+        return $AC->clear_cache($format, $cachekey);
+    }
+
     my $err;
     my $data;
     my $method = "${type}_${format}";
@@ -330,6 +343,36 @@ sub serve_from_cache {
     return $class->print_content($data, 1);
 }
 
+sub delete_from_cache {
+    my($class, $type, $format, $key) = @_;
+    my $data = $cache->get_cache("ac.$type.$format.$key");
+    if ($data) {
+        $logger->debug("deleting $type/$format/$key from cache");
+        $cache->delete_cache("ac.$type.$format.$key");
+        return 1;
+    }
+    return 0;
+}
 
+sub clear_cache {
+    my($class, $category, $key) = @_;
+    my $data = {
+        content_type => 'text/plain',
+        content => "Checking/Clearing Cache Entries for $key\n"
+    };
+    my @cleartypes = ($category);
+    if ($category eq 'all') {
+        @cleartypes = keys(%cachetypes);
+    }
+    for my $type (@cleartypes) {
+        for my $format (@{$cachetypes{$type}}) {
+            if ($class->delete_from_cache($type, $format, $key)) {
+                $data->{content} .= "Cleared $type/$format\n";
+            }
+        }
+    }
+    $data->{content} .= "Done Checking $key\n";
+    return $class->print_content($data, 0);
+}
 
 1;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/apache/eg_vhost.conf.in          |    6 +++
 Open-ILS/examples/apache_24/eg_vhost.conf.in       |    6 +++
 .../src/perlmods/lib/OpenILS/WWW/AddedContent.pm   |   44 ++++++++++++++++++++
 .../src/templates/opac/parts/record/summary.tt2    |    7 +++
 .../Client/clear-added-content-cache.txt           |    6 +++
 5 files changed, 69 insertions(+), 0 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Client/clear-added-content-cache.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list