Skip to main content

Overview

The archetypes.fieldtraverser is used to traverse to an Archetypes field and access its storage.

It patches Products.Archetypes so that it uses the fieldtraverser for access to fields.

Use Cases

  • Access to images, files or other binary data via AnnotationStorage instead of traditional AttributeStorage. archetypes.fieldtraverser eliminates the need to hack __bobo_traverse__ for this. Advantage: When accessing objects with binary data stored in an AttributeStorage, much binary data chunks are loaded regardless if they are used. When doing this quite often the ZODB is unnecessarily stressed.

  • You can use archetypes.fieldtraverser for simple Web Services which return just the content of Archetypes fields without the HTML rendered by widgets.

  • Impress your friends by easily accessing field-contents via URLs.

Usage

In an URL this traverser can be used to access a fields data by use of the fieldname and the storage variant if needed (such as image sizes):

obj/++atfield++FIELDNAME

or

obj/++atfield++FIELDNAME-STORAGENAME

Example

To access an original image from a field named ‘photo’:

obj/++atfield++photo

To access its thumbnail with size named ‘thumb’:

obj/++atfield++photo-thumb

Dependencies

Products.Archetypes

Installation

Install like any other Plone egg and import the GenericSetup profiles in ZMI, portal_setup.

Known Issues

The ImageWidget, FileWidget and RichWidget are patched to use the ++atfield++FIELDNAME notation for accessing binary contents. This patch is done via updating the fields’ _properties which is then copied in the concrete schematas. But our default patch mechanism does not affect ATContentTypes (and possibly other ConentTypes too) because they are loaded by Zope BEFORE the patches are applied. This happens also for eggified products in Plone3.2 because Products.ATContentTypes is being recognised as a Product by Zope/Five because of the “Products” namespace. Therefore Products.ATContentTypes is loaded BEFORE any eggs are loaded. So we have to patch the concrete ATContentTypes too. See patch.py for more information.

Please note that RichWidget has the ability to upload and download files, and therefore we also provide custom fieldtraverser aware widgets. BUT the upload/download feature is deactivated by default in the RichWidget templates and settings. The RichWidget patching is done just for completeness.

So, if you include your own Products or eggs in the “Products” namespace you’ll also have to patch your content types to use our fieldtraverser aware widgets. With this in mind using this product should not be a problem.

For your pleasure

An “Easter egg” can be found when opening “++resource++plone.jpg” in your Plone site. For more information read archetypes/fieldtraverser/tests/plone.jpg.CREDITS

Credits

Release files for archetypes.fieldtraverser 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for archetypes.fieldtraverser 0.4.4
File Size Uploaded
archetypes.fieldtraverser-0.4.4.tar.gz 37.2 kB Details

Release files / archetypes.fieldtraverser-0.4.4.tar.gz

Download URL archetypes.fieldtraverser-0.4.4.tar.gz
Size 37.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7be7baa85116f93d36705c7a79080e2daf7fd8814ac6c5acb68b88ad9e0fc553
BLAKE2b-256 checksum
How to use checksums
86ab35796a75108fbc0e2a40e362b267d62aea664569f20d7cd038509155a07e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4.4 This release

1 release file

0.2.1

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page