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
0
Issues
0
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
Xavier Thompson
erp5
Commits
03c832b2
Commit
03c832b2
authored
Oct 13, 2016
by
Ayush Tiwari
Committed by
Ayush Tiwari
Aug 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Add hot_ReindexAll action for ERP5 portal_catalog
parent
02ba86cd
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 @
03c832b2
<?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 @
03c832b2
# 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 @
03c832b2
<?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 @
03c832b2
...
@@ -75,10 +75,10 @@
...
@@ -75,10 +75,10 @@
<value>
<value>
<list>
<list>
<string>
my_title
</string>
<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_hot_reindexing_state
</string>
<string>
my_archive_path
</string>
<string>
my_archive_path
</string>
<string>
my_destination_sql_catalog_id
</string>
<string>
my_source_sql_catalog_id
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CatalogTool_viewCatalogList/my_destination_sql_catalog_id.xml
View file @
03c832b2
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 @
03c832b2
This diff is collapsed.
Click to expand it.
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
View file @
03c832b2
...
@@ -43,6 +43,7 @@ Cache Factory | statistics
...
@@ -43,6 +43,7 @@ Cache Factory | statistics
Cache Factory | view
Cache Factory | view
Cache Tool | statistics
Cache Tool | statistics
Cache Tool | view
Cache Tool | view
Catalog Tool | hot_reindex
Catalog Tool | view
Catalog Tool | view
Catalog | catalog_filter_view
Catalog | catalog_filter_view
Catalog | clear_catalog
Catalog | clear_catalog
...
...
product/ERP5Catalog/Tool/ERP5CatalogTool.py
View file @
03c832b2
...
@@ -185,4 +185,19 @@ class ERP5CatalogTool(BaseTool, CMFCore_CatalogTool):
...
@@ -185,4 +185,19 @@ class ERP5CatalogTool(BaseTool, CMFCore_CatalogTool):
def
getCatalogUrl
(
self
,
object
):
def
getCatalogUrl
(
self
,
object
):
return
self
.
__url
(
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
)
InitializeClass
(
ERP5CatalogTool
)
product/ZSQLCatalog/ZSQLCatalog.py
View file @
03c832b2
...
@@ -541,7 +541,14 @@ class ZCatalog(Folder, Persistent, Implicit):
...
@@ -541,7 +541,14 @@ class ZCatalog(Folder, Persistent, Implicit):
destination_sql_catalog_id
=
destination_sql_catalog_id
,
destination_sql_catalog_id
=
destination_sql_catalog_id
,
skin_selection_dict
=
skin_selection_dict
,
skin_selection_dict
=
skin_selection_dict
,
sql_connection_id_dict
=
sql_connection_id_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'
)
URL1
=
REQUEST
.
get
(
'URL1'
)
RESPONSE
.
redirect
(
URL1
+
'/manage_catalogHotReindexing?manage_tabs_message=HotReindexing%20Started'
)
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