Personal tools
You are here: Home dk Work Documentation How-tos Find which Plone Sites have a Product Installed
Document Actions

Find which Plone Sites have a Product Installed


This How-to is intended for: Developers

When upgrading a Product a Zope instance with shared Plone Sites, it helps to know which sites have the Product installed.

Add a Script (Python) to the Zope root folder.

I called mine isProdInstalled.

It has a parameter of productname.


# check which plone sites have a product installed. 
# Product is is hand entered when running the Test tab

from Products.CMFCore.utils import getToolByName

objects = context.objectValues()                       

for object in objects:
    if object.meta_type == 'Plone Site':
        portal = getToolByName(object,'portal_url').getPortalObject()
        qi = getToolByName(portal, 'portal_quickinstaller')
        if qi.isProductInstalled(productname):
            print productname, "is installed in:", object.id

return printed

From the ZMI, when you select the Test tab, you will see a box asking for the productname, enter something like PloneFormGen and you should see the Plone site IDs that have this product installed.


If you want to run from a URL, you must pass the parameter: something like this:

    http://127.0.0.1:8080/isProdInstalled/?productname=PloneFormGen



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: