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
6607df2b
Commit
6607df2b
authored
Apr 25, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added prelim. converter for old-style indexes to pluggable indexes
(without converting their contents...needs reindexing)
parent
f5fac610
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
12 deletions
+41
-12
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+34
-0
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
+7
-12
No files found.
lib/python/Products/ZCatalog/ZCatalog.py
View file @
6607df2b
...
@@ -780,6 +780,40 @@ class ZCatalog(Folder, Persistent, Implicit):
...
@@ -780,6 +780,40 @@ class ZCatalog(Folder, Persistent, Implicit):
ct
=
time
.
clock
()
-
ct
ct
=
time
.
clock
()
-
ct
return
'Finished conversion in %s seconds (%s cpu)'
%
(
tt
,
ct
)
return
'Finished conversion in %s seconds (%s cpu)'
%
(
tt
,
ct
)
def
manage_convertIndex
(
self
,
ids
,
REQUEST
=
None
,
RESPONSE
=
None
,
URL1
=
None
):
"""convert old-style indexes to new-style indexes"""
from
Products.PluginIndexes.KeywordIndex
import
KeywordIndex
from
Products.PluginIndexes.FieldIndex
import
FieldIndex
from
Products.PluginIndexes.TextIndex
import
TextIndex
from
Acquisition
import
aq_base
import
copy
converted
=
[]
for
id
in
ids
:
idx
=
self
.
Indexes
[
id
]
iface
=
getattr
(
idx
,
'__implements__'
,
None
)
if
iface
is
None
:
mt
=
idx
.
meta_type
converted
.
append
(
id
)
self
.
delIndex
(
id
)
if
mt
in
(
'Field Index'
,
'Keyword Index'
):
self
.
addIndex
(
id
,
mt
.
replace
(
' '
,
''
))
elif
mt
==
'Text Index'
:
# TODO: Lexicon handling to be added
self
.
addIndex
(
id
,
'TextIndex'
)
if
converted
:
RESPONSE
.
redirect
(
URL1
+
'/manage_main?manage_tabs_message=Indexes%20converted'
)
else
:
RESPONSE
.
redirect
(
URL1
+
'/manage_main?manage_tabs_message=No%20indexes%20found%20to%20be%20converted'
)
#
#
# Indexing methods
# Indexing methods
#
#
...
...
lib/python/Products/ZCatalog/dtml/manageIndex.dtml
View file @
6607df2b
...
@@ -142,6 +142,9 @@ function toggleSelect() {
...
@@ -142,6 +142,9 @@ function toggleSelect() {
</td>
</td>
</tr>
</tr>
<dtml-call "REQUEST.set('oldidx',0)">
<dtml-in objectItems sort_expr="skey" reverse_expr="rkey">
<dtml-in objectItems sort_expr="skey" reverse_expr="rkey">
<dtml-if sequence-odd>
<dtml-if sequence-odd>
<tr class="row-normal">
<tr class="row-normal">
...
@@ -156,16 +159,6 @@ function toggleSelect() {
...
@@ -156,16 +159,6 @@ function toggleSelect() {
<a href="&dtml.url_quote-sequence-key;/manage_workspace">
<a href="&dtml.url_quote-sequence-key;/manage_workspace">
&dtml-sequence-key; <dtml-if title>(&dtml-title;)</dtml-if>
&dtml-sequence-key; <dtml-if title>(&dtml-title;)</dtml-if>
</a>
</a>
<dtml-if locked_in_version>
<dtml-if modified_in_version>
<img src="&dtml-BASEPATH1;/p_/locked"
alt="This item has been modified in this version" />
<dtml-else>
<img src="&dtml-BASEPATH1;/p_/lockedo"
alt="This item has been modified in another version" />
(<em>&dtml-locked_in_version;</em>)
</dtml-if>
</dtml-if>
</div>
</div>
</td>
</td>
...
@@ -177,6 +170,7 @@ function toggleSelect() {
...
@@ -177,6 +170,7 @@ function toggleSelect() {
<dtml-if "_.string.find(_.str(_.getattr(this(),'__implements__','old')),'PluggableIndexInterface')>-1">
<dtml-if "_.string.find(_.str(_.getattr(this(),'__implements__','old')),'PluggableIndexInterface')>-1">
<dtml-var meta_type>
<dtml-var meta_type>
<dtml-else>
<dtml-else>
<dtml-call "REQUEST.set('oldidx',1)">
(pre-2.4 index)
(pre-2.4 index)
<dtml-var meta_type>
<dtml-var meta_type>
</dtml-if>
</dtml-if>
...
@@ -210,8 +204,9 @@ function toggleSelect() {
...
@@ -210,8 +204,9 @@ function toggleSelect() {
<input class="form-element" type="submit" name="manage_delIndex: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_reindexIndex:method" value="Reindex">
<input class="form-element" type="submit" name="manage_clearIndex:method" value="Clear index">
<input class="form-element" type="submit" name="manage_clearIndex:method" value="Clear index">
<input class="form-element" type="submit" name="manage_convertIndex:method" value="Convert index">
<dtml-if oldidx>
<input class="form-element" type="submit" name="manage_convertIndex:method" value="Convert index">
</dtml-if>
<script type="text/javascript">
<script type="text/javascript">
<!--
<!--
if (document.forms[0]) {
if (document.forms[0]) {
...
...
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