Commit 0c1cf470 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: update slideshow and slideshow tests

parent 60591225
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310012.01</string> </value>
<value> <string>ts12554317.38</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>1989493e6839d5f557d8d74e307b7e0f</string> </value>
<value> <string>cf97caf7dce3dac69a926c601f1933d4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>378385</int> </value>
<value> <int>375399</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.35036.11451</string> </value>
<value> <string>963.62225.40453.40038</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310241.56</float>
<float>1512554317.39</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310274.15</string> </value>
<value> <string>ts11431737.56</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>43db3b3b7b7d265d698eb117bd94657f</string> </value>
<value> <string>8e1ecefbc23d77cab30dcb62ac2c711a</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>380150</int> </value>
<value> <int>377551</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.4391.31095</string> </value>
<value> <string>963.42080.62928.8823</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310274.16</float>
<float>1512554370.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310313.51</string> </value>
<value> <string>ts11431795.07</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>9c03cf629dde17279851cff0a291f61e</string> </value>
<value> <string>f0f6c61a858f026327dadb9898b9fba0</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>382024</int> </value>
<value> <int>377551</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19595.20482.48810</string> </value>
<value> <string>963.42081.60204.26828</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310313.53</float>
<float>1512554384.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310027.33</string> </value>
<value> <string>ts11432920.01</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>2e6c4e1acf9ac40bc97788b14433df3a</string> </value>
<value> <string>3978a348b1101fe7e69cc9bddef6aebc</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>392070</int> </value>
<value> <int>389059</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.51795.59289</string> </value>
<value> <string>963.42100.43774.6092</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310258.11</float>
<float>1512554357.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310331.56</string> </value>
<value> <string>ts11431833.72</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -63,6 +63,97 @@
</tuple>
</value>
</item>
<item>
<key> <string>_content_information</string> </key>
<value>
<dictionary>
<item>
<key> <string>ArtBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>BleedBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>CreationDate</string> </key>
<value> <string>Thu Nov 23 11:10:17 2017</string> </value>
</item>
<item>
<key> <string>Creator</string> </key>
<value> <string>wkhtmltopdf 0.12.4</string> </value>
</item>
<item>
<key> <string>CropBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>Encrypted</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>File size</string> </key>
<value> <string>390890 bytes</string> </value>
</item>
<item>
<key> <string>Form</string> </key>
<value> <string>none</string> </value>
</item>
<item>
<key> <string>JavaScript</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>MediaBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>Optimized</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>PDF version</string> </key>
<value> <string>1.4</string> </value>
</item>
<item>
<key> <string>Page rot</string> </key>
<value> <string>0</string> </value>
</item>
<item>
<key> <string>Page size</string> </key>
<value> <string>842 x 595 pts (A4)</string> </value>
</item>
<item>
<key> <string>Pages</string> </key>
<value> <string>14</string> </value>
</item>
<item>
<key> <string>Producer</string> </key>
<value> <string>Qt 4.8.7</string> </value>
</item>
<item>
<key> <string>Suspects</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Tagged</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Title</string> </key>
<value> <string>Template Test Slideshow</string> </value>
</item>
<item>
<key> <string>TrimBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>UserProperties</string> </key>
<value> <string>no</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
......@@ -83,7 +174,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>693677d5fab4c61d19689dd52ec4cc80</string> </value>
<value> <string>3f1545b0e18dd872d0d930a953862848</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +216,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>393912</int> </value>
<value> <int>390890</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +373,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.44997.41745</string> </value>
<value> <string>963.42358.28102.28245</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +391,7 @@
</tuple>
<state>
<tuple>
<float>1510310331.56</float>
<float>1512554397.63</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.37170.40925</string> </value>
<value> <string>963.62225.48075.33638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310243.64</float>
<float>1512554324.53</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>22fa93382042ec9a35fa45ecf9748770</string> </value>
<value> <string>51f2363a7945b9146b9a255bc77eba54</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.9418.9489</string> </value>
<value> <string>963.42100.62104.26897</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310279.27</float>
<float>1512554372.6</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>8c6a2877327c58710f43b3a69860969a</string> </value>
<value> <string>51f2363a7945b9146b9a255bc77eba54</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.27813.44373</string> </value>
<value> <string>963.42101.19457.30378</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310316.58</float>
<float>1512554385.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.53316.14967</string> </value>
<value> <string>963.42100.46018.29252</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310259.72</float>
<float>1512554358.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.47125.20821</string> </value>
<value> <string>963.42101.40464.53077</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310333.2</float>
<float>1512554399.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -77,7 +77,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>NXD-Template.Slideshow.Nexedi</string> </value>
<value> <string>Template.Slideshow</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -159,7 +159,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Slideshow</string> </value>
<value> <string>Add Slideshow</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -294,7 +294,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.29188.19818.49834</string> </value>
<value> <string>963.29190.19224.30805</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -312,7 +312,7 @@
</tuple>
<state>
<tuple>
<float>1510658264.87</float>
<float>1511349015.17</float>
<string>UTC</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAndUpdateTestFilesForSlideTemplate</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test and Update Test Files for SLIDE Template</title>
</head>
<body>
<!--
Update SLIDE Test Files for LiveTest and Test UI
This Zuite updates all test files (diff-html, pdfs, bmps) used in the LiveTests
based on the example web pages included in this bt5. Run this zuite after making
changes to the bt5 which will alter their look to automatically update all files
(else you need to do it by hand). This also means: DON'T RUN THIS AUTOMATICALLY,
because it will also update all test files with any errors you make, causing
liveTests to always pass (comparing wrong rendering to wrong test file).
Help:
http://www.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese
http://seleniummaster.com/sitecontent/index.php/introduction-to-selenium-automation/selenium-ide/114-selenium-ide-complete-list-of-commands
-->
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test RenderJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<!-- update 1st output - template_test_slideshow_output_expected_001_en_html -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//section[@class="ci-slideshow-intro present"]</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"]);</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Slide%</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Slideshow.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 2nd output - template_test_slideshow_output_expected_002_en_html -->
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Logo.Alternativ</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_publisher_title</td>
<td>Foobarbazbam</td>
</tr>
<tr>
<td>click</td>
<td>//input[@value="svg"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
<tr>
<td>verifyValue</td>
<td>name=field_svg_display</td>
<td>on</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//section[@class="ci-slideshow-intro present"]</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"]);</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Slide%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Slideshow.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 3rd output - template_test_slideshow_output_expected_003_en_html -->
<tr>
<td>verifyTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//section[@class="ci-slideshow-intro present"]</td>
<td></td>
</tr>
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch iframe source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) {var xhr = new XMLHttpRequest();return new Promise(function(resolve, reject) {var k;xhr.open("GET", url, true);xhr.addEventListener("load", function(e) {if (e.target.status >= 400) {return reject(e);}resolve(e);});xhr.addEventListener("error", reject);xhr.send();}, function() {xhr.abort();});};ajax(storedVars["url"]);</td>
<td>page_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Web Pages')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>%Template% AND %Output% AND %Slide%</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_reference</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template.Test.Slideshow.Expected.Output.Sample</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow.Expected.Output.Sample')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a/span[contains(text(), 'Edit')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["page_source"].then(function (evt) {var content = evt.target.response || evt.target.responseText;document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter = content;})</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_parameter;</td>
<td>dump</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_text_content"]</td>
<td>${dump}</td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@class="save"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- update 1st pdf documents - template_test_slideshow_input_001_en_pdf -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't access pdf source inside iframe, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"]);</td>
<td>pdf_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Slideshow-001-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_001_en_bmp -->
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;id=template_test_slideshow_input_slide_0_001_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 2nd pdf document - template_test_slideshow_input_004_en_pdf -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>check</td>
<td>name=field_note_display</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"]);</td>
<td>pdf_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>004</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Slideshow-004-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_13_004_en_bmp -->
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=13&amp;id=template_test_slideshow_input_slide_13_004_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 3rd pdf document - template_test_slideshow_input_002_en_pdf -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"]);</td>
<td>pdf_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Slideshow-002-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_002_en_bmp -->
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?shot?frame=0&amp;id=template_test_slideshow_input_slide_0_002_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 4th pdf document - template_test_slideshow_input_003_en_pdf -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>002</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_logo_reference</td>
<td>Template.Test.Image.Erp5.Logo</td>
</tr>
<tr>
<td>type</td>
<td>name=field_override_publisher_title</td>
<td>Couscous</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"]);</td>
<td>pdf_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template.Test.Slideshow-003-en.pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_0_003_en_bmp -->
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=0&amp;id=template_test_slideshow_input_slide_0_003_en_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- update 5th pdf document - template_test_slideshow_input_005_de_pdf -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>003</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="import_export"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Export Slideshow</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>name=field_format</td>
<td>index=1</td>
</tr>
<tr>
<td>check</td>
<td>name=field_note_display</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<!-- PDF viewer has no document.title, wait for "" means pdf is loaded -->
<tr>
<td>waitForTitle</td>
<td></td>
<td></td>
</tr>
<!-- Store this location for re-requesting -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${url}</td>
<td></td>
</tr>
<!-- Can't fetch pdf source, so request page again -->
<tr>
<td>storeEval</td>
<td>function ajax(url) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("GET", url, true); xhr.responseType = "blob", xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); xhr.send(); }, function() { xhr.abort(); }); }; ajax(storedVars["url"]);</td>
<td>pdf_source</td>
</tr>
<tr>
<td>goBackAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForPageToLoad</td>
<td></td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Web Pages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'ERP5')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Documents')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>005</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<!-- manual form submit -->
<tr>
<td>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<!-- only handle pdf_source (a promise!) here, because it needs to be set on
the iframe and a page-reload resets all (bad) parameters manually set -->
<tr>
<td>storeEval</td>
<td>storedVars["pdf_source"].then(function (evt) {document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter = new Blob([evt.target.response || evt.target.responseText], {"type": evt.target.getResponseHeader("Content-Type")});});</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>document.getElementById("selenium_myiframe").contentDocument.body.bad_pdf_parameter</td>
<td>pdf_dump</td>
</tr>
<tr>
<td>echo</td>
<td>${pdf_dump}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>function ajax(url, param) { var xhr = new XMLHttpRequest(); return new Promise(function(resolve, reject) { var k; xhr.open("POST", url, true); xhr.responseType = param.dataType || ""; if (typeof param.headers === 'object' &amp;&amp; param.headers !== null) { for (k in param.headers) { if (param.headers.hasOwnProperty(k)) { xhr.setRequestHeader(k, param.headers[k]); } } } xhr.addEventListener("load", function(e) { if (e.target.status >= 400) { return reject(e); } resolve(e); }); xhr.addEventListener("error", reject); if (typeof param.xhrFields === 'object' &amp;&amp; param.xhrFields !== null) { for (k in param.xhrFields) { if (param.xhrFields.hasOwnProperty(k)) { xhr[k] = param.xhrFields[k]; } } } xhr.send(param.data); }, function() { xhr.abort(); }); } var form_data = new FormData(); form_data.append("field_my_file", storedVars["pdf_dump"], "Template_test_slideshow_005_de_pdf"); form_data.append("form_id", "File_view"); x = ajax(storedVars["url"].split("?")[0] + "/Base_edit", {"xhrFields": {"with_credentials": true}, "data": form_data});</td>
<td>promise</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars["promise"].then(function () {document.getElementById("selenium_myiframe").src=storedVars["url"].split("?")[0]+"/File_view?portal_status_message=Data%20updated."});</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Data updated.</td>
<td></td>
</tr>
<!-- generate image - template_test_slideshow_input_slide_8_005_de_bmp -->
<tr>
<td>storeEval</td>
<td>storedVars["url"].split("?")[0]</td>
<td>screenshot_url</td>
</tr>
<tr>
<td>echo</td>
<td>${screenshot_url}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${screenshot_url}/Document_createScreenshot?frame=8&amp;id=template_test_slideshow_input_slide_8_005_de_bmp</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Screenshot updated.</td>
<td></td>
</tr>
<!-- make sure print exchange works -->
<tr>
<td>open</td>
<td>${base_url}/web_page_module/</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_reference</td>
<td>Template.Test.Slideshow</td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_version</td>
<td>001</td>
</tr>
<tr>
<td>keyPressAndWait</td>
<td>listbox_version</td>
<td>\13</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Template Test Slideshow</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), 'Template.Test.Slideshow')]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Short Title</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@class="print"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Print As Slideshow</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>name=Base_showUpdateDialog:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="transition_message"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Preview updated.</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -85,9 +85,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<value> <string>Some description</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -242,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19340.52569.29576</string> </value>
<value> <string>963.20770.57899.51268</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1510153132.9</float>
<float>1511279847.2</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,8 +37,9 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=xsmall" />
<img alt="Logo" src="common_images/fallback.png" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-right">
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19676.57436.19217</string> </value>
<value> <string>963.62213.44228.42205</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310199.1</float>
<float>1512554172.68</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,14 +37,16 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=xsmall" />
<img alt="Logo"
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=small" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-right">
&copy;
<span>2017</span>&nbsp;
<span>Foobarbazbam</span><br />
<span></span><br />
<span></span>&nbsp;
<span class="page"></span> | <span class="topage"></span>
</div>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19677.3600.59101</string> </value>
<value> <string>963.62222.14724.18073</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310212.82</float>
<float>1512554204.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,14 +37,15 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/common_images/fallback.png?format=png&amp;display=xsmall" />
<img alt="Logo" src="common_images/fallback.png" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-center">Some description</div>
<div class="ci-slideshow-container-right">
&copy;
<span>2017</span>&nbsp;
<span>Test Organisation</span><br />
<span></span><br />
<span>Test Author, Test Recipient</span>&nbsp;
<span class="page"></span> | <span class="topage"></span>
</div>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19677.15056.47342</string> </value>
<value> <string>963.62222.28215.59050</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310221.55</float>
<float>1512554256.59</float>
<string>UTC</string>
</tuple>
</state>
......
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_slide</skin_folder>
<skin_selection>CI,CI_Slideshow,CI_slideshow,Slide,SlideShow,WhiteSlideShow</skin_selection>
<skin_selection>Slide</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
"""
================================================================================
Create a source dict for filling templates
================================================================================
"""
blank = ''
from Products.PythonScripts.standard import html_quote
# -------------------------- External parameters ------------------------------
# eg "Nexedi" specific parameters
customHandler = getattr(context, "WebPage_getCustomParameter", None)
# parameters common to all templates
commonHandler = getattr(context, "WebPage_getCommonParameter", None)
commonProxyHandler = getattr(context, "WebPage_getCommonProxyParameter", None)
def getCustomParameter(my_parameter, my_override_data):
if customHandler is not None:
source_data = my_override_data or context.getUid()
return customHandler(parameter=my_parameter, source_data=source_data)
def getCommonParameter(my_parameter, my_override_data):
if commonHandler is not None:
source_data = my_override_data or context.getUid()
return commonHandler(parameter=my_parameter, source_data=source_data)
def getCommonProxyParameter(my_parameter, my_override_data):
if commonProxyHandler is not None:
source_data = my_override_data or context.getUid()
return commonProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------------------- Set Source ----------------------------------
if source is None:
contributor_title_string = blank
source_logo_url = None
source_person = None
source_person_list = []
source_organisation = None
source_organisation_list = []
source_organisation_uid = None
# source person
if override_source_person_title is not None or override_source_person_title is blank:
source_person_list = getCommonProxyParameter("override_person", override_source_person_title)
if len(source_person_list) == 0:
source_person_list = getCommonProxyParameter("author", None)
if len(source_person_list) > 0:
source_person = source_person_list[0]
contributor_title_string = ', '.join(x.get("name", blank) for x in source_person_list)
# source organisation
if override_source_organisation_title is not None or override_source_organisation_title is blank:
source_organisation_list = getCommonProxyParameter("override_organisation", override_source_organisation_title)
if len(source_organisation_list) == 0:
source_organisation_uid = getCustomParameter("source_organisation_uid", None)
if source_organisation_uid:
source_organisation_list = getCommonProxyParameter("sender", source_organisation_uid)
if len(source_organisation_list) == 0 and default_company_title:
source_organisation_list = getCommonProxyParameter("override_organisation", html_quote(default_company_title))
if len(source_organisation_list) == 0 and source_person is not None:
source_organisation_list = getCommonProxyParameter("source", source_person.get("uid")) or []
if len(source_organisation_list) > 0:
source_organisation = source_organisation_list[0]
source = {}
source.update(source_person or {})
source.update(source_organisation or {})
source["contributor_title_string"] = contributor_title_string
# source => event
else:
source_uid =context.restrictedTraverse(source).getUid()
source = getCommonProxyParameter("source", source_uid)[0]
# override specific bank account (no default to pick correct one if multiple exist)
if default_bank_account_uid is not None:
override_bank_account_list = getCommonProxyParameter("bank", default_bank_account_uid)
if len(override_bank_account_list) > 0:
override_bank_account = override_bank_account_list[0]
source["bank"] = override_bank_account.get("bank")
source["bic"] = override_bank_account.get("bic")
source["iban"] = override_bank_account.get("iban")
# XXX: logos stored on organisation fail on base_convert or fallback images
# is not found in skin folder base_convert => drop conversion on fallback image
source_logo_url = override_logo_reference or source.get("logo_url", blank)
if source_logo_url != blank:
source_logo_url = html_quote(source_logo_url) + "?format=png&display=small"
if source_logo_url == blank and theme_logo_url is not None:
source_logo_url = theme_logo_url
source["enhanced_logo_url"] = source_logo_url
return source
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None,cancel_url=None, svg_display=None, portal_skin=None,note_display=None, override_publisher_title=None, override_logo_reference=None, *args,**kw</string> </value>
<value> <string>source=None, override_logo_reference=None, override_source_person_title=None, override_source_organisation_title=None, default_company_title=None, default_bank_account_uid=None, theme_logo_url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_updatePrintAsSlideshowDialog</string> </value>
<value> <string>Base_getSourceDict</string> </value>
</item>
</dictionary>
</pickle>
......
"""
================================================================================
Create a theme dict for filling templates
================================================================================
"""
blank = ''
# -------------------------- External parameters ------------------------------
# eg "Nexedi" specific parameters
customHandler = getattr(context, "WebPage_getCustomParameter", None)
# parameters common to all templates
commonHandler = getattr(context, "WebPage_getCommonParameter", None)
commonProxyHandler = getattr(context, "WebPage_getCommonProxyParameter", None)
def getCustomParameter(my_parameter, my_override_data):
if customHandler is not None:
source_data = my_override_data or context.getUid()
return customHandler(parameter=my_parameter, source_data=source_data)
def getCommonParameter(my_parameter, my_override_data):
if commonHandler is not None:
source_data = my_override_data or context.getUid()
return commonHandler(parameter=my_parameter, source_data=source_data)
def getCommonProxyParameter(my_parameter, my_override_data):
if commonProxyHandler is not None:
source_data = my_override_data or context.getUid()
return commonProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------------------- Set Theme -----------------------------------
# XXX images in portal_skins folders don't convert with ?params. Only format
# is kept in Base_convertHtmlToSingleFile
img = getCommonParameter("fallback_image", blank)
pdf = ".pdf" if format == "pdf" else blank
css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?display=png"
theme_logo_alt = "Default Logo"
default_company_title = getCustomParameter("default_company_title", None)
theme_logo = None
theme_logo_url = None
theme_logo_description = blank
theme = (
getCommonProxyParameter("theme", None) or
custom_theme or
default_company_title
)
if theme and override_batch_mode:
theme = "default"
if theme is not None:
logo_prefix = getCustomParameter("default_logo_prefix", None)
theme = theme.lower()
if logo_prefix:
theme_logo_url = logo_prefix + theme.capitalize()
try:
theme_logo = context.restrictedTraverse(theme_logo_url)
except LookupError:
theme_logo = None
if theme_logo:
theme_logo_description = theme_logo.getDescription()
if theme is None:
theme = "default"
theme_dict = {}
theme_dict["theme"] = theme
theme_dict["theme_logo_description"] = theme_logo_description
theme_dict["theme_logo_url"] = (theme_logo_url + param) if theme_logo_url is not None else getCommonParameter("fallback_image", None) or blank
theme_dict["template_css_url"] = ''.join([url, css_path, pdf, ".css"])
theme_dict["fallback_img_url"] = ''.join([url, '/', img])
theme_dict["theme_css_font_list"] = getCustomParameter(font, None) or []
theme_dict["theme_css_url"] = getCustomParameter(css, None) or getCommonParameter(css, None) or blank
return theme_dict
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>custom_theme=None, override_batch_mode=None, format=None, css_path=None, url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_getLocalParameter</string> </value>
<value> <string>Base_getThemeDict</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,6 +2,8 @@ if id is None:
return "Failed. Missing image id."
if context.getPortalType() != "PDF":
return "Failed. Not a pdf."
if context.getId().find("template_test") == -1:
return "Failed. Not a template test item."
pdf_page = context
portal = pdf_page.getPortalObject()
......@@ -14,7 +16,9 @@ preferred_document_conversion_server_url = (
)
try:
system_preference.edit(
preferred_document_conversion_server_url="https://cloudooo.erp5.net/",
preferred_document_conversion_server_url="https://softinst77579.host.vifib.net/",
#https://cloudooo.erp5.net/
#https://softinst77579.host.vifib.net/
)
content_type, bmp_data = pdf_page.convert("bmp", frame=frame)
image = portal.portal_catalog(
......
"""
================================================================================
Save, download or return generated PDF Document
================================================================================
"""
if doc_save == 1:
dms_module = getattr(context, 'document_module', None)
if dms_module is not None:
document = dms_module.newContent(
portal_type="PDF",
version=doc_version,
follow_up=doc_relative_url,
title=doc_title,
language=doc_language,
publication_date=doc_modification_date or None,
reference=doc_reference
)
document.edit(
source_reference=''.join([doc_reference, '.pdf']),
file=doc_pdf_file
)
#context.setAggregateList((doc_aggregate_list or []) + [doc_relative_url])
message = context.Base_translateString(
'%(portal_type)s created successfully as PDF Document.' % {
'portal_type': document.getTranslatedPortalType()
}
)
return document.Base_redirect(
keep_items=dict(portal_status_message=message)
)
#XXX else:
# download
elif doc_download == 1:
context.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'attachment; filename="' + doc_full_reference + '.pdf"')
# display in browser
else:
context.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'filename="' + doc_full_reference + '.pdf"')
return doc_pdf_file
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None, cancel_url=None, format=None, note_display=None, svg_display=None, override_publisher_title=None, override_logo_reference=None, portal_skin=None, *args,**kw</string> </value>
<value> <string>doc_download=None, doc_aggregate_list=None, doc_title=None, doc_save=None, doc_version=None, doc_relative_url=None, doc_language=None, doc_modification_date=None, doc_reference=None, doc_full_reference=None, doc_pdf_file=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_updateExportAsSlideshowDialog</string> </value>
<value> <string>WebPage_finishPdfCreation</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -4,8 +4,47 @@ Return common parameter across all templates
================================================================================
"""
# general parameters
if parameter == "fallback_image":
return "common_images/fallback.png"
if parameter == "default_theme_css_url":
return "default_themes/themes.css"
if parameter == "wkhtmltopdf_rendering_fix":
return
"""
<script>
(function () {
var table_list = document.body.querySelectorAll("table"),
sheet_width_in_px,
div;
if (table_list.length > 0) {
// measure what is the px equivalent for 210mm (A4 210x297mm)
div = document.createElement("div")
div.style.width = "200mm"; // XXX HARDCODED
document.body.appendChild(div);
sheet_width_in_px = div.clientWidth;
document.body.removeChild(div);
// Resize a table by reducing th and td font-size,
// to avoid the table to be larger than the sheet width,
// to avoid global fonts to be reduced.
[].forEach.call(table_list, function (table) {
if (sheet_width_in_px > table.clientWidth) return;
var ratio_percent = Math.floor((sheet_width_in_px / table.clientWidth) * 100);
table.style.width = "100%";
// Select th and td and affect the font-size in percent.
// The CSS should not set the font-size on the table instead of th and td
[].forEach.call(table.querySelectorAll("td"), function (e) {
e.setAttribute("style", "font-size: " + ratio_percent + "%");
});
[].forEach.call(table.querySelectorAll("th"), function (e) {
e.setAttribute("style", "font-size: " + ratio_percent + "%");
});
});
}
}());
</script>
"""
return None
"""
================================================================================
Return local parameters that require proxy role to access
================================================================================
"""
portal_type_valid_list = ["Web Site", "Web Section", "Web Page", "Letter"]
portal_type = context.getPortalType()
portal_object = context.getPortalObject()
if REQUEST is not None:
return None
if portal_type not in portal_type_valid_list:
return None
def err(my_value):
#return "XXX No " + my_value + " defined."
return ""
def populateProductDictFromCategoryList(my_category_list):
result_list = []
for category in my_cateogry_list:
if category.find("follow_up/") > -1:
output_dict = {}
stripped_category_url = category.replace("follow_up/", "")
stripped_category_url_title = portal_object.restrictedTraverse(
stripped_category_url
).getTitle()
output_dict["title"] = stripped_category_url_title or err("product software")
result_list.append(output_dict)
return result_list
def populateProductDict(my_product_list):
result_list = []
for product in my_product_list:
output_dict = {}
output_dict["title"] = product.getTitle() or err("product software")
result_list.append(output_dict)
return result_list
def populateBankDict(my_bank_list):
result_list = []
for bank in my_bank_list:
output_dict = {}
output_dict["bank"] = bank.getTitle() or err("bank account title")
output_dict["iban"] = bank.getIban() or err("iban")
output_dict["bic"] = bank.getBicCode() or err("bic")
result_list.append(output_dict)
return result_list
def populatePersonDict(my_person_list):
result_list = []
for person in my_person_list:
output_dict = {}
person_default_telephone = person.getDefaultTelephoneValue()
person_default_mail = person.getDefaultEmail()
person_address = person.getDefaultAddress()
person_region = person.getRegionValue()
output_dict["name"] = person.getTitle() or err("title")
output_dict["title"] = person.getFunctionTitle() or err("function title")
output_dict["uid"] = person.getUid() or err("uid")
if person.getDefaultAddress() is not None:
output_dict["address"] = person_address.getStreetAddress() or err("street address")
output_dict["postal_code"] = person_address.getZipCode() or err("postal code")
output_dict["city"] = person_address.getCity() or err("city")
else:
output_dict["address"] = err("street_adress")
output_dict["postal_code"] = err("postal_code")
output_dict["city"] = err("city")
if person_region is not None:
output_dict["country"] = person_region.getTitle() or err("country")
output_dict["codification"] = person_region.getCodification() or err("country code")
else:
output_dict["country"] = err("country")
output_dict["codification"] = err("country code")
if person_default_telephone is not None:
output_dict["phone"] = person_default_telephone.getCoordinateText() or err("phone")
else:
output_dict["phone"] = err("phone")
if person_default_mail is not None:
output_dict["email"] = person_default_mail.getUrlString() or err("email")
else:
output_dict["email"] = err("email")
result_list.append(output_dict)
return result_list
def populateOrganisationDict(my_organisation_list):
result_list = []
for organisation in my_organisation_list:
output_dict = {}
organisation_address = organisation.getDefaultAddress()
organisation_region = organisation.getRegionValue()
organisation_phone = organisation.getDefaultTelephoneValue()
organisation_fax = organisation.getDefaultFax()
organisation_link_list = organisation.objectValues(portal_type="Link",title="Corporate Web Site")
organisation_bank_list = organisation.objectValues(portal_type="Bank Account",title="Default Bank Account")
output_dict["organisation_title"] = organisation.getTitle()
output_dict["logo_url"] = organisation.getDefaultImageAbsoluteUrl() or err("logo_url")
output_dict["corporate_name"] = organisation.getCorporateName() or err("corporate name")
output_dict["social_capital"] = organisation.getSocialCapital() or err("social capital")
output_dict["activity_code"] = organisation.getActivityCode() or err("activitiy code")
# XXX we should have social_capital_currency and corporate_registration_court
output_dict["social_capital_currency"] = err("social capital")
output_dict["corporate_registration_code"] = err("corporate_registration_code")
output_dict["vat"] = organisation.getVatCode() or err("vat")
output_dict["corporate_registration"] = organisation.getCorporateRegistrationCode() or err("corporate_registration")
output_dict["email"] = organisation.getDefaultEmailText() or err("email")
if organisation.getDefaultAddress() is not None:
output_dict["address"] = organisation_address.getStreetAddress() or err("street address")
output_dict["postal_code"] = organisation_address.getZipCode() or err("postal code")
output_dict["city"] = organisation_address.getCity() or err("city")
else:
output_dict["address"] = err("street address")
output_dict["postal_code"] = err("postal code")
output_dict["city"] = err("city")
if organisation_region is not None:
output_dict["country"] = organisation_region.getTitle() or err("country")
output_dict["codification"] = organisation_region.getCodification() or err("country code")
else:
output_dict["country"] = err("country")
output_dict["codification"] = err("country code")
if organisation_phone is not None:
output_dict["phone"] = organisation_phone.getDefaultTelephoneCoordinateText() or err("phone")
else:
output_dict["phone"] = err("phone")
if organisation_fax is not None:
output_dict["fax"] = organisation_fax.getCoordinateText() or err("fax")
else:
output_dict["fax"] = err("fax")
if len(organisation_link_list) == 1:
output_dict["website"] = organisation_link_list[0].getUrlString() or err("Website")
else:
output_dict["website"] = err("web site")
if len(organisation_bank_list) > 0:
output_dict["bank"] = organisation_bank_list[0].getTitle() or err("bank account title")
output_dict["iban"] = organisation_bank_list[0].getIban() or err("iban")
output_dict["bic"] = organisation_bank_list[0].getBicCode() or err("bic")
else:
output_dict["bank"] = err("bank")
output_dict["iban"] = err("iban")
output_dict["bic"] = err("bic")
result_list.append(output_dict)
return result_list
# "ERP5 Software" => erp5
def getSubstringFromProduct(my_candidate, my_as_is):
software_match_string = " Software"
software_title = my_candidate.get("title") or ""
if software_title.find(software_match_string) > 1:
if my_as_is is True:
return software_title.split(software_match_string)[0]
return software_title.split(software_match_string)[0].lower()
def callSelf(my_parameter, my_source_id, my_flag_site):
return context.WebPage_getCommonProxyParameter(
parameter=my_parameter,
source_uid=my_source_id,
flag_site=my_flag_site
)
pass_parameter = kw.get("parameter", None)
pass_source_data = kw.get("source_data", None)
pass_flag_site = kw.get("flag_site", None)
if pass_parameter is not None and pass_source_data is not None:
# ---------------------- Override Person -------------------------------------
# returns [{person_dict}]
if pass_parameter == "override_person":
return populatePersonDict(portal_object.portal_catalog(
portal_type="Person",
title=pass_source_data
))
# -------------------------- Contributor -------------------------------------
# returns [{person_dict}, {person_dict...}]
if pass_parameter == "author":
return populatePersonDict(context.getContributorValueList(*args, **kw))
# ------------- Override Sender/Recipient Organisation -----------------------
# returns [{organisation_dict}]
if pass_parameter == "override_organisation":
return populateOrganisationDict(portal_object.portal_catalog(
portal_type="Organisation",
title=pass_source_data
))
# ----------------------- Sender (Override) ----------------------------------
# returns [{organisation_dict}]
if pass_parameter == "sender":
return populateOrganisationDict(portal_object.portal_catalog(
portal_type="Organisation",
uid=pass_source_data
))
# -------------- Source/Destination (Person => Organisation) -----------------
# returns [{organisation_dict}]
if pass_parameter == "source" or pass_parameter == "destination":
for c in portal_object.person_module.searchFolder(uid=pass_source_data):
organisation = c.getCareerSubordinationValue()
if organisation is not None:
return populateOrganisationDict([organisation])
return []
# -------------------- Organisation (Follow-Up) ------------------------------
# returns [{organisation_dict}] used in leaflet, letter
if pass_parameter == "organisation":
return populateOrganisationDict(context.getFollowUpValueList(
portal_type=pass_parameter.title(),
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# ---------------------- Person (Follow-Up) ----------------------------------
# returns [{person_dict} used in letter
if pass_parameter == "person":
return populatePersonDict(context.getFollowUpValueList(
portal_type=pass_parameter.title(),
checked_permission='View'
))
# --------------------- Bank (Default Bank Account) --------------------------
# returns [{bank_account_dict}] used in letter
if pass_parameter == "bank":
return populateBankDict(portal_object.portal_catalog(
portal_type="Bank Account",
uid=pass_source_data
))
# ------------------------- Product (Website) --------------------------------
if pass_parameter == "product":
if pass_flag_site == True:
return populateProductDictFromCategoryList(
context.getWebSiteValue().getMembershipCriterionCategoryList() or []
)
elif pass_source_data is not None:
return populateProductDict(context.getFollowUpValueList(
portal_type=pass_parameter,
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# --------------------------- Theme (Website) --------------------------------
# returns string of theme eg. "foo" or None
# tries to match theme to follow-up product
# XXX custom?
if pass_parameter == "theme":
theme = None
product_candidate_list = callSelf("product", pass_source_data, pass_flag_site)
if product_candidate_list is not None:
if len(product_candidate_list) > 0:
theme = getSubstringFromProduct(product_candidate_list[0], None)
return theme
......@@ -50,7 +50,15 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>REQUEST=None, *args, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -14,7 +14,7 @@ img_type = img_obj.getContentType()
# ensure alt attributes are set
if img_string.find('alt=') == -1:
img_string.replace ("src=", 'alt="%s" src=' % img_obj.getTitle())
img_string.replace ("src=", 'alt="%s" src=' % img_caption or img_obj.getTitle())
# force svg display as svg or png
if img_type == "image/svg+xml":
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>img_string=None, img_wrap=None, img_svg_format=None</string> </value>
<value> <string>img_string=None, img_wrap=None, img_svg_format=None, image_caption=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -75,9 +75,10 @@
<value>
<list>
<string>format</string>
<string>note_display</string>
<string>svg_display</string>
<string>display_note</string>
<string>display_svg</string>
<string>portal_skin</string>
<string>document_save</string>
</list>
</value>
</item>
......@@ -86,7 +87,7 @@
<value>
<list>
<string>override_logo_reference</string>
<string>override_publisher_title</string>
<string>override_source_organisation_title</string>
</list>
</value>
</item>
......@@ -127,7 +128,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>WebPage_updateExportAsSlideshowDialog</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>note_display</string> </value>
<value> <string>display_note</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>svg_display</string> </value>
<value> <string>display_svg</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document_save</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Save in Document Module</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>override_publisher_title</string> </value>
<value> <string>override_source_organisation_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -74,9 +74,9 @@
<key> <string>left</string> </key>
<value>
<list>
<string>note_display</string>
<string>display_note</string>
<string>portal_skin</string>
<string>svg_display</string>
<string>display_svg</string>
</list>
</value>
</item>
......@@ -85,7 +85,7 @@
<value>
<list>
<string>override_logo_reference</string>
<string>override_publisher_title</string>
<string>override_source_organisation_title</string>
</list>
</value>
</item>
......@@ -126,7 +126,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>WebPage_updatePrintAsSlideshowDialog</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>note_display</string> </value>
<value> <string>display_note</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>svg_display</string> </value>
<value> <string>display_svg</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>override_publisher_title</string> </value>
<value> <string>override_source_organisation_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
/* ========================================================================== */
/* ===================== Font Declarations ================================= */
/* ========================================================================== */
/* fonts are declared in default theme, so any custom themes.css can override */
.ci-letter .ci-letter-header span,
.ci-letter .ci-letter-head-right .ci-letter-timestamp span,
.ci-letter .ci-letter-head-right .ci-letter-page span,
.ci-letter .ci-letter-head .ci-letter-destination span {
font-family: "Roboto", Arial, sans-serif;
font-weight: normal;
}
.ci-letter span,
/*.ci-letter .ci-letter-head table tr td:last-child span, */
/*.ci-letter .ci-letter-head .ci-letter-destination span, */
.ci-letter .ci-letter-body p b i,
.ci-letter .ci-letter-body p,
.ci-letter .ci-letter-body {
font-family: "Heuristica", Helvetica, serif;
font-weight: normal;
}
.ci-letter .ci-letter-head .ci-letter-source span,
.ci-letter .ci-letter-footer table td div span {
font-family: "Roboto Condensed", Arial, sans-serif;
font-weight: normal;
}
.ci-letter .ci-letter-header td span {
font-family: "Roboto Condensed", Arial, sans-serif !important;
font-weight: normal !important;
}
.ci-leaflet p,
.ci-leaflet li {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
.ci-leaflet h1,
.ci-leaflet h2,
.ci-leaflet .ci-leaflet-footer div,
.ci-leaflet-header p,
.ci-leaflet p.ci-leaflet-source-header,
.ci-leaflet p.ci-leaflet-sheet-header,
.ci-leaflet #left-summary p,
.ci-leaflet #left-summary li,
.ci-leaflet #main-content .left-icon .excerpt,
.ci-leaflet #legalese .bottom {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow .ci-slideshow-handout h1,
.ci-slideshow .ci-slideshow-handout h2,
.ci-slideshow .ci-slideshow-intro:before,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
html .ci-slideshow pre,
html .ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
.ci-book * {
font-family: "Heuristica", Helvetica, "Times", serif;
font-weight: normal;
font-style: normal;
}
.ci-book caption {
font-family: "Heuristica", Helvetica, "Times", serif;
font-weight: normal;
font-style: normal !important;
}
.ci-book pre,
.ci-book code {
/* does not load: font-family: "TexGyreCursor", Monospace, Arial; */
font-family: "Roboto", Arial, sans-serif;
font-weight: normal;
font-style: normal;
}
.ci-book strong {
font-weight: bold;
font-style: normal;
}
.ci-book table thead th b,
.ci-book table thead td strong,
.ci-book table tbody td b,
.ci-book table tbody td strong,
.ci-book table tbody td div,
.ci-book table tbody th div,
.ci-book table tbody td span,
.ci-book table tbody th span {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
font-style: normal;
}
/* XXX custom report css */
.ci-book div.ci-book-box-offer div,
.ci-book div.ci-book-box-offer-milestone div {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
}
.ci-book .ci-book-box-offer *,
.ci-book .ci-book-box-offer-milestone * {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif !important;
}
.ci-book .ci-book-footer .ci-book-footer-copy,
.ci-book table th,
.ci-book table th span,
.ci-book table td,
.ci-book table td li,
.ci-book table tbody td p,
.ci-book table tbody td p em,
.ci-book table th a,
.ci-book table td a,
.ci-book table td i {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
}
.ci-book h1,
.ci-book h2,
.ci-book h3,
.ci-book h4,
.ci-book h5,
.ci-book h6,
.ci-book .ci-book-header td div,
.ci-book .ci-book-header .ci-book-header-key,
.ci-book .ci-book-header .ci-book-header-value,
.ci-book .ci-book-header td div span,
.ci-book .ci-book-footer td span,
.ci-book .ci-book-header td div,
.ci-book table td em {
font-family: "Roboto", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
}
/* ========================================================================== */
/* ======================= Default THEME =================================== */
/* ========================================================================== */
......@@ -69,8 +208,8 @@
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
}
/* ------------------------- Two Pager ------------------------------------- */
.ci-default .ci-two-page .ci-two-page-header {
/* ------------------------- Leaflet --------------------------------------- */
.ci-default .ci-leaflet .ci-leaflet-header {
background-color: #C3C7C6;
color: #ffffff;
}
......
......@@ -12,7 +12,7 @@ Generates the complete slideshow
doc_template_css_url python: options.get('doc_template_css_url');
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_theme_footer_url python: options.get('doc_theme_footer_url');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
doc_copyright python: options.get('doc_copyright');
......
......@@ -12,7 +12,7 @@ Creates the Slideshow footer section.
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_template_css_url python: options.get('doc_template_css_url');
doc_theme_footer_url python: options.get('doc_theme_footer_url');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
doc_copyright python: options.get('doc_copyright');
......@@ -56,7 +56,9 @@ Creates the Slideshow footer section.
<tal:block metal:define-macro="slide_footer">
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img tal:attributes="src python: ''.join([doc_theme_footer_url, '?format=png&amp;display=xsmall'])" alt="Logo" />
<tal:block tal:condition="python: doc_footer_url != ''">
<img alt="Logo" tal:attributes="src python: doc_footer_url" />
</tal:block>
</div>
<div class="ci-slideshow-container-center" tal:content="doc_description"></div>
<div class="ci-slideshow-container-right">
......
......@@ -5,10 +5,12 @@ Export slideshow in any of the supported formats
"""
return context.WebPage_viewAsSlideshow(
format=format,
note_display=note_display,
svg_display=svg_display,
override_publisher_title=override_publisher_title,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
batch_mode=batch_mode,
document_save=document_save,
document_download=document_download,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", note_display=0, svg_display=\'png\', override_publisher_title=None, override_logo_reference=None, batch_mode=False, **kw</string> </value>
<value> <string>format="html", document_download=None, document_save=None, display_note=0, display_svg=None, override_source_organisation_title=None, override_logo_reference=None, batch_mode=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
"""
================================================================================
Return local parameters
================================================================================
"""
return None
"""
================================================================================
Return local parameters that require proxy role to access
================================================================================
"""
portal_type_valid_list = ["Web Site", "Web Section", "Web Page"]
portal_type = context.getPortalType()
portal_object = context.getPortalObject()
if REQUEST is not None:
return None
if portal_type not in portal_type_valid_list:
return None
def err(my_value):
#return "XXX No " + my_value + " defined."
return ""
def populateProductDictFromCategoryList(my_category_list):
result_list = []
for category in my_cateogry_list:
if category.find("follow_up/") > -1:
output_dict = {}
stripped_category_url = category.replace("follow_up/", "")
stripped_category_url_title = portal_object.restrictedTraverse(
stripped_category_url
).getTitle()
output_dict["title"] = stripped_category_url_title or err("product software")
result_list.append(output_dict)
return result_list
def populateOrganisationDict(my_organisation_list):
result_list = []
for organisation in my_organisation_list:
output_dict = {}
output_dict["title"] = organisation.getTitle() or err("title")
output_dict["organisation"] = organisation.getCorporateName() or err("corporate_name")
result_list.append(output_dict)
return result_list
def populateProductDict(my_product_list):
result_list = []
for product in my_product_list:
output_dict = {}
output_dict["title"] = product.getTitle() or err("product software")
result_list.append(output_dict)
return result_list
def populatePersonDict(my_person_list):
result_list = []
for person in my_person_list:
output_dict = {}
person_default_telephone = person.getDefaultTelephoneValue()
person_default_mail = person.getDefaultEmail()
output_dict["name"] = person.getTitle() or err("title")
output_dict["title"] = person.getFunctionTitle() or err("function title")
output_dict["uid"] = person.getUid() or err("uid")
if person_default_telephone is not None:
output_dict["phone"] = person_default_telephone.getCoordinateText() or err("phone")
else:
output_dict["phone"] = err("phone")
if person_default_mail is not None:
output_dict["email"] = person_default_mail.getUrlString() or err("email")
else:
output_dict["email"] = err("email")
result_list.append(output_dict)
return result_list
# "ERP5 Software" => erp5
def getSubstringFromProduct(my_candidate, my_as_is):
software_match_string = " Software"
software_title = my_candidate.get("title") or ""
if software_title.find(software_match_string) > 1:
if my_as_is is True:
return software_title.split(software_match_string)[0]
return software_title.split(software_match_string)[0].lower()
def callSelf(my_parameter, my_source_id, my_flag_site):
return context.WebPage_getLocalProxyParameter(
parameter=my_parameter,
source_uid=my_source_id,
flag_site=my_flag_site
)
pass_parameter = kw.get("parameter", None)
pass_source_data = kw.get("source_data", None)
pass_flag_site = kw.get("flag_site", None)
if pass_parameter is not None and pass_source_data is not None:
# ---------------------- Author (Contributors) -------------------------------
if pass_parameter == "author":
return populatePersonDict(context.getContributorValueList(*args, **kw))
# ----------------- Publisher (Follow-Up Organisation) -----------------------
if pass_parameter == "publisher":
return populateOrganisationDict(context.getFollowUpValueList(
portal_type="Organisation",
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# ------------------------- Product (Website) --------------------------------
if pass_parameter == "product":
if pass_flag_site == True:
return populateProductDictFromCategoryList(
context.getWebSiteValue().getMembershipCriterionCategoryList() or []
)
elif pass_source_data is not None:
return populateProductDict(context.getFollowUpValueList(
portal_type=pass_parameter,
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# --------------------------- Theme (Website) --------------------------------
if pass_parameter == "theme":
theme = None
product_candidate_list = callSelf("product", pass_source_data, pass_flag_site)
if product_candidate_list is not None:
if len(product_candidate_list) > 0:
theme = getSubstringFromProduct(product_candidate_list[0], None)
# XXX no more overrides here, use override parameters on slideshow
# OSOE Sonderlocke
#if theme is None:
# osoe_match_string = "osoe"
# category_candidate_list = context.getCategoryList() or []
# for category in category_candidate_list:
# if category.find(osoe_match_string) > 1:
# theme = osoe_match_string
# MyNij Sonderlocke
#if theme is None:
# organisation_candidate_list = callSelf("Organisation", source_uid, None)
# if len(organisation_candidate_list) > 0:
# theme = organisation_candidate_list[0].get('title').lower()
return theme
......@@ -3,4 +3,14 @@
Print and download slideshow in PDF format
================================================================================
"""
return context.WebPage_viewAsSlideshow(format=format,note_display=note_display,svg_display=svg_display,flag_download=True, **kw)
return context.WebPage_viewAsSlideshow(
format=format,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
batch_mode=batch_mode,
document_download=document_download,
document_save=document_save,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="pdf", note_display=0, svg_display=\'png\', **kw</string> </value>
<value> <string>format="pdf", display_note=0,override_source_organisation_title=None,override_logo_reference=None, batch_mode=False, document_download=None, display_svg=None, document_save=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
"""
================================================================================
Update the slide dialog with parameters manually entered
================================================================================
"""
from Products.ERP5Type.Message import translateString
if dialog_id is not None:
return context.Base_redirect(
dialog_id,
keep_items = dict(
portal_status_message=translateString('Preview updated.'),
cancel_url=cancel_url,
portal_skin=portal_skin,
override_logo_reference=override_logo_reference,
override_publisher_title=override_publisher_title,
note_display=note_display,
svg_display=svg_display,
format="pdf",
)
)
......@@ -12,9 +12,11 @@ if dialog_id is not None:
cancel_url=cancel_url,
portal_skin=portal_skin,
override_logo_reference=override_logo_reference,
override_publisher_title=override_publisher_title,
note_display=note_display,
svg_display=svg_display,
override_source_organisation_title=override_source_organisation_title,
display_note=display_note,
display_svg=display_svg,
document_save=document_save,
document_download=document_download,
format=format,
)
)
......@@ -50,19 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, *args, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
<value> <string>dialog_id=None, cancel_url=None, document_download=None, document_save=None ,format=None, display_note=None, display_svg=None, override_source_organisation_title=None, override_logo_reference=None, portal_skin=None, *args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_getLocalProxyParameter</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -6,24 +6,26 @@ MAIN FILE: generate presentation in different output formats
# kw-parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# note_display: display slide notes (1) or not (0)*
# svg_display: display svg-images as svg or png*
# transformation: convert content into nothing*, book
# ------
# override_source_organisation_title: to use instead of default company
# override_logo_reference: to use instead of default company logo in footer
# override_publisher_title: to use instead of default company publisher
# override_batch_mode: used for tests
# ------
# flag_download: download file directly (default None)
# flag_save: save file in document module (default None)
# flag_ooo: convert from legacy odp, sxi formats (default None)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# ------
# display_note: display slide notes (1) or not (0)*
# display_svg: display svg-images as svg or png*
# ------
# flag_ooo: convert legacy odp, sxi formats (not active)
import re
from Products.PythonScripts.standard import html_quote
from base64 import b64encode
empty_string = ''
blank = ''
# -------------------------- External parameters ------------------------------
......@@ -34,10 +36,6 @@ customHandler = getattr(context, "WebPage_getCustomParameter", None)
commonHandler = getattr(context, "WebPage_getCommonParameter", None)
commonProxyHandler = getattr(context, "WebPage_getCommonProxyParameter", None)
# parameters specific to this template
localHandler = getattr(context, "WebPage_getLocalParameter", None)
localProxyHandler = getattr(context, "WebPage_getLocalProxyParameter", None)
def getCustomParameter(my_parameter, my_override_data):
if customHandler is not None:
source_data = my_override_data or doc_uid
......@@ -53,16 +51,6 @@ def getCommonProxyParameter(my_parameter, my_override_data):
source_data = my_override_data or doc_uid
return commonProxyHandler(parameter=my_parameter, source_data=source_data)
def getLocalParameter(my_parameter, my_override_data):
if localHandler is not None:
source_data = my_override_data or doc_uid
return localHandler(parameter=my_parameter, source_data=source_data)
def getLocalProxyParameter(my_parameter, my_override_data):
if localProxyHandler is not None:
source_data = my_override_data or doc_uid
return localProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------ HTML cleanup/converter methods ----------------------------
def getSlideList(my_content):
return re.findall(r'<section[^>]*?>(.*?)</section>', my_content, re.S)
......@@ -80,29 +68,28 @@ def removeSlidesWithoutDetailsFromNotes(my_content):
slide_list = getSlideList(my_content)
for slide in slide_list:
if getNestedSection(slide) is False:
my_content = my_content.replace(slide, empty_string)
content = my_content.replace('<section></section>', empty_string)
content = re.sub(r'<section class="[^"]*"></section>', empty_string, content)
my_content = my_content.replace(slide, blank)
content = my_content.replace('<section></section>', blank)
content = re.sub(r'<section class="[^"]*"></section>', blank, content)
return content
def removeSectionTags(my_content):
content = re.sub(r'<section class="[^"]*">', empty_string, my_content)
content = content.replace('</section>', empty_string)
content = content.replace('<section>', empty_string)
content = re.sub(r'<section class="[^"]*">', blank, my_content)
content = content.replace('</section>', blank)
content = content.replace('<section>', blank)
return content
def removeDetailTags(my_content):
content = my_content.replace('</details>', empty_string)
content = content.replace('<details>', empty_string)
content = content.replace('<details open="open">', empty_string)
content = my_content.replace('</details>', blank)
content = content.replace('<details>', blank)
content = content.replace('<details open="open">', blank)
return content
def removeEmptyDetails(my_content):
content = my_content.replace('<details open="open"></details>', empty_string)
content = content.replace('<details></details>', empty_string)
content = content.replace('<details>&nbsp;</details>', empty_string)
content = content.replace('<details> </details>', empty_string)
# more to come
content = my_content.replace('<details open="open"></details>', blank)
content = content.replace('<details></details>', blank)
content = content.replace('<details>&nbsp;</details>', blank)
content = content.replace('<details> </details>', blank)
return content
def getPageList(my_content):
......@@ -116,7 +103,7 @@ def getPageTitle(my_full_page):
def getPageContent(my_full_page):
result_list = my_full_page.split("</center><br>")
if len(result_list) == 2:
return result_list[1].replace("</body>", "")
return result_list[1].replace("</body>", blank)
def addSlideContent(my_content, my_notes):
return ''.join([
......@@ -135,7 +122,7 @@ def sortContent(my_page_list):
for page in my_page_list:
page_title = getPageTitle(page)
# XXX cloudooo html-transformation mixes up slide order! dirty fix
# Note cloudooo default html transformation mixes slide order. dirty fix
if page_title.find("Commercial") > -1:
page_content = getPageContent(page)
if page_content.find("<center>") > -1:
......@@ -162,24 +149,36 @@ def sortContent(my_page_list):
except Exception as e:
raise e
def setOverrideParam(my_context, my_override, my_param):
if my_override is not None and my_override is not blank:
return html_quote(my_override)
return getattr(my_context, my_param) or None
# XXX how to set checkbox correctly?
def setToNone(param):
if param == blank or param == None or param == 0 or param == str(0):
return None
else:
return param
# -------------------------- Setup ---------------------------------------------
doc = context
doc_prefix = "Slideshow."
doc_converted_content = None
doc_uid = doc.getUid()
doc_url = doc.getAbsoluteUrl()
doc_format = kw.get('format', 'html')
doc_transformation = kw.get('transformation', None)
doc_display_notes = kw.get('note_display', None)
doc_display_svg = kw.get('svg_display', None)
doc_download = kw.get('flag_download', None)
doc_save = kw.get('flag_save', None)
doc_display_notes = kw.get('display_note', None)
doc_display_svg = kw.get('display_svg', 'png')
doc_download = kw.get('document_download', None)
doc_save = kw.get('document_save', None)
doc_ooo = kw.get('flag_ooo', None)
override_doc_logo = kw.get('override_logo_reference', None)
override_doc_publisher = kw.get("override_publisher_title", None)
override_logo_reference = kw.get('override_logo_reference', None)
override_source_organisation_title = kw.get("override_source_organisation_title", None)
override_batch_mode = kw.get('batch_mode', False)
follow_up_doc_publisher = None
override_source_person_title = None
# ---------- backward compatability with legacy odp/sxi presentations ----------
# note: this has to come first to convert file into html and then continue
......@@ -188,7 +187,7 @@ if doc_ooo is not None:
if doc.getPortalType() in ["Presentation"]:
raw_data = doc_portal.portal_transforms.convertToData(
"text/html",
str(context.getData() or empty_string),
str(context.getData() or blank),
context=context,
mimetype=context.getContentType()
)
......@@ -199,13 +198,13 @@ if doc_ooo is not None:
page_list = getPageList(raw_data)
if len(page_list) > 0:
page_content = sortContent(page_list)
doc_converted_content = empty_string
doc_converted_content = blank
for slide in page_content:
if slide[1].find("<center>") > -1:
slide_content_list = slide[1].split("<h3>Notes:</h3>")
if len(slide_content_list) != 2:
slide_content = slide[1]
slide_notes = empty_string
slide_notes = blank
else:
slide_content = slide_content_list[0]
slide_content = slide_content.replace("<center>", "")
......@@ -221,104 +220,74 @@ doc_title = doc.getTitle()
doc_language = doc.getLanguage()
doc_description = doc.getDescription()
doc_creation_year = doc.getCreationDate().strftime('%Y')
doc_full_reference = '-'.join([doc.getReference(), doc.getVersion(), doc_language])
doc_version = doc.getVersion() or "001"
doc_reference = doc.getReference()
doc_relative_url = doc.getRelativeUrl()
doc_aggregate_list = []
doc_modification_date = doc.getModificationDate()
if doc_language and doc_format == "pdf":
doc.REQUEST['AcceptLanguage'].set(doc_language, 10)
if doc_reference is None:
doc_reference = doc_prefix + doc_title.replace(" ", ".")
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# --------------------------- Layout Parameters --------------------------------
doc_theme_claim = empty_string
doc_theme_logo = None
doc_theme_logo_url = None
doc_theme_footer_url = override_doc_logo
doc_pdf = ".pdf" if doc_format == "pdf" else empty_string
doc_template_css_url = ''.join([doc_url, "/slide_css/slide", doc_pdf, ".css"])
doc_fallback_img_url = ''.join([doc_url, '/', getCommonParameter("fallback_image", None)])
doc_logo_prefix = getCustomParameter("default_logo_prefix", None)
# XXX simplify
doc_theme_css_font_list = getCustomParameter("default_theme_font_css_url_list", None) or []
doc_theme_css_url = (
getCustomParameter("default_theme_css_url", None) or
getCommonParameter("default_theme_css_url", None) or
empty_string
)
doc_publisher_list = getLocalProxyParameter("publisher", None)
if doc_publisher_list and len(doc_publisher_list) > 0:
follow_up_doc_publisher = doc_publisher_list[0].get("organisation") or None
doc_publisher = (
getCustomParameter("default_company_title", None) or
empty_string
)
doc_copyright = (
override_doc_publisher or
follow_up_doc_publisher or
getCustomParameter("default_company_title", None) or
empty_string
doc_theme = doc.Base_getThemeDict(
custom_theme=getCustomParameter("theme", None),
override_batch_mode=override_batch_mode,
format=doc_format,
url=doc_url,
css_path="/slide_css/slide"
)
# theme
doc_theme = (
getLocalProxyParameter("theme", None) or
getCustomParameter("theme", None) or
doc_publisher
)
if doc_theme and override_batch_mode:
doc_theme = "default"
if doc_theme:
doc_theme = doc_theme.lower()
if doc_logo_prefix:
doc_theme_logo_url = doc_logo_prefix + doc_theme.capitalize()
doc_theme_logo = context.restrictedTraverse(doc_theme_logo_url)
doc_theme_footer_url = doc_theme_footer_url or (doc_logo_prefix + doc_publisher)
if doc_theme_logo:
doc_theme_claim = doc_theme_logo.getDescription()
else:
doc_theme = "default"
doc_theme_logo_url = doc_fallback_img_url
doc_theme_footer_url = doc_theme_footer_url or doc_fallback_img_url
doc_author_list = ', '.join(c.get("name") for c in getLocalProxyParameter("author", [])) or empty_string
doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {',
'content: "%s";' % (doc_theme_claim),
'background: #FFF url("%s?format=png&amp;display=small") center no-repeat;' % (doc_theme_logo_url),
'content: "%s";' % (doc_theme.get("theme_logo_description")),
'background: #FFF url("%s") center no-repeat;' % (doc_theme.get("theme_logo_url")),
'background-size: auto 120px;'
'}'])
# --------------------------- Content Upgrades ---------------------------------
# ---------------------------------- Source ------------------------------------
doc_source = doc.Base_getSourceDict(
override_source_person_title=override_source_person_title,
override_source_organisation_title=html_quote(override_source_organisation_title),
override_logo_reference=html_quote(override_logo_reference),
default_company_title=getCustomParameter("default_company_title", None),
default_bank_account_uid=getCustomParameter("default_bank_account_uid", None),
theme_logo_url=doc_theme.get("theme_logo_url", None)
)
# --------------------------- Content Upgrades ---------------------------------
for image in re.findall('(<img.*?/>)', doc_content):
doc_content = doc_content.replace(image, context.WebPage_validateImage(img_string=image, img_svg_format=doc_display_svg))
doc_content = doc_content.replace(
image,
context.WebPage_validateImage(img_string=image, img_svg_format=setToNone(doc_display_svg))
)
# ========================= TRANSFORMATION: book ===============================
# XXX still dirty
if doc_transformation == "book":
intro_slide = ''.join([
'<h1 i18n:translate="" i18n:domain="erp5_ui">Introduction</h1>',
'<p>%s</p>' % doc_description,
'${WebPage_insertTableOfReferences}'
])
doc_content = ''.join([intro_slide, doc_content])
for slide in getSectionSlideList(doc_content):
mod_slide = removeEmptyDetails(slide)
mod_slide = removeDetailTags(mod_slide)
if slide.find('class="chapter"') == -1:
mod_slide = context.WebPage_downgradeHeaders(mod_slide, 1)
mod_slide = removeSectionTags(mod_slide)
doc_content = doc_content.replace(slide, mod_slide)
for table in re.findall('(<table.*?<\/table>)', doc_content):
doc_content = doc_content.replace(table, context.WebPage_validateTable(table_string=table))
for link in re.findall('(<a.*?<\/a>)', document_content):
doc_content = doc_content.replace(link, context.WebPage_validateLink(link_string=link, link_toc=true))
# XXX return?
return document_content
#if doc_transformation == "book":
#
# intro_slide = ''.join([
# '<h1 i18n:translate="" i18n:domain="erp5_ui">Introduction</h1>',
# '<p>%s</p>' % doc_description,
# '${WebPage_insertTableOfReferences}'
# ])
# doc_content = ''.join([intro_slide, doc_content])
#
# for slide in getSectionSlideList(doc_content):
# mod_slide = removeEmptyDetails(slide)
# mod_slide = removeDetailTags(mod_slide)
# if slide.find('class="chapter"') == -1:
# mod_slide = context.WebPage_downgradeHeaders(mod_slide, 1)
# mod_slide = removeSectionTags(mod_slide)
# doc_content = doc_content.replace(slide, mod_slide)
#
# for table in re.findall('(<table.*?<\/table>)', doc_content):
# doc_content = doc_content.replace(table, context.WebPage_validateTable(table_string=table))
#
# for link in re.findall('(<a.*?<\/a>)', document_content):
# doc_content = doc_content.replace(link, context.WebPage_validateLink(link_string=link, link_toc=true))
#
# ------------- backwards compatability with old slideshow ---------------------
# requires to wrap content of slides that contain <details> into nested
......@@ -334,64 +303,52 @@ if getDetails(doc_content) > -1:
details = updated.replace('<details>', '<details open="open">')
# XXX split content above 1600 chars into multiple details tags?
doc_content = doc_content.replace(slide, details)
# ============================= Format: html ===================================
if doc_format == "html":
doc.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return context.WebPage_createSlideshow(
# meta
doc_format=doc_format,
doc_theme=doc_theme,
doc_title=html_quote(doc_title),
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
doc_language=doc_language,
doc_template_css_url=doc_template_css_url,
doc_theme_css_font_list=doc_theme_css_font_list,
doc_theme_css_url=doc_theme_css_url,
#footer
doc_theme_footer_url=html_quote(doc_theme_footer_url),
doc_description=html_quote(doc_description),
doc_creation_year=html_quote(doc_creation_year),
doc_copyright=html_quote(doc_copyright),
doc_author_list=html_quote(doc_author_list),
# cover
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_footer_url=doc_source.get("enhanced_logo_url"),
doc_description=doc_description,
doc_creation_year=doc_creation_year,
doc_copyright=doc_source.get("organisation_title", blank),
doc_author_list=doc_source.get("contributor_title_string"),
doc_css=doc_css,
# content
doc_content=doc_content,
# notes are on the slide
#doc_display_notes=doc_display_notes,
#doc_notes=removeSlidesWithoutDetailsFromNotes(doc_content)
doc_content=doc_content
)
# ============================= Format: pdf ====================================
if doc_format == "pdf":
doc_slideshow_footer = context.WebPage_createSlideshowFooter(
# meta
doc_format=doc_format,
doc_theme=doc_theme,
doc_title=html_quote(doc_title),
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
doc_language=doc_language,
doc_template_css_url=doc_template_css_url,
doc_theme_css_font_list=doc_theme_css_font_list,
doc_theme_css_url=doc_theme_css_url,
#footer
doc_theme_footer_url=html_quote(doc_theme_footer_url),
doc_description=html_quote(doc_description),
doc_creation_year=html_quote(doc_creation_year),
doc_copyright=html_quote(doc_copyright),
doc_author_list=html_quote(doc_author_list)
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_footer_url=doc_source.get("enhanced_logo_url"),
doc_description=doc_description,
doc_creation_year=doc_creation_year,
doc_copyright=doc_source.get("organisation_title", blank),
doc_author_list=doc_source.get("contributor_title_string")
)
doc_slideshow_cover = context.WebPage_createSlideshowCover(
# meta
doc_format=doc_format,
doc_theme=doc_theme,
doc_title=html_quote(doc_title),
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
doc_language=doc_language,
doc_template_css_url=doc_template_css_url,
doc_theme_css_font_list=doc_theme_css_font_list,
doc_theme_css_url=doc_theme_css_url,
# cover
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_css=doc_css
)
......@@ -399,37 +356,28 @@ if doc_format == "pdf":
# and add extra css to recreate the same layout. so a separate output=content
# instead of defaulting to None
doc_slideshow_content = context.WebPage_createSlideshowContent(
# meta
doc_format=doc_format,
doc_theme=doc_theme,
doc_title=html_quote(doc_title),
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
doc_language=doc_language,
doc_template_css_url=doc_template_css_url,
doc_theme_css_font_list=doc_theme_css_font_list,
doc_theme_css_url=doc_theme_css_url,
# content
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_content=doc_content
)
if doc_display_notes:
doc_slideshow_notes = context.WebPage_createSlideshowNotes(
# meta
doc_format=doc_format,
doc_theme=doc_theme,
doc_title=html_quote(doc_title),
doc_theme=doc_theme.get("theme"),
doc_title=doc_title,
doc_language=doc_language,
doc_template_css_url=doc_template_css_url,
doc_theme_css_font_list=doc_theme_css_font_list,
doc_theme_css_url=doc_theme_css_url,
# notes
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_notes=removeSlidesWithoutDetailsFromNotes(doc_content)
)
# ================ encode and build cloudoo elements =========================
# parameters => https://lab.nexedi.com/nexedi/cloudooo/blob/master/cloudooo/handler/wkhtmltopdf/handler.py
# before_body_data_list
# embedded_html_data
# after_body_data_list
# footer_embedded_html_data
footer_embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_footer, allow_script=True)
embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_content, allow_script=True)
before_body_data_list = [
......@@ -455,36 +403,16 @@ if doc_format == "pdf":
)
)
if doc_save:
dms_module = getattr(context, 'document_module', None)
if dms_module is not None:
save_document = dms_module.newContent(
portal_type="PDF",
title=doc_title,
language=doc_language,
reference=doc_full_reference
)
save_document.edit(
source_reference=''.join([doc_reference, '.pdf']),
file=pdf_file
)
message = context.Base_translateString(
'%(portal_type)s created successfully as PDF Document.' % {
'portal_type': save_document.getTranslatedPortalType()
}
)
return document.Base_redirect(
keep_items=dict(portal_status_message=message)
)
elif doc_download:
doc.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
doc.REQUEST.RESPONSE.setHeader("Content-Disposition", 'attachment; filename="' + doc_full_reference + '.pdf"')
else:
doc.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
doc.REQUEST.RESPONSE.setHeader("Content-Disposition", 'filename="' + doc_full_reference + '.pdf"')
return pdf_file
# XXX throw if all fails?
raise Exception("No or unsupported format: " + str(doc_format))
return doc.WebPage_finishPdfCreation(
doc_download=doc_download,
doc_save=doc_save,
doc_version=doc_version,
doc_title=doc_title,
doc_relative_url=doc_relative_url,
doc_aggregate_list=doc_aggregate_list,
doc_language=doc_language,
doc_modification_date=doc_modification_date,
doc_reference=doc_reference,
doc_full_reference=doc_full_reference,
doc_pdf_file=pdf_file
)
......@@ -5,9 +5,12 @@ Display WebPage as slideshow if called with portal_skin=Slide parameter
"""
return context.WebPage_viewAsSlideshow(
format=format,
note_display=note_display,
svg_display=svg_display,
override_publisher_title=override_publisher_title,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
document_save=document_save,
document_download=document_download,
batch_mode=batch_mode,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", note_display=0, svg_display="png",override_logo_reference=None, override_publisher_title=None,**kw</string> </value>
<value> <string>format="html", batch_mode=False, document_download=None, document_save=None, display_note=0, display_svg=None, override_logo_reference=None, override_source_organisation_title=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
/* === font family === */
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow .ci-slideshow-handout h1,
.ci-slideshow .ci-slideshow-handout h2,
.ci-slideshow .ci-slideshow-intro:before,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
html .ci-slideshow pre,
html .ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
/* === font size === */
.ci-slideshow .ci-slideshow-intro:before {
font-size: 28px;
......@@ -300,9 +280,13 @@ html .ci-slideshow .ci-slideshow-footer > div {
}
html .ci-slideshow .ci-slideshow-header > div img,
html .ci-slideshow .ci-slideshow-footer > div img {
/*
max-width: 8em;
min-width: initial;
height: 4em;
*/
max-height: 2.5em;
min-width: initial;
}
html .ci-slideshow .ci-slideshow-container-left {
text-align: left;
......
......@@ -9,27 +9,6 @@ html {
height: 100%;
}
/* === font family === */
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow-handout .ci-slideshow-handout-header,
.ci-slideshow-handout h1,
.ci-slideshow-handout h2,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div,
.ci-slideshow .ci-slideshow-intro:before {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
.ci-slideshow pre,
.ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
/* === font size === */
.ci-slideshow h1,
.ci-slideshow h2,
......
##############################################################################
#
# Copyright (c) 2002-2017 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
class TestCorportateIdentityTemplateUiElements(ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "template_zuite"
def getBusinessTemplateList(self):
return (
'erp5_base',
'erp5_font',
'erp5_web',
'erp5_dms',
'erp5_corporate_identity',
'erp5_ui_test_core'
)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCorportateIdentityTemplateUiElements))
return suite
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testCorporateIdentityTemplateUiElements</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Tests verifying the various templates and exports work in the ERP5 UI.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testCorportateIdentityTemplateUiElements</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -27,17 +27,39 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.Localizer.itools.i18n.accept import AcceptLanguage
from Products.ERP5.tests.testERP5WebWithDms import customScript
from Products.ERP5Type.tests.utils import createZODBPythonScript
from PIL import Image
from urlparse import urlparse
import transaction
import functools
import cStringIO
import math, operator
import math
import re
import base64
host_url = r"https?://localhost(?::[0-9]+)?/[^/]+/"
test_url = "https://softinst73908.host.vifib.net/"
def setDomainDict(script_id, script_param, script_code):
def wrapper(func):
@functools.wraps(func)
def wrapped(self, *args, **kwargs):
if script_id in self.portal.portal_skins.custom.objectIds():
raise ValueError('Precondition failed: %s exists in custom' % script_id)
createZODBPythonScript(
self.portal.portal_skins.custom,
script_id,
script_param,
script_code,
)
try:
func(self, *args, **kwargs)
finally:
if script_id in self.portal.portal_skins.custom.objectIds():
self.portal.portal_skins.custom.manage_delObjects(script_id)
transaction.commit()
return wrapped
return wrapper
def changeSkin(skin_name):
"""
Change skin for following commands and attribute resolution.
......@@ -81,7 +103,9 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
self.message_catalog.message_edit('Notes', 'de', 'Notizen', '')
self.message_catalog.gettext('VAT ID', add=1)
self.message_catalog.message_edit('VAT ID', 'de', 'USt-ID', '')
self.message_catalog.gettext('Data Sheet', add=1)
self.message_catalog.message_edit('Data Sheet', 'de', 'Datenblatt', '')
# Activating a system preference if none is activated
for preference in self.portal.portal_catalog(portal_type="System Preference"):
if preference.getPreferenceState() == "global":
......@@ -131,8 +155,8 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
return
raise AssertionError("%(message)s\nComparing image:\n%(base64_1)s\nWith image:\n%(base64_2)s\nRMS: %(rms)s > %(max_rms)s\nAssertionError: %(message)s" % {
"message": message,
"base64_1": base64.encodestring(test_image_data),
"base64_2": base64.encodestring(expected_image_data),
"base64_1": "pfff", #base64.encodestring(test_image_data),
"base64_2": "pfff", #base64.encodestring(expected_image_data),
"rms": rms,
"max_rms": max_rms,
})
......@@ -152,7 +176,9 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
preferred_document_conversion_server_url = system_preference.getPreferredDocumentConversionServerUrl()
try:
system_preference.edit(
preferred_document_conversion_server_url="https://cloudooo.erp5.net/",
preferred_document_conversion_server_url="https://softinst77579.host.vifib.net/",
#https://cloudooo.erp5.net/
#https://softinst77579.host.vifib.net/
)
return args[0](*args[1:], **kw)
finally:
......@@ -203,13 +229,16 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"""
test_page = getattr(self.portal.web_page_module, id1)
expected_page = getattr(self.portal.web_page_module, id2)
dump = getattr(self.portal, 'dump_data')
kw["override_date"] = kw.get("override_date", test_page.getModificationDate())
html = getattr(test_page, kw.get("test_method"))(portal_skin=kw.get("use_skin"), **kw)
html = re.sub(host_url, test_url, html)
html = html.replace(test_page.getReference(), expected_page.getReference())
# update html test files or run tests
if dump is True:
expected_page.edit(text_content=html)
self.assertEquals(html, expected_page.getData())
def runPdfTestPattern(self, id1, id2, id3, **kw):
......@@ -219,7 +248,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
test_page = getattr(self.portal.web_page_module, id1)
expected_image = getattr(self.portal.image_module, id2)
image_source_pdf_doc = getattr(self.portal.document_module, id3)
dump = getattr(self.portal, 'dump_data')
kw["override_date"] = kw.get("override_date", test_page.getModificationDate())
pdf_kw = dict(
......@@ -237,12 +266,15 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
**kw
)
# XXX don't overwrite file to create image, use temporary-pdf?
image_source_pdf_doc.setData(pdf_data)
_, bmp = image_source_pdf_doc.convert("bmp", frame=kw.get("page_number"))
# update bmp files
if dump is True:
expected_image.setData(bmp)
self.assertImageRenderingEquals(str(bmp), str(expected_image.getData()))
##############################################################################
# What rendering is tested:
# - Web Page as Slideshow, Letter, Leaflet (Two Page) and Book
......@@ -321,101 +353,6 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
)
)
@changeSkin('CI')
def test_htmlSlideShowBackcompatSkinCi(self):
"""
Test:
- backcompat test for portal_skin "CI"
- Web Page as Slideshow
- without follow up
- without contributor
- export as html
"""
self.runHtmlTestPattern(
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_001_en_html",
**dict(
use_skin="CI",
test_method="WebPage_exportAsSlideshow"
)
)
@changeSkin('CI_slideshow')
def test_htmlSlideShowBackcompatSkinCislideshow(self):
"""
Test:
- backcompat test for portal_skin "CI_slideshow"
- Web Page as Slideshow
- without follow up
- without contributor
- export as html
"""
self.runHtmlTestPattern(
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_001_en_html",
**dict(
use_skin="CI_slideshow",
test_method="WebPage_exportAsSlideshow"
)
)
@changeSkin('CI_Slideshow')
def test_htmlSlideShowBackcompatSkinCiSlideshow(self):
"""
Test:
- backcompat test for portal_skin "CI_Slideshow"
- Web Page as Slideshow
- without follow up
- without contributor
- export as html
"""
self.runHtmlTestPattern(
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_001_en_html",
**dict(
use_skin="CI_slideshow",
test_method="WebPage_exportAsSlideshow"
)
)
@changeSkin('SlideShow')
def test_htmlSlideShowBackcompatSkinSlideShow(self):
"""
Test:
- backcompat test for portal_skin "SlideShow"
- Web Page as Slideshow
- without follow up
- without contributor
- export as html
"""
self.runHtmlTestPattern(
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_001_en_html",
**dict(
use_skin="SlideShow",
test_method="WebPage_exportAsSlideshow"
)
)
@changeSkin('WhiteSlideShow')
def test_htmlSlideShowBackcompatSkinWhiteSlideShow(self):
"""
Test:
- backcompat test for portal_skin "WhiteSlideShow"
- Web Page as Slideshow
- without follow up
- without contributor
- export as html
"""
self.runHtmlTestPattern(
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_001_en_html",
**dict(
use_skin="WhiteSlideShow",
test_method="WebPage_exportAsSlideshow"
)
)
@changeSkin('Slide')
def test_htmlSlideShowOptionsSet(self):
"""
......@@ -430,11 +367,11 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_001_en_html",
"template_test_slideshow_output_expected_002_en_html",
**dict(
use_skin="WhiteSlideShow",
use_skin="Slide",
test_method="WebPage_exportAsSlideshow",
override_publisher_title="Foobarbazbam",
override_logo_reference="Template.Test.Image.Logo.Alternativ",
svg_display="svg"
display_svg="svg"
)
)
......@@ -451,7 +388,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_002_en_html",
"template_test_slideshow_output_expected_003_en_html",
**dict(
use_skin="WhiteSlideShow",
use_skin="Slide",
test_method="WebPage_exportAsSlideshow"
)
)
......@@ -491,7 +428,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_004_en_pdf",
**dict(
page_number=13,
note_display=1,
display_note=1,
use_skin="Slide",
test_method="WebPage_exportAsSlideshow",
format="pdf"
......@@ -536,7 +473,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
# "template_test_slideshow_input_003_en_pdf",
# **dict(
# page_number=4,
# override_publisher_title="Couscous",
# override_source_organisation_title="Couscous",
# override_logo_reference="Template.Test.Image.Erp5.Logo",
# use_skin="Slide",
# test_method="WebPage_exportAsSlideshow",
......@@ -559,7 +496,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_003_en_pdf",
**dict(
page_number=0,
override_publisher_title="Couscous",
override_source_organisation_title="Couscous",
override_logo_reference="Template.Test.Image.Erp5.Logo",
use_skin="Slide",
test_method="WebPage_exportAsSlideshow",
......@@ -582,7 +519,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_003_en_pdf",
**dict(
page_number=0,
override_publisher_title="Couscous",
override_source_organisation_title="Couscous",
override_logo_reference="Template.Test.Image.Erp5.Logo",
use_skin="Slide",
test_method="WebPage_printAsSlideshow",
......@@ -605,7 +542,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
"template_test_slideshow_input_005_de_pdf",
**dict(
page_number=8,
note_display=1,
display_note=1,
lang="de",
test_method="WebPage_exportAsSlideshow",
use_skin="Slide",
......@@ -613,12 +550,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
)
)
'''
@changeSkin('Letter')
def test_htmlLetter(self):
"""
......@@ -695,7 +627,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
test_method="WebPage_exportAsLetter",
use_skin="Letter",
head_display=0,
lang="de"
lang="de",
)
)
......@@ -715,7 +647,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
page_number=0,
test_method="WebPage_exportAsLetter",
format="pdf",
use_skin="Letter"
use_skin="Letter",
)
)
......@@ -737,7 +669,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
page_number=0,
test_method="WebPage_exportAsLetter",
format="pdf",
use_skin="Letter"
use_skin="Letter",
)
)
......@@ -765,7 +697,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
override_destination_person_title="Test Association Member",
subfield_field_override_date_year="1999",
subfield_field_override_date_month="12",
subfield_field_override_date_day="31"
subfield_field_override_date_day="31",
)
)
......@@ -788,7 +720,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
format="pdf",
lang="de",
head_display=0,
use_skin="Letter"
use_skin="Letter",
)
)
......@@ -807,145 +739,142 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
**dict(
page_number=0,
test_method="WebPage_PrintAsLetter",
use_skin="Letter"
use_skin="Letter",
)
)
def dumpOrCheckPrintout(self, delivery=None, report_name=None, prefix=None):
"""
render printout as html, then either compare with previous dumps, or
dump value
"""
dump_printout = getattr(self.portal, 'dump_notification', None)
printout_content = getattr(delivery, report_name)(batch_mode=True, test_mode=True)
printout_name = "%s_%s" % (prefix, report_name)
web_page_id = "test_printout_%s" % printout_name
if dump_printout:
former_web_page = getattr(self.portal.web_page_module, web_page_id, None)
if former_web_page is None:
former_web_page = self.portal.web_page_module.newContent(id=web_page_id)
former_web_page.edit(title=printout_name)
former_web_page.setTextContent(printout_content)
else:
former_web_page = getattr(self.portal.web_page_module, web_page_id)
self.assertEqual(former_web_page.getTextContent(),
printout_content)
self.tic()
def test_CI_twoPage(self):
"""
Test:
- Web Page as Two Page
- without follow up
- without contributor
- export as Default
- html format
"""
self.runTestPattern1("nexedi_ci_test_twopage_sample_001_en", "nexedi_ci_test_twopage_sample_002_en")
def test_CI_twoPageContributor(self):
@changeSkin('Leaflet')
def test_htmlLeaflet(self):
"""
Test:
- Web Page as Two Page
- without follow up
- with contributor (email only)
- export as Default
- html format
"""
self.runTestPattern1("nexedi_ci_test_twopage_sample_003_en", "nexedi_ci_test_twopage_sample_004_en")
def test_CI_twoPageContributorFollowUpOrganisation(self):
"""
Test:
- Web Page as Two Page
- with follow up (organisation)
- with contributor (email only)
- export as Default
- html format
- Web Page as Leaflet
- as-is
- export as html
"""
self.runTestPattern1("nexedi_ci_test_twopage_sample_005_en", "nexedi_ci_test_twopage_sample_006_en")
def test_CI_twoPageContributorFollowUpOrganisationPerson(self):
self.runHtmlTestPattern(
"template_test_leaflet_input_001_en_html",
"template_test_leaflet_output_expected_001_en_html",
**dict(
test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet"
)
)
@changeSkin('Leaflet')
def test_htmlLeafletOverrides(self):
"""
Test:
- Web Page as Two Page
- with follow up (organisation + person)
- with contributor (email only)
- export as Default
- html format
- Web Page as Leaflet
- Set all overrides and hide side panel
- export as html
"""
self.runTestPattern1("nexedi_ci_test_twopage_sample_007_en", "nexedi_ci_test_twopage_sample_008_en")
self.runHtmlTestPattern(
"template_test_leaflet_input_002_en_html",
"template_test_leaflet_output_expected_002_en_html",
**dict(
test_method="WebPage_exportAsLeaflet",
side_display=0,
override_source_person_title="Test Recipipent",
override_source_organisation_title="Test Association",
override_leaflet_header_title="Couscous",
use_skin="Leaflet"
)
)
@customScript("ERP5Site_getWebSiteDomainDict", "", r'return {}')
def test_CI_twoPageChapterPdfPage1(self):
@changeSkin('Leaflet')
def test_htmlLeafletContributorFollowUp(self):
"""
Test:
- Web Page as Two Page
- without follow up
- without contributor
- export as Chapter
- pdf format (page 1)
- Web Page as Leaflet
- add follow up organisation and contributor
- export as html
"""
self.runTestPattern3("nexedi_ci_test_twopage_sample_001_en", "nexedi_ci_test_twopage_sample_001_en_image_p01", 0)
@customScript("ERP5Site_getWebSiteDomainDict", "", r'return {}')
def test_CI_twoPageChapterPdfPage6(self):
self.runHtmlTestPattern(
"template_test_leaflet_input_003_de_html",
"template_test_leaflet_output_expected_003_de_html",
**dict(
test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet"
)
)
@changeSkin('Leaflet')
def test_pdfLeaflet(self):
"""
Test:
- Web Page as Two Page
- without follow up
- without contributor
- export as Chapter
- pdf format (page 6)
- Web Page as Leaflet
- as-is
- export as pdf
"""
self.runTestPattern3("nexedi_ci_test_twopage_sample_001_en", "nexedi_ci_test_twopage_sample_001_en_image_p06", 5)
def test_CI_pressRelease(self):
self.runPdfTestPattern(
"template_test_leaflet_input_001_en_html",
"template_test_leaflet_input_page_1_001_en_bmp",
"template_test_leaflet_input_001_en_pdf",
**dict(
page_number=1,
test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet"
)
)
@changeSkin('Leaflet')
@setDomainDict("ERP5Site_getWebSiteDomainDict", "", 'return {"test.portal.erp": context.getPortalObject()}')
def test_pdfLeafletOverrides(self):
"""
Test:
- Web Page as Press Release
- without follow up
- without contributor
- export as Default
- html format
- Web Page as Leaflet
- Set all overrides and hide side panel, display organisation logo
- export as pdf
"""
self.runTestPattern1("nexedi_ci_test_pressrelease_sample_001_en", "nexedi_ci_test_pressrelease_sample_002_en")
self.runPdfTestPattern(
"template_test_leaflet_input_002_en_html",
"template_test_leaflet_input_page_0_002_en_bmp",
"template_test_leaflet_input_002_en_pdf",
**dict(
page_number=0,
test_method="WebPage_exportAsLeaflet",
format="pdf",
use_skin="Leaflet",
override_source_organisation_title="Test Association",
override_source_person_title="Test Recipient",
override_leaflet_header_title="Couscous",
)
)
def test_CI_pressReleaseContributor(self):
@changeSkin('Leaflet')
def test_pdfLeafletContributorFollowUp(self):
"""
Test:
- Web Page as Press Release
- without follow up
- with contributor (email only)
- export as Default
- html format
- Web Page as Leaflet
- add follow up organisation and contributor, test language translation
- export as pdf
"""
self.runTestPattern1("nexedi_ci_test_pressrelease_sample_003_en", "nexedi_ci_test_pressrelease_sample_004_en")
self.runPdfTestPattern(
"template_test_leaflet_input_003_de_html",
"template_test_leaflet_input_page_0_003_de_bmp",
"template_test_leaflet_input_003_de_pdf",
**dict(
page_number=0,
test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet"
)
)
def test_CI_pressReleaseContributorFollowUpOrganisation(self):
"""
Test:
- Web Page as Press Release
- with follow up (organisation)
- with contributor (email only)
- export as Default
- html format
@changeSkin('Leaflet')
def test_pdfLeafletPrint(self):
"""
self.runTestPattern2("nexedi_ci_test_pressrelease_sample_005_en", "nexedi_ci_test_pressrelease_sample_006_en", "Nexedi")
def test_CI_pressReleaseContributorFollowUpOrganisationPerson(self):
Test:
- Web Page as Press Release
- with follow up (organisation + person)
- with contributor (email only)
- export as Default
- html format
- Web Page as Leaflet
- print as pdf
"""
self.runTestPattern2("nexedi_ci_test_pressrelease_sample_007_en", "nexedi_ci_test_pressrelease_sample_008_en", "Nexedi")
'''
\ No newline at end of file
self.runPdfTestPattern(
"template_test_leaflet_input_001_en_html",
"template_test_leaflet_input_page_1_001_en_bmp",
"template_test_leaflet_input_001_en_pdf",
**dict(
page_number=1,
test_method="WebPage_PrintAsLeaflet",
use_skin="Leaflet"
)
)
'''
......@@ -44,9 +44,7 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 30, 0: Unused customScript imported from Products.ERP5.tests.testERP5WebWithDms (unused-import)</string>
<string>W: 32, 0: Unused urlparse imported from urlparse (unused-import)</string>
<string>W: 34, 0: Unused import operator (unused-import)</string>
<string>W: 37, 0: Unused import base64 (unused-import)</string>
</tuple>
</value>
</item>
......
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
image_module/template_test_*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
image_module/template_test_*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
erp5_corporate_identity_slide | CI
erp5_corporate_identity_slide | CI_Slideshow
erp5_corporate_identity_slide | CI_slideshow
erp5_corporate_identity_slide | Slide
erp5_corporate_identity_slide | SlideShow
erp5_corporate_identity_slide | WhiteSlideShow
\ No newline at end of file
erp5_corporate_identity_slide | Slide
\ No newline at end of file
test.erp5.testCorportateIdentityTemplates
test.erp5.testCorportateIdentityTemplateUiElements
\ No newline at end of file
test.erp5.testCorportateIdentityTemplates
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment