Resource registries Plone 5: ++plone++ namespace and overriding single resources

From the documentation on the new resources registries:

http://docs.plone.org/adapt-and-extend/theming/resourceregistry.html#the-plone-traversal-namespace

The ++plone++ traversal namespace
We have a new plone.resource based traversal namespace called ++plone++. Plone registers the Products.CMFPlone.static folder for this traversal namespace. Resource contained in this namespace can be stored in the ZODB (where they are looked up first, by default) or in the filesystem. This allows us to customize filesystem based resources Through-The-Web. One advantage of this new namespace over the existing ++resource++ and ++theme++ namespaces is that you may override resources in this namespace one file at a time, rather than needing to override the entire directory.

I am missing some context/information here what this the overriding of single resources means:

  • Can I override single resources in an add'on or in a policy package add'on? Or is this only accessible in the overrides tab in the resource registry control panel and not doable from the filesystem?

  • From what I understand the problem with the zcml/zope Resourcedirectorries is that you cannot override single resources from a resourceDirectory in zcml. So some add'ons add there resources one registration at a time in zcml so that they can be overriden in other zcml. Is this related to solve this issue?

I have the same question.
I need to override some wrong translations in builded tinymce and that resource is available here:

++plone++static/components/tinymce-builded/js/tinymce/langs/it.js

Is there a way to override that js in my addon?
I tried to override it TTW in the resources registry, but i can't find the tiny resources under "/langs".

I believe, it should be possible to create the overriding path manually with BTreeFolder2 and File objects through ZMI at

portal_resources/resource_overrides/manage

into

portal_resources/resource_overrides/static/components/tinymce-builded/js/tinymce/langs/it.js

And you should be able to confirm if it works by refreshing ++plone++static/components/tinymce-builded/js/tinymce/langs/it.js.

I'm not a big fan of ttw editing, but i tried it anyway :wink: ..and doesn't work.

It seems that at some level, filesystem files always wins against ttw ones.

I recreated the exact folder structure, but here's what i see for every step:

http://localhost:8080/Plone/++plone++static/components

<PersistentResourceDirectory object at /Plone/portal_resources/resource_overrides/static/components>

http://localhost:8080/Plone/++plone++static/components/

<FilesystemResourceDirectory object at components>

http://localhost:8080/Plone/++plone++static/components/tinymce-builded

<FilesystemResourceDirectory object at tinymce-builded>

And from now on, filesystem resource directories wins over ttw folders so i can't reach my custom resource

Fixed in https://github.com/zopefoundation/z3c.jbot/pull/12