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.
Files changed (116) hide show
  1. rer/solrpush/__init__.py +7 -0
  2. rer/solrpush/adapters/__init__.py +1 -0
  3. rer/solrpush/adapters/configure.zcml +13 -0
  4. rer/solrpush/adapters/file.py +52 -0
  5. rer/solrpush/adapters/rss_feed.py +28 -0
  6. rer/solrpush/behaviors/__init__.py +0 -0
  7. rer/solrpush/behaviors/configure.zcml +16 -0
  8. rer/solrpush/behaviors/solr_fields.py +41 -0
  9. rer/solrpush/browser/__init__.py +0 -0
  10. rer/solrpush/browser/configure.zcml +111 -0
  11. rer/solrpush/browser/controlpanel.py +96 -0
  12. rer/solrpush/browser/elevate_settings.py +35 -0
  13. rer/solrpush/browser/maintenance.py +476 -0
  14. rer/solrpush/browser/query_debug.py +12 -0
  15. rer/solrpush/browser/querybuilder.py +168 -0
  16. rer/solrpush/browser/scales.py +80 -0
  17. rer/solrpush/browser/static/.gitkeep +0 -0
  18. rer/solrpush/browser/static/dist/dev/main.js +58240 -0
  19. rer/solrpush/browser/static/dist/dev/main.js.map +180 -0
  20. rer/solrpush/browser/static/dist/prod/main.js +9604 -0
  21. rer/solrpush/browser/static/dist/prod/main.js.map +1 -0
  22. rer/solrpush/browser/static/javascripts/FacetsContainer/index.js +46 -0
  23. rer/solrpush/browser/static/javascripts/ProgressBar/index.js +40 -0
  24. rer/solrpush/browser/static/javascripts/ProgressBarContainer/index.js +66 -0
  25. rer/solrpush/browser/static/javascripts/index.js +14 -0
  26. rer/solrpush/browser/static/package.json +13 -0
  27. rer/solrpush/browser/static/styles.css +22 -0
  28. rer/solrpush/browser/static/styles.css.map +1 -0
  29. rer/solrpush/browser/static/styles.scss +27 -0
  30. rer/solrpush/browser/static/yarn.lock +1408 -0
  31. rer/solrpush/browser/templates/controlpanel_layout.pt +49 -0
  32. rer/solrpush/browser/templates/query_debug.pt +17 -0
  33. rer/solrpush/browser/templates/reindex_solr.pt +35 -0
  34. rer/solrpush/configure.zcml +81 -0
  35. rer/solrpush/indexer.py +120 -0
  36. rer/solrpush/interfaces/__init__.py +8 -0
  37. rer/solrpush/interfaces/adapter.py +13 -0
  38. rer/solrpush/interfaces/elevate.py +98 -0
  39. rer/solrpush/interfaces/layer.py +6 -0
  40. rer/solrpush/interfaces/queueprocessor.py +6 -0
  41. rer/solrpush/interfaces/settings.py +194 -0
  42. rer/solrpush/locales/README.rst +37 -0
  43. rer/solrpush/locales/__init__.py +0 -0
  44. rer/solrpush/locales/en/LC_MESSAGES/rer.solrpush.mo +0 -0
  45. rer/solrpush/locales/en/LC_MESSAGES/rer.solrpush.po +399 -0
  46. rer/solrpush/locales/it/LC_MESSAGES/rer.solrpush.mo +0 -0
  47. rer/solrpush/locales/it/LC_MESSAGES/rer.solrpush.po +399 -0
  48. rer/solrpush/locales/rer.solrpush.pot +402 -0
  49. rer/solrpush/locales/update.py +71 -0
  50. rer/solrpush/locales/update.sh +12 -0
  51. rer/solrpush/parser.py +211 -0
  52. rer/solrpush/permissions.zcml +18 -0
  53. rer/solrpush/profiles/default/actions.xml +21 -0
  54. rer/solrpush/profiles/default/browserlayer.xml +7 -0
  55. rer/solrpush/profiles/default/catalog.xml +4 -0
  56. rer/solrpush/profiles/default/controlpanel.xml +31 -0
  57. rer/solrpush/profiles/default/metadata.xml +8 -0
  58. rer/solrpush/profiles/default/registry/bundle.xml +25 -0
  59. rer/solrpush/profiles/default/registry/criteria.xml +55 -0
  60. rer/solrpush/profiles/default/registry/settings.xml +6 -0
  61. rer/solrpush/profiles/default/rolemap.xml +13 -0
  62. rer/solrpush/profiles/default/types/Document.xml +12 -0
  63. rer/solrpush/profiles/to_1100/componentregistry.xml +9 -0
  64. rer/solrpush/profiles/to_1100/metadata.xml +5 -0
  65. rer/solrpush/profiles/to_1300/controlpanel.xml +13 -0
  66. rer/solrpush/profiles/to_1300/registry.xml +5 -0
  67. rer/solrpush/profiles/uninstall/browserlayer.xml +7 -0
  68. rer/solrpush/profiles/uninstall/controlpanel.xml +21 -0
  69. rer/solrpush/profiles/uninstall/registry.xml +17 -0
  70. rer/solrpush/restapi/__init__.py +0 -0
  71. rer/solrpush/restapi/configure.zcml +8 -0
  72. rer/solrpush/restapi/services/__init__.py +0 -0
  73. rer/solrpush/restapi/services/configure.zcml +8 -0
  74. rer/solrpush/restapi/services/elevate_schema/__init__.py +0 -0
  75. rer/solrpush/restapi/services/elevate_schema/configure.zcml +14 -0
  76. rer/solrpush/restapi/services/elevate_schema/get.py +12 -0
  77. rer/solrpush/restapi/services/solr_search/__init__.py +0 -0
  78. rer/solrpush/restapi/services/solr_search/batch.py +129 -0
  79. rer/solrpush/restapi/services/solr_search/configure.zcml +14 -0
  80. rer/solrpush/restapi/services/solr_search/get.py +25 -0
  81. rer/solrpush/restapi/services/solr_search/solr_search_handler.py +86 -0
  82. rer/solrpush/setuphandlers.py +20 -0
  83. rer/solrpush/testing.py +161 -0
  84. rer/solrpush/tests/__init__.py +0 -0
  85. rer/solrpush/tests/docs/example.docx +0 -0
  86. rer/solrpush/tests/docs/example.ods +0 -0
  87. rer/solrpush/tests/docs/example.pdf +0 -0
  88. rer/solrpush/tests/docs/plone_logo.png +0 -0
  89. rer/solrpush/tests/test_behaviors.py +61 -0
  90. rer/solrpush/tests/test_elevate.py +124 -0
  91. rer/solrpush/tests/test_events.py +181 -0
  92. rer/solrpush/tests/test_image_tags.py +85 -0
  93. rer/solrpush/tests/test_maintenance.py +165 -0
  94. rer/solrpush/tests/test_querybuilder.py +272 -0
  95. rer/solrpush/tests/test_restapi_search.py +127 -0
  96. rer/solrpush/tests/test_search.py +177 -0
  97. rer/solrpush/tests/test_setup.py +67 -0
  98. rer/solrpush/tests/test_solr_interface.py +359 -0
  99. rer/solrpush/tests/test_tika.py +85 -0
  100. rer/solrpush/tests/test_vocabularies.py +113 -0
  101. rer/solrpush/upgrades.py +76 -0
  102. rer/solrpush/upgrades.zcml +86 -0
  103. rer/solrpush/utils/__init__.py +6 -0
  104. rer/solrpush/utils/solr_common.py +122 -0
  105. rer/solrpush/utils/solr_indexer.py +295 -0
  106. rer/solrpush/utils/solr_search.py +352 -0
  107. rer/solrpush/vocabularies.py +50 -0
  108. rer.solrpush-1.3.4-py3.10-nspkg.pth +1 -0
  109. rer.solrpush-1.3.4.dist-info/LICENSE.GPL +339 -0
  110. rer.solrpush-1.3.4.dist-info/LICENSE.rst +15 -0
  111. rer.solrpush-1.3.4.dist-info/METADATA +507 -0
  112. rer.solrpush-1.3.4.dist-info/RECORD +116 -0
  113. rer.solrpush-1.3.4.dist-info/WHEEL +5 -0
  114. rer.solrpush-1.3.4.dist-info/entry_points.txt +5 -0
  115. rer.solrpush-1.3.4.dist-info/namespace_packages.txt +1 -0
  116. rer.solrpush-1.3.4.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["webpack:///main.js"],"mappings":"AAAA;;;;;AA4dA;;;;;;;;AAooBA;;;;;;;;AAmCA;;;;;;;;AAsSA;;;;;;;AAuFA","sourceRoot":""}
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { object } from 'prop-types';
3
+
4
+ const FacetsContainer = ({ facets }) => {
5
+ if (!facets) {
6
+ return '';
7
+ }
8
+ return (
9
+ <div
10
+ className="facets-container"
11
+ style={{ flex: '30%', marginRight: '1em' }}
12
+ >
13
+ <h3>Facets</h3>
14
+ {Object.keys(facets).map((id, i) => {
15
+ const facet_values = facets[id];
16
+ return (
17
+ <div
18
+ key={i}
19
+ className="facet"
20
+ style={{
21
+ backgroundColor: '#eee',
22
+ padding: '5px 20px',
23
+ margin: '10px 0',
24
+ }}
25
+ >
26
+ <strong>{id}</strong>
27
+ {facet_values.map((val, idx) => {
28
+ const key = Object.keys(val)[0];
29
+ return (
30
+ <div key={`${id}-${idx}`}>
31
+ {key} [{val[key]}]
32
+ </div>
33
+ );
34
+ })}
35
+ </div>
36
+ );
37
+ })}
38
+ </div>
39
+ );
40
+ };
41
+
42
+ FacetsContainer.propTypes = {
43
+ facets: object,
44
+ };
45
+
46
+ export default FacetsContainer;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Line } from 'rc-progress';
3
+ import { number, string, bool } from 'prop-types';
4
+
5
+ const ProgressBar = ({ tot, counter, message, error }) => {
6
+ if (error) {
7
+ return <div className="status-message">{message || 'Generic Error.'}</div>;
8
+ }
9
+ const progress = tot === 0 ? 0 : Math.floor((counter * 100) / tot);
10
+ return (
11
+ <React.Fragment>
12
+ {message ? <div>{message}</div> : ''}
13
+ <div className="status-bar">
14
+ <Line
15
+ percent={progress}
16
+ strokeWidth="2"
17
+ strokeLinecap="butt"
18
+ strokeColor={progress === 100 ? '#008000' : '#007bb1'}
19
+ />
20
+ {}
21
+ {tot > 0 ? (
22
+ <div>
23
+ {counter}/{tot} ({progress}%)
24
+ </div>
25
+ ) : (
26
+ ''
27
+ )}
28
+ </div>
29
+ </React.Fragment>
30
+ );
31
+ };
32
+
33
+ ProgressBar.propTypes = {
34
+ tot: number,
35
+ counter: number,
36
+ message: string,
37
+ error: bool,
38
+ };
39
+
40
+ export default ProgressBar;
@@ -0,0 +1,66 @@
1
+ import React, { useState } from 'react';
2
+ import axios from 'axios';
3
+ import { string } from 'prop-types';
4
+ import Spinner from 'react-svg-spinner';
5
+ import ProgressBar from '../ProgressBar';
6
+
7
+ const ProgressBarContainer = ({ authenticator, action }) => {
8
+ const defaultData = {
9
+ in_progress: true,
10
+ tot: 0,
11
+ counter: 0,
12
+ message: '',
13
+ error: false,
14
+ };
15
+ const [intervalId, setIntervalId] = useState();
16
+ const [reindexStart, setReindexStart] = useState(false);
17
+ const [data, setData] = useState(defaultData);
18
+
19
+ const portalUrl = document.body
20
+ ? document.body.getAttribute('data-portal-url') || ''
21
+ : '';
22
+
23
+ const doCancel = () => {
24
+ window.location.href = `${portalUrl}/@@solrpush-settings`;
25
+ };
26
+
27
+ const doReindex = () => {
28
+ setData(defaultData);
29
+ setReindexStart(true);
30
+ axios(`${portalUrl}/${action}`, {
31
+ params: { _authenticator: authenticator },
32
+ });
33
+ const intervalId = setInterval(function () {
34
+ axios(`${portalUrl}/reindex-progress`).then((result) =>
35
+ setData(result.data),
36
+ );
37
+ }, 5000);
38
+ setIntervalId(intervalId);
39
+ };
40
+
41
+ const { in_progress } = data;
42
+ if (reindexStart && !in_progress) {
43
+ setReindexStart(false);
44
+ clearInterval(intervalId);
45
+ }
46
+ return (
47
+ <div className="maintenance-wrapper">
48
+ <div className="formControls">
49
+ <button onClick={doReindex} disabled={reindexStart}>
50
+ Start {reindexStart ? <Spinner /> : ''}
51
+ </button>{' '}
52
+ <button onClick={doCancel} disabled={reindexStart}>
53
+ Cancel
54
+ </button>
55
+ </div>
56
+ <ProgressBar {...data} />
57
+ </div>
58
+ );
59
+ };
60
+
61
+ ProgressBarContainer.propTypes = {
62
+ authenticator: string,
63
+ action: string,
64
+ };
65
+
66
+ export default ProgressBarContainer;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import ProgressBarContainer from './ProgressBarContainer';
4
+
5
+ const rootElement = document.getElementById('solr-maintenance');
6
+
7
+ if (rootElement) {
8
+ const authenticator = rootElement.getAttribute('data-authenticator');
9
+ const action = rootElement.getAttribute('data-action');
10
+ ReactDOM.render(
11
+ <ProgressBarContainer authenticator={authenticator} action={action} />,
12
+ rootElement,
13
+ );
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "rer-solrpush",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "license": "MIT",
6
+ "scripts": {
7
+ "build": "sass styles.scss styles.css"
8
+ },
9
+ "dependencies": {
10
+ "node-sass": "^5.0.0",
11
+ "sass": "^1.29.0"
12
+ }
13
+ }
@@ -0,0 +1,22 @@
1
+ body.template-elevate-settings .datagridwidget-table-view .header {
2
+ vertical-align: top;
3
+ }
4
+ body.template-elevate-settings .datagridwidget-cell {
5
+ vertical-align: middle;
6
+ padding: 0.5rem;
7
+ }
8
+ body.template-elevate-settings .datagridwidget-cell.cell-2 {
9
+ width: 40%;
10
+ }
11
+ body.template-elevate-settings .datagridwidget-cell .select2-container {
12
+ margin-bottom: 0.5rem;
13
+ }
14
+ body.template-elevate-settings .datagridwidget-cell input[type=text] {
15
+ padding: 6px 12px;
16
+ }
17
+ body.template-elevate-settings .datagridwidget-manipulator {
18
+ padding: 1rem 0.5rem;
19
+ vertical-align: middle;
20
+ }
21
+
22
+ /*# sourceMappingURL=styles.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["styles.scss"],"names":[],"mappings":"AACE;EACE;;AAGF;EACE;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;AAIJ;EACE;EACA","file":"styles.css"}
@@ -0,0 +1,27 @@
1
+ body.template-elevate-settings {
2
+ .datagridwidget-table-view .header {
3
+ vertical-align: top;
4
+ }
5
+
6
+ .datagridwidget-cell {
7
+ vertical-align: middle;
8
+ padding: 0.5rem;
9
+
10
+ &.cell-2 {
11
+ width: 40%;
12
+ }
13
+
14
+ .select2-container {
15
+ margin-bottom: 0.5rem;
16
+ }
17
+
18
+ input[type='text'] {
19
+ padding: 6px 12px;
20
+ }
21
+ }
22
+
23
+ .datagridwidget-manipulator {
24
+ padding: 1rem 0.5rem;
25
+ vertical-align: middle;
26
+ }
27
+ }