Question

I would like to 'unregister' a resource directory registered with configure zcml and the directive

I have uninstalled my custom add-on that originally registered the resource directory, but other packages are still able to call /++resource++my.package and bring in resources from the uninstalled addon... is there a directive to unregister it properly, or via ZMI or one-off script somehow?

Ref: http://plone.org/products/dexterity/documentation/manual/five.grok/browser-components/resource-directories

Was it helpful?

Solution

You are confused between install and uninstall of the persistent configurations, through the Plone control panel, and actual removal of the egg from your buildout.

Resource directories are registered in the package ZCML files, and are not persistent. You'll have to remove the package egg from your buildout for these ZCML files to not be loaded.

If you, for some reason, need code provided by the package egg but absolutely do not want the resources to be registered, you'll need to use the z3c.unconfigure package to unregister the resource directories again.

Unless they actively interfere with anything I see no need for you to do so, though. Note that there is absolutely no harm in having the resource URLs still available in your Plone site.

OTHER TIPS

You want to use z3c.unconfigure

http://pypi.python.org/pypi/z3c.unconfigure

Why wouldn't you just remove the unnecessary registration from your package, if you're not using it?

Another option would be to register the resource directory for a particular browser layer (I believe that's possible in ZCML, anyway) and then only install that layer with your package using browserlayer.xml in GenericSetup. That's more complex, though.

As Martijn says, however, there's no harm in leaving it where it is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top