Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
Commits
27a7e5fc
Commit
27a7e5fc
authored
Oct 13, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Add hot_ReindexAll action for ERP5 portal_catalog
parent
76e23d4b
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
238 additions
and
399 deletions
+238
-399
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Catalog%20Tool/hot_reindex.xml
...nTemplateItem/portal_types/Catalog%20Tool/hot_reindex.xml
+85
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_hotReindexAll.py
...eItem/portal_skins/erp5_core/CatalogTool_hotReindexAll.py
+11
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_hotReindexAll.xml
...Item/portal_skins/erp5_core/CatalogTool_hotReindexAll.xml
+62
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList.xml
...em/portal_skins/erp5_core/CatalogTool_viewCatalogList.xml
+2
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList/my_destination_sql_catalog_id.xml
...logTool_viewCatalogList/my_destination_sql_catalog_id.xml
+27
-198
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList/my_source_sql_catalog_id.xml
.../CatalogTool_viewCatalogList/my_source_sql_catalog_id.xml
+27
-198
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
...uct/ERP5/bootstrap/erp5_core/bt/template_action_path_list
+1
-0
product/ERP5Catalog/Tool/ERP5CatalogTool.py
product/ERP5Catalog/Tool/ERP5CatalogTool.py
+15
-0
product/ZSQLCatalog/ZSQLCatalog.py
product/ZSQLCatalog/ZSQLCatalog.py
+8
-1
No files found.
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Catalog%20Tool/hot_reindex.xml
0 → 100644
View file @
27a7e5fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
hot_reindex
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Hot ReindexAll
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/CatalogTool_hotReindexAll
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_hotReindexAll.py
0 → 100644
View file @
27a7e5fc
# Hot reindexing reindexes all documents using destination_sql_catalog_id
# with low priority (so site can keep working during hot reindexation).
REQUEST
=
context
.
REQUEST
source_sql_catalog_id
=
context
.
getSourceSqlCatalogId
()
destination_sql_catalog_id
=
context
.
getDestinationSqlCatalogId
()
return
context
.
manage_hotReindexAll
(
source_sql_catalog_id
=
source_sql_catalog_id
,
destination_sql_catalog_id
=
destination_sql_catalog_id
,
REQUEST
=
REQUEST
)
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_hotReindexAll.xml
0 → 100644
View file @
27a7e5fc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
CatalogTool_hotReindexAll
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList.xml
View file @
27a7e5fc
...
...
@@ -75,10 +75,10 @@
<value>
<list>
<string>
my_title
</string>
<string>
my_source_sql_catalog_id
</string>
<string>
my_destination_sql_catalog_id
</string>
<string>
my_hot_reindexing_state
</string>
<string>
my_archive_path
</string>
<string>
my_destination_sql_catalog_id
</string>
<string>
my_source_sql_catalog_id
</string>
</list>
</value>
</item>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList/my_destination_sql_catalog_id.xml
View file @
27a7e5fc
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList/my_source_sql_catalog_id.xml
View file @
27a7e5fc
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
View file @
27a7e5fc
...
...
@@ -43,6 +43,7 @@ Cache Factory | statistics
Cache Factory | view
Cache Tool | statistics
Cache Tool | view
Catalog Tool | hot_reindex
Catalog Tool | view
Catalog | catalog_filter_view
Catalog | clear_catalog
...
...
product/ERP5Catalog/Tool/ERP5CatalogTool.py
View file @
27a7e5fc
...
...
@@ -184,4 +184,19 @@ class ERP5CatalogTool(BaseTool, CMFCore_CatalogTool):
def
getCatalogUrl
(
self
,
object
):
return
self
.
__url
(
object
)
def
_redirectHotReindexAll
(
self
,
REQUEST
,
RESPONSE
):
'''
Override this function from ZSQLCatalog as here we want to redirect to
the view for ERP5CatalogTool.
'''
if
not
RESPONSE
:
try
:
RESPONSE
=
REQUEST
.
RESPONSE
except
AttributeError
:
return
if
RESPONSE
is
not
None
:
url
=
self
.
absolute_url
()
+
'/view'
\
+
'?portal_status_message=HotReindexing%20Started'
return
RESPONSE
.
redirect
(
url
)
InitializeClass
(
ERP5CatalogTool
)
product/ZSQLCatalog/ZSQLCatalog.py
View file @
27a7e5fc
...
...
@@ -541,7 +541,14 @@ class ZCatalog(Folder, Persistent, Implicit):
destination_sql_catalog_id
=
destination_sql_catalog_id
,
skin_selection_dict
=
skin_selection_dict
,
sql_connection_id_dict
=
sql_connection_id_dict
)
if
RESPONSE
is
not
None
:
self
.
_redirectHotReindexAll
(
REQUEST
,
RESPONSE
)
def
_redirectHotReindexAll
(
self
,
REQUEST
,
RESPONSE
):
'''
We need to separate the final redirection from manage_reindexAll to
remove the need of copy and patch for the ERP5CatalogTool.
'''
if
RESPONE
is
not
None
:
URL1
=
REQUEST
.
get
(
'URL1'
)
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogHotReindexing?manage_tabs_message=HotReindexing%20Started'
)
...
...
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