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
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
erp5
Commits
9ab5d18d
Commit
9ab5d18d
authored
Jan 17, 2025
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Plain Diff
fixup! erp5_full_text_mroonga_catalog: defer fulltext index and unindex using...
See merge request
!2045
parents
1c4f6aa0
eff019bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
121 deletions
+10
-121
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py
...atalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py
+2
-2
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.catalog_keys.xml
...db/SQLCatalog_deferFullTextIndexActivity.catalog_keys.xml
+0
-2
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.py
...rp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.py
+0
-33
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.xml
...p5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.xml
+0
-80
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+8
-4
No files found.
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndex.py
View file @
9ab5d18d
# This script is called to defer fulltext indexing.
METHOD_ID
=
script
.
id
+
'Activity'
GROUP_METHOD_ID
=
context
.
getRelativeUrl
()
+
'/'
+
METHOD_ID
GROUP_METHOD_ID
=
'portal_catalog/catalogObjectList'
activateObject
=
context
.
getPortalObject
().
portal_activities
.
activateObject
try
:
priority
=
context
.
getActivityRuntimeEnvironment
().
getPriority
()
...
...
@@ -26,4 +26,4 @@ for document in getPath:
serialization_tag
=
'full_text_'
+
document
,
),
METHOD_ID
,
)()
)(
check_uid
=
0
,
deferred
=
1
)
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.catalog_keys.xml
deleted
100644 → 0
View file @
1c4f6aa0
<catalog_method>
</catalog_method>
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.py
deleted
100644 → 0
View file @
1c4f6aa0
from
Products.ERP5Type.Utils
import
UpperCase
from
ZODB.POSException
import
ConflictError
from
zExceptions
import
Unauthorized
import
six
for
method_id
in
context
.
getSqlDeferredCatalogObjectListList
():
method
=
getattr
(
context
,
method_id
)
property_list
=
method
.
arguments_src
.
split
()
parameter_dict
=
{
x
:
[]
for
x
in
property_list
}
for
group_object
in
object_list
:
tmp_dict
=
{}
try
:
obj
=
group_object
.
object
for
property
in
property_list
:
getter
=
getattr
(
obj
,
property
,
None
)
if
callable
(
getter
):
value
=
getter
()
else
:
value
=
getattr
(
obj
,
'get%s'
%
UpperCase
(
property
))()
tmp_dict
[
property
]
=
value
except
ConflictError
:
raise
except
Unauthorized
:
# should happen in tricky testERP5Catalog tests only
# Fake activity success: if indexation cannot View document, ignore it.
group_object
.
result
=
None
except
Exception
:
group_object
.
raised
()
else
:
for
property
,
value
in
six
.
iteritems
(
tmp_dict
):
parameter_dict
[
property
].
append
(
value
)
group_object
.
result
=
None
if
parameter_dict
:
method
(
**
parameter_dict
)
bt5/erp5_full_text_mroonga_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_deferFullTextIndexActivity.xml
deleted
100644 → 0
View file @
1c4f6aa0
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Python Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
object_list
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SQLCatalog_deferFullTextIndexActivity
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Python Script
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ZSQLCatalog/SQLCatalog.py
View file @
9ab5d18d
...
...
@@ -1258,7 +1258,7 @@ class Catalog(Folder,
security
.
declarePrivate
(
'catalogObjectList'
)
def
catalogObjectList
(
self
,
object_list
,
method_id_list
=
None
,
disable_cache
=
0
,
check_uid
=
1
,
idxs
=
None
):
disable_cache
=
0
,
check_uid
=
1
,
idxs
=
None
,
deferred
=
0
):
"""Add objects to the Catalog by calling all SQL methods and
providing needed arguments.
...
...
@@ -1282,7 +1282,8 @@ class Catalog(Folder,
method_id_list
=
method_id_list
,
disable_cache
=
disable_cache
,
check_uid
=
check_uid
,
idxs
=
idxs
)
idxs
=
idxs
,
deferred
=
deferred
)
def
getSqlCatalogObjectListList
(
self
):
return
self
.
sql_catalog_object_list
...
...
@@ -1291,7 +1292,7 @@ class Catalog(Folder,
return
self
.
sql_deferred_catalog_object_list
def
_catalogObjectList
(
self
,
object_list
,
method_id_list
=
None
,
disable_cache
=
0
,
check_uid
=
1
,
idxs
=
None
):
disable_cache
=
0
,
check_uid
=
1
,
idxs
=
None
,
deferred
=
0
):
"""This is the real method to catalog objects."""
if
idxs
not
in
(
None
,
[]):
LOG
(
'ZSLQCatalog.SQLCatalog:catalogObjectList'
,
WARNING
,
...
...
@@ -1358,7 +1359,10 @@ class Catalog(Folder,
LOG
(
'SQLCatalog._catalogObjectList'
,
ERROR
,
error_message
)
if
method_id_list
is
None
:
method_id_list
=
self
.
getSqlCatalogObjectListList
()
if
deferred
:
method_id_list
=
self
.
getSqlDeferredCatalogObjectListList
()
else
:
method_id_list
=
self
.
getSqlCatalogObjectListList
()
econtext
=
getEngine
().
getContext
()
if
disable_cache
:
argument_cache
=
DummyDict
()
...
...
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