Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
25b79436
Commit
25b79436
authored
Aug 14, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5/Extensions: This script was replaced by ERP5Site_reindexAll
parent
30488ba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
78 deletions
+0
-78
product/ERP5/Extensions/ReindexAll.py
product/ERP5/Extensions/ReindexAll.py
+0
-78
No files found.
product/ERP5/Extensions/ReindexAll.py
deleted
100644 → 0
View file @
30488ba1
##############################################################################
#
# Copyright (c) 2003 Nexedi SARL and Contributors. All Rights Reserved.
# Sebastien Robin <seb@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
#
# This program as such is not intended to be used by end users. End
# users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the Zope Public License (ZPL) Version 2.0
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
##############################################################################
from
Acquisition
import
aq_base
def
filterReindexAll
(
object
=
None
,
request
=
None
,
**
kw
):
return
1
def
testAfterReindexAll
(
object
=
None
,
request
=
None
,
**
kw
):
result
=
[]
try
:
result
.
append
((
object
.
getRelativeUrl
(),
'portal_type'
,
1
,
object
.
getPortalType
()))
except
:
message
=
'Could not find the portal type'
if
hasattr
(
object
,
'getRelativeUrl'
):
result
.
append
((
object
.
getRelativeUrl
(),
'testAfterReindexAll'
,
101
,
message
))
elif
hasattr
(
object
,
'id'
):
result
.
append
((
object
.
id
,
'testAfterReindexAll'
,
101
,
message
))
else
:
result
.
append
((
'Object with no id'
,
'testAfterReindexAll'
,
101
,
message
))
return
result
def
methodReindexAll
(
object
,
REQUEST
=
None
,
**
kw
):
result
=
[]
try
:
object
.
portal_catalog
.
catalog_object
(
object
,
None
)
#object.reindexObject()
except
:
message
=
'Object could not be catalogued'
if
hasattr
(
object
,
'getRelativeUrl'
):
result
.
append
((
object
.
getRelativeUrl
(),
'methodReindexAll'
,
101
,
message
))
elif
hasattr
(
object
,
'id'
):
result
.
append
((
object
.
id
,
'methodReindexAll'
,
101
,
message
))
else
:
result
.
append
((
'Object with no id'
,
'methodReindexAll'
,
101
,
message
))
return
result
def
reindexAll
(
object
=
None
,
REQUEST
=
None
,
**
kw
):
"""
Folder needs to be updated in order to take into account
changes of classes and in particular meta_type
"""
result
=
[]
container
=
object
obase
=
aq_base
(
container
)
# Call recursiveApply only if this is an ERP5 Folder
if
hasattr
(
obase
,
'recursiveApply'
):
result
+=
container
.
recursiveApply
(
filter
=
filterReindexAll
,
method
=
methodReindexAll
,
test_after
=
testAfterReindexAll
,
REQUEST
=
REQUEST
)
# or if this is a folder, do it on contained objects
elif
hasattr
(
obase
,
'objectValues'
):
for
object
in
container
.
objectValues
():
result
+=
reindexAll
(
object
=
object
,
REQUEST
=
REQUEST
,
**
kw
)
# else reindex
else
:
result
+=
methodReindexAll
(
object
=
container
,
REQUEST
=
REQUEST
,
**
kw
)
return
result
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