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
20890ca4
Commit
20890ca4
authored
Oct 05, 2001
by
Steve Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge ZCatalog API cleanup into trunk.
parent
5ceff2c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
21 deletions
+72
-21
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+66
-12
lib/python/Products/ZCatalog/dtml/catalogIndexes.dtml
lib/python/Products/ZCatalog/dtml/catalogIndexes.dtml
+2
-2
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
+3
-6
lib/python/Products/ZCatalog/regressiontests/regressionCatalogTiming.py
...ducts/ZCatalog/regressiontests/regressionCatalogTiming.py
+1
-1
No files found.
lib/python/Products/ZCatalog/ZCatalog.py
View file @
20890ca4
...
...
@@ -198,9 +198,13 @@ class ZCatalog(Folder, Persistent, Implicit):
'manage_catalogAdvanced'
,
'manage_objectInformation'
,
'manage_catalogReindex'
,
'manage_catalogFoundItems'
,
'manage_catalogClear'
,
'manage_addColumn'
,
'manage_delColumns'
,
'manage_addIndex'
,
'manage_delIndexes'
,
'manage_main'
,
'availableSplitters'
],
'manage_catalogClear'
,
'manage_addColumn'
,
'manage_delColumn'
,
'manage_addIndex'
,
'manage_delIndex'
,
'manage_clearIndex'
,
'manage_reindexIndex'
,
'manage_main'
,
'availableSplitters'
,
# these two are deprecated:
'manage_delColumns'
,
'manage_deleteIndex'
],
[
'Manager'
]),
(
'Search ZCatalog'
,
...
...
@@ -294,10 +298,12 @@ class ZCatalog(Folder, Persistent, Implicit):
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogAdvanced?manage_tabs_message=Catalog%20Changed'
)
def
manage_catalogObject
(
self
,
REQUEST
,
RESPONSE
,
URL1
,
urls
=
None
):
""" index
all Zope objects
that 'urls' point to """
""" index
Zope object(s)
that 'urls' point to """
if
urls
:
if
isinstance
(
urls
,
types
.
StringType
):
urls
=
(
urls
,)
for
url
in
urls
:
obj
=
self
.
resolve_path
(
url
)
if
not
obj
:
...
...
@@ -309,9 +315,12 @@ class ZCatalog(Folder, Persistent, Implicit):
def
manage_uncatalogObject
(
self
,
REQUEST
,
RESPONSE
,
URL1
,
urls
=
None
):
""" removes Zope object 'urls' from catalog """
""" removes Zope object
(s)
'urls' from catalog """
if
urls
:
if
isinstance
(
urls
,
types
.
StringType
):
urls
=
(
urls
,)
for
url
in
urls
:
self
.
uncatalog_object
(
url
)
...
...
@@ -406,14 +415,33 @@ class ZCatalog(Folder, Persistent, Implicit):
if
REQUEST
and
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogSchema?manage_tabs_message=Column%20Added'
)
def
manage_delColumns
(
self
,
names
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" del a column """
""" Deprecated method. Use manage_delColumn instead. """
# log a deprecation warning
import
warnings
warnings
.
warn
(
"The manage_delColumns method of ZCatalog is deprecated"
\
"since Zope 2.4.2.
\
n
"
\
"This method is only kept for backwards compatibility for a while
\
n
"
\
"and will go away in a future release.
\
n
"
\
"
\
n
"
\
"Please use instead the manage_delColumn method.
\
n
"
\
,
DeprecationWarning
)
self
.
manage_delColumn
(
names
,
REQUEST
=
REQUEST
,
RESPONSE
=
RESPONSE
,
URL1
=
URL1
)
def
manage_delColumn
(
self
,
names
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" delete a column or some columns """
if
isinstance
(
names
,
types
.
StringType
):
names
=
(
names
,)
for
name
in
names
:
self
.
delColumn
(
name
)
if
REQUEST
and
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogSchema?manage_tabs_message=Column%20Deleted'
)
def
manage_addIndex
(
self
,
name
,
type
,
extra
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" add an index """
self
.
addIndex
(
name
,
type
,
extra
)
...
...
@@ -424,26 +452,48 @@ class ZCatalog(Folder, Persistent, Implicit):
def
manage_deleteIndex
(
self
,
ids
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" del an index """
""" Deprecated method. Use manage_delIndex instead. """
# log a deprecation warning
import
warnings
warnings
.
warn
(
"The manage_deleteIndex method of ZCatalog is deprecated"
\
"since Zope 2.4.2.
\
n
"
\
"This method is only kept for backwards compatibility for a while
\
n
"
\
"and will go away in a future release.
\
n
"
\
"
\
n
"
\
"Please use instead the manage_delIndex method.
\
n
"
\
,
DeprecationWarning
)
self
.
manage_delIndex
(
ids
=
ids
,
REQUEST
=
REQUEST
,
RESPONSE
=
RESPONSE
,
URL1
=
URL1
)
def
manage_delIndex
(
self
,
ids
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" delete an index or some indexes """
if
not
ids
:
return
MessageDialog
(
title
=
'No items specified'
,
message
=
'No items were specified!'
,
action
=
"./manage_main"
,)
if
isinstance
(
ids
,
types
.
StringType
):
ids
=
(
ids
,)
for
name
in
ids
:
self
.
delIndex
(
name
)
if
REQUEST
and
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_main?manage_tabs_message=Index%20Deleted'
)
def
manage_clearIndex
(
self
,
ids
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
"""
del an index
"""
"""
clear an index or some indexes
"""
if
not
ids
:
return
MessageDialog
(
title
=
'No items specified'
,
message
=
'No items were specified!'
,
action
=
"./manage_main"
,)
if
isinstance
(
ids
,
types
.
StringType
):
ids
=
(
ids
,)
for
name
in
ids
:
self
.
clearIndex
(
name
)
...
...
@@ -462,15 +512,19 @@ class ZCatalog(Folder, Persistent, Implicit):
if
obj
is
not
None
:
self
.
catalog_object
(
obj
,
p
,
idxs
=
[
name
])
def
manage_reindexIndex
(
self
,
ids
=
None
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
""" Reindex indexe
s
from a ZCatalog"""
""" Reindex indexe
(s)
from a ZCatalog"""
if
not
ids
:
return
MessageDialog
(
title
=
'No items specified'
,
message
=
'No items were specified!'
,
action
=
"./manage_main"
,)
if
isinstance
(
ids
,
types
.
StringType
):
ids
=
(
ids
,)
for
id
in
ids
:
self
.
reindexIndex
(
id
,
REQUEST
)
for
name
in
ids
:
self
.
reindexIndex
(
name
,
REQUEST
)
if
REQUEST
and
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_main?manage_tabs_message=Reindexing%20Performed'
)
...
...
lib/python/Products/ZCatalog/dtml/catalogIndexes.dtml
View file @
20890ca4
...
...
@@ -42,7 +42,7 @@ that have one or more keywords specified in a search query.
<dtml-if name="sequence-odd"><tr class="row-normal">
<dtml-else><tr class="row-hilite"></dtml-if>
<td align="right" valign="top">
<input type="checkbox" name="
name
s:list" value="<dtml-var
<input type="checkbox" name="
id
s:list" value="<dtml-var
id html_quote>" />
</td>
<td width="60%" align="left" valign="top">
...
...
@@ -61,7 +61,7 @@ that have one or more keywords specified in a search query.
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="manage_delIndex
es
:method"
<input class="form-element" type="submit" name="manage_delIndex:method"
value="Delete" />
</div>
</td>
...
...
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
View file @
20890ca4
...
...
@@ -184,11 +184,8 @@ function toggleSelect() {
<td>
<div class="list-item">
<dtml-try>
<dtml-var numObjects missing="not available">
<dtml-except>n/a
</dtml-try>
</div>
<dtml-var numObjects missing="n/a">
</div>
</td>
<td>
...
...
@@ -209,7 +206,7 @@ function toggleSelect() {
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="manage_del
ete
Index:method" value="Remove index">
<input class="form-element" type="submit" name="manage_delIndex:method" value="Remove index">
<input class="form-element" type="submit" name="manage_reindexIndex:method" value="Reindex">
<input class="form-element" type="submit" name="manage_clearIndex:method" value="Clear index">
...
...
lib/python/Products/ZCatalog/regressiontests/regressionCatalogTiming.py
View file @
20890ca4
...
...
@@ -44,7 +44,7 @@ class TestTimeIndex(TestCase):
self
.
app
.
catalogtest
.
_setObject
(
'catalog'
,
zcatalog
)
c
=
self
.
app
.
catalogtest
.
catalog
for
x
in
(
'title'
,
'to'
,
'from'
,
'date'
,
'raw'
):
try
:
c
.
manage_delIndex
es
([
x
])
try
:
c
.
manage_delIndex
([
x
])
except
:
pass
c
.
manage_addIndex
(
'title'
,
'TextIndex'
)
c
.
manage_addIndex
(
'to'
,
'TextIndex'
)
...
...
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