Attention

This document was written for an unsupported version of Plone, Plone 2.5.x, and was last updated 1239 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

View an object's catalog information

by Dan Thomas last modified Dec 30, 2008 03:03 PM
This little utility is really useful to me. I'm not sure it's posted elsewhere, it comes from Joel Burton originally. Inspect any content on your site (including folders) by appending /getCatInfo to the URL.

In your Plone root, from the ZMI, add a Script (Python). Give it the id getCatInfo, and use the code below:

from string import join
obid = context.id
path = join(context.getPhysicalPath(), '/') 
results = container.portal_catalog(path=path,getID=obid,sort_on='created',sort_order='reverse')
rid = ''
for r in results:
     rid = r.getRID()
if rid:
     print container.portal_catalog.manage_objectInformation(rid=rid)
else:
     print "Not in the catalog, apparently."
return printed

After you save this, you can append /getCatInfo to any Plone URL to get complete catalog information about the page, folder, link, etc. you are looking at.

 


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.