ZClass Catalog Update
I created the following DTML method in the "methods" folder of a ZClass: <dtml-let URL1=HTTP_REFERER> <dtml-call "Catalog.manage_catalogReindex(REQUEST, RESPONSE, URL1)"> <dtml-call expr="RESPONSE.redirect(URL1)"> </dtml-let> I then created an "update" tab which calls this method from the "views" folder. The thing is, when I click on this tab, it updates the entire Catalog. It also requires that the person performing the update have additional permissions (within the Catalog). My questions are these: 1) Is there a way to update only the individual ZClass object in the catalog when someone clicks on the "update" tab? (as opposed to updating the whole Catalog). 2) What is the best way to deal with the permissions for this? Do I have to have two User Folders (and duplicate the username and password for each username in both User Folders) for each perosn who is publishing to the site: a) one UserFolder above the directory where these items are being published, b) the second UserFolder within the Catalog directory? 3) Additionally, I notice that when an object gets cataloged initally, the path to the object (as viewed in the Catalog) is from the root of the site, such as /myfolder/myobject. However, if I were to recatalog the site from the Control Panel, the path to the object now changes to: /mysite/myfolder/myobject Thanks in advance. John T.
KJZZ Webmaster wrote at 2004-1-16 14:59 -0700:
... <dtml-call "Catalog.manage_catalogReindex(REQUEST, RESPONSE, URL1)"> ... The thing is, when I click on this tab, it updates the entire Catalog.
"manage_catalogReindex" does what it name tells: it reindexes the catalog (a "well chosen name", I call this).
... My questions are these:
1) Is there a way to update only the individual ZClass object in the catalog
The method is "catalog_object" -- it, too, has a well chosen name ;-)
... 2) What is the best way to deal with the permissions for this?
A proxy role (read about them in the Zope Book, 2.6 edition).
... 3) Additionally, I notice that when an object gets cataloged initally, the path to the object (as viewed in the Catalog) is from the root of the site, such as /myfolder/myobject.
However, if I were to recatalog the site from the Control Panel, the path to the object now changes to: /mysite/myfolder/myobject
Please try to be precise when you describe problems: The "Control_Panel" does not allow you to recatalog anything. It is strange that "manage_catalogReindex" should change the path. In fact, it recatalogs the object with its original path. You must mean a different path (not the one returned via the "getPath" method). There are 2 base classes providing path awareness for ZCatalog: the old "ZCatalogAware" and the newer "ZCatalogPathAware". You should always use the new one (as the old one does not work with virtual hosting). -- Dieter
participants (2)
-
Dieter Maurer -
KJZZ Webmaster