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
0aa3f2ea
Commit
0aa3f2ea
authored
Jul 03, 2009
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- improved index creation in ProductHelp
- removed special PluginIndexes handling in Product initialization code
parent
52797a27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
24 deletions
+25
-24
src/App/Product.py
src/App/Product.py
+3
-10
src/HelpSys/HelpSys.py
src/HelpSys/HelpSys.py
+21
-11
src/OFS/Application.py
src/OFS/Application.py
+1
-3
No files found.
src/App/Product.py
View file @
0aa3f2ea
...
...
@@ -101,16 +101,9 @@ class Product(Folder, PermissionManager):
def
__init__
(
self
,
id
,
title
):
from
HelpSys.HelpSys
import
ProductHelp
self
.
id
=
id
self
.
title
=
title
# Workaround for unknown problem with help system and PluginIndexes product
# NEEDS to be fixed for 2.4 ! (ajung)
try
:
self
.
_setObject
(
'Help'
,
ProductHelp
(
'Help'
,
id
))
except
:
pass
self
.
id
=
id
self
.
title
=
title
self
.
_setObject
(
'Help'
,
ProductHelp
(
'Help'
,
id
))
security
.
declarePublic
(
'Destination'
)
def
Destination
(
self
):
...
...
src/HelpSys/HelpSys.py
View file @
0aa3f2ea
...
...
@@ -23,8 +23,16 @@ from App.special_dtml import HTML
from
OFS.ObjectManager
import
ObjectManager
from
OFS.SimpleItem
import
Item
from
Persistence
import
Persistent
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
import
KeywordIndex
from
Products.ZCatalog.ZCatalog
import
ZCatalog
from
Products.ZCatalog.Lazy
import
LazyCat
from
Products.ZCTextIndex.OkapiIndex
import
OkapiIndex
from
Products.ZCTextIndex.Lexicon
import
CaseNormalizer
from
Products.ZCTextIndex.HTMLSplitter
import
HTMLWordSplitter
from
Products.ZCTextIndex.Lexicon
import
StopWordRemover
from
Products.ZCTextIndex.ZCTextIndex
import
PLexicon
from
Products.ZCTextIndex.ZCTextIndex
import
ZCTextIndex
class
HelpSys
(
Implicit
,
ObjectManager
,
Item
,
Persistent
):
"""
...
...
@@ -221,17 +229,19 @@ class ProductHelp(Implicit, ObjectManager, Item, Persistent):
)
def
__init__
(
self
,
id
=
'Help'
,
title
=
''
):
self
.
id
=
id
self
.
title
=
title
c
=
self
.
catalog
=
ZCatalog
(
'catalog'
)
# clear catalog
for
index
in
c
.
indexes
():
c
.
delIndex
(
index
)
for
col
in
c
.
schema
():
c
.
delColumn
(
col
)
c
.
addIndex
(
'SearchableText'
,
'TextIndex'
)
c
.
addIndex
(
'categories'
,
'KeywordIndex'
)
c
.
addIndex
(
'permissions'
,
'KeywordIndex'
)
self
.
id
=
id
self
.
title
=
title
c
=
self
.
catalog
=
ZCatalog
(
'catalog'
)
l
=
PLexicon
(
'lexicon'
,
''
,
HTMLWordSplitter
(),
CaseNormalizer
(),
StopWordRemover
())
c
.
_setObject
(
'lexicon'
,
l
)
i
=
ZCTextIndex
(
'SearchableText'
,
caller
=
c
,
index_factory
=
OkapiIndex
,
lexicon_id
=
l
.
id
)
# not using c.addIndex because it depends on Product initialization
c
.
_catalog
.
addIndex
(
'SearchableText'
,
i
)
c
.
_catalog
.
addIndex
(
'categories'
,
KeywordIndex
(
'categories'
))
c
.
_catalog
.
addIndex
(
'permissions'
,
KeywordIndex
(
'permissions'
))
c
.
addColumn
(
'categories'
)
c
.
addColumn
(
'permissions'
)
c
.
addColumn
(
'title_or_id'
)
...
...
src/OFS/Application.py
View file @
0aa3f2ea
...
...
@@ -547,12 +547,10 @@ def get_products():
if
(
os
.
path
.
exists
(
os
.
path
.
join
(
fullpath
,
'__init__.py'
))
or
os
.
path
.
exists
(
os
.
path
.
join
(
fullpath
,
'__init__.pyo'
))
or
os
.
path
.
exists
(
os
.
path
.
join
(
fullpath
,
'__init__.pyc'
))
):
# import PluginIndexes 1st (why?)
priority
=
(
name
!=
'PluginIndexes'
)
# i is used as sort ordering in case a conflict exists
# between Product names. Products will be found as
# per the ordering of Products.__path__
products
.
append
((
priority
,
name
,
i
,
product_dir
))
products
.
append
((
0
,
name
,
i
,
product_dir
))
i
=
i
+
1
products
.
sort
()
return
products
...
...
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