[Zope] Preventing duplicates in ZCatalog

Wankyu Choi wankyu@neoqst.com
Wed, 23 Apr 2003 19:02:22 +0900


I found that this problem only occurs with CMF instances + virtual host
monster.=20

Normal Zope folders cause no such problem. Only CMF and Plone instances
cause this problem when virtual host monster maps a domain to their =
paths.

It's not even a CatalogAwareness problem either since a simple call to =
an
object's getPhysicalPath() via urls can demonstrate what's happening
internally:

- Add a CMF site named 'CMF'.

- Add and set up a virtual host monster in such a way that a certain =
domain,
www.example.com, for example, maps to the path of the CMF instance =
created
above.=20

- create a DTML method called 'test'=20

A call to this DTML method's getPhysicalPath() with the URL
"http://www.example.com/test/getPhysicalPath"  returns: ('', 'CMF', =
'test')

The URL "http://www.example.com/CMF/test/getPhysicalPath"  returns: ('',
'CMF', 'CMF', 'test')

The URL "http://www.example.com/CMF/CMF/CMF/CMF/test/getPhysicalPath"
returns: ('', 'CMF', 'CMF', 'CMF', 'CMF', 'CMF', 'test')

You get the idea. Without VHM, the problem disappears.

With VHM, one can create tons of duplicate entries in the portal_catalog =
as
demonstrated above.

I suspect the getPhysicalPath() method overriden in the CMF package =
doesn't
behave well with VHM.=20

I'm cc'ing this to the CMF maillinglist since it's more of a CMF problem =
:-)

How can I fix it? (or is it fixed in the upcoming CMF 1.4 ?)

TIA.

Wankyu Choi
---------------------------------------------------------------
  Wankyu Choi
  CEO/President
  NeoQuest Communications, Inc.
  http://www.zoper.net
  http://www.neoboard.net
---------------------------------------------------------------  =20