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
b4c65aa6
Commit
b4c65aa6
authored
Jun 12, 2000
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs and cosmetic enhancments
parent
27948bbf
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
93 additions
and
37 deletions
+93
-37
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+12
-7
lib/python/Products/ZCatalog/CatalogAwareness.py
lib/python/Products/ZCatalog/CatalogAwareness.py
+3
-2
lib/python/Products/ZCatalog/Vocabulary.py
lib/python/Products/ZCatalog/Vocabulary.py
+5
-6
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+2
-2
lib/python/Products/ZCatalog/catalogIndexes.dtml
lib/python/Products/ZCatalog/catalogIndexes.dtml
+2
-2
lib/python/Products/ZCatalog/manage_vocab.dtml
lib/python/Products/ZCatalog/manage_vocab.dtml
+55
-12
lib/python/Products/ZCatalog/version.txt
lib/python/Products/ZCatalog/version.txt
+1
-1
lib/python/SearchIndex/Lexicon.py
lib/python/SearchIndex/Lexicon.py
+2
-2
lib/python/SearchIndex/UnIndex.py
lib/python/SearchIndex/UnIndex.py
+3
-1
lib/python/SearchIndex/UnKeywordIndex.py
lib/python/SearchIndex/UnKeywordIndex.py
+3
-0
lib/python/SearchIndex/UnTextIndex.py
lib/python/SearchIndex/UnTextIndex.py
+5
-2
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
b4c65aa6
...
...
@@ -523,13 +523,18 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# reached, therefor 'sort-on' does not happen in the
# context of text index query. This should probably
# sort by relevance first, then the 'sort-on' attribute.
for
k
,
intset
in
sort_index
.
_index
.
items
():
if
type
(
rs
)
is
IIBType
:
intset
=
rs
.
intersection
(
intset
)
else
:
intset
=
intset
.
intersection
(
rs
)
if
intset
:
append
((
k
,
LazyMap
(
self
.
__getitem__
,
intset
)))
if
len
(
rs
)
>
len
(
sort_index
.
_index
):
for
k
,
intset
in
sort_index
.
_index
.
items
():
if
type
(
rs
)
is
IIBType
:
intset
=
rs
.
intersection
(
intset
)
else
:
intset
=
intset
.
intersection
(
rs
)
if
intset
:
append
((
k
,
LazyMap
(
self
.
__getitem__
,
intset
)))
else
:
for
r
in
rs
:
append
(
sort_index
.
_unindex
[
r
],
LazyMap
(
self
.
__getitem__
,[
r
]))
return
used
...
...
lib/python/Products/ZCatalog/CatalogAwareness.py
View file @
b4c65aa6
...
...
@@ -102,11 +102,12 @@ class CatalogAware:
manage_editCatalogerForm
=
HTMLFile
(
'editCatalogerForm'
,
globals
())
def
manage_editCataloger
(
self
,
default
,
REQUEST
):
def
manage_editCataloger
(
self
,
default
,
REQUEST
=
None
):
""" """
self
.
default_catalog
=
default
message
=
"Your changes have been saved"
return
self
.
manage_main
(
self
,
REQUEST
,
manage_tabs_message
=
message
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
,
manage_tabs_message
=
message
)
def
manage_afterAdd
(
self
,
item
,
container
):
...
...
lib/python/Products/ZCatalog/Vocabulary.py
View file @
b4c65aa6
...
...
@@ -122,10 +122,10 @@ class Vocabulary(Item, Persistent, Implicit,
manage_options
=
(
(
{
'label'
:
'Vocabulary'
,
'action'
:
'manage_
vocabulary
'
,
'target'
:
'manage_
main
'
},
{
'label'
:
'Vocabulary'
,
'action'
:
'manage_
main
'
,
'target'
:
'manage_
workspace
'
},
{
'label'
:
'Query'
,
'action'
:
'manage_query'
,
'target'
:
'manage_
main
'
},
'target'
:
'manage_
workspace
'
},
)
+
Item
.
manage_options
+
AccessControl
.
Role
.
RoleManager
.
manage_options
...
...
@@ -144,8 +144,7 @@ class Vocabulary(Item, Persistent, Implicit,
## manage_main = HTMLFile('vocab_manage_main', globals())
manage_vocabulary
=
HTMLFile
(
'manage_vocab'
,
globals
())
manage_main
=
HTMLFile
(
'manage_vocab'
,
globals
())
manage_query
=
HTMLFile
(
'vocab_query'
,
globals
())
def
__init__
(
self
,
id
,
title
=
''
,
globbing
=
None
):
...
...
@@ -175,7 +174,7 @@ class Vocabulary(Item, Persistent, Implicit,
self
.
insert
(
word
)
if
RESPONSE
:
RESPONSE
.
redirect
(
URL1
+
'/manage_
vocabulary
'
)
RESPONSE
.
redirect
(
URL1
+
'/manage_
main
'
)
def
manage_stop_syn
(
self
,
stop_syn
,
REQUEST
=
None
):
pass
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
b4c65aa6
...
...
@@ -143,7 +143,7 @@ class ZCatalog(Folder, Persistent, Implicit):
meta_type
=
"ZCatalog"
icon
=
'misc_/ZCatalog/ZCatalog.gif'
manage_options
=
(
manage_options
=
Folder
.
manage_options
+
(
{
'label'
:
'Cataloged Objects'
,
'action'
:
'manage_catalogView'
,
'target'
:
'manage_main'
,
'help'
:(
'ZCatalog'
,
'ZCatalog_Cataloged-Objects.dtml'
)},
...
...
@@ -159,7 +159,7 @@ class ZCatalog(Folder, Persistent, Implicit):
{
'label'
:
'Status'
,
'action'
:
'manage_catalogStatus'
,
'target'
:
'manage_main'
,
'help'
:(
'ZCatalog'
,
'ZCatalog_Status.dtml'
)},
)
+
Folder
.
manage_options
)
__ac_permissions__
=
(
...
...
lib/python/Products/ZCatalog/catalogIndexes.dtml
View file @
b4c65aa6
...
...
@@ -28,10 +28,10 @@ that have one or more keywords specified in a search query.</p>
<form
action=
"<dtml-var URL1>"
>
<ul>
<dtml-in
index
e
s
>
<dtml-in
index
_object
s
>
<li>
<input
type=
"checkbox"
name=
"names:list"
value=
"<dtml-var sequence-item html_quote>"
>
<dtml-var
sequence-item
>
</li>
<dtml-var
id
>
(
<i><dtml-var
meta_type
></i>
)
</li>
</dtml-in>
</ul>
<br>
...
...
lib/python/Products/ZCatalog/manage_vocab.dtml
View file @
b4c65aa6
...
...
@@ -6,20 +6,63 @@
<dtml-var
manage_tabs
>
<!--
<form action="manage_insert" method="POST">
<input name="word"><br>
<input type="submit" value="Add">
</form>
<br>
-->
<ul>
<dtml-in
words
>
<li><dtml-var
sequence-key
>
(
<dtml-var
sequence-item
>
)
</li>
</dtml-in>
</ul>
<dtml-if
words
>
<dtml-var
id
>
contains
<em><dtml-var
words
fmt=
collection-length
thousands_commas
></em>
word(s).
<BR><BR>
<dtml-in
words
previous
size=
20
start=
query_start
>
<a
href=
"<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>"
>
[Previous
<dtml-var
previous-sequence-size
>
entries]
</a>
</dtml-in>
<dtml-in
words
next
size=
20
start=
query_start
>
<a
href=
"<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>"
>
[Next
<dtml-var
next-sequence-size
>
entries]
</a>
</dtml-in>
<table>
<dtml-in
words
size=
20
start=
query_start
>
<tr
valign=
top
>
<td
valign=
"top"
align=
"left"
>
<dtml-var
sequence-item
>
(
<dtml-var
sequence-key
>
)
</td>
</tr>
</dtml-in>
</table>
<dtml-in
words
previous
size=
20
start=
query_start
>
<a
href=
"<dtml-var URL>?query_start=<dtml-var previous-sequence-start-number>"
>
[Previous
<dtml-var
previous-sequence-size
>
entries]
</a>
</dtml-in>
<dtml-in
words
next
size=
20
start=
query_start
>
<a
href=
"<dtml-var URL>?query_start=<dtml-var next-sequence-start-number>"
>
[Next
<dtml-var
next-sequence-size
>
entries]
</a>
</dtml-in>
<dtml-else>
<P>
There are no words in the Vocabulary.
</P>
</dtml-if>
</body>
</html>
lib/python/Products/ZCatalog/version.txt
View file @
b4c65aa6
ZCatalog-
1-1
-0
ZCatalog-
2-2
-0
lib/python/SearchIndex/Lexicon.py
View file @
b4c65aa6
...
...
@@ -148,9 +148,9 @@ class Lexicon(Persistent, Implicit):
self
.
counter
=
self
.
counter
+
1
return
self
.
counter
-
1
def
get
(
self
,
key
):
def
get
(
self
,
key
,
default
=
None
):
""" """
return
[
self
.
_lexicon
[
key
]
]
return
[
self
.
_lexicon
.
get
(
key
,
default
)
]
def
__getitem__
(
self
,
key
):
return
self
.
get
(
key
)
...
...
lib/python/SearchIndex/UnIndex.py
View file @
b4c65aa6
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Simple column indices"""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
Acquisition
import
Implicit
...
...
@@ -111,6 +111,8 @@ def nonEmpty(s):
class
UnIndex
(
Persistent
,
Implicit
):
"""UnIndex object interface"""
meta_type
=
'Field Index'
def
__init__
(
self
,
id
=
None
,
ignore_ex
=
None
,
call_methods
=
None
):
"""Create an unindex
...
...
lib/python/SearchIndex/UnKeywordIndex.py
View file @
b4c65aa6
...
...
@@ -2,6 +2,9 @@ from UnIndex import UnIndex, MV, intSet
from
types
import
ListType
,
TupleType
class
UnKeywordIndex
(
UnIndex
):
meta_type
=
'Keyword Index'
"""Like an UnIndex only it indexes sequences of items
Searches match any keyword.
...
...
lib/python/SearchIndex/UnTextIndex.py
View file @
b4c65aa6
...
...
@@ -92,7 +92,7 @@ is no longer known.
"""
__version__
=
'$Revision: 1.2
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
from
Globals
import
Persistent
import
BTree
,
IIBTree
,
IOBTree
,
OIBTree
...
...
@@ -123,6 +123,8 @@ QueryError='TextIndex.QueryError'
class
UnTextIndex
(
Persistent
,
Implicit
):
meta_type
=
'Text Index'
def
__init__
(
self
,
id
=
None
,
ignore_ex
=
None
,
call_methods
=
None
,
lexicon
=
None
):
"""Create an index
...
...
@@ -337,7 +339,8 @@ class UnTextIndex(Persistent, Implicit):
if
len
(
src
)
==
1
:
src
=
src
[
0
]
if
src
[:
1
]
==
'"'
and
src
[
-
1
:]
==
'"'
:
return
self
[
src
]
r
=
self
.
_index
.
get
(
self
.
getLexicon
(
self
.
_lexicon
)[
word
][
0
],
None
)
r
=
self
.
_index
.
get
(
self
.
getLexicon
(
self
.
_lexicon
).
get
(
word
)[
0
],
None
)
if
r
is
None
:
r
=
{}
return
ResultList
(
r
,
(
word
,),
self
)
...
...
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