Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Carlos Ramos Carreño
slapos.core
Commits
3ae3590c
Commit
3ae3590c
authored
Apr 01, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Dump Web Page Module Content Hash for comparation
parent
5b2ece44
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
550 additions
and
0 deletions
+550
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_assertDumpedConfiguration.py
...apos_administration/ERP5Site_assertDumpedConfiguration.py
+6
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.py
...lapos_administration/ERP5Site_dumpWebPageModuleContent.py
+32
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.xml
...apos_administration/ERP5Site_dumpWebPageModuleContent.xml
+62
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_web_page_module_configuration.txt
...administration/expected_web_page_module_configuration.txt
+421
-0
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_web_page_module_configuration.xml
...administration/expected_web_page_module_configuration.xml
+28
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5SiteDump.py
...tem/portal_components/test.erp5.testSlapOSERP5SiteDump.py
+1
-0
No files found.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_assertDumpedConfiguration.py
View file @
3ae3590c
...
@@ -44,6 +44,12 @@ if show_all or configuration == "skins":
...
@@ -44,6 +44,12 @@ if show_all or configuration == "skins":
found
=
portal
.
ERP5Site_dumpPortalSkinsContent
()
found
=
portal
.
ERP5Site_dumpPortalSkinsContent
()
print
resolveDiff
(
"Skins Configuration Diff"
,
expected_file
,
found
)
print
resolveDiff
(
"Skins Configuration Diff"
,
expected_file
,
found
)
if
show_all
or
configuration
==
"web_content"
:
expected_file
=
portal
.
expected_web_page_module_configuration
found
=
portal
.
ERP5Site_dumpWebPageModuleContent
(
ignore_string_on_reference
=
[
"rapid_"
])
print
resolveDiff
(
"Web Content Configuration Diff"
,
expected_file
,
found
)
if
show_all
or
configuration
==
"actions"
:
if
show_all
or
configuration
==
"actions"
:
expected_file
=
portal
.
expected_type_actions_dumped_configuration
expected_file
=
portal
.
expected_type_actions_dumped_configuration
found
=
portal
.
ERP5Site_dumpPortalTypeActionList
()
found
=
portal
.
ERP5Site_dumpPortalTypeActionList
()
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.py
0 → 100644
View file @
3ae3590c
import
hashlib
portal
=
context
.
getPortalObject
()
def
getWebContentHash
(
document
):
content
=
document
.
getTextContent
(
"ignore"
)
m
=
hashlib
.
md5
()
m
.
update
(
content
)
content_hash
=
m
.
hexdigest
()
return
";"
.
join
((
document
.
getReference
(),
content_hash
))
zero_to_nine_list
=
range
(
10
)
for
document
in
portal
.
web_page_module
.
searchFolder
(
validation_state
=
[
"published"
,
"published_alive"
]):
document_id_first_letter
=
document
.
getId
()[
0
]
if
document_id_first_letter
in
zero_to_nine_list
:
continue
print_web_content
=
1
document_reference
=
str
(
document
.
getReference
(
""
))
for
ignore_string
in
ignore_string_on_reference
:
if
ignore_string
in
document_reference
:
print_web_content
=
0
break
if
print_web_content
:
print
getWebContentHash
(
document
)
container
.
REQUEST
.
RESPONSE
.
setHeader
(
'content-type'
,
'text/plain'
)
return
'
\
n
'
.
join
(
sorted
(
printed
.
splitlines
()))
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/ERP5Site_dumpWebPageModuleContent.xml
0 → 100644
View file @
3ae3590c
<?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>
ignore_string_on_reference=["rapid"]
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_dumpWebPageModuleContent
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_web_page_module_configuration.txt
0 → 100644
View file @
3ae3590c
This diff is collapsed.
Click to expand it.
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_web_page_module_configuration.xml
0 → 100644
View file @
3ae3590c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
expected_web_page_module_configuration
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/plain
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
expected_web_page_module_configuration
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5SiteDump.py
View file @
3ae3590c
...
@@ -41,6 +41,7 @@ class TestSlapOSDump(SlapOSTestCaseMixin):
...
@@ -41,6 +41,7 @@ class TestSlapOSDump(SlapOSTestCaseMixin):
(
'ERP5Site_dumpPropertySheetList'
,
'expected_property_sheet_dumped_configuration'
,
None
),
(
'ERP5Site_dumpPropertySheetList'
,
'expected_property_sheet_dumped_configuration'
,
None
),
(
'ERP5Site_dumpRuleTesterList'
,
'expected_rule_dumped_configuration'
,
None
),
(
'ERP5Site_dumpRuleTesterList'
,
'expected_rule_dumped_configuration'
,
None
),
(
'ERP5Site_dumpSkinProperty'
,
'expected_skin_property_dumped_configuration'
,
None
),
(
'ERP5Site_dumpSkinProperty'
,
'expected_skin_property_dumped_configuration'
,
None
),
(
'ERP5Site_dumpWebPageModuleContent'
,
'expected_web_page_module_configuration'
,
None
),
(
'ERP5Site_dumpWorkflowChain'
,
'expected_workflow_dumped_configuration'
,
None
),
(
'ERP5Site_dumpWorkflowChain'
,
'expected_workflow_dumped_configuration'
,
None
),
]:
]:
ZopeTestCase
.
_print
(
'
\
n
'
)
ZopeTestCase
.
_print
(
'
\
n
'
)
...
...
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