How to list the installed products in your Zope
by
T. Kim Nguyen
—
last modified
Jun 23, 2009 04:19 PM
a script that iterates over the sites folders and Plone sites in your Zope, showing which products have been installed via quickinstaller
At the root of your Zope, add a Script(Python) object with the following body. Call it ".listInstalledProducts" so that it appears before most other items in the ZMI view.
# Script to place in Zope root that shows which non-standard products
# are installed in all the contained Plone sites.
from Products.CMFCore.utils import getToolByName
productsToSkip = [ 'ATContentTypes', 'ATReferenceBrowserWidget', 'Archetypes', 'CMFActionIcons', 'CMFCalendar', 'CMFFormController', 'CMFPlacefulWorkflow', 'GroupUserFolder', 'MimetypesRegistry', 'PasswordResetTool', 'PlonePAS', 'PortalTransforms', 'ResourceRegistries', 'kupu', 'CMFSquidTool', 'Products.CMFSquidTool', 'CacheSetup']
for itemTuple in context.items():
(item, itemType) = itemTuple
if str(itemType).startswith('<PloneSite at '):
site = getattr(context, item)
pq = getToolByName(site, "portal_quickinstaller")
print "Plone site '<a href='%s/portal_quickinstaller/manage_workspace'>%s</a>'<br>" % (item, item)
for product in pq.listInstalledProducts():
pid = product['id']
if pid not in productsToSkip:
print " Has installed product '%s'<br>" % pid
if str(itemType).startswith('<Folder at '):
folder = getattr(context, item)
for folderItemTuple in folder.items():
(folderItem, folderItemType) = folderItemTuple
if str(folderItemType).startswith('<PloneSite at '):
site = getattr(folder, folderItem)
pq = getToolByName(site, "portal_quickinstaller")
print "Plone site '<a href='%s/%s/portal_quickinstaller/manage_workspace'>%s</a>'<br>" % (folder.id, folderItem, folderItem)
for product in pq.listInstalledProducts():
pid = product['id']
if pid not in productsToSkip:
print " Has installed product '%s'<br>" % pid
return printed











