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
Levin Zimmermann
erp5
Commits
378b2d17
Commit
378b2d17
authored
Dec 11, 2015
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_dms_conversion_catalog: add WebIllustration_preConvert and improve Image_preConvert
parent
94f6da21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
2 deletions
+104
-2
bt5/erp5_dms_conversion_catalog/SkinTemplateItem/portal_skins/erp5_dms_conversion_catalog/Image_preConvert.xml
...al_skins/erp5_dms_conversion_catalog/Image_preConvert.xml
+13
-2
bt5/erp5_dms_conversion_catalog/SkinTemplateItem/portal_skins/erp5_dms_conversion_catalog/WebIllustration_preConvert.xml
...rp5_dms_conversion_catalog/WebIllustration_preConvert.xml
+91
-0
No files found.
bt5/erp5_dms_conversion_catalog/SkinTemplateItem/portal_skins/erp5_dms_conversion_catalog/Image_preConvert.xml
View file @
378b2d17
...
@@ -50,7 +50,9 @@
...
@@ -50,7 +50,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
"""\n
Do actual conversion of any Image type.\n
Do actual conversion of any Image type.\n
"""\n
"""\n
if quality is None:\n
if quality is None:\n
...
@@ -58,10 +60,19 @@ if quality is None:\n
...
@@ -58,10 +60,19 @@ if quality is None:\n
# directly accessed over URL will do the same\n
# directly accessed over URL will do the same\n
quality = context.getDefaultImageQuality(format)\n
quality = context.getDefaultImageQuality(format)\n
\n
\n
if not context.getContentType("").startswith(\'image/\'):\n
context.log(\'Image_preConvert\', \'%s is not an image, skipping preconversion\' % context.getRelativeUrl())\n
return \n
\n
# UI uses \'large\' display\n
# UI uses \'large\' display\n
display_list.append(\'large\')\n
display_list.append(\'large\')\n
# Usually links in web page contain image as <img src="url?format=png">
without display\n
display_list.append(None)\n
\n
context.Base_preConvert(format, quality, display_list)\n
context.Base_preConvert(format, quality, display_list)\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
...
...
bt5/erp5_dms_conversion_catalog/SkinTemplateItem/portal_skins/erp5_dms_conversion_catalog/WebIllustration_preConvert.xml
0 → 100644
View file @
378b2d17
<?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>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
"""\n
Do actual conversion of Web Page. As it involves cloudoo use serialization tag and activity.\n
"""\n
portal = context.getPortalObject()\n
\n
format_kw = {\'format\': format,\n
\'quality\': quality}\n
for display in display_list:\n
format_kw[\'display\'] = display\n
context.activate(serialization_tag=\'pre_convert\').convert(**format_kw)\n
\n
# try to convert all relative referenced (i.e. by <img>
tag) documents\n
context.activate().WebPage_preConvertReferencedImageList(**format_kw)\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
format, quality, display_list
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebIllustration_preConvert
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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