Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs-appstore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
officejs-appstore
Commits
a606c493
Commit
a606c493
authored
Apr 26, 2021
by
Roque
Browse files
Options
Browse Files
Download
Plain Diff
Document Module HBTree migration post upgrade constraint
See merge request
!16
parents
d4398718
332117e4
Pipeline
#15129
failed with stage
in 0 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
262 additions
and
18 deletions
+262
-18
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreConfigurator.py
..._components/test.erp5.testOfficeJSAppstoreConfigurator.py
+21
-1
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreConfigurator.xml
...components/test.erp5.testOfficeJSAppstoreConfigurator.xml
+20
-16
bt5/officejs_upgrader/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
bt5/officejs_upgrader/PropertySheetTemplateItem/portal_property_sheets/DocumentModuleOfficeJSUpgradeConstraint.xml
...operty_sheets/DocumentModuleOfficeJSUpgradeConstraint.xml
+66
-0
bt5/officejs_upgrader/PropertySheetTemplateItem/portal_property_sheets/DocumentModuleOfficeJSUpgradeConstraint/document_module_hbtree_folder_constraint.xml
...deConstraint/document_module_hbtree_folder_constraint.xml
+80
-0
bt5/officejs_upgrader/SkinTemplateItem/portal_skins/officejs_upgrader/DocumentModule_migrateFolderToHBTree.py
...officejs_upgrader/DocumentModule_migrateFolderToHBTree.py
+7
-0
bt5/officejs_upgrader/SkinTemplateItem/portal_skins/officejs_upgrader/DocumentModule_migrateFolderToHBTree.xml
...fficejs_upgrader/DocumentModule_migrateFolderToHBTree.xml
+62
-0
bt5/officejs_upgrader/bt/template_portal_type_property_sheet_list
...cejs_upgrader/bt/template_portal_type_property_sheet_list
+1
-0
bt5/officejs_upgrader/bt/template_property_sheet_id_list
bt5/officejs_upgrader/bt/template_property_sheet_id_list
+2
-1
No files found.
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreConfigurator.py
View file @
a606c493
...
@@ -76,6 +76,27 @@ class TestSlapOSConfigurator(testOfficeJSAppstoreMixin):
...
@@ -76,6 +76,27 @@ class TestSlapOSConfigurator(testOfficeJSAppstoreMixin):
conversion_url
=
"https://cloudooo.erp5.net/"
conversion_url
=
"https://cloudooo.erp5.net/"
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentConversionServerUrl
(),
conversion_url
)
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentConversionServerUrl
(),
conversion_url
)
def
testDocumentModuleMigration
(
self
):
"""
check document module folder was migrated to HBTree
"""
document_module
=
self
.
portal
.
document_module
self
.
assertEqual
(
document_module
.
getIdGenerator
(),
'_generatePerDayId'
)
self
.
assertEqual
(
document_module
.
isBTree
(),
False
)
self
.
assertEqual
(
document_module
.
isHBTree
(),
True
)
#check existing documents with custom ids were not migrated
existing_doc
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'File'
,
reference
=
'data/application_sample.json'
)
self
.
assertEqual
(
existing_doc
.
getId
(),
'store_officejs_data_application_sample_json'
)
#check new documents use new id format
doc
=
document_module
.
newContent
()
self
.
tic
()
date
=
doc
.
getCreationDate
().
Date
().
replace
(
'/'
,
''
)
self
.
assertTrue
(
doc
.
getId
().
startswith
(
'%s-'
%
date
))
def
notestModuleHasIdGeneratorByDay
(
self
):
def
notestModuleHasIdGeneratorByDay
(
self
):
""" Ensure the Constraint sets appropriate id generator on all modules.
""" Ensure the Constraint sets appropriate id generator on all modules.
"""
"""
...
@@ -169,7 +190,6 @@ class TestSlapOSConfigurator(testOfficeJSAppstoreMixin):
...
@@ -169,7 +190,6 @@ class TestSlapOSConfigurator(testOfficeJSAppstoreMixin):
'workflow_module'
,
'workflow_module'
,
])
])
def
testConfiguredBusinessTemplateList
(
self
):
def
testConfiguredBusinessTemplateList
(
self
):
""" Make sure Installed business Templates are
""" Make sure Installed business Templates are
what it is expected. """
what it is expected. """
...
...
bt5/officejs_test/TestTemplateItem/portal_components/test.erp5.testOfficeJSAppstoreConfigurator.xml
View file @
a606c493
...
@@ -100,24 +100,28 @@
...
@@ -100,24 +100,28 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
bt5/officejs_upgrader/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
a606c493
<property_sheet_list>
<property_sheet_list>
<portal_type
id=
"Document Module"
>
<item>
DocumentModuleOfficeJSUpgradeConstraint
</item>
</portal_type>
<portal_type
id=
"Preference Tool"
>
<portal_type
id=
"Preference Tool"
>
<item>
PreferenceToolAppstoreConstraint
</item>
<item>
PreferenceToolAppstoreConstraint
</item>
</portal_type>
</portal_type>
...
...
bt5/officejs_upgrader/PropertySheetTemplateItem/portal_property_sheets/DocumentModuleOfficeJSUpgradeConstraint.xml
0 → 100644
View file @
a606c493
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
DocumentModuleOfficeJSUpgradeConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/officejs_upgrader/PropertySheetTemplateItem/portal_property_sheets/DocumentModuleOfficeJSUpgradeConstraint/document_module_hbtree_folder_constraint.xml
0 → 100644
View file @
a606c493
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/post_upgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document_module_hbtree_folder_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
DocumentModule_migrateFolderToHBTree
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/officejs_upgrader/SkinTemplateItem/portal_skins/officejs_upgrader/DocumentModule_migrateFolderToHBTree.py
0 → 100644
View file @
a606c493
portal
=
context
.
getPortalObject
()
document_module
=
portal
.
document_module
if
not
document_module
.
isHBTree
():
document_module
.
migrateToHBTree
(
migration_generate_id_method
=
"Base_generateIdFromCreationDate"
,
new_generate_id_method
=
"_generatePerDayId"
,
bundle_count
=
100
)
return
[]
bt5/officejs_upgrader/SkinTemplateItem/portal_skins/officejs_upgrader/DocumentModule_migrateFolderToHBTree.xml
0 → 100644
View file @
a606c493
<?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>
fixit=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
DocumentModule_migrateFolderToHBTree
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/officejs_upgrader/bt/template_portal_type_property_sheet_list
View file @
a606c493
Document Module | DocumentModuleOfficeJSUpgradeConstraint
Preference Tool | PreferenceToolAppstoreConstraint
Preference Tool | PreferenceToolAppstoreConstraint
Software Product | SoftwareProductAppstoreConstraint
Software Product | SoftwareProductAppstoreConstraint
Web Section | WebSectionAppstoreConstraint
Web Section | WebSectionAppstoreConstraint
\ No newline at end of file
bt5/officejs_upgrader/bt/template_property_sheet_id_list
View file @
a606c493
PreferenceToolAppstoreConstraint
PreferenceToolAppstoreConstraint
SoftwareProductAppstoreConstraint
SoftwareProductAppstoreConstraint
WebSectionAppstoreConstraint
WebSectionAppstoreConstraint
\ No newline at end of file
DocumentModuleOfficeJSUpgradeConstraint
\ No newline at end of file
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