A mini language for reuse of information
Project description
visaplan.plone.infohubs
This product establishes a “mini language” for the calculation and re-use of information in Plone instances during the processing of a single request, e.g. when creating breadcrumbs; e.g., if the login state is important for the breadcrumb for /foo, that same state might be important for the /foo/bar breadcrumb as well.
It is part of the footing of the “Unitracc family” of Plone sites which are maintained by visaplan GmbH, Bochum, Germany; the mini-language was established during the development of the now factored-out package visaplan.plone.breadcrumbs.
The purpose of this package (for now) is not to provide new functionality but to factor out existing functionality from our former monolithic Zope product. Thus, it is more likely to lose functionality during further development (as parts of it will be forked out into their own packages, or some functionality may even become obsolete because there are better alternatives in standard Plone components).
Features
The info dictionary holds the collected information of interest during processing of the request.
The hub dictionary holds the tools which were used to get those information chunks.
For some named tools, there are abbreviations available (e.g. pc for portal_catalog), mostly for historical reasons.
Examples
This add-on can be seen in action at the following sites:
Installation and usage
Add visaplan.plone.infohubs to the requirements of your add-on.
Then, in your own code:
from visaplan.plone.infohubs import make_hubs ... # in some function or method where you have a meaningful context: hub, info = make_hubs(self.context) someval = info['some_known_key']
While getting the information for the given key some_known_key, the used tools will be stored in the hub dictionary, and other information found on the way will be stored in the info dictionary.
Contribute
Issue Tracker: https://github.com/visaplan/plone.infohubs/issues
Source Code: https://github.com/visaplan/plone.infohubs
Support
If you are having issues, please let us know; please use the issue tracker mentioned above.
License
The project is licensed under the GPLv2.
Contributors
Tobias Herp, tobias.herp@visaplan.com
Changelog
1.2.1 (2024-08-09)
Improvements:
info key ‘named_sizes’: don’t fail if impr.allowed_sizes is a tuple already
[tobiasherp]
1.2.0 (2020-12-16)
New Features:
@@infohubs-demo view to allow interactive tests; info keys and their values are listed in resolution order.
With visaplan.tools >= v1.3.1, the keys input field will take multiple keys to demonstrate.
info key my_translation: a proxy to get the appropriate language version for an object given by path or uid
Improvements:
If visaplan.zope.reldb is installed, the hub['sqlwrapper'] will use its wrapper for an SQLAlchemy -based database connection
Hard dependencies removed:
Package |
Depending features |
---|---|
|
|
|
|
visaplan.plone.pdfexport |
|
|
|
visaplan.plone.unitracctool |
|
Requirements:
If visaplan.zope.reldb is not installed but visaplan.plone.sqlwrapper is, the latter must be >= v1.0.3.
If visaplan.zope.reldb is installed, we don’t care whether or not visaplan.plone.sqlwrapper is installed as well, and which version.
[tobiasherp]
1.1.0 (2020-07-15)
New Features:
info key my_translation: a proxy to get the appropriate language version for an object given by path or uid
[tobiasherp]
1.0.2 (2019-05-09)
convenience function context_tuple, e.g. for methods with optional hub and info arguments
Explicitly raise TypeErrors instead of using assertions (context_and_form_tuple, context_tuple)
New info keys counter and counters
[tobiasherp]
1.0.1 (2019-01-31)
info['my_uid'] uses plone.uuid.interfaces.IUUID directly [tobiasherp]
1.0 (2018-09-17)
Initial release. [tobiasherp]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file visaplan.plone.infohubs-1.2.1.tar.gz
.
File metadata
- Download URL: visaplan.plone.infohubs-1.2.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.19.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b882be369c81217ad7c87e9a21205124a890f5b6742ed824aa3383ad8896c91 |
|
MD5 | f33a4ffe16daf6681d635e825653182d |
|
BLAKE2b-256 | 464209a0891def48428a09cd5551e1d67a02299a21396ca45d2ceed1dc5a6bc6 |