Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
b3819363
Commit
b3819363
authored
Jun 22, 1999
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closer
parent
cf2486a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
13 deletions
+43
-13
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+1
-0
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+38
-9
lib/python/Products/ZCatalog/catalogView.dtml
lib/python/Products/ZCatalog/catalogView.dtml
+4
-4
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
b3819363
...
...
@@ -95,6 +95,7 @@ class Catalog(Persistent, Acquisition.Implicit):
for
key
,
value
in
self
.
schema
.
items
():
scopy
[
key
]
=
value
scopy
[
'data_record_id_'
]
=
len
(
self
.
schema
.
keys
())
scopy
[
'data_record_unique_id_'
]
=
seLfy
.
paths
[
scopy
[
'data_record_id_'
]]
mybrains
.
__theCircularGottaCoverUpABugRefOfJoy
=
mybrains
mybrains
.
__record_schema__
=
scopy
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
b3819363
...
...
@@ -98,7 +98,7 @@ import Products
from
Acquisition
import
Implicit
from
Persistence
import
Persistent
from
Catalog
import
Catalog
,
orify
import
pdb
import
pdb
,
traceback
manage_addZCatalogForm
=
HTMLFile
(
'addZCatalog'
,
globals
())
...
...
@@ -141,6 +141,7 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
manage_catalogView
=
HTMLFile
(
'catalogView'
,
globals
())
manage_catalogFind
=
HTMLFile
(
'catalogFind'
,
globals
())
manage_catalogFindResult
=
HTMLFile
(
'catalogFindResult'
,
globals
())
manage_catalogSchema
=
HTMLFile
(
'catalogSchema'
,
globals
())
manage_main
=
HTMLFile
(
'catalogView'
,
globals
())
...
...
@@ -163,7 +164,17 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
""" index all Zope objects that 'urls' point to """
if
urls
:
for
url
in
urls
:
obj
=
self
.
resolve_url
(
url
,
REQUEST
)
try
:
# if an error happens here, the catalog will be in
# an unstable state. If this happens, ignore the
# object.
obj
=
self
.
resolve_url
(
url
,
REQUEST
)
except
:
## print 'resolve_url failed while cataloging'
## c, i, t = sys.exc_info()
## traceback.print_exc()
continue
self
.
catalog_object
(
obj
,
url
)
return
MessageDialog
(
title
=
"Bah!"
,
...
...
@@ -176,7 +187,14 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
if
urls
:
for
url
in
urls
:
obj
=
self
.
resolve_url
(
url
,
REQUEST
)
try
:
obj
=
self
.
resolve_url
(
url
,
REQUEST
)
except
:
print
'resolve_url failed while uncataloging'
c
,
i
,
t
=
sys
.
exc_info
()
traceback
.
print_exc
()
continue
print
'uncataloging %s'
%
url
self
.
uncatalog_object
(
url
)
return
MessageDialog
(
title
=
"Bah!"
,
...
...
@@ -189,6 +207,8 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
references and refreshing objects"""
items
=
tuple
(
self
.
_catalog
.
uids
.
items
())
self
.
_catalog
.
clear
()
for
path
,
i
in
items
:
try
:
obj
=
self
.
resolve_url
(
path
,
REQUEST
)
...
...
@@ -340,12 +360,21 @@ class ZCatalog(SimpleItem, FindSupport, Persistent, Implicit):
# waaa - traversal may return a "default object"
# like an index_html document, though you really
# wanted to get a Folder back :(
if
callable
(
object
.
id
):
name
=
object
.
id
()
else
:
name
=
object
.
id
if
name
!=
os
.
path
.
split
(
path
)[
-
1
]
and
\
hasattr
(
object
,
'aq_parent'
):
return
object
.
aq_parent
## print path
## print `object`
## print (str(req.PARENTS))
if
hasattr
(
object
,
'id'
):
if
callable
(
object
.
id
):
name
=
object
.
id
()
else
:
name
=
object
.
id
elif
hasattr
(
object
,
'__name__'
):
name
=
object
.
__name__
else
:
name
=
''
if
name
!=
os
.
path
.
split
(
path
)[
-
1
]:
return
req
.
PARENTS
[
0
]
return
object
raise
rsp
.
errmsg
,
sys
.
exc_value
...
...
lib/python/Products/ZCatalog/catalogView.dtml
View file @
b3819363
...
...
@@ -37,8 +37,8 @@ can also remove or update individual catalog records.
<!--#/in-->
<form action="<!--#var URL1-->/">
<input type="submit" value=" Remove " NAME="manage_
catalogRemove
:method">
<input type="submit" value=" Update " NAME="manage_catalog
Reindex
:method">
<input type="submit" value=" Remove " NAME="manage_
uncatalogObject
:method">
<input type="submit" value=" Update " NAME="manage_catalog
Object
:method">
<!--#comment-->
<input type="submit" value=" VOODOO "
NAME="manage_enterDebuger:method">
...
...
@@ -50,8 +50,8 @@ NAME="manage_enterDebuger:method">
<tr valign=top>
<td valign="middle" align="center">
<INPUT TYPE="checkbox" NAME="
ids:int
:list" VALUE="<!--#var
data_record_id_-->">
<INPUT TYPE="checkbox" NAME="
urls
:list" VALUE="<!--#var
data_record_
unique_
id_-->">
</TD>
<td valign="top"><!--#var meta_type--></td>
<td valign="top" align="left">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment