Skip to content

Commit

Permalink
Fixed resolve_url issues and removing items from catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Pelletier committed Aug 31, 1999
1 parent 3a574d6 commit 2e30b1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 7 additions & 9 deletions ZCatalog.py
Expand Up @@ -217,7 +217,7 @@ def manage_catalogObject(self, REQUEST, urls=None):
# if an error happens here, the catalog will be in
# an unstable state. If this happens, ignore the
# object.
obj = REQUEST.resolve_url(url, REQUEST)
obj = self.resolve_url(url, REQUEST)
except:
continue

Expand All @@ -229,11 +229,12 @@ def manage_catalogObject(self, REQUEST, urls=None):

def manage_uncatalogObject(self, REQUEST, urls=None):
""" removes Zope object 'urls' from catalog """

## import pdb
## pdb.set_trace()
if urls:
for url in urls:
try:
obj = REQUEST.resolve_url(url, REQUEST)
obj = self.resolve_url(url, REQUEST)
except:
continue
self.uncatalog_object(url)
Expand All @@ -246,11 +247,11 @@ def manage_catalogReindex(self, REQUEST):
""" clear the catalog, then re-index everything """

paths = tuple(self._catalog.paths.values())
self.manage_catalogClear()
self.manage_catalogClear(REQUEST)

for p in paths:
try:
obj = REQUEST.resolve_url(p)
obj = self.resolve_url(p, REQUEST)
self.catalog_object(obj, p)
except:
pass
Expand Down Expand Up @@ -369,9 +370,8 @@ def getobject(self, rid, REQUEST=None):
"""
if REQUEST is None:
REQUEST=self.REQUEST
url='%s/%s' %(REQUEST.script, self.getpath(rid))
try:
obj = REQUEST.resolve_url(url)
obj = self.resolve_url(self.getpath(rid), REQUEST)
except:
return None
return obj
Expand Down Expand Up @@ -498,8 +498,6 @@ def resolve_url(self, path, REQUEST):
raise rsp.errmsg, sys.exc_value




Globals.default__class_init__(ZCatalog)


Expand Down
7 changes: 5 additions & 2 deletions catalogView.dtml
Expand Up @@ -47,7 +47,7 @@ can also remove or update individual catalog records.
</TD>
<td valign="top"><dtml-var meta_type></td>
<td valign="top" align="left">
<a href="../<dtml-var "getpath(data_record_id_)">/manage_main"><dtml-var "getpath(data_record_id_)">
<a href="<dtml-var "getpath(data_record_id_)">/manage_main"><dtml-var "getpath(data_record_id_)">
<dtml-if title> (<dtml-var title>)</dtml-if></a>
</td>
</tr>
Expand All @@ -73,7 +73,7 @@ can also remove or update individual catalog records.

<dtml-else>

<P>There are no entries in the Catalog.</P>
<P>There are no objects in the Catalog.</P>

</dtml-if>

Expand All @@ -82,3 +82,6 @@ can also remove or update individual catalog records.






0 comments on commit 2e30b1b

Please sign in to comment.