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
a93df48e
Commit
a93df48e
authored
Jan 26, 2001
by
Christopher Petrilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge of lexicon cleanup and text index merge along with some misc stuff.
parent
41eb6fe8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
61 deletions
+83
-61
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+23
-16
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+6
-3
lib/python/Products/ZCatalog/dtml/catalogAdvanced.dtml
lib/python/Products/ZCatalog/dtml/catalogAdvanced.dtml
+3
-1
lib/python/Products/ZCatalog/dtml/manage_vocab.dtml
lib/python/Products/ZCatalog/dtml/manage_vocab.dtml
+51
-41
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
a93df48e
...
...
@@ -101,6 +101,7 @@ from zLOG import LOG, ERROR
from
Lazy
import
LazyMap
,
LazyFilter
,
LazyCat
from
CatalogBrains
import
AbstractCatalogBrain
,
NoBrainer
import
time
class
KWMultiMapping
(
MultiMapping
):
def
has_key
(
self
,
name
):
try
:
...
...
@@ -347,18 +348,30 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
data
=
self
.
data
if
self
.
uids
.
has_key
(
uid
):
i
=
self
.
uids
[
uid
]
i
ndex
=
self
.
uids
[
uid
]
elif
data
:
i
=
data
.
keys
()[
-
1
]
+
1
# find the next available unique id
index
=
data
.
keys
()[
-
1
]
+
1
# find the next available unique id
self
.
uids
[
uid
]
=
index
self
.
paths
[
index
]
=
uid
else
:
i
=
0
index
=
0
self
.
uids
[
uid
]
=
index
self
.
paths
[
index
]
=
uid
self
.
uids
[
uid
]
=
i
self
.
paths
[
i
]
=
uid
# meta_data is stored as a tuple for efficiency
data
[
i
]
=
self
.
recordify
(
object
)
newDataRecord
=
self
.
recordify
(
object
)
oldDataRecord
=
data
.
get
(
index
,
None
)
# Now we need to compare the tuples before we update them!
if
oldDataRecord
is
not
None
:
for
i
in
range
(
len
(
newDataRecord
)):
if
newDataRecord
[
i
]
!=
oldDataRecord
[
i
]:
data
[
index
]
=
newDataRecord
break
else
:
data
[
index
]
=
newDataRecord
total
=
0
for
x
in
self
.
indexes
.
values
():
## tricky! indexes need to acquire now, and because they
...
...
@@ -366,7 +379,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
## acquisition doesn't kick in, we must explicitly wrap!
x
=
x
.
__of__
(
self
)
if
hasattr
(
x
,
'index_object'
):
blah
=
x
.
index_object
(
i
,
object
,
threshold
)
blah
=
x
.
index_object
(
i
ndex
,
object
,
threshold
)
total
=
total
+
blah
else
:
LOG
(
'Catalog'
,
ERROR
,
(
'catalogObject was passed '
...
...
@@ -480,11 +493,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
handling intSets and IIBuckets.
"""
## import pdb
## pdb.set_trace()
## I use this so much I'm just leaving it commented out -michel
rs
=
None
data
=
self
.
data
...
...
@@ -570,8 +578,6 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
type
(
''
):
Query
.
String
,
},
**
kw
):
# Get search arguments:
if
REQUEST
is
None
and
not
kw
:
try
:
REQUEST
=
self
.
REQUEST
...
...
@@ -605,7 +611,8 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# Perform searches with indexes and sort_index
r
=
[]
used
=
self
.
_indexedSearch
(
kw
,
sort_index
,
r
.
append
,
used
)
if
not
r
:
return
LazyCat
(
r
)
if
not
r
:
return
LazyCat
(
r
)
# Sort/merge sub-results
if
len
(
r
)
==
1
:
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
a93df48e
...
...
@@ -318,8 +318,11 @@ class ZCatalog(Folder, Persistent, Implicit):
elapse
=
time
.
time
()
-
elapse
c_elapse
=
time
.
clock
()
-
c_elapse
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogView?manage_tabs_message='
+
urllib
.
quote
(
'Catalog Updated<br>Total time: %s<br>Total CPU time: %s'
%
(
`elapse`
,
`c_elapse`
)))
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogAdvanced?manage_tabs_message='
+
urllib
.
quote
(
'Catalog Updated<br>'
'Total time: %s<br>'
'Total CPU time: %s'
%
(
`elapse`
,
`c_elapse`
)))
def
manage_catalogClear
(
self
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
...
...
@@ -327,7 +330,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self
.
_catalog
.
clear
()
if
REQUEST
and
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_catalog
View
?manage_tabs_message=Catalog%20Cleared'
)
RESPONSE
.
redirect
(
URL1
+
'/manage_catalog
Advanced
?manage_tabs_message=Catalog%20Cleared'
)
def
manage_catalogFoundItems
(
self
,
REQUEST
,
RESPONSE
,
URL2
,
URL1
,
...
...
lib/python/Products/ZCatalog/dtml/catalogAdvanced.dtml
View file @
a93df48e
...
...
@@ -98,7 +98,9 @@
<dtml-if threshold>
<tr>
<td align="left" valign="top">
<p class="form-help">The Subtransaction threshold is the number of words the catalog
<p class="form-help">The Subtransaction threshold is the number of
objects cataloged
in the context of a single transaction that the catalog
will index before it commits a subtransaction. If this number
is low, the Catalog will take longer to index but consume less
memory. If this number is higher, the Catalog will index
...
...
lib/python/Products/ZCatalog/dtml/manage_vocab.dtml
View file @
a93df48e
...
...
@@ -9,48 +9,58 @@
word(s).
</p>
<dtml-in words previous size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>">
[Next <dtml-var next-sequence-size> entries]
</a>
</div>
</dtml-in>
<table>
<dtml-in words size=20 start=query_start >
<tr valign=top>
<td valign="top" align="left">
<div class="form-text">
<dtml-var sequence-item> (<dtml-var sequence-key>)
</div>
</td>
</tr>
</dtml-in>
</table>
<dtml-in words previous size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>">
[Next <dtml-var next-sequence-size> entries]
</a>
</div>
<dtml-in words previous size=20 start=query_start >
<span class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</span>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<span class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>">
[Next <dtml-var next-sequence-size> entries]
</a>
</span>
</dtml-in>
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<dtml-in words size=20 start=query_start >
<dtml-if name="sequence-start">
<tr class="list-header">
<td width="80%" align="left" valign="top">
<div class="list-item">Word</div></td>
<td width="20%" align="left" valign="top">
<div class="list-item">Word ID</div></td>
</tr>
</dtml-if>
<dtml-if name="sequence-odd"><tr class="row-normal">
<dtml-else><tr class="row-hilite"></dtml-if>
<td valign="top" align="left">
<div class="form-text">&dtml-sequence-key;</div>
</td>
<td valign="top" align="left">
<div class="form-text">&dtml-sequence-item;</div>
</td>
</tr>
</dtml-in>
</table>
<dtml-in words previous size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>">
[Previous <dtml-var previous-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-in words next size=20 start=query_start >
<div class="list-nav">
<a href="<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>">
[Next <dtml-var next-sequence-size> entries]
</a>
</div>
</dtml-in>
<dtml-else>
...
...
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