[open-ils-commits] r17604 - in branches/rel_2_0/Open-ILS: examples examples/apache src/perlmods/OpenILS/Application/Search web/js/dojo/openils/widget (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 11 10:51:20 EDT 2010
Author: miker
Date: 2010-09-11 10:51:18 -0400 (Sat, 11 Sep 2010)
New Revision: 17604
Modified:
branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf
branches/rel_2_0/Open-ILS/examples/openils.profile.js
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js
Log:
Backporting 17856, 17587, 17593, 17601 and 17603 from trunk: mod_deflate support; improved and expanded dojo layers; support for limiting facet retrieval in IE to just the initially displayed set (IE is terrible with large data sets)
Modified: branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf
===================================================================
--- branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf 2010-09-11 14:18:24 UTC (rev 17603)
+++ branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf 2010-09-11 14:51:18 UTC (rev 17604)
@@ -128,7 +128,66 @@
</LocationMatch>
+<Location /opac/>
+ # ----------------------------------------------------------------------------------
+ # Some mod_deflate fun
+ # ----------------------------------------------------------------------------------
+ <IfModule mod_deflate.c>
+ SetOutputFilter DEFLATE
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+ <IfModule mod_headers.c>
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+
+</Location>
+
+<Location //opac/>
+ # ----------------------------------------------------------------------------------
+ # Some mod_deflate fun
+ # ----------------------------------------------------------------------------------
+ <IfModule mod_deflate.c>
+ SetOutputFilter DEFLATE
+
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+ <IfModule mod_headers.c>
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+
+</Location>
+
+<Location /js/>
+ # ----------------------------------------------------------------------------------
+ # Some mod_deflate fun
+ # ----------------------------------------------------------------------------------
+ <IfModule mod_deflate.c>
+ SetOutputFilter DEFLATE
+
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
+ BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
+
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
+
+ <IfModule mod_headers.c>
+ Header append Vary User-Agent env=!dont-vary
+ </IfModule>
+ </IfModule>
+
+</Location>
+
# ----------------------------------------------------------------------------------
# Force SSL on the OPAC's "My Account" page
# ----------------------------------------------------------------------------------
@@ -472,4 +531,15 @@
SetHandler None
</LocationMatch>
+# ----------------------------------------------------------------------------------
+# Some mod_deflate logging setup
+# ----------------------------------------------------------------------------------
+<IfModule mod_deflate.c>
+ DeflateFilterNote Input instream
+ DeflateFilterNote Output outstream
+ DeflateFilterNote Ratio ratio
+ LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
+ CustomLog /var/log/apache2/deflate_log deflate
+</IfModule>
+
Modified: branches/rel_2_0/Open-ILS/examples/openils.profile.js
===================================================================
--- branches/rel_2_0/Open-ILS/examples/openils.profile.js 2010-09-11 14:18:24 UTC (rev 17603)
+++ branches/rel_2_0/Open-ILS/examples/openils.profile.js 2010-09-11 14:51:18 UTC (rev 17604)
@@ -1,50 +1,223 @@
-dependencies ={
- layers: [
-{
- name: "openils_dojo.js",
- dependencies: [
+dependencies = {
+ layers: [{
+ name: "openils_all_opac_dojo.js",
+ dependencies: [
+
+ "dijit._Calendar",
+ "dijit.Menu",
+ "dojo.io.script",
+ "dijit.Dialog",
+ "dijit.form.Button",
+ "dijit.form.CheckBox",
"dijit.form.CurrencyTextBox",
- "dijit.Menu",
+ "dijit.form.DateTextBox",
"dijit.form.FilteringSelect",
+ "dijit.form._FormWidget",
+ "dijit.form.NumberSpinner",
+ "dijit.form.NumberTextBox",
+ "dijit.form.TextBox",
+ "dijit.form.ValidationTextBox",
+ "dijit.layout.ContentPane",
+ "dijit.ProgressBar",
+ "dijit._Templated",
+ "dijit._Widget",
+ "dojo.cookie",
+ "dojo.data.ItemFileReadStore",
+ "dojo.data.ItemFileWriteStore",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.query",
+ "dojo.string",
"dojox.grid.compat._data.dijitEditors",
+ "dojox.grid.compat._data.editors",
+ "dojox.grid.compat._data.model",
+ "dojox.grid.DataGrid",
+ "dojox.grid.Grid",
"dojox.jsonPath",
+ "dojox.xml.parser"
+ ]
+ },{
+ name: "openils_ui_dojo.js",
+ dependencies: [
+ "dijit.Dialog",
+ "dijit.form.Button",
+ "dijit.form.CheckBox",
+ "dijit.form.ComboBox",
+ "dijit.form.CurrencyTextBox",
+ "dijit.form.DateTextBox",
+ "dijit.form.DropDownButton",
+ "dijit.form.FilteringSelect",
+ "dijit.form.Form",
+ "dijit.form.NumberSpinner",
+ "dijit.form.NumberTextBox",
+ "dijit.form.RadioButton",
+ "dijit.form.Textarea",
+ "dijit.form.TextBox",
+ "dijit.form.TimeTextBox",
+ "dijit.layout.ContentPane",
+ "dijit.layout.LayoutContainer",
+ "dijit.layout.SplitContainer",
+ "dijit.layout.StackContainer",
+ "dijit.layout.TabContainer",
+ "dijit.Menu",
+ "dijit.MenuItem",
"dijit.ProgressBar",
"dijit.Toolbar",
- "dijit.form.TextBox",
+ "dijit.Tooltip",
+ "dijit.TooltipDialog",
+ "dojo.cookie",
+ "dojo.data.ItemFileReadStore",
+ "dojo.data.ItemFileWriteStore",
+ "dojo.date",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.dnd.Container",
+ "dojo.dnd.Source",
+ "dojo.io.iframe",
+ "dojo.parser",
+ "dojo.string",
+ "dojox.encoding.base64",
+ "dojox.form.CheckedMultiSelect",
+ "dojox.grid.cells.dijit",
"dojox.grid.DataGrid",
- "dojox.fx",
- "dijit.layout.BorderContainer",
"dojox.grid.Grid",
+ "dojox.string.sprintf",
+ "dojox.widget.PlaceholderMenuItem",
+ "dojox.xml.parser"
+ ]
+ },{
+ name: "openils_full_dojo.js",
+ dependencies: [
+ "dijit._Calendar",
+ "dijit.Dialog",
+ "dijit.form.Button",
+ "dijit.form.CheckBox",
+ "dijit.form.ComboBox",
+ "dijit.form.CurrencyTextBox",
+ "dijit.form.DateTextBox",
+ "dijit.form.DropDownButton",
+ "dijit.form.FilteringSelect",
+ "dijit.form.Form",
+ "dijit.form._FormWidget",
+ "dijit.form.NumberSpinner",
+ "dijit.form.NumberTextBox",
+ "dijit.form.RadioButton",
+ "dijit.form.Textarea",
+ "dijit.form.TextBox",
+ "dijit.form.TimeTextBox",
"dijit.form.ValidationTextBox",
- "dijit.form.ComboBox",
+ "dijit.layout.BorderContainer",
+ "dijit.layout.ContentPane",
"dijit.layout.LayoutContainer",
+ "dijit.layout.SplitContainer",
+ "dijit.layout.StackContainer",
+ "dijit.layout.TabContainer",
+ "dijit.Menu",
+ "dijit.MenuItem",
+ "dijit.ProgressBar",
+ "dijit._Templated",
+ "dijit.Toolbar",
+ "dijit.Tooltip",
+ "dijit.TooltipDialog",
"dijit.Tree",
- "dijit.form.NumberSpinner",
- "dijit.Tooltip",
- "dojox.widget.PlaceholderMenuItem",
- "dijit.form.Form",
- "dijit.form.Textarea",
+ "dijit._Widget",
+ "dojo.cookie",
"dojo.data.ItemFileReadStore",
"dojo.data.ItemFileWriteStore",
+ "dojo.date",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.dnd.Container",
+ "dojo.dnd.Source",
+ "dojo.io.iframe",
+ "dojo.io.script",
+ "dojo.parser",
+ "dojo.query",
+ "dojo.string",
+ "dojox.encoding.base64",
+ "dojox.form.CheckedMultiSelect",
+ "dojox.fx",
+ "dojox.grid.cells.dijit",
+ "dojox.grid.compat._data.dijitEditors",
+ "dojox.grid.compat._data.editors",
+ "dojox.grid.compat._data.model",
+ "dojox.grid.DataGrid",
+ "dojox.grid.Grid",
+ "dojox.jsonPath",
+ "dojox.string.sprintf",
+ "dojox.widget.PlaceholderMenuItem",
+ "dojox.widget.Toaster",
+ "dojox.xml.parser"
+ ]
+ },{
+ name: "openils_opac_dojo.js",
+ dependencies: [
+ "dijit._Calendar",
+ "dijit.Dialog",
"dijit.form.Button",
"dijit.form.DateTextBox",
- "dijit.layout.ContentPane",
+ "dijit.form.FilteringSelect",
+ "dijit.form.TextBox",
+ "dijit.Menu",
+ "dojo.cookie",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.io.script",
+ "dojo.parser"
+ ]
+ },{
+ name: "openils_dojo.js",
+ dependencies: [
+ "dijit._Calendar",
"dijit.Dialog",
- "dojox.widget.Toaster",
+ "dijit.form.Button",
+ "dijit.form.DateTextBox",
+ "dijit.form.FilteringSelect",
+ "dijit.form.TextBox",
+ "dijit.Menu",
+ "dojo.cookie",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.io.script",
+ "dojo.parser"
+ ]
+ },{
+ name: "openils_dojo_dojo.js",
+ dependencies: [
+ "dijit.Dialog",
+ "dijit.form.Button",
+ "dijit.form.CheckBox",
+ "dijit.form.CurrencyTextBox",
+ "dijit.form.DateTextBox",
+ "dijit.form.FilteringSelect",
+ "dijit.form._FormWidget",
+ "dijit.form.NumberSpinner",
"dijit.form.NumberTextBox",
- "dijit.layout.SplitContainer",
- "dojox.form.CheckedMultiSelect",
- "dijit.form.TimeTextBox",
- "dijit.form.CheckBox",
- "dijit.layout.TabContainer",
- "dojo.io.script"
- ]
-}
-
- ],
+ "dijit.form.TextBox",
+ "dijit.form.ValidationTextBox",
+ "dijit.layout.ContentPane",
+ "dijit.ProgressBar",
+ "dijit._Templated",
+ "dijit._Widget",
+ "dojo.cookie",
+ "dojo.data.ItemFileReadStore",
+ "dojo.data.ItemFileWriteStore",
+ "dojo.date.locale",
+ "dojo.date.stamp",
+ "dojo.query",
+ "dojo.string",
+ "dojox.grid.compat._data.dijitEditors",
+ "dojox.grid.compat._data.editors",
+ "dojox.grid.compat._data.model",
+ "dojox.grid.DataGrid",
+ "dojox.grid.Grid",
+ "dojox.jsonPath",
+ "dojox.xml.parser"
+ ]
+ }],
prefixes: [
- [ "dijit", "../dijit" ],
- [ "dojox", "../dojox" ]
- ]
+ [ "dijit", "../dijit" ],
+ [ "dojox", "../dojox" ]
+ ]
};
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-09-11 14:18:24 UTC (rev 17603)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-09-11 14:51:18 UTC (rev 17604)
@@ -1319,7 +1319,24 @@
return undef unless ($key and $key =~ /_facets$/);
- return $cache->get_cache($key) || {};
+ my $blob = $cache->get_cache($key) || {};
+
+ my $facets = {};
+ if ($limit) {
+ for my $f ( keys %$blob ) {
+ my @sorted = map{ { $$_[1] => $$_[0] } } sort {$$b[0] <=> $$a[0] || $$a[1] cmp $$b[1]} map { [$$blob{$f}{$_}, $_] } keys %{ $$blob{$f} };
+ @sorted = @sorted[0 .. $limit - 1] if (scalar(@sorted) > $limit);
+ for my $s ( @sorted ) {
+ my ($k) = keys(%$s);
+ my ($v) = values(%$s);
+ $$facets{$f}{$k} = $v;
+ }
+ }
+ } else {
+ $facets = $blob;
+ }
+
+ return $facets;
}
__PACKAGE__->register_method(
Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js 2010-09-11 14:18:24 UTC (rev 17603)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js 2010-09-11 14:51:18 UTC (rev 17604)
@@ -47,12 +47,28 @@
if (openils.widget.Searcher._cache.facetData) {
this.facetData = openils.widget.Searcher._cache.facetData;
+ this._render_callback();
} else {
- var facetData = fieldmapper.standardRequest( [ 'open-ils.search', 'open-ils.search.facet_cache.retrieve'], this.facetCacheKey );
- if (!facetData) return;
- this.facetData = openils.widget.Searcher._cache.facetData = facetData;
+ var limit = dojo.isIE ? this.facetLimit : null;
+ var self = this;
+ fieldmapper.standardRequest(
+ [ 'open-ils.search', 'open-ils.search.facet_cache.retrieve'],
+ { async : true,
+ params : [this.facetCacheKey, limit],
+ oncomplete : function(r) {
+ var facetData = r.recv().content();
+ if (!facetData) return;
+ self.facetData = openils.widget.Searcher._cache.facetData = facetData;
+ self._render_callback();
+ }
+ }
+ );
}
+ },
+
+ _render_callback : function(facetData) {
+ var facetData = this.facetData;
var classes = openils.widget.Searcher._cache.arr.cmc;
if (this.classOrder && this.classOrder.length > 0) {
classes = [];
More information about the open-ils-commits
mailing list