Op 25-04-12 19:37, Jean-Michel FRANCOIS schreef:
We all have suffer from some uninstall issue with some addons. I would
like to contribute to some addons for that
but it's not really clear to me on what should be achieved when
uninstall addons.

Yesterday I created an uninstall for Products.Poi:
https://github.com/collective/Products.Poi/commit/7d0ba27d9763c1042cb04cf7eab96818d31c3319

The strategy was:

- install Poi
- uninstall it
- copy profiles/default to profiles/uninstall
- for each item in profiles/uninstall check in the Plone Site whether stuff is left behind. If not, then delete the file, else add remove="True" in the correct spots or do whatever else is needed to further clean up the site.
- go to the top and try again.

One thing I noticed was that rolemap.xml does not support the 'remove' option. It will just crash. I decided not to do anything about that in Poi, so two roles and several permissions will still be around after uninstall. That may be cruft, but it should not break anything. Might be safer this way.

I have started some controlpanels to clean up things like persistent
import step (because some addons use import°step.xml) and some code
to remove usage of assigned view on content types to replace them with
the default view, ...

Please give me your feedback on this.

So those are general control panels that go through the site and fix things that may have been left behind by add-on products that are no longer available? Sounds handy.

Usually for a solution like this, I choose to not register a control panel, but just make some browser views available and make sure they are documented on PyPI. For example, I have just created a package to do some cleanup in the catalogs:
http://pypi.python.org/pypi/collective.catalogcleanup
Or a package to cleanup spam comments:
http://pypi.python.org/pypi/zest.commentcleanup

I may not even bother to give such a browser view a template that uses the main_template, or give it any template at all. It is ugly, but at least it keeps working when the main_template, or your skin in general, is broken, which may indeed be the case when you need to resort to a package like this.

Cheers,

--
Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to