Customize single file in resource directory

Hello Community,

I was wondering, if it is possible to customize just a single file which lives inside a resource directory (from an other package). I heard of z3c.jbot, but this seems to work for files inside CMF Skin Folders. Nevertheless, I tried it with jbot yesterday, but there was no avail.

My research on this topic showed, that this problem has been noted in 2009, see http://david.wglick.org/2009/report-from-the-berlinale-sprint-how-we-can-fix-the-plone-skin-situation/ saying

There’s no way to override just one item from a resource directory.

Are there today any improvements on this topic? What are my options?

best regards,
Paul

z3c.jbot can customize any resource. Perhaps you're not using it correctly. Can you share how you were using it?

There is also: https://github.com/collective/collective.jbot -- it's a TTW version of jbot but it's rough and might have bugs...

Sure I can. To give you some background. I intend to modify a javascript file of collective.ckeditor living in src/collective/ckeditor/browser/ckeditor/lang. If you want to verify this path, please look into the release version on Pypi.

Now I do the following steps:

  1. Create folder overrides/lang relative of my product root.
  2. Edit root configure.zcml:
  < include package="z3c.jbot" file="meta.zcml" />
  < browser:jbot directory = "overrides/lang"  />
  1. Create a copy of my file de.js into overrides/lang and rename it to collective.ckeditor.browser.ckeditor.lang.de.js
  2. Restart instance.
  3. Check if my version gets returned, when calling http://localhost:8080/Plone/++resource++ckeditor/lang/de.js

But then only the default version shows up.

I think the filename will need to be something more like: collective.ckeditor._src.ckeditor.lang.de.js

That's due to the setup of collective.ckeditor. The version on Github can be used to create releases, which will populate the folder /browser/ckeditor with the original files.

If you look into the zip file provided on Pypi, you will see the directory and files there. It's the very same directory specified in collective/ckeditor/browser/configure.zcml:

<browser:resourceDirectory
    name="ckeditor"
    directory="ckeditor"
  />

Sorry, I don't know then. It should work.