rer.solrpush 1.3.4__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.
- rer/solrpush/__init__.py +7 -0
- rer/solrpush/adapters/__init__.py +1 -0
- rer/solrpush/adapters/configure.zcml +13 -0
- rer/solrpush/adapters/file.py +52 -0
- rer/solrpush/adapters/rss_feed.py +28 -0
- rer/solrpush/behaviors/__init__.py +0 -0
- rer/solrpush/behaviors/configure.zcml +16 -0
- rer/solrpush/behaviors/solr_fields.py +41 -0
- rer/solrpush/browser/__init__.py +0 -0
- rer/solrpush/browser/configure.zcml +111 -0
- rer/solrpush/browser/controlpanel.py +96 -0
- rer/solrpush/browser/elevate_settings.py +35 -0
- rer/solrpush/browser/maintenance.py +476 -0
- rer/solrpush/browser/query_debug.py +12 -0
- rer/solrpush/browser/querybuilder.py +168 -0
- rer/solrpush/browser/scales.py +80 -0
- rer/solrpush/browser/static/.gitkeep +0 -0
- rer/solrpush/browser/static/dist/dev/main.js +58240 -0
- rer/solrpush/browser/static/dist/dev/main.js.map +180 -0
- rer/solrpush/browser/static/dist/prod/main.js +9604 -0
- rer/solrpush/browser/static/dist/prod/main.js.map +1 -0
- rer/solrpush/browser/static/javascripts/FacetsContainer/index.js +46 -0
- rer/solrpush/browser/static/javascripts/ProgressBar/index.js +40 -0
- rer/solrpush/browser/static/javascripts/ProgressBarContainer/index.js +66 -0
- rer/solrpush/browser/static/javascripts/index.js +14 -0
- rer/solrpush/browser/static/package.json +13 -0
- rer/solrpush/browser/static/styles.css +22 -0
- rer/solrpush/browser/static/styles.css.map +1 -0
- rer/solrpush/browser/static/styles.scss +27 -0
- rer/solrpush/browser/static/yarn.lock +1408 -0
- rer/solrpush/browser/templates/controlpanel_layout.pt +49 -0
- rer/solrpush/browser/templates/query_debug.pt +17 -0
- rer/solrpush/browser/templates/reindex_solr.pt +35 -0
- rer/solrpush/configure.zcml +81 -0
- rer/solrpush/indexer.py +120 -0
- rer/solrpush/interfaces/__init__.py +8 -0
- rer/solrpush/interfaces/adapter.py +13 -0
- rer/solrpush/interfaces/elevate.py +98 -0
- rer/solrpush/interfaces/layer.py +6 -0
- rer/solrpush/interfaces/queueprocessor.py +6 -0
- rer/solrpush/interfaces/settings.py +194 -0
- rer/solrpush/locales/README.rst +37 -0
- rer/solrpush/locales/__init__.py +0 -0
- rer/solrpush/locales/en/LC_MESSAGES/rer.solrpush.mo +0 -0
- rer/solrpush/locales/en/LC_MESSAGES/rer.solrpush.po +399 -0
- rer/solrpush/locales/it/LC_MESSAGES/rer.solrpush.mo +0 -0
- rer/solrpush/locales/it/LC_MESSAGES/rer.solrpush.po +399 -0
- rer/solrpush/locales/rer.solrpush.pot +402 -0
- rer/solrpush/locales/update.py +71 -0
- rer/solrpush/locales/update.sh +12 -0
- rer/solrpush/parser.py +211 -0
- rer/solrpush/permissions.zcml +18 -0
- rer/solrpush/profiles/default/actions.xml +21 -0
- rer/solrpush/profiles/default/browserlayer.xml +7 -0
- rer/solrpush/profiles/default/catalog.xml +4 -0
- rer/solrpush/profiles/default/controlpanel.xml +31 -0
- rer/solrpush/profiles/default/metadata.xml +8 -0
- rer/solrpush/profiles/default/registry/bundle.xml +25 -0
- rer/solrpush/profiles/default/registry/criteria.xml +55 -0
- rer/solrpush/profiles/default/registry/settings.xml +6 -0
- rer/solrpush/profiles/default/rolemap.xml +13 -0
- rer/solrpush/profiles/default/types/Document.xml +12 -0
- rer/solrpush/profiles/to_1100/componentregistry.xml +9 -0
- rer/solrpush/profiles/to_1100/metadata.xml +5 -0
- rer/solrpush/profiles/to_1300/controlpanel.xml +13 -0
- rer/solrpush/profiles/to_1300/registry.xml +5 -0
- rer/solrpush/profiles/uninstall/browserlayer.xml +7 -0
- rer/solrpush/profiles/uninstall/controlpanel.xml +21 -0
- rer/solrpush/profiles/uninstall/registry.xml +17 -0
- rer/solrpush/restapi/__init__.py +0 -0
- rer/solrpush/restapi/configure.zcml +8 -0
- rer/solrpush/restapi/services/__init__.py +0 -0
- rer/solrpush/restapi/services/configure.zcml +8 -0
- rer/solrpush/restapi/services/elevate_schema/__init__.py +0 -0
- rer/solrpush/restapi/services/elevate_schema/configure.zcml +14 -0
- rer/solrpush/restapi/services/elevate_schema/get.py +12 -0
- rer/solrpush/restapi/services/solr_search/__init__.py +0 -0
- rer/solrpush/restapi/services/solr_search/batch.py +129 -0
- rer/solrpush/restapi/services/solr_search/configure.zcml +14 -0
- rer/solrpush/restapi/services/solr_search/get.py +25 -0
- rer/solrpush/restapi/services/solr_search/solr_search_handler.py +86 -0
- rer/solrpush/setuphandlers.py +20 -0
- rer/solrpush/testing.py +161 -0
- rer/solrpush/tests/__init__.py +0 -0
- rer/solrpush/tests/docs/example.docx +0 -0
- rer/solrpush/tests/docs/example.ods +0 -0
- rer/solrpush/tests/docs/example.pdf +0 -0
- rer/solrpush/tests/docs/plone_logo.png +0 -0
- rer/solrpush/tests/test_behaviors.py +61 -0
- rer/solrpush/tests/test_elevate.py +124 -0
- rer/solrpush/tests/test_events.py +181 -0
- rer/solrpush/tests/test_image_tags.py +85 -0
- rer/solrpush/tests/test_maintenance.py +165 -0
- rer/solrpush/tests/test_querybuilder.py +272 -0
- rer/solrpush/tests/test_restapi_search.py +127 -0
- rer/solrpush/tests/test_search.py +177 -0
- rer/solrpush/tests/test_setup.py +67 -0
- rer/solrpush/tests/test_solr_interface.py +359 -0
- rer/solrpush/tests/test_tika.py +85 -0
- rer/solrpush/tests/test_vocabularies.py +113 -0
- rer/solrpush/upgrades.py +76 -0
- rer/solrpush/upgrades.zcml +86 -0
- rer/solrpush/utils/__init__.py +6 -0
- rer/solrpush/utils/solr_common.py +122 -0
- rer/solrpush/utils/solr_indexer.py +295 -0
- rer/solrpush/utils/solr_search.py +352 -0
- rer/solrpush/vocabularies.py +50 -0
- rer.solrpush-1.3.4-py3.10-nspkg.pth +1 -0
- rer.solrpush-1.3.4.dist-info/LICENSE.GPL +339 -0
- rer.solrpush-1.3.4.dist-info/LICENSE.rst +15 -0
- rer.solrpush-1.3.4.dist-info/METADATA +507 -0
- rer.solrpush-1.3.4.dist-info/RECORD +116 -0
- rer.solrpush-1.3.4.dist-info/WHEEL +5 -0
- rer.solrpush-1.3.4.dist-info/entry_points.txt +5 -0
- rer.solrpush-1.3.4.dist-info/namespace_packages.txt +1 -0
- rer.solrpush-1.3.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from Products.Five.browser import BrowserView
|
|
3
|
+
from zope.publisher.interfaces import IPublishTraverse
|
|
4
|
+
from zope.interface import implementer
|
|
5
|
+
from plone import api
|
|
6
|
+
|
|
7
|
+
import six
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SolrScalesHandler(BrowserView):
|
|
11
|
+
"""
|
|
12
|
+
View callable on SolrBrain contents that mimic @@images.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def tag(
|
|
16
|
+
self,
|
|
17
|
+
fieldname=None,
|
|
18
|
+
scale=None,
|
|
19
|
+
css_class="",
|
|
20
|
+
alt=None,
|
|
21
|
+
title=None,
|
|
22
|
+
direction="thumbnail",
|
|
23
|
+
loading="lazy",
|
|
24
|
+
**args
|
|
25
|
+
):
|
|
26
|
+
if not title:
|
|
27
|
+
title = self.context.Title
|
|
28
|
+
if not alt:
|
|
29
|
+
alt = self.context.Description or self.context.Title
|
|
30
|
+
|
|
31
|
+
if six.PY2:
|
|
32
|
+
title = title.encode("utf-8")
|
|
33
|
+
alt = alt.encode("utf-8")
|
|
34
|
+
|
|
35
|
+
# needed for cache invalidation
|
|
36
|
+
date = self.context.modified.strftime("%Y%m%d%H%M%S")
|
|
37
|
+
|
|
38
|
+
html = '<img src="{url}/@@solr-images/{fieldname}/{scale}?direction={direction}&v={date}" alt="{alt}" title="{title}" loading="{loading}"'.format(
|
|
39
|
+
url=self.context.getURL(),
|
|
40
|
+
fieldname=fieldname or "image",
|
|
41
|
+
scale=scale or "thumb",
|
|
42
|
+
alt=alt,
|
|
43
|
+
title=title,
|
|
44
|
+
loading=loading,
|
|
45
|
+
direction=direction,
|
|
46
|
+
date=date,
|
|
47
|
+
)
|
|
48
|
+
if css_class:
|
|
49
|
+
html += ' class="{}"'.format(css_class)
|
|
50
|
+
if args:
|
|
51
|
+
for key, value in sorted(args.items()):
|
|
52
|
+
if value:
|
|
53
|
+
html += ' {}="{}"'.format(key, value)
|
|
54
|
+
html += ">"
|
|
55
|
+
return html
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@implementer(IPublishTraverse)
|
|
59
|
+
class SolrImages(BrowserView):
|
|
60
|
+
def __init__(self, context, request):
|
|
61
|
+
super(SolrImages, self).__init__(context, request)
|
|
62
|
+
self.name = ""
|
|
63
|
+
self.scale = ""
|
|
64
|
+
|
|
65
|
+
def publishTraverse(self, request, name):
|
|
66
|
+
self.name = name
|
|
67
|
+
stack = request.get("TraversalRequestNameStack")
|
|
68
|
+
if stack:
|
|
69
|
+
self.scale = stack.pop()
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def __call__(self):
|
|
73
|
+
direction = self.request.form.get("direction", "thumbnail")
|
|
74
|
+
scales = api.content.get_view(
|
|
75
|
+
name="images", context=self.context, request=self.request
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return self.request.response.redirect(
|
|
79
|
+
scales.scale(self.name, scale=self.scale, direction=direction).url
|
|
80
|
+
)
|
|
File without changes
|