eea.facetednavigation 16.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eea/facetednavigation/README.txt +34 -0
- eea/facetednavigation/__init__.py +10 -0
- eea/facetednavigation/browser/__init__.py +2 -0
- eea/facetednavigation/browser/app/__init__.py +2 -0
- eea/facetednavigation/browser/app/catalog.py +43 -0
- eea/facetednavigation/browser/app/configure.py +307 -0
- eea/facetednavigation/browser/app/counter.py +77 -0
- eea/facetednavigation/browser/app/error.py +28 -0
- eea/facetednavigation/browser/app/exportimport.py +85 -0
- eea/facetednavigation/browser/app/query.py +209 -0
- eea/facetednavigation/browser/app/schema.py +39 -0
- eea/facetednavigation/browser/app/view.py +169 -0
- eea/facetednavigation/browser/configure.zcml +155 -0
- eea/facetednavigation/browser/interfaces.py +52 -0
- eea/facetednavigation/browser/javascript/edit.js +1198 -0
- eea/facetednavigation/browser/javascript/expand.js +107 -0
- eea/facetednavigation/browser/javascript/independent.js +25 -0
- eea/facetednavigation/browser/javascript/view.js +551 -0
- eea/facetednavigation/browser/static/30px.png +0 -0
- eea/facetednavigation/browser/static/32px.png +0 -0
- eea/facetednavigation/browser/static/README.md +6 -0
- eea/facetednavigation/browser/static/ajax-loader-small.gif +0 -0
- eea/facetednavigation/browser/static/ajax-loader.gif +0 -0
- eea/facetednavigation/browser/static/faceted-edit.css +325 -0
- eea/facetednavigation/browser/static/faceted-edit.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-edit.min.css +2 -0
- eea/facetednavigation/browser/static/faceted-edit.min.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-edit.min.js +1 -0
- eea/facetednavigation/browser/static/faceted-jquery.css +4117 -0
- eea/facetednavigation/browser/static/faceted-jquery.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-jquery.min.css +6 -0
- eea/facetednavigation/browser/static/faceted-jquery.min.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-jquery.min.js +2 -0
- eea/facetednavigation/browser/static/faceted-jquery.min.js.LICENSE.txt +263 -0
- eea/facetednavigation/browser/static/faceted-view.css +447 -0
- eea/facetednavigation/browser/static/faceted-view.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-view.min.css +2 -0
- eea/facetednavigation/browser/static/faceted-view.min.css.map +1 -0
- eea/facetednavigation/browser/static/faceted-view.min.js +1 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-bold-webfont.eot +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-bold-webfont.svg +2377 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-bold-webfont.ttf +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-bold-webfont.woff +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-extralight-webfont.eot +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-extralight-webfont.svg +2410 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-extralight-webfont.ttf +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-extralight-webfont.woff +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-regular-webfont.eot +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-regular-webfont.svg +2725 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-regular-webfont.ttf +0 -0
- eea/facetednavigation/browser/static/fonts/titillium/titilliumweb-regular-webfont.woff +0 -0
- eea/facetednavigation/browser/static/hide.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_444444_256x240.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_555555_256x240.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_777620_256x240.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_777777_256x240.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_cc0000_256x240.png +0 -0
- eea/facetednavigation/browser/static/images/ui-icons_ffffff_256x240.png +0 -0
- eea/facetednavigation/browser/static/select2-spinner.gif +0 -0
- eea/facetednavigation/browser/static/select2.png +0 -0
- eea/facetednavigation/browser/static/select2x2.png +0 -0
- eea/facetednavigation/browser/static/show.png +0 -0
- eea/facetednavigation/browser/static/throbber.gif +0 -0
- eea/facetednavigation/browser/stylesheets/edit.scss +383 -0
- eea/facetednavigation/browser/stylesheets/view.scss +126 -0
- eea/facetednavigation/browser/template/configure.pt +180 -0
- eea/facetednavigation/browser/template/counter.pt +0 -0
- eea/facetednavigation/browser/template/default.xml +54 -0
- eea/facetednavigation/browser/template/error.pt +15 -0
- eea/facetednavigation/browser/template/macros.pt +59 -0
- eea/facetednavigation/browser/template/query.pt +14 -0
- eea/facetednavigation/browser/template/simple_view.pt +9 -0
- eea/facetednavigation/browser/template/view.pt +34 -0
- eea/facetednavigation/browser/template/widgets.pt +57 -0
- eea/facetednavigation/caching/__init__.py +24 -0
- eea/facetednavigation/caching/cache.py +64 -0
- eea/facetednavigation/caching/configure.zcml +17 -0
- eea/facetednavigation/caching/nocache.py +24 -0
- eea/facetednavigation/config.py +6 -0
- eea/facetednavigation/configure.zcml +29 -0
- eea/facetednavigation/criteria/__init__.py +2 -0
- eea/facetednavigation/criteria/configure.zcml +12 -0
- eea/facetednavigation/criteria/handler.py +291 -0
- eea/facetednavigation/criteria/interfaces.py +7 -0
- eea/facetednavigation/criteria/utils.py +11 -0
- eea/facetednavigation/data/vocabularies/faceted_sortorder.vdex +115 -0
- eea/facetednavigation/docs/browser.txt +294 -0
- eea/facetednavigation/docs/counter.txt +76 -0
- eea/facetednavigation/docs/criteria.txt +134 -0
- eea/facetednavigation/docs/exportimport.txt +544 -0
- eea/facetednavigation/docs/facetednavigation.txt +113 -0
- eea/facetednavigation/docs/solr.txt +66 -0
- eea/facetednavigation/docs/syndication.txt +36 -0
- eea/facetednavigation/docs/unicode.txt +224 -0
- eea/facetednavigation/docs/versions.txt +175 -0
- eea/facetednavigation/docs/vocabularies.txt +69 -0
- eea/facetednavigation/docs/widgets.txt +10 -0
- eea/facetednavigation/docs/wrapper.txt +87 -0
- eea/facetednavigation/events.py +56 -0
- eea/facetednavigation/exportimport/__init__.py +2 -0
- eea/facetednavigation/exportimport/configure.zcml +27 -0
- eea/facetednavigation/exportimport/criteria.py +103 -0
- eea/facetednavigation/exportimport/criterion.py +75 -0
- eea/facetednavigation/exportimport/faceted.py +35 -0
- eea/facetednavigation/indexes/__init__.py +2 -0
- eea/facetednavigation/indexes/configure.zcml +8 -0
- eea/facetednavigation/indexes/language/__init__.py +2 -0
- eea/facetednavigation/indexes/language/adapter.py +77 -0
- eea/facetednavigation/indexes/language/configure.zcml +13 -0
- eea/facetednavigation/indexes/language/interfaces.py +7 -0
- eea/facetednavigation/interfaces.py +109 -0
- eea/facetednavigation/layout/__init__.py +2 -0
- eea/facetednavigation/layout/configure.zcml +38 -0
- eea/facetednavigation/layout/events.py +63 -0
- eea/facetednavigation/layout/interfaces.py +21 -0
- eea/facetednavigation/layout/layout.py +95 -0
- eea/facetednavigation/layout/menu.py +77 -0
- eea/facetednavigation/layout/overrides.zcml +13 -0
- eea/facetednavigation/locales/bg/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/bg/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/bg/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/bg/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/ca/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/ca/LC_MESSAGES/eea.po +1180 -0
- eea/facetednavigation/locales/ca/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/ca/LC_MESSAGES/plone.po +38 -0
- eea/facetednavigation/locales/cs/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/cs/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/cs/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/cs/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/da/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/da/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/da/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/da/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/de/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/de/LC_MESSAGES/eea.po +1236 -0
- eea/facetednavigation/locales/de/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/de/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/eea.pot +1182 -0
- eea/facetednavigation/locales/el/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/el/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/el/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/el/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/en/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/en/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/en/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/en/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/es/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/es/LC_MESSAGES/eea.po +1247 -0
- eea/facetednavigation/locales/es/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/es/LC_MESSAGES/plone.po +39 -0
- eea/facetednavigation/locales/et/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/et/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/et/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/et/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/eu/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/eu/LC_MESSAGES/eea.po +1247 -0
- eea/facetednavigation/locales/eu/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/eu/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/fi/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/fi/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/fi/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/fi/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/fr/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/fr/LC_MESSAGES/eea.po +1247 -0
- eea/facetednavigation/locales/fr/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/fr/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/hr/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/hr/LC_MESSAGES/eea.po +1182 -0
- eea/facetednavigation/locales/hr/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/hr/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/hu/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/hu/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/hu/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/hu/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/is/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/is/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/is/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/is/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/it/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/it/LC_MESSAGES/eea.po +1242 -0
- eea/facetednavigation/locales/it/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/it/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/kl/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/kl/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/kl/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/kl/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/lt/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/lt/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/lt/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/lt/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/lv/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/lv/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/lv/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/lv/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/mt/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/mt/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/mt/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/mt/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/nl/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/nl/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/nl/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/nl/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/no/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/no/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/no/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/no/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/pl/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/pl/LC_MESSAGES/eea.po +1242 -0
- eea/facetednavigation/locales/pl/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/pl/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/plone-manual.pot +38 -0
- eea/facetednavigation/locales/pt/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/pt/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/pt/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/pt/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/pt_BR/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/pt_BR/LC_MESSAGES/eea.po +1180 -0
- eea/facetednavigation/locales/pt_BR/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/pt_BR/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/ro/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/ro/LC_MESSAGES/eea.po +1244 -0
- eea/facetednavigation/locales/ro/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/ro/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/ru/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/ru/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/ru/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/ru/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/sk/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/sk/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/sk/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/sk/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/sl/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/sl/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/sl/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/sl/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/sv/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/sv/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/sv/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/sv/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/tr/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/tr/LC_MESSAGES/eea.po +1179 -0
- eea/facetednavigation/locales/tr/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/tr/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/locales/update.sh +6 -0
- eea/facetednavigation/locales/zh_TW/LC_MESSAGES/eea.mo +0 -0
- eea/facetednavigation/locales/zh_TW/LC_MESSAGES/eea.po +1243 -0
- eea/facetednavigation/locales/zh_TW/LC_MESSAGES/plone.mo +0 -0
- eea/facetednavigation/locales/zh_TW/LC_MESSAGES/plone.po +37 -0
- eea/facetednavigation/meta.zcml +22 -0
- eea/facetednavigation/overrides.zcml +11 -0
- eea/facetednavigation/permissions.zcml +12 -0
- eea/facetednavigation/plonex.py +36 -0
- eea/facetednavigation/profiles/default/actions.xml +67 -0
- eea/facetednavigation/profiles/default/eea.facetednavigation.txt +0 -0
- eea/facetednavigation/profiles/default/metadata.xml +4 -0
- eea/facetednavigation/profiles/default/registry.xml +48 -0
- eea/facetednavigation/profiles/default/rolemap.xml +11 -0
- eea/facetednavigation/profiles/uninstall/actions.xml +11 -0
- eea/facetednavigation/profiles/uninstall/eea.facetednavigation.txt +0 -0
- eea/facetednavigation/profiles/uninstall/registry.xml +8 -0
- eea/facetednavigation/profiles.zcml +42 -0
- eea/facetednavigation/search/__init__.py +2 -0
- eea/facetednavigation/search/catalog.py +84 -0
- eea/facetednavigation/search/configure.zcml +8 -0
- eea/facetednavigation/search/interfaces.py +10 -0
- eea/facetednavigation/settings/__init__.py +2 -0
- eea/facetednavigation/settings/configure.zcml +34 -0
- eea/facetednavigation/settings/interfaces.py +52 -0
- eea/facetednavigation/settings/menu.py +170 -0
- eea/facetednavigation/setuphandlers.py +92 -0
- eea/facetednavigation/subtypes/__init__.py +2 -0
- eea/facetednavigation/subtypes/configure.zcml +61 -0
- eea/facetednavigation/subtypes/interfaces.py +45 -0
- eea/facetednavigation/subtypes/subtyper.py +130 -0
- eea/facetednavigation/subtypes/wrapper.py +39 -0
- eea/facetednavigation/syndication/__init__.py +2 -0
- eea/facetednavigation/syndication/configure.zcml +13 -0
- eea/facetednavigation/syndication/feed.py +19 -0
- eea/facetednavigation/tests/__init__.py +2 -0
- eea/facetednavigation/tests/autocomplete.py +33 -0
- eea/facetednavigation/tests/autocomplete.zcml +15 -0
- eea/facetednavigation/tests/base.py +49 -0
- eea/facetednavigation/tests/configure.zcml +17 -0
- eea/facetednavigation/tests/data/criteria_with_purge_false.xml +15 -0
- eea/facetednavigation/tests/data/criteria_with_purge_true.xml +15 -0
- eea/facetednavigation/tests/data/criterion_with_purge_false.xml +15 -0
- eea/facetednavigation/tests/data/criterion_with_purge_true.xml +15 -0
- eea/facetednavigation/tests/data/exportimport.xml +31 -0
- eea/facetednavigation/tests/profiles/testing/types/Document.xml +6 -0
- eea/facetednavigation/tests/profiles/testing/types.xml +4 -0
- eea/facetednavigation/tests/test_bundles.py +42 -0
- eea/facetednavigation/tests/test_doctests.py +139 -0
- eea/facetednavigation/tests/utils.py +39 -0
- eea/facetednavigation/upgrades/__init__.py +2 -0
- eea/facetednavigation/upgrades/configure.zcml +28 -0
- eea/facetednavigation/upgrades/evolve165.py +13 -0
- eea/facetednavigation/utils.py +66 -0
- eea/facetednavigation/version.txt +1 -0
- eea/facetednavigation/versions/__init__.py +2 -0
- eea/facetednavigation/versions/browser.py +78 -0
- eea/facetednavigation/versions/configure.zcml +20 -0
- eea/facetednavigation/versions/events.py +16 -0
- eea/facetednavigation/versions/interfaces.py +15 -0
- eea/facetednavigation/views/__init__.py +2 -0
- eea/facetednavigation/views/configure.zcml +41 -0
- eea/facetednavigation/views/example/__init__.py +2 -0
- eea/facetednavigation/views/example/configure.zcml +24 -0
- eea/facetednavigation/views/example/summary.pt +74 -0
- eea/facetednavigation/views/example/summary.py +20 -0
- eea/facetednavigation/views/interfaces.py +7 -0
- eea/facetednavigation/views/meta.py +63 -0
- eea/facetednavigation/views/preview-item.pt +10 -0
- eea/facetednavigation/views/preview-items.pt +38 -0
- eea/facetednavigation/views/preview.py +74 -0
- eea/facetednavigation/vocabularies/__init__.py +2 -0
- eea/facetednavigation/vocabularies/autocomplete.py +44 -0
- eea/facetednavigation/vocabularies/catalog.py +204 -0
- eea/facetednavigation/vocabularies/configure.zcml +101 -0
- eea/facetednavigation/vocabularies/faceted.py +62 -0
- eea/facetednavigation/vocabularies/portal.py +55 -0
- eea/facetednavigation/vocabularies/position.py +23 -0
- eea/facetednavigation/vocabularies/section.py +19 -0
- eea/facetednavigation/vocabularies/simple.py +40 -0
- eea/facetednavigation/vocabularies/types.py +23 -0
- eea/facetednavigation/vocabularies/utils.py +10 -0
- eea/facetednavigation/widgets/__init__.py +12 -0
- eea/facetednavigation/widgets/alphabetic/__init__.py +2 -0
- eea/facetednavigation/widgets/alphabetic/adapters.py +48 -0
- eea/facetednavigation/widgets/alphabetic/alphabets.py +1042 -0
- eea/facetednavigation/widgets/alphabetic/configure.zcml +19 -0
- eea/facetednavigation/widgets/alphabetic/edit.js +80 -0
- eea/facetednavigation/widgets/alphabetic/edit.scss +0 -0
- eea/facetednavigation/widgets/alphabetic/interfaces.py +44 -0
- eea/facetednavigation/widgets/alphabetic/tests.py +32 -0
- eea/facetednavigation/widgets/alphabetic/view.js +229 -0
- eea/facetednavigation/widgets/alphabetic/view.scss +47 -0
- eea/facetednavigation/widgets/alphabetic/widget.pt +45 -0
- eea/facetednavigation/widgets/alphabetic/widget.py +64 -0
- eea/facetednavigation/widgets/alphabetic/widget.txt +104 -0
- eea/facetednavigation/widgets/autocomplete/__init__.py +2 -0
- eea/facetednavigation/widgets/autocomplete/configure.zcml +20 -0
- eea/facetednavigation/widgets/autocomplete/edit.js +52 -0
- eea/facetednavigation/widgets/autocomplete/edit.scss +0 -0
- eea/facetednavigation/widgets/autocomplete/interfaces.py +77 -0
- eea/facetednavigation/widgets/autocomplete/tests.py +32 -0
- eea/facetednavigation/widgets/autocomplete/view.js +245 -0
- eea/facetednavigation/widgets/autocomplete/view.scss +52 -0
- eea/facetednavigation/widgets/autocomplete/widget.pt +63 -0
- eea/facetednavigation/widgets/autocomplete/widget.py +117 -0
- eea/facetednavigation/widgets/autocomplete/widget.txt +142 -0
- eea/facetednavigation/widgets/boolean/__init__.py +2 -0
- eea/facetednavigation/widgets/boolean/configure.zcml +12 -0
- eea/facetednavigation/widgets/boolean/interfaces.py +48 -0
- eea/facetednavigation/widgets/boolean/widget.pt +46 -0
- eea/facetednavigation/widgets/boolean/widget.py +56 -0
- eea/facetednavigation/widgets/checkbox/__init__.py +2 -0
- eea/facetednavigation/widgets/checkbox/configure.zcml +12 -0
- eea/facetednavigation/widgets/checkbox/edit.js +115 -0
- eea/facetednavigation/widgets/checkbox/edit.scss +0 -0
- eea/facetednavigation/widgets/checkbox/interfaces.py +104 -0
- eea/facetednavigation/widgets/checkbox/view.js +319 -0
- eea/facetednavigation/widgets/checkbox/view.scss +59 -0
- eea/facetednavigation/widgets/checkbox/widget.pt +75 -0
- eea/facetednavigation/widgets/checkbox/widget.py +102 -0
- eea/facetednavigation/widgets/configure.zcml +30 -0
- eea/facetednavigation/widgets/criteria/__init__.py +2 -0
- eea/facetednavigation/widgets/criteria/configure.zcml +12 -0
- eea/facetednavigation/widgets/criteria/edit.js +0 -0
- eea/facetednavigation/widgets/criteria/edit.scss +0 -0
- eea/facetednavigation/widgets/criteria/interfaces.py +35 -0
- eea/facetednavigation/widgets/criteria/view.js +123 -0
- eea/facetednavigation/widgets/criteria/view.scss +61 -0
- eea/facetednavigation/widgets/criteria/widget.pt +36 -0
- eea/facetednavigation/widgets/criteria/widget.py +17 -0
- eea/facetednavigation/widgets/date/__init__.py +2 -0
- eea/facetednavigation/widgets/date/configure.zcml +12 -0
- eea/facetednavigation/widgets/date/edit.js +89 -0
- eea/facetednavigation/widgets/date/edit.scss +0 -0
- eea/facetednavigation/widgets/date/interfaces.py +36 -0
- eea/facetednavigation/widgets/date/tests.py +32 -0
- eea/facetednavigation/widgets/date/view.js +195 -0
- eea/facetednavigation/widgets/date/view.scss +10 -0
- eea/facetednavigation/widgets/date/widget.pt +40 -0
- eea/facetednavigation/widgets/date/widget.py +166 -0
- eea/facetednavigation/widgets/date/widget.txt +225 -0
- eea/facetednavigation/widgets/daterange/__init__.py +2 -0
- eea/facetednavigation/widgets/daterange/configure.zcml +12 -0
- eea/facetednavigation/widgets/daterange/edit.js +114 -0
- eea/facetednavigation/widgets/daterange/edit.scss +0 -0
- eea/facetednavigation/widgets/daterange/interfaces.py +102 -0
- eea/facetednavigation/widgets/daterange/tests.py +32 -0
- eea/facetednavigation/widgets/daterange/utils.py +117 -0
- eea/facetednavigation/widgets/daterange/view.js +308 -0
- eea/facetednavigation/widgets/daterange/view.scss +14 -0
- eea/facetednavigation/widgets/daterange/widget.pt +61 -0
- eea/facetednavigation/widgets/daterange/widget.py +184 -0
- eea/facetednavigation/widgets/daterange/widget.txt +280 -0
- eea/facetednavigation/widgets/debug/__init__.py +2 -0
- eea/facetednavigation/widgets/debug/browser.py +161 -0
- eea/facetednavigation/widgets/debug/configure.zcml +58 -0
- eea/facetednavigation/widgets/debug/edit.js +104 -0
- eea/facetednavigation/widgets/debug/edit.scss +0 -0
- eea/facetednavigation/widgets/debug/interfaces.py +35 -0
- eea/facetednavigation/widgets/debug/view.js +109 -0
- eea/facetednavigation/widgets/debug/view.scss +6 -0
- eea/facetednavigation/widgets/debug/vocabulary.py +21 -0
- eea/facetednavigation/widgets/debug/widget.pt +43 -0
- eea/facetednavigation/widgets/debug/widget.py +17 -0
- eea/facetednavigation/widgets/etag/__init__.py +2 -0
- eea/facetednavigation/widgets/etag/configure.zcml +12 -0
- eea/facetednavigation/widgets/etag/edit.js +51 -0
- eea/facetednavigation/widgets/etag/edit.scss +0 -0
- eea/facetednavigation/widgets/etag/interfaces.py +52 -0
- eea/facetednavigation/widgets/etag/view.js +0 -0
- eea/facetednavigation/widgets/etag/view.scss +0 -0
- eea/facetednavigation/widgets/etag/widget.pt +25 -0
- eea/facetednavigation/widgets/etag/widget.py +16 -0
- eea/facetednavigation/widgets/interfaces.py +156 -0
- eea/facetednavigation/widgets/multiselect/__init__.py +2 -0
- eea/facetednavigation/widgets/multiselect/configure.zcml +12 -0
- eea/facetednavigation/widgets/multiselect/edit.js +131 -0
- eea/facetednavigation/widgets/multiselect/edit.scss +0 -0
- eea/facetednavigation/widgets/multiselect/interfaces.py +120 -0
- eea/facetednavigation/widgets/multiselect/view.js +383 -0
- eea/facetednavigation/widgets/multiselect/view.scss +65 -0
- eea/facetednavigation/widgets/multiselect/widget.pt +73 -0
- eea/facetednavigation/widgets/multiselect/widget.py +107 -0
- eea/facetednavigation/widgets/path/__init__.py +2 -0
- eea/facetednavigation/widgets/path/configure.zcml +28 -0
- eea/facetednavigation/widgets/path/edit.js +63 -0
- eea/facetednavigation/widgets/path/edit.scss +0 -0
- eea/facetednavigation/widgets/path/interfaces.py +67 -0
- eea/facetednavigation/widgets/path/tree.js +99 -0
- eea/facetednavigation/widgets/path/tree.py +171 -0
- eea/facetednavigation/widgets/path/view.js +158 -0
- eea/facetednavigation/widgets/path/view.scss +16 -0
- eea/facetednavigation/widgets/path/widget.pt +29 -0
- eea/facetednavigation/widgets/path/widget.py +134 -0
- eea/facetednavigation/widgets/portlet/__init__.py +2 -0
- eea/facetednavigation/widgets/portlet/configure.zcml +12 -0
- eea/facetednavigation/widgets/portlet/edit.js +0 -0
- eea/facetednavigation/widgets/portlet/edit.scss +0 -0
- eea/facetednavigation/widgets/portlet/interfaces.py +34 -0
- eea/facetednavigation/widgets/portlet/view.js +23 -0
- eea/facetednavigation/widgets/portlet/view.scss +6 -0
- eea/facetednavigation/widgets/portlet/widget.pt +20 -0
- eea/facetednavigation/widgets/portlet/widget.py +46 -0
- eea/facetednavigation/widgets/radio/__init__.py +2 -0
- eea/facetednavigation/widgets/radio/configure.zcml +12 -0
- eea/facetednavigation/widgets/radio/edit.js +76 -0
- eea/facetednavigation/widgets/radio/edit.scss +0 -0
- eea/facetednavigation/widgets/radio/interfaces.py +76 -0
- eea/facetednavigation/widgets/radio/view.js +262 -0
- eea/facetednavigation/widgets/radio/view.scss +11 -0
- eea/facetednavigation/widgets/radio/widget.pt +71 -0
- eea/facetednavigation/widgets/radio/widget.py +53 -0
- eea/facetednavigation/widgets/range/__init__.py +2 -0
- eea/facetednavigation/widgets/range/configure.zcml +12 -0
- eea/facetednavigation/widgets/range/edit.js +66 -0
- eea/facetednavigation/widgets/range/edit.scss +0 -0
- eea/facetednavigation/widgets/range/interfaces.py +78 -0
- eea/facetednavigation/widgets/range/tests.py +32 -0
- eea/facetednavigation/widgets/range/view.js +176 -0
- eea/facetednavigation/widgets/range/view.scss +14 -0
- eea/facetednavigation/widgets/range/widget.pt +50 -0
- eea/facetednavigation/widgets/range/widget.py +74 -0
- eea/facetednavigation/widgets/range/widget.txt +153 -0
- eea/facetednavigation/widgets/resultsfilter/__init__.py +2 -0
- eea/facetednavigation/widgets/resultsfilter/adapters.py +18 -0
- eea/facetednavigation/widgets/resultsfilter/configure.zcml +19 -0
- eea/facetednavigation/widgets/resultsfilter/edit.js +54 -0
- eea/facetednavigation/widgets/resultsfilter/edit.scss +0 -0
- eea/facetednavigation/widgets/resultsfilter/interfaces.py +41 -0
- eea/facetednavigation/widgets/resultsfilter/tests.py +32 -0
- eea/facetednavigation/widgets/resultsfilter/view.js +0 -0
- eea/facetednavigation/widgets/resultsfilter/view.scss +0 -0
- eea/facetednavigation/widgets/resultsfilter/widget.pt +24 -0
- eea/facetednavigation/widgets/resultsfilter/widget.py +94 -0
- eea/facetednavigation/widgets/resultsfilter/widget.txt +66 -0
- eea/facetednavigation/widgets/resultsperpage/__init__.py +2 -0
- eea/facetednavigation/widgets/resultsperpage/configure.zcml +12 -0
- eea/facetednavigation/widgets/resultsperpage/edit.js +47 -0
- eea/facetednavigation/widgets/resultsperpage/edit.scss +0 -0
- eea/facetednavigation/widgets/resultsperpage/interfaces.py +65 -0
- eea/facetednavigation/widgets/resultsperpage/view.js +159 -0
- eea/facetednavigation/widgets/resultsperpage/view.scss +5 -0
- eea/facetednavigation/widgets/resultsperpage/widget.pt +45 -0
- eea/facetednavigation/widgets/resultsperpage/widget.py +71 -0
- eea/facetednavigation/widgets/schema.pt +36 -0
- eea/facetednavigation/widgets/schema.py +31 -0
- eea/facetednavigation/widgets/select/__init__.py +2 -0
- eea/facetednavigation/widgets/select/configure.zcml +12 -0
- eea/facetednavigation/widgets/select/edit.js +63 -0
- eea/facetednavigation/widgets/select/edit.scss +0 -0
- eea/facetednavigation/widgets/select/interfaces.py +68 -0
- eea/facetednavigation/widgets/select/view.js +239 -0
- eea/facetednavigation/widgets/select/view.scss +24 -0
- eea/facetednavigation/widgets/select/widget.pt +59 -0
- eea/facetednavigation/widgets/select/widget.py +44 -0
- eea/facetednavigation/widgets/sorting/__init__.py +2 -0
- eea/facetednavigation/widgets/sorting/configure.zcml +12 -0
- eea/facetednavigation/widgets/sorting/edit.js +55 -0
- eea/facetednavigation/widgets/sorting/edit.scss +0 -0
- eea/facetednavigation/widgets/sorting/interfaces.py +35 -0
- eea/facetednavigation/widgets/sorting/view.js +213 -0
- eea/facetednavigation/widgets/sorting/view.scss +9 -0
- eea/facetednavigation/widgets/sorting/widget.pt +58 -0
- eea/facetednavigation/widgets/sorting/widget.py +80 -0
- eea/facetednavigation/widgets/storage.py +65 -0
- eea/facetednavigation/widgets/tagscloud/__init__.py +2 -0
- eea/facetednavigation/widgets/tagscloud/configure.zcml +20 -0
- eea/facetednavigation/widgets/tagscloud/counter.pt +0 -0
- eea/facetednavigation/widgets/tagscloud/counter.py +79 -0
- eea/facetednavigation/widgets/tagscloud/edit.js +150 -0
- eea/facetednavigation/widgets/tagscloud/edit.scss +0 -0
- eea/facetednavigation/widgets/tagscloud/interfaces.py +154 -0
- eea/facetednavigation/widgets/tagscloud/tagcloud.js +210 -0
- eea/facetednavigation/widgets/tagscloud/view.js +301 -0
- eea/facetednavigation/widgets/tagscloud/view.scss +33 -0
- eea/facetednavigation/widgets/tagscloud/widget.pt +65 -0
- eea/facetednavigation/widgets/tagscloud/widget.py +100 -0
- eea/facetednavigation/widgets/tal/__init__.py +2 -0
- eea/facetednavigation/widgets/tal/configure.zcml +12 -0
- eea/facetednavigation/widgets/tal/edit.js +54 -0
- eea/facetednavigation/widgets/tal/edit.scss +0 -0
- eea/facetednavigation/widgets/tal/interfaces.py +42 -0
- eea/facetednavigation/widgets/tal/tests.py +32 -0
- eea/facetednavigation/widgets/tal/view.js +0 -0
- eea/facetednavigation/widgets/tal/view.scss +0 -0
- eea/facetednavigation/widgets/tal/widget.pt +24 -0
- eea/facetednavigation/widgets/tal/widget.py +118 -0
- eea/facetednavigation/widgets/tal/widget.txt +216 -0
- eea/facetednavigation/widgets/text/__init__.py +2 -0
- eea/facetednavigation/widgets/text/configure.zcml +12 -0
- eea/facetednavigation/widgets/text/edit.js +52 -0
- eea/facetednavigation/widgets/text/edit.scss +0 -0
- eea/facetednavigation/widgets/text/interfaces.py +64 -0
- eea/facetednavigation/widgets/text/tests.py +32 -0
- eea/facetednavigation/widgets/text/view.js +190 -0
- eea/facetednavigation/widgets/text/view.scss +15 -0
- eea/facetednavigation/widgets/text/widget.pt +53 -0
- eea/facetednavigation/widgets/text/widget.py +77 -0
- eea/facetednavigation/widgets/text/widget.txt +153 -0
- eea/facetednavigation/widgets/widget.py +386 -0
- eea/facetednavigation/widgets/widgets.py +127 -0
- eea.facetednavigation-16.5-py3.14-nspkg.pth +1 -0
- eea_facetednavigation-16.5.dist-info/METADATA +1617 -0
- eea_facetednavigation-16.5.dist-info/RECORD +553 -0
- eea_facetednavigation-16.5.dist-info/WHEEL +5 -0
- eea_facetednavigation-16.5.dist-info/entry_points.txt +2 -0
- eea_facetednavigation-16.5.dist-info/namespace_packages.txt +1 -0
- eea_facetednavigation-16.5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
""" Faceted query
|
|
2
|
+
"""
|
|
3
|
+
from eea.facetednavigation.caching import cacheKeyFacetedNavigation
|
|
4
|
+
from eea.facetednavigation.caching import ramcache
|
|
5
|
+
from eea.facetednavigation.interfaces import ICriteria
|
|
6
|
+
from eea.facetednavigation.interfaces import IEEASettings
|
|
7
|
+
from eea.facetednavigation.interfaces import IFacetedCatalog
|
|
8
|
+
from eea.facetednavigation.interfaces import IFacetedLayout
|
|
9
|
+
from eea.facetednavigation.interfaces import IFacetedWrapper
|
|
10
|
+
from eea.facetednavigation.interfaces import ILanguageWidgetAdapter
|
|
11
|
+
from eea.facetednavigation.interfaces import IWidgetFilterBrains
|
|
12
|
+
from plone.app.contentlisting.interfaces import IContentListing
|
|
13
|
+
from plone.app.contenttypes.browser.folder import FolderView
|
|
14
|
+
from plone.registry.interfaces import IRegistry
|
|
15
|
+
from Products.CMFPlone.PloneBatch import Batch
|
|
16
|
+
from Products.CMFPlone.utils import safeToInt
|
|
17
|
+
from types import GeneratorType
|
|
18
|
+
from zope.component import getUtility
|
|
19
|
+
from zope.component import queryAdapter
|
|
20
|
+
from zope.component import queryMultiAdapter
|
|
21
|
+
|
|
22
|
+
import logging
|
|
23
|
+
import time
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
logger = logging.getLogger("eea.facetednavigation")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class FacetedQueryHandler(FolderView):
|
|
30
|
+
"""Faceted Query"""
|
|
31
|
+
|
|
32
|
+
def __init__(self, context, request):
|
|
33
|
+
super(FacetedQueryHandler, self).__init__(context, request)
|
|
34
|
+
if request.get("HTTP_X_REQUESTED_WITH", "") == "XMLHttpRequest":
|
|
35
|
+
registry = getUtility(IRegistry)
|
|
36
|
+
settings = registry.forInterface(IEEASettings, check=False)
|
|
37
|
+
if settings.disable_diazo_rules_ajax:
|
|
38
|
+
request.response.setHeader("X-Theme-Disabled", "1")
|
|
39
|
+
|
|
40
|
+
def macros(self, name="content-core"):
|
|
41
|
+
"""Return macro from default layout"""
|
|
42
|
+
return IFacetedLayout(self.context).get_macro(macro=name)
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def language(self):
|
|
46
|
+
"""Get context language"""
|
|
47
|
+
lang = getattr(self.context, "getLanguage", None)
|
|
48
|
+
if lang:
|
|
49
|
+
return lang()
|
|
50
|
+
return self.request.get("LANGUAGE", "")
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def default_criteria(self):
|
|
54
|
+
"""Return default criteria"""
|
|
55
|
+
query = {}
|
|
56
|
+
criteria = queryAdapter(self.context, ICriteria)
|
|
57
|
+
for cid, criterion in criteria.items():
|
|
58
|
+
widget = criteria.widget(cid=cid)
|
|
59
|
+
widget = widget(self.context, self.request, criterion)
|
|
60
|
+
default = widget.default
|
|
61
|
+
if not default:
|
|
62
|
+
continue
|
|
63
|
+
query[cid] = default
|
|
64
|
+
return query
|
|
65
|
+
|
|
66
|
+
def get_context(self, content=None):
|
|
67
|
+
"""Return context"""
|
|
68
|
+
wrapper = queryAdapter(self.context, IFacetedWrapper)
|
|
69
|
+
if not wrapper:
|
|
70
|
+
return self.context
|
|
71
|
+
return wrapper(content)
|
|
72
|
+
|
|
73
|
+
def criteria(self, sort=False, **kwargs):
|
|
74
|
+
"""Process catalog query"""
|
|
75
|
+
if self.request:
|
|
76
|
+
kwargs.update(self.request.form)
|
|
77
|
+
|
|
78
|
+
# jQuery >= 1.4 adds type to params keys
|
|
79
|
+
# $.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4"
|
|
80
|
+
# Let's fix this
|
|
81
|
+
kwargs = dict((key.replace("[]", ""), val) for key, val in kwargs.items())
|
|
82
|
+
|
|
83
|
+
logger.debug("REQUEST: %r", kwargs)
|
|
84
|
+
|
|
85
|
+
# Generate the catalog query
|
|
86
|
+
criteria = ICriteria(self.context)
|
|
87
|
+
query = {}
|
|
88
|
+
for cid, criterion in criteria.items():
|
|
89
|
+
widget = criteria.widget(cid=cid)
|
|
90
|
+
widget = widget(self.context, self.request, criterion)
|
|
91
|
+
|
|
92
|
+
widget_query = widget.query(kwargs)
|
|
93
|
+
if getattr(widget, "faceted_field", False):
|
|
94
|
+
widget_index = widget.data.get("index", "")
|
|
95
|
+
if "facet.field" in query and widget_index not in query["facet.field"]:
|
|
96
|
+
query["facet.field"].append(widget_index)
|
|
97
|
+
else:
|
|
98
|
+
query["facet.field"] = [widget_index]
|
|
99
|
+
query.update(widget_query)
|
|
100
|
+
|
|
101
|
+
# Handle language widgets
|
|
102
|
+
if criterion.get("index", "") == "Language":
|
|
103
|
+
language_widget = queryMultiAdapter(
|
|
104
|
+
(widget, self.context), ILanguageWidgetAdapter
|
|
105
|
+
)
|
|
106
|
+
if not language_widget:
|
|
107
|
+
continue
|
|
108
|
+
query.update(language_widget(kwargs))
|
|
109
|
+
|
|
110
|
+
# Add default sorting criteria
|
|
111
|
+
if sort and "sort_on" not in query:
|
|
112
|
+
query["sort_on"] = "effective"
|
|
113
|
+
query["sort_order"] = "reverse"
|
|
114
|
+
|
|
115
|
+
# Add default language.
|
|
116
|
+
# Also make sure to return language-independent content.
|
|
117
|
+
lang = self.language
|
|
118
|
+
if lang:
|
|
119
|
+
lang = [lang, ""]
|
|
120
|
+
query.setdefault("Language", lang)
|
|
121
|
+
|
|
122
|
+
logger.debug("QUERY: %s", query)
|
|
123
|
+
return query
|
|
124
|
+
|
|
125
|
+
def query(self, batch=True, sort=False, **kwargs):
|
|
126
|
+
"""Search using given criteria"""
|
|
127
|
+
if self.request:
|
|
128
|
+
kwargs.update(self.request.form)
|
|
129
|
+
kwargs.pop("sort[]", None)
|
|
130
|
+
kwargs.pop("sort", None)
|
|
131
|
+
|
|
132
|
+
# jQuery >= 1.4 adds type to params keys
|
|
133
|
+
# $.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4"
|
|
134
|
+
# Let's fix this
|
|
135
|
+
kwargs = dict((key.replace("[]", ""), val) for key, val in kwargs.items())
|
|
136
|
+
|
|
137
|
+
query = self.criteria(sort=sort, **kwargs)
|
|
138
|
+
# We don't want to do an unnecessary sort for a counter query
|
|
139
|
+
counter_query = kwargs.pop("counter_query", False)
|
|
140
|
+
if counter_query:
|
|
141
|
+
query.pop("sort_on", None)
|
|
142
|
+
query.pop("sort_order", None)
|
|
143
|
+
|
|
144
|
+
catalog = getUtility(IFacetedCatalog)
|
|
145
|
+
num_per_page = 20
|
|
146
|
+
criteria = ICriteria(self.context)
|
|
147
|
+
brains_filters = []
|
|
148
|
+
for cid, criterion in criteria.items():
|
|
149
|
+
widgetclass = criteria.widget(cid=cid)
|
|
150
|
+
widget = widgetclass(self.context, self.request, criterion)
|
|
151
|
+
|
|
152
|
+
if widget.widget_type == "resultsperpage":
|
|
153
|
+
num_per_page = widget.results_per_page(kwargs)
|
|
154
|
+
|
|
155
|
+
brains_filter = queryAdapter(widget, IWidgetFilterBrains)
|
|
156
|
+
if brains_filter:
|
|
157
|
+
brains_filters.append(brains_filter)
|
|
158
|
+
|
|
159
|
+
b_start = safeToInt(kwargs.get("b_start", 0))
|
|
160
|
+
# make sure orphans is an integer, // is used so in Python3 we have an
|
|
161
|
+
# integer division as by default, a division result is a float
|
|
162
|
+
orphans = num_per_page * 20 // 100 # orphans = 20% of items per page
|
|
163
|
+
if batch and not brains_filters:
|
|
164
|
+
# add b_start and b_size to query to use better sort algorithm
|
|
165
|
+
query["b_start"] = b_start
|
|
166
|
+
query["b_size"] = num_per_page + orphans
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
brains = catalog(self.context, **query)
|
|
170
|
+
except Exception as err:
|
|
171
|
+
logger.exception(err)
|
|
172
|
+
return Batch([], 20, 0)
|
|
173
|
+
if not brains:
|
|
174
|
+
return Batch([], 20, 0)
|
|
175
|
+
|
|
176
|
+
# Apply after query (filter) on brains
|
|
177
|
+
start = time.time()
|
|
178
|
+
for brains_filter in brains_filters:
|
|
179
|
+
brains = brains_filter(brains, kwargs)
|
|
180
|
+
|
|
181
|
+
if not batch:
|
|
182
|
+
return brains
|
|
183
|
+
|
|
184
|
+
if isinstance(brains, GeneratorType):
|
|
185
|
+
brains = [brain for brain in brains]
|
|
186
|
+
|
|
187
|
+
delta = time.time() - start
|
|
188
|
+
if delta > 30:
|
|
189
|
+
logger.warn(
|
|
190
|
+
"Very slow IWidgetFilterBrains adapters: %s at %s",
|
|
191
|
+
brains_filters,
|
|
192
|
+
self.context.absolute_url(),
|
|
193
|
+
)
|
|
194
|
+
return Batch(brains, num_per_page, b_start, orphan=orphans)
|
|
195
|
+
|
|
196
|
+
def results(self, **kwargs):
|
|
197
|
+
"""Faceted results"""
|
|
198
|
+
kwargs["batch"] = False
|
|
199
|
+
results = self.query(**kwargs)
|
|
200
|
+
if isinstance(results, GeneratorType):
|
|
201
|
+
results = [i for i in results]
|
|
202
|
+
results = IContentListing(results)
|
|
203
|
+
return results
|
|
204
|
+
|
|
205
|
+
@ramcache(cacheKeyFacetedNavigation, dependencies=["eea.facetednavigation"])
|
|
206
|
+
def __call__(self, *args, **kwargs):
|
|
207
|
+
self.brains = self.query(**kwargs)
|
|
208
|
+
html = self.index()
|
|
209
|
+
return html
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
""" Schema
|
|
2
|
+
"""
|
|
3
|
+
from eea.facetednavigation.widgets.storage import Criterion
|
|
4
|
+
from eea.facetednavigation.widgets.schema import Schema
|
|
5
|
+
from eea.facetednavigation.interfaces import ICriteria
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FacetedSchemaGetter(object):
|
|
9
|
+
"""Faceted Query"""
|
|
10
|
+
|
|
11
|
+
def __init__(self, context, request):
|
|
12
|
+
self.context = context
|
|
13
|
+
self.request = request
|
|
14
|
+
|
|
15
|
+
def get_criterion(self, cid):
|
|
16
|
+
"""Criterion"""
|
|
17
|
+
return ICriteria(self.context).get(cid)
|
|
18
|
+
|
|
19
|
+
def get_widget(self, wid):
|
|
20
|
+
"""Widget"""
|
|
21
|
+
if not wid:
|
|
22
|
+
return None
|
|
23
|
+
return ICriteria(self.context).widget(wid=wid)
|
|
24
|
+
|
|
25
|
+
def __call__(self, **kwargs):
|
|
26
|
+
kwargs.update(self.request.form)
|
|
27
|
+
criterion_id = kwargs.get("criterion", "").split("_")[0]
|
|
28
|
+
|
|
29
|
+
criterion = self.get_criterion(criterion_id)
|
|
30
|
+
# Not added yet use an empty one
|
|
31
|
+
if not criterion:
|
|
32
|
+
criterion = Criterion()
|
|
33
|
+
|
|
34
|
+
widget_id = kwargs.get("widget", criterion.get("widget", ""))
|
|
35
|
+
widget = self.get_widget(widget_id)
|
|
36
|
+
if not widget:
|
|
37
|
+
return ""
|
|
38
|
+
|
|
39
|
+
return Schema(self.context, self.request, widget, criterion)()
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
""" Faceted views
|
|
2
|
+
"""
|
|
3
|
+
from zope.component import getUtility
|
|
4
|
+
from zope.component import queryAdapter
|
|
5
|
+
from zope.schema.interfaces import IVocabularyFactory
|
|
6
|
+
from eea.facetednavigation.interfaces import ICriteria
|
|
7
|
+
from eea.facetednavigation.interfaces import IFacetedWrapper
|
|
8
|
+
from eea.facetednavigation.interfaces import IHidePloneLeftColumn
|
|
9
|
+
from eea.facetednavigation.interfaces import IHidePloneRightColumn
|
|
10
|
+
from eea.facetednavigation.interfaces import IDisableSmartFacets
|
|
11
|
+
from eea.facetednavigation.interfaces import IFacetedSearchMode
|
|
12
|
+
from Products.Five.browser import BrowserView
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FacetedContainerView(object):
|
|
16
|
+
"""Faceted view"""
|
|
17
|
+
|
|
18
|
+
def __init__(self, context, request):
|
|
19
|
+
self.context = context
|
|
20
|
+
self.request = request
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def mode(self):
|
|
24
|
+
"""Display mode"""
|
|
25
|
+
if IFacetedSearchMode.providedBy(self.context):
|
|
26
|
+
return "search"
|
|
27
|
+
return "view"
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def positions(self):
|
|
31
|
+
"""Return available columns"""
|
|
32
|
+
voc = getUtility(IVocabularyFactory, "eea.faceted.vocabularies.WidgetPositions")
|
|
33
|
+
return voc(self.context)
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def hide_left_portlets(self):
|
|
37
|
+
"""Disable plone portlets left column"""
|
|
38
|
+
return IHidePloneLeftColumn.providedBy(self.context)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def hide_right_portlets(self):
|
|
42
|
+
"""Disable plone portlets right column"""
|
|
43
|
+
return IHidePloneRightColumn.providedBy(self.context)
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def disable_smart_facets(self):
|
|
47
|
+
"""Disable 'smart facets hiding'"""
|
|
48
|
+
return IDisableSmartFacets.providedBy(self.context)
|
|
49
|
+
|
|
50
|
+
def get_context(self, content=None):
|
|
51
|
+
"""Return context"""
|
|
52
|
+
wrapper = queryAdapter(self.context, IFacetedWrapper)
|
|
53
|
+
if not wrapper:
|
|
54
|
+
return self.context
|
|
55
|
+
return wrapper(content)
|
|
56
|
+
|
|
57
|
+
def get_sections(self, position="", mode="view"):
|
|
58
|
+
"""Get sections for given position or return all sections"""
|
|
59
|
+
voc = getUtility(IVocabularyFactory, "eea.faceted.vocabularies.WidgetSections")
|
|
60
|
+
voc = voc(self.context)
|
|
61
|
+
if not position or mode not in ("view", "search"):
|
|
62
|
+
return [t for t in voc]
|
|
63
|
+
|
|
64
|
+
widgets = self.get_view_widgets(position=position)
|
|
65
|
+
sections = [widget.data.get("section") for widget in widgets]
|
|
66
|
+
return [term for term in voc if term.value in sections]
|
|
67
|
+
|
|
68
|
+
def get_view_widgets(self, position="", section=""):
|
|
69
|
+
"""Get not hidden widgets"""
|
|
70
|
+
widgets = self.get_widgets(position, section)
|
|
71
|
+
for widget in widgets:
|
|
72
|
+
if widget.hidden:
|
|
73
|
+
continue
|
|
74
|
+
widget.mode = "display"
|
|
75
|
+
yield widget
|
|
76
|
+
|
|
77
|
+
def get_widgets(self, position="", section=""):
|
|
78
|
+
"""Get all widgets"""
|
|
79
|
+
criteria = ICriteria(self.context)
|
|
80
|
+
for criterion in criteria.values():
|
|
81
|
+
if position and criterion.get("position", "right") != position:
|
|
82
|
+
continue
|
|
83
|
+
if section and criterion.get("section", "default") != section:
|
|
84
|
+
continue
|
|
85
|
+
widget = criteria.widget(wid=criterion.get("widget"))
|
|
86
|
+
yield widget(self.context, self.request, criterion)
|
|
87
|
+
|
|
88
|
+
def check_display_criteria(self, faceted_html):
|
|
89
|
+
"""Check criteria"""
|
|
90
|
+
if self.disable_smart_facets:
|
|
91
|
+
return True
|
|
92
|
+
return self.context.unrestrictedTraverse(
|
|
93
|
+
"@@faceted_display_criteria_checker"
|
|
94
|
+
).check(faceted_html)
|
|
95
|
+
|
|
96
|
+
def has_left_widgets(self):
|
|
97
|
+
for widget in self.get_widgets(position="left"):
|
|
98
|
+
if widget.hidden:
|
|
99
|
+
continue
|
|
100
|
+
return True
|
|
101
|
+
|
|
102
|
+
def has_right_widgets(self):
|
|
103
|
+
for widget in self.get_widgets(position="right"):
|
|
104
|
+
if widget.hidden:
|
|
105
|
+
continue
|
|
106
|
+
return True
|
|
107
|
+
|
|
108
|
+
def left_col(self, mode):
|
|
109
|
+
"""Show faceted left col"""
|
|
110
|
+
if mode == "edit":
|
|
111
|
+
return True
|
|
112
|
+
if not self.has_left_widgets():
|
|
113
|
+
return False
|
|
114
|
+
if not self.hide_left_portlets:
|
|
115
|
+
return False
|
|
116
|
+
return True
|
|
117
|
+
|
|
118
|
+
def right_col(self, mode):
|
|
119
|
+
"""Show faceted right col"""
|
|
120
|
+
if mode == "edit":
|
|
121
|
+
return True
|
|
122
|
+
if not self.has_right_widgets():
|
|
123
|
+
return False
|
|
124
|
+
if not self.hide_right_portlets:
|
|
125
|
+
return False
|
|
126
|
+
return True
|
|
127
|
+
|
|
128
|
+
def left_col_grid(self, mode):
|
|
129
|
+
"""Grid for left facets column"""
|
|
130
|
+
if self.left_col(mode):
|
|
131
|
+
return "col-lg-3"
|
|
132
|
+
return "col-lg-12"
|
|
133
|
+
|
|
134
|
+
def right_col_grid(self, mode):
|
|
135
|
+
"""Return right column bootstrap grid col"""
|
|
136
|
+
if self.right_col(mode):
|
|
137
|
+
return "col-lg-3"
|
|
138
|
+
return "col-lg-12"
|
|
139
|
+
|
|
140
|
+
def center_col_grid(self, mode):
|
|
141
|
+
"""Return center column bootstrap grid col"""
|
|
142
|
+
if self.left_col(mode) and self.right_col(mode):
|
|
143
|
+
return "col-lg-6"
|
|
144
|
+
if self.left_col(mode) or self.right_col(mode):
|
|
145
|
+
return "col-lg-9"
|
|
146
|
+
return "col-lg-12"
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class DisplayCriteriaCheckerView(BrowserView):
|
|
150
|
+
"""This views checks if criteria are displayed on faceted navigation"""
|
|
151
|
+
|
|
152
|
+
def check(self, faceted_html):
|
|
153
|
+
"""Check"""
|
|
154
|
+
if "pagination" in faceted_html:
|
|
155
|
+
return True
|
|
156
|
+
elif self.language_present():
|
|
157
|
+
return True
|
|
158
|
+
else:
|
|
159
|
+
return False
|
|
160
|
+
|
|
161
|
+
def language_present(self):
|
|
162
|
+
"""Is there any widget for Language index?"""
|
|
163
|
+
|
|
164
|
+
criteria = ICriteria(self.context)
|
|
165
|
+
for criterion in criteria.values():
|
|
166
|
+
if criterion.get("index", None) == "Language":
|
|
167
|
+
if not criterion.hidden:
|
|
168
|
+
return True
|
|
169
|
+
return False
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<configure
|
|
2
|
+
xmlns="http://namespaces.zope.org/zope"
|
|
3
|
+
xmlns:browser="http://namespaces.zope.org/browser"
|
|
4
|
+
xmlns:plone="http://namespaces.plone.org/plone"
|
|
5
|
+
i18n_domain="eea"
|
|
6
|
+
>
|
|
7
|
+
|
|
8
|
+
<browser:page
|
|
9
|
+
name="facetednavigation_view"
|
|
10
|
+
for="..interfaces.IFacetedNavigable"
|
|
11
|
+
class=".app.view.FacetedContainerView"
|
|
12
|
+
template="template/view.pt"
|
|
13
|
+
permission="zope2.View"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<browser:page
|
|
17
|
+
name="faceted_display_criteria_checker"
|
|
18
|
+
for="..interfaces.IFacetedNavigable"
|
|
19
|
+
class=".app.view.DisplayCriteriaCheckerView"
|
|
20
|
+
permission="zope2.View"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<browser:page
|
|
24
|
+
name="facetednavigation_simple_view"
|
|
25
|
+
for="..interfaces.IFacetedNavigable"
|
|
26
|
+
class=".app.view.FacetedContainerView"
|
|
27
|
+
template="template/simple_view.pt"
|
|
28
|
+
permission="zope2.View"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<browser:page
|
|
32
|
+
name="faceted_widgets"
|
|
33
|
+
for="..interfaces.IFacetedNavigable"
|
|
34
|
+
class=".app.view.FacetedContainerView"
|
|
35
|
+
template="template/widgets.pt"
|
|
36
|
+
permission="zope2.View"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<browser:page
|
|
40
|
+
name="faceted_widgets_macros"
|
|
41
|
+
for="..interfaces.IFacetedNavigable"
|
|
42
|
+
template="template/widgets.pt"
|
|
43
|
+
permission="zope2.View"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<browser:page
|
|
47
|
+
name="faceted_macros"
|
|
48
|
+
for="..interfaces.IFacetedNavigable"
|
|
49
|
+
template="template/macros.pt"
|
|
50
|
+
permission="zope2.View"
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
<browser:page
|
|
54
|
+
name="configure_faceted.html"
|
|
55
|
+
for="..interfaces.IFacetedNavigable"
|
|
56
|
+
class=".app.configure.FacetedConfigureView"
|
|
57
|
+
template="template/configure.pt"
|
|
58
|
+
permission="eea.faceted.configure"
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<browser:page
|
|
62
|
+
name="faceted_configure"
|
|
63
|
+
for="..interfaces.IFacetedNavigable"
|
|
64
|
+
class=".app.configure.FacetedFormHandler"
|
|
65
|
+
allowed_interface=".interfaces.IFacetedFormHandler"
|
|
66
|
+
permission="eea.faceted.configure"
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<browser:page
|
|
70
|
+
name="faceted_update_criteria"
|
|
71
|
+
for="..interfaces.IFacetedNavigable"
|
|
72
|
+
class=".app.configure.FacetedCriteriaHandler"
|
|
73
|
+
permission="eea.faceted.configure"
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
<browser:page
|
|
77
|
+
name="faceted_update_criterion"
|
|
78
|
+
for="..interfaces.IFacetedNavigable"
|
|
79
|
+
class=".app.configure.FacetedCriterionHandler"
|
|
80
|
+
permission="eea.faceted.configure"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<browser:page
|
|
84
|
+
name="faceted_update_position"
|
|
85
|
+
for="..interfaces.IFacetedNavigable"
|
|
86
|
+
class=".app.configure.FacetedPositionHandler"
|
|
87
|
+
permission="eea.faceted.configure"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<browser:page
|
|
91
|
+
name="faceted_query"
|
|
92
|
+
for="..interfaces.IFacetedNavigable"
|
|
93
|
+
class=".app.query.FacetedQueryHandler"
|
|
94
|
+
template="template/query.pt"
|
|
95
|
+
permission="zope2.View"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<browser:page
|
|
99
|
+
name="faceted_counter"
|
|
100
|
+
for="..interfaces.IFacetedNavigable"
|
|
101
|
+
class=".app.counter.FacetedQueryCounter"
|
|
102
|
+
template="template/counter.pt"
|
|
103
|
+
permission="zope2.View"
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<browser:page
|
|
107
|
+
name="faceted_exportimport"
|
|
108
|
+
for="..interfaces.IFacetedNavigable"
|
|
109
|
+
class=".app.exportimport.FacetedExportImport"
|
|
110
|
+
permission="eea.faceted.configure"
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<browser:page
|
|
114
|
+
name="faceted_schema"
|
|
115
|
+
for="..interfaces.IFacetedNavigable"
|
|
116
|
+
class=".app.schema.FacetedSchemaGetter"
|
|
117
|
+
permission="eea.faceted.configure"
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
<browser:page
|
|
121
|
+
name="default_widgets.xml"
|
|
122
|
+
for="..interfaces.IPossibleFacetedNavigable"
|
|
123
|
+
template="template/default.xml"
|
|
124
|
+
permission="eea.faceted.configure"
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
<browser:page
|
|
128
|
+
name="faceted.widget.error"
|
|
129
|
+
for="..interfaces.IFacetedNavigable"
|
|
130
|
+
class=".app.error.FacetedError"
|
|
131
|
+
template="template/error.pt"
|
|
132
|
+
permission="zope2.View"
|
|
133
|
+
/>
|
|
134
|
+
|
|
135
|
+
<browser:page
|
|
136
|
+
name="faceted.catalog.types.json"
|
|
137
|
+
for="..interfaces.IFacetedNavigable"
|
|
138
|
+
class=".app.catalog.FacetedCatalog"
|
|
139
|
+
attribute="json_types"
|
|
140
|
+
permission="zope2.View"
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<!-- BBB -->
|
|
144
|
+
<browser:resourceDirectory
|
|
145
|
+
name="facetednavigation"
|
|
146
|
+
directory="./static"
|
|
147
|
+
/>
|
|
148
|
+
|
|
149
|
+
<plone:static
|
|
150
|
+
directory="static"
|
|
151
|
+
name="facetednavigation"
|
|
152
|
+
type="plone"
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
</configure>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
""" Browser interfaces
|
|
2
|
+
"""
|
|
3
|
+
from zope.interface import Interface
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class IFacetedCriteriaHandler(Interface):
|
|
7
|
+
"""Edit faceted criteria"""
|
|
8
|
+
|
|
9
|
+
def add():
|
|
10
|
+
"""Add empty criterion"""
|
|
11
|
+
|
|
12
|
+
def edit():
|
|
13
|
+
"""Update criteria properties"""
|
|
14
|
+
|
|
15
|
+
def delete(paths):
|
|
16
|
+
"""Delete criteria by given paths (ids)"""
|
|
17
|
+
|
|
18
|
+
def __call__():
|
|
19
|
+
"""Call handler with"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class IFacetedCriterionHandler(Interface):
|
|
23
|
+
"""Edit faceted criterion in criteria"""
|
|
24
|
+
|
|
25
|
+
def add():
|
|
26
|
+
"""Add a criterion with properties"""
|
|
27
|
+
|
|
28
|
+
def edit(cid):
|
|
29
|
+
"""Edit criterion"""
|
|
30
|
+
|
|
31
|
+
def delete(cid):
|
|
32
|
+
"""Delete criterion by given cid"""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class IFacetedPositionHandler(Interface):
|
|
36
|
+
"""Handle criteria positions"""
|
|
37
|
+
|
|
38
|
+
def update():
|
|
39
|
+
"""Update position by given slots"""
|
|
40
|
+
|
|
41
|
+
def move_up():
|
|
42
|
+
"""Move criterion up"""
|
|
43
|
+
|
|
44
|
+
def move_down():
|
|
45
|
+
"""Move criterion down"""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class IFacetedFormHandler(Interface):
|
|
49
|
+
"""Handle criteria from a static form"""
|
|
50
|
+
|
|
51
|
+
def __call__():
|
|
52
|
+
"""Run appropiate handler"""
|