Commit 86e9f0ae authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: initial commit

parent 309cc441
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Generate a book from the current web page.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>export_book</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>24.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export as Book</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewExportAsBookDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Generate a leaflet from the current web page.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>export_leaflet</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>23.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export as Leaflet</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewExportAsLeafletDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Generate a letter from the current web page.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>export_letter</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>22.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export as Letter</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewExportAsLetterDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Generate a press release from the current web page.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>export_release</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>25.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export as Press Release</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewExportAsReleaseDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_exchange</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_exchange</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Generate a slideshow from the current web page.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>export_slideshow</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>21.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export as SlideShow</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewExportAsSlideshowDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_print</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_print</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Print the current web page as Book PDF.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_book</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>24.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print As Book</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewPrintAsBookDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_print</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_print</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Print the current web page as Leaflet PDF.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_leaflet</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>23.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print As Leaflet</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewPrintAsLeafletDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_print</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_print</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Print the current web page as Letter PDF.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_letter</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>22.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print As Letter</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewPrintAsLetterDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_print</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_print</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Print the current web page as press release PDF.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_release</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>25.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print As Press Release</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewPrintAsReleaseDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_print</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_print</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Print the current web page as Slideshow PDF.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_slideshow</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>21.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print As Slideshow</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewPrintAsSlideshowDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_button</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_button</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>View Document in Content Type specific mode.</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_slideshow</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View As Slideshow</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebPage_viewAsWeb?portal_skin=Slide</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/template_images/slide_icon.png?portal_skin=Slide</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
##############################################################################
#
# Copyright (c) 2006-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 responsability 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
# garantees 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
# Cloudooo uses zip= argument, which is also a python builtin
# pylint: disable=redefined-builtin
from xmlrpclib import ServerProxy
from base64 import b64encode, b64decode
from zExceptions import Unauthorized
def convertDocumentByConversionServer(
self,
data,
source_mimetype,
destination_mimetype,
zip=False,
refresh=False,
conversion_kw=None,
REQUEST=None
):
if REQUEST is not None:
raise Unauthorized
proxy = ServerProxy(
self.getPortalObject().portal_preferences.getPreferredDocumentConversionServerUrl(),
allow_none=True
)
return b64decode(
proxy.convertFile(
b64encode(data),
source_mimetype,
destination_mimetype,
zip,
refresh,
conversion_kw or {}
)
)
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension 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>TemplateDocumentConversion</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.TemplateDocumentConversion</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension 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>
<h1>Synthesis</h1>
<p>This should be the summary of the document, for example: this document
is an example of a erp5 book document. It is usable for project reports,
sale offers and sale orders. It's plain HTML and can be rendered as html (for
displaying on websites) or as pdf using the export dialog. The following options
can be activated through the export dialog:
</p>
<ul>
<li>Add table of content</li>
<li>Add table of history (version, signatures, distribution - XXX only raw)</li>
<li>Add table of references (abbreviations, referenced/applicable documents, figures, tables), applies to links in []</li>
<li>Embed (internal) documents, applies to links with references</li>
<li>Embed (internal) reports, applies to links with url parameter report</li>
</ul>
<p>After this you can write plain html and embed documents as needed. Some things to note:</p>
<h1>Headers</h1>
<p>
Make sure to number headers correctly (h1->h2->h3...). No numbering (&gt;h1&lt;1....)
is needed. Also, no html inside headers is allowed.
</p>
<h1>Links</h1>
<h2>Applicable Documents</h2>
<p>
Look like this [<a href="http://proceedings.ewea.org/annual2013/allfiles2/1287_EWEA2013presentationfinal.pdf" title="Claudia Hofemann Wind Energy Section, TU Delft">AD</a>].
Note you need to wrap in [] and add "AD", href and title. Semicolons in titles
fill the different cells in the generated table.
</p>
<h2>Referenced Documents</h2>
<p>Same as applicable documents, so [<a href="https://www.epa.ie/pubs/advice/noise/Wind_Turbine_web.pdf" title="Guidance Note on Noise Assessment of Devices;A;B;C">RD</a>],
note that doubles are counted correctly, [<a href="http://proceedings.ewea.org/annual2013/allfiles2/1287_EWEA2013presentationfinal.pdf" title="Claudia Hofemann Wind Energy Section, TU Delft">AD</a>]
and everything is auto-numbered and linked from the tables.
</p>
<h2>Abbreviations</h2>
<p>Have a similar synatx, [<a href="http://www.wikipedia.com/ERP" title="Enterprise Research Planning;The process of planning the resources of an enterprise">ERP</a>],
with the only difference being the abbreviation instead of AD/RD
</p>
<h2>Plain Links</h2>
<p>
Plain links will not be formatted, unless embedding documents/reports is active.
Embedding documents will cause internal (!) links to be replaced with the content
of the document. So, this link external link <a href="https://google.com">document</a>
will not be touched, while this one will end up as a reference [<a href="https://www.google.com/" title="Google Website;Search;0;1">AD</a>]
and this internl link (only reference) will be embedded if the option is active:
</p>
<a href="Template.Test.Book.Embeddable.Document">This link should be embedded</a>
<p>Embedded document above.</p>
<h2>Table Caption/Image Captions</h2>
<p>Tables should have caption tags after (!) the tbody tag, images should have an
alt attribute, to list them in the reference tables. Examples of both:
</p>
<table>
<thead>
<tr>
<th colspan="4">Some Table</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
</tr>
</tbody>
<caption>Table description</caption>
</table>
<p>There is more</p>
<table>
<thead>
<tr>
<th colspan="4">Some Table</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
</tr>
</tbody>
<caption>Table description</caption>
</table>
<p>And an image</p>
<p>Please don't add any formatting to a table except for the width of cells. There
is a default css applied to all tables. Finally an image:
</p>
<img src="Template.Test.Image.Office?format=png&amp;display=medium" type="image/png" alt="Caption for this image" />
<h1>Reports</h1>
<p>
Reports are not part of the standard template, so they have to be implemented indivually
in template customizations. Calling a nonexisting report will not throw an error and
only leave the link untouched.
</p>
<p> To embedding a report just create a link to the module and object (no references!,
report must be callable on the object) and specify the report name and subsequent
report parameters. For example:
</p>
<h2>Project Reports</h2>
<a href="project_module/template_test_project?report=Base_generateLineBreakdownReport&amp;display_header=2">Line Breakdown Report</a>
<br/>
<h2>Sale Order Reports</h2>
<a href="sale_order_module/template_test_sale_order?report=Base_generateCostEffortReport&amp;display_detail=detailed">Cost Effort Report</a>
<br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateDeliverableReport">Deliverable Report</a>
<br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateLineBreakdownReport">Project Breakdown</a>
<br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateRequirementCoverageReport&amp;display_comment=''">Requirement Coverage</a>
<br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateRequirementReport&amp;display_comment=''&amp;requirement_url=requirement_module/template_test_requirement_sale_order">Requirement Report</a>
<p>
These reports are part of the Nexedi corporate identity template and will be rendered
if the template is installed. Else, only the links will be visible.
</p>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Book</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_web_page_book</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>isTemplate</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Book</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<div id="left-summary">
<p class="title">Key Benefits</p>
<ul>
<li>Benefit 1</li>
<li>Benefit 2</li>
<li>Benefit 3</li>
<li>Benefit 4</li>
<li>Benefit 5</li>
<li>Benefit 6</li>
<li>Benefit 7</li>
<li>Benefit 8</li>
</ul>
<p class="excerpt">Some staticistical catchline that will grab the viewers attention, like 4 million units of foo shipped in 2017.</p>
</div>
<div id="main-content">
<h2 class="summary">Summary Headline: What this Leaflet is about</h2>
<p>
Foo is a Web based operating system (OS) for desktop and laptop based on
Bar. It is designed for low maintenance cost and high interoperability.
Foo HTML5 technology provides independence from single Cloud Computing
provider, strong privacy and high interoperability with enterprise IT infrastructure.
</p>
<h2>Straightforward User Interface</h2>
<p>
Foo user interface has been acclaimed by users and media for its ease of
use and straightforwardness. Thanks to the Web's pervasive nature, users feel
no change and thus adopt Foo in a matter of seconds.
</p>
<h2>Zero Maintenance</h2>
<p>
Applications for Foo are based on HTML5 W3C standard. They require no
explicit installation or upgrade, leading to zero maintenance cost. Foo
core can be upgraded automatically through online upgrade service.
</p>
<h2>Ubiquitous HTML5 Appstore</h2>
<div class="left-icon"> <img alt="" src="Template.Test.Image.Screenshot.Erp5?format=png" />
<p class="excerpt">Foo HTML5 Appstore</p>
</div>
<p>
Foo Appstore is a collection of HTML5 applications for text processing,
drawing, spreadsheet, presentation, accounting, project management, etc.
HTML5 applications can be used on Foo PC or on any device with a modern
HTML5 compatible Web browser. This includes Windows PC, Apple computers,
Android smartphones, etc. The ubiquitous nature of Foo applications ensures
interoperability in heterogenous environments.
</p>
<h2>Work Anywhere</h2>
<p>
Foo HTML5 applications can be used online or offline, including in countries
where Internet connectivity is less reliable or in locations without Internet
access such as airplanes. Foo can operate in China where it has received
official ICP registration. It can also operate in highly sensitive private
networks with no Internet access.
</p>
<h2>Never lose your data</h2>
<div class="left-icon"> <img alt="" src="Template.Test.Image.Screenshot.Erp5?format=png" />
<p class="excerpt">Foo supports new generation low cost Baz such as Snip 1234</p>
</div>
<p>
Foo storage is based on Couscous technology. Couscous provides interoperability with
virtually any storage technology. Public clouds: Zip, Zap and Zop.
Private clouds: Zup, Zyp. Browser storage.
</p>
<p>
Couscous can store data in enterprise database (MariaDB, MongoDB) or in business
applications (Tschaka, Hooray, Krupal). Replication in multiple storage
technologies virtually elimininate any risk of losing user data.
</p>
<h2>Trade Secret Protection</h2>
<p>
Foo's Couscous technology reduces sthe risks of theft of valuable corporate
information through data encryption, data splitting and searchable encrypted
indexing.
</p>
<h2>Enterprise Directory Integration</h2>
<p>
Foo user accounts are by default managed locally on each device with no
requirement of Internet access. HTML5 applications do not require prior
identification. Integration with Enterprise Directory is possible through OpenID.
</p>
<h2>Interoperability</h2>
<p>
Foo supports Bulgur applications through virtual desktop service deployed
on public or private Cloud.
</p>
<h2>Longer Battery Life</h2>
<p>
Foo runs efficiently on low power hardware with typical battery operation of 10 hours.
</p>
<h2>Wide Hardware Support</h2>
<p>
Foo supports any Abc or Def (Efg, Hij, Klm, Nop, Qrs, etc.). X provides
customisation service to support any hardware based on
x86 (Intel) or ARM (Rockchip) architecture.
</p>
<h2>Open Source</h2>
<p>
Foo is open source software. Its source code is fully auditable and thus
exempt of secret back doors. It includes a developer mode with Linux tools
and a complete Integrated Development Environment (IDE).
</p>
${legalese}
${document_id}
</div>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Leaflet</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_web_page_leaflet</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>isTemplate</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Leaflet</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<p><b><i>Recommendation Letter for someone</i></b></p>
<p>
Dear Mr Couscous, <br/>
Dear Mr Burgur,
</p>
<p>
Someone has done a six month traineeship with us in the summer of 2015 and
asked me to write a reference letter for him. I'm responsible for recruiting
at Nexedi, have done the intial interviews with someone and was involved in
recommending for a temporary contract with scikit-learn.
</p>
<p>
On the technical side someone was working mostly on our NEO solution and its
integration into SlapOS. He was mentored by my colleague someone else. According
to him someone was able to hit the ground running although the complexity of the
topic was considerably high. Someone succeeded in improving the integration of
NEO in SlapOS (<a href="lab.nexedi.com">link to commits</a>) which today allows us to provide NEO as default
database in all our SlapOS instances.
</p>
<p>
<p>
Personally I remember someone as an always friendly and helpful colleague who
was involved in daily trainee activities beyond his work as a developer - be it
in organising our "Trainee Days" (camping trip) or initiiating the "Trainee 101"
repository with helpful tips for future trainees arriving in Lille and Nexedi (advice
for finding housing, getting a phone contract, etc.), which we are still using today.
</p>
<p>
Feel free to call me back in case you have further questions (01-23-456789-0).
</p>
<section>
<p>Best regards,</p>
<br />
<br />
<p>Me</p>
<p>Nexedi SA</p>
</section>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Letter</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_web_page_letter</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>isTemplate</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Letter</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<p style="text-align:center"><em>Press Release</em></p>
<p><strong>Here, There, Everywhere, November 4th, 1976</strong>. Hokuspokus Computing Solutions, and Foo today announced the general availibility of a turnkey Enterprise Cloud offering based on recertified Open Hardware Solutions (OHS) and Bar fully integrated Edge Cloud solution.</p>
<p>The hardware offering relies on building blocks of 180 dual Xeon servers. Each subsystem integrates 2880 x86 core, 11.5 TB of main memory and 180 TB of high performance, full SSD storage. Networking relies on redundant industry standard 10 Gbps Ethernet. Each building block is coming at a price of 205,000 Euros and is ready to scale to hundred thousands of cores.</p>
<p style="text-align:center">
<img src="Template.Test.Image.Map?format=png" alt="" />
</p>
<p>The software offering relies on Bar Open Source / Free Software. Bar integrates IaaS (virtualisation, nano-containers), PaaS, software defined networking, accounting, billing, provisionning, orchestration, automated disaster recovery, network resiliency and edge computing. Typical Bar monthly operating cost per building block is 4800 euro.</p>
<p>For about 1 million euros, a corporation can create it&#39;s private Cloud backbone with up to 16 000 x86 cores and full control on costs and foreign intelligence threats, something which can not be guaranteed by public cloud providers in any country.</p>
<p>Jon Doe, CEO of Foo, explains: &quot;Bar performance on big data loads has been benchmarked as four times higher than with other cloud platforms. Total monthly operating cost of a 16 GB / 2 core virtual machine is about 7 euros, which is 2 to 10 times less than current public cloud providers.&quot;</p>
<p>Jim Donahugh, CEO of Hokuspokus Computing, concludes: &quot;Open Hardware is a fast growing trend in the IT hardware industry and opens doors to new business opportunities, that leverage the main benefit of such a design approach. Customers can benefit from a more flexible infrastructure, easier to manage solutions, virtually unlimited lifetime and better disposale solutions.&quot;</p>
<p>Proposed offers comes with a full 1 year on site warranty and require a limited space of 2.5 sqm per building block.</p>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Press.Release</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Release summary dash separated - Release summary dash separated - max 3 items, max 2 lines</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_web_page_release</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>isTemplate</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value> <string>Subheader</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Press Release</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<section class="master">
<h1>Presenters</h1>
<img src="common_images/fallback.png" type="image/png" alt="Fallback Logo">
<ul>
<li><b>Topic Introduction</b></li>
<li>Name | Email | Contact</li>
</ul>
</section>
<section class="master">
<h1>Overview</h1>
<ul>
<li>Chapter 1</li>
<li>Chapter 2</li>
<li>Chapter 3</li>
</ul>
</section>
<section class="chapter">
<h1>Chapter 1</h1>
</section>
<section>
<h1>Profile</h1>
<img src="common_images/fallback.png" type="image/png" alt="Profile Picture">
<ul>
<li>Fact 1</li>
<li>Fact 2</li>
<li>Fact 3</li>
<li>Fact 4</li>
<li>Fact 5</li></ul>
<details open="open">
Additional information provided here.
</details>
</section>
<section>
<h1>Content Header</h1>
<img src="Template.Test.Image.Screenshot.Erp5?format=png" alt="Fullsize Screenshot">
<details open="open">
Additional information provided here.
</details>
</section>
<section>
<h1>Content Header</h1>
<img src="Template.Test.Image.Screenshot.Erp5?format=png" alt="Fullsize Screenshot">
<p>Screenshot info</p>
<details open="open">
Additional information provided here.
</details>
</section>
<section class="master">
<h1>Thank You</h1>
<div>
<img src="common_images/fallback.png" type="image/png" alt="Side by Side Image" />
</div>
<div>
<ul style="list-style:none;display:block;">
<li>Contact Info</li>
<li>Contact Info</li>
<li>Contact Info</li>
<li>Contact Info</li>
</ul>
<ul style="list-style:none;display:block;">
<li>Contact Info</li>
<li>Contact Info</li>
</ul>
</div>
<details open="open">First Detail Slide</details>
<details><p>Second Details Slide</p></details>
</section>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Slideshow</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_web_page_slideshow</string> </value>
</item>
<item>
<key> <string>isIndexable</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="PropertyGetter" module="Products.ERP5Type.Accessor.Constant"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isIndexable</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>isTemplate</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>_id</string> </key>
<value> <string>isTemplate</string> </value>
</item>
<item>
<key> <string>value</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Slideshow</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_book</skin_folder>
<skin_selection>Book,Report</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_leaflet</skin_folder>
<skin_selection>Leaflet</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_letter</skin_folder>
<skin_selection>Letter</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_release</skin_folder>
<skin_selection>Release</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_slide</skin_folder>
<skin_selection>Slide</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_corporate_identity</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>convertDocumentByConversionServer</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>TemplateDocumentConversion</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_cloudoooDocumentConvert</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Convert document using Cloudooo</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Export WebPage as Report
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
return context.Base_viewAsReport(
format=format,
document_save=document_save,
document_download=document_download,
document_language=document_language,
document_reference=document_reference,
document_version=document_version,
document_title=document_title,
display_depth=display_depth,
display_detail=display_detail,
display_comment=display_comment,
display_header=display_header,
report_name=report_name,
report_title=report_title,
requirement_relative_url=requirement_relative_url,
batch_mode=batch_mode,
**kw
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=None, batch_mode=None, requirement_relative_url=None, document_save=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_detail=None, display_depth=None, display_comment=None, display_header=None, report_title=None, document_title=None, report_name=None, *args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_exportAsReport</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Save, download or return generated HTML Document
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# doc_download download this document in HTML format
# doc_save save this web page in HTML format
# doc_version version of the document
# doc_title title of the document
# doc_relative_url relative url to set as follow-up
# doc_language language of the document
# doc_reference reference of the document
# doc_full_reference full reference with version/language
# doc_modification_date date to set as initial date
# doc_html_file text content for document
# doc_aggregate_list not applicable (only used for events)
if doc_save:
web_page_module = getattr(context, 'web_page_module', None)
if web_page_module is not None:
web_page = web_page_module.newContent(
portal_type="Web Page",
version=doc_version,
follow_up=doc_relative_url,
title=doc_title,
language=doc_language,
publication_date=doc_modification_date or None,
reference=doc_reference
)
web_page.edit(
text_content=doc_html_file
)
context.setAggregate(web_page.getRelativeUrl())
message = context.Base_translateString(
'%(portal_type)s created successfully as PDF Document.' % {
'portal_type': web_page.getTranslatedPortalType()
}
)
return web_page.Base_redirect(
keep_items=dict(portal_status_message=message)
)
#XXX else:
# download
elif doc_download:
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'attachment; filename="' + doc_full_reference + '.html"')
# display in browser
else:
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'filename="' + doc_full_reference + '.html"')
return doc_html_file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>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_html_file=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_finishWebPageCreation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Create a destination dict for filling templates
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# destination: Can be set if called from Event
# override_destination_person_title: Title of person to use
# override_destination_organisation_title: Title of organisation to use
blank = ''
# ---------------------------- Set Destination --------------------------------
# destination => Web Page = follow-up Organisation or Person, Event
if destination is None:
destination_person = None
destination_person_list = []
destination_organisation = None
destination_organisation_list = []
destination_uid = None
# destination person
if override_destination_person_title is not None or override_destination_person_title == blank:
destination_person_list = context.Base_getTemplateProxyParameter(parameter="override_person", source_data=override_destination_person_title)
if len(destination_person_list) == 0:
destination_person_list = context.Base_getTemplateProxyParameter(parameter="person", source_data=None)
if len(destination_person_list) > 0:
destination_person = destination_person_list[0]
# destination organisation
if override_destination_organisation_title is not None or override_destination_organisation_title == blank:
destination_organisation_list = context.Base_getTemplateProxyParameter(parameter="override_organisation", source_data=override_destination_organisation_title)
if len(destination_organisation_list) == 0:
destination_organisation_list = context.Base_getTemplateProxyParameter(parameter="organisation", source_data=None)
if len(destination_organisation_list) == 0 and destination_person is not None:
destination_organisation_list = context.Base_getTemplateProxyParameter(parameter="source", source_data=destination_person.get("uid")) or []
if len(destination_organisation_list) > 0:
destination_organisation = destination_organisation_list[0]
destination = {}
destination.update(destination_person or {})
destination.update(destination_organisation or {})
# destination => event
else:
destination_uid = context.restrictedTraverse(destination).getUid()
destination = context.Base_getTemplateProxyParameter(parameter="destination", source_data=destination_uid)[0]
return destination
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>destination=None, override_destination_person_title=None, override_destination_organisation_title=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getDestinationDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Create a source dict for filling templates
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# source: Can be set if called from Event
# override_logo_reference Logo to use instead of organisation logo
# override_source_person_title: Title of person to use
# override_source_organisation_title: Title of organisation to use
# theme_logo_url Theme logo url to use if no logo found
blank = ''
from Products.PythonScripts.standard import html_quote
# ------------------------------- Set Source ----------------------------------
source_logo_url = None
default_bank_account_uid=context.Base_getTemplateParameter("default_bank_account_uid")
if source is None:
default_company_title=context.Base_getTemplateParameter("default_company_title")
contributor_title_string = blank
source_person = None
source_person_list = []
source_organisation = None
source_organisation_list = []
source_organisation_uid = None
source_set = None
# source person
if override_source_person_title is not None or override_source_person_title == blank:
source_person_list = context.Base_getTemplateProxyParameter(parameter="override_person", source_data=override_source_person_title)
if len(source_person_list) == 0:
source_person_list = context.Base_getTemplateProxyParameter(parameter="author", source_data=None) or []
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
# order: override => follow-up => default_organisation_uid => default_company_title => source_person career subordinate
if override_source_organisation_title is not None or override_source_organisation_title == blank:
source_organisation_list = context.Base_getTemplateProxyParameter(parameter="override_organisation", source_data=override_source_organisation_title)
if len(source_organisation_list) == 0:
source_organisation_list = context.Base_getTemplateProxyParameter(parameter="organisation", source_data=None)
if len(source_organisation_list) == 0:
source_organisation_uid = context.Base_getTemplateParameter("default_source_organisation_uid")
if source_organisation_uid:
source_organisation_list = context.Base_getTemplateProxyParameter(parameter="sender", source_data=source_organisation_uid) or []
if len(source_organisation_list) == 0 and default_company_title:
source_organisation_list = context.Base_getTemplateProxyParameter(parameter="override_organisation", source_data=default_company_title) or []
if len(source_organisation_list) == 0 and source_person is not None:
for organisation_candidate in source_person_list:
organisation_candidate_list = context.Base_getTemplateProxyParameter(parameter="source", source_data=organisation_candidate.get("uid")) or []
if len(organisation_candidate_list) > 0:
source_organisation_list = organisation_candidate_list
break
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 = context.Base_getTemplateProxyParameter(parameter="source", source_data=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 = context.Base_getTemplateProxyParameter(parameter="bank", source_data=default_bank_account_uid) or []
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")
# social capital currency and registered court fallbacks
if source.get("social_capital_currency") is blank:
source["social_capital_currency"] = context.Base_getTemplateParameter("default_source_company_capital_currency")
if source.get("corporate_registration_code") is blank:
source["corporate_registration_code"] = context.Base_getTemplateParameter("default_source_registered_court")
# XXX images stored on organisation (as do images in skin folders)
if override_logo_reference:
source_logo_url = html_quote(override_logo_reference) + "?format=png"
source_set = True
if source_logo_url is None:
source_logo_url = source.get("logo_url", blank)
if source_logo_url != blank and source_set is None:
# XXX: test environment fails if url with parameters are supplied
source_logo_url = source_logo_url + "?format=png"
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
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>source=None, override_logo_reference=None, override_source_person_title=None, override_source_organisation_title=None, theme_logo_url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getSourceDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Return custom hardcoded parameters
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# parameter Parameter to lookup
if parameter == "fallback_image":
return "template_images/fallback.png"
if parameter == "default_theme_css_url":
return "template_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>
"""
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>parameter=None, source_data=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getTemplateParameter</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>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>
<value> <string>Base_getTemplateProxyParameter</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Create a theme dict for filling templates
=================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# doc_format Output format for building css paths
# css_path Path for template css
blank = ''
# ------------------------------- Set Theme -----------------------------------
# XXX images in portal_skins folders don't convert with ?params. Only format
# is kept in Base_convertHtmlToSingleFile
pdf = ".pdf" if doc_format == "pdf" else blank
css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?format=png"
theme_logo_list = []
theme_logo_dict = {}
theme_reference = None
theme = (
context.Base_getTemplateProxyParameter(parameter="theme", source_data=None) or
context.Base_getTemplateParameter("theme") or
context.Base_getTemplateParameter("default_company_title")
)
if theme is not None:
theme = theme.lower()
theme_logo_prefix = context.Base_getTemplateParameter("default_logo_prefix")
if theme_logo_prefix:
theme_reference = theme_logo_prefix + theme.capitalize()
theme_logo_list = context.Base_getTemplateProxyParameter(parameter="logo", source_data=theme_reference)
if len(theme_logo_list) > 0:
theme_logo_dict = theme_logo_list[0]
if theme is None:
theme = "default"
theme_dict = {}
theme_dict["theme"] = theme
theme_dict["theme_logo_description"] = theme_logo_dict.get("description", blank)
theme_dict["theme_logo_url"] = context.Base_getTemplateParameter("fallback_image")
if theme_logo_dict.get("relative_url", None) is not None:
theme_dict["theme_logo_url"] = theme_logo_dict.get("relative_url") + param
theme_dict["template_css_url"] = css_path + pdf + ".css"
theme_dict["fallback_img_url"] = context.Base_getTemplateParameter("fallback_image") or blank
theme_dict["theme_css_font_list"] = context.Base_getTemplateParameter(font) or []
theme_dict["theme_css_url"] = context.Base_getTemplateParameter(css) or context.Base_getTemplateParameter(css) or blank
return theme_dict
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>doc_format=None, css_path=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getThemeDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Export WebPage as Report
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
return context.Base_viewAsReport(
format=format,
document_save=document_save,
document_download=document_download,
document_language=document_language,
document_reference=document_reference,
document_version=document_version,
document_title=document_title,
display_depth=display_depth,
display_detail=display_detail,
display_comment=display_comment,
display_header=display_header,
report_name=report_name,
report_title=report_title,
requirement_relative_url=requirement_relative_url,
batch_mode=batch_mode,
**kw
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=\'pdf\', batch_mode=None, requirement_relative_url=None, document_save=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_header=None, display_detail=None, display_comment=None, document_title=None, display_depth=None, report_title=None, report_name=None, *args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_printAsReport</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Add image size conversion only if image is not the default image
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# path Image path to embed
# XXX replace this with clear defintion of possible values for dialog params
# XXX Note, this is necessary, because it seems images scored in skin folders
# cannot convert (neither format nor size) and in wkhtmltopdf fail if a
# conversion parameter is provided.
if path.find("template_images") > -1:
return path
else:
return path + ("&" if path.find("?") > -1 else "?") + "display=%s" % (display or "thumbnail")
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>path=None, display=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_setUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Update a book report dialog with parameters manually entered
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# cancel_url: url to cancel dialog
# dialog_id: id of current_dialog
# portal_skin: portal_skin used
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
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,
format=format,
document_save=document_save,
document_download=document_download,
document_language=document_language,
document_reference=document_reference,
document_version=document_version,
document_title=document_title,
display_depth=display_depth,
display_detail=display_detail,
display_comment=display_comment,
display_header=display_header,
report_name=report_name,
report_title=report_title,
requirement_relative_url=requirement_relative_url,
**kw
)
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None, cancel_url=None, requirement_relative_url=None, report_name=None, report_title=None, portal_skin=None, format=None, display_comment=None, document_title=None, document_save=None, document_download=None, document_language=None, document_version=None, document_reference=None,display_detail=None, display_depth=None, display_header=None ,*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_updateReportDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewAsLetter</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
MAIN FILE: generate report (book header/footer and report content)
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# kw-parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# ------
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
# ------
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# ------
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
# --------
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
from Products.PythonScripts.standard import html_quote
from base64 import b64encode
blank = ''
# ------------------ HTML cleanup/converter methods ----------------------------
def translateText(snip):
return doc_localiser.erp5_ui.gettext(snip, lang=doc_language).encode('utf-8').strip()
# -------------------------- Setup ---------------------------------------------
doc = context
doc_download = None #XXX not yet implemented
doc_save = int(kw.get('document_save') or 0)
doc_display_header = int(kw.get('display_header') or 0)
doc_display_comment = int(kw.get('display_comment') or 0)
doc_display_detail = int(kw.get('display_detail') or 0)
doc_display_depth = int(kw.get('display_depth') or 0)
override_document_title = kw.get('document_title')
override_document_version = kw.get('document_version')
override_document_reference = kw.get('document_reference')
override_document_language = kw.get('document_language')
override_batch_mode = kw.get('batch_mode')
doc_report_name = kw.get('report_name')
doc_report_title = kw.get('report_title')
doc_format = kw.get('format') or 'html'
doc_requirement_relative_url = kw.get('requirement_relative_url')
# -------------------------- Document Parameters ------------------------------
doc_localiser = doc.getPortalObject().Localizer
doc_relative_url = doc.getRelativeUrl()
doc_rendering_fix = doc.Base_getTemplateParameter('wkhtmltopdf_rendering_fix') or blank
doc_report = getattr(doc, doc_report_name)
doc_aggregate_list = []
doc_revision = "1"
doc_modification_date = DateTime()
doc_short_date = doc_modification_date.strftime('%Y-%m-%d')
doc_reference = html_quote(override_document_reference) if override_document_reference else doc.getReference() or blank
doc_short_title = html_quote(doc_report_title) if doc_report_title else doc.getShortTitle() or blank
doc_version = html_quote(override_document_version) if override_document_version else getattr(doc, "version", None) or "001"
doc_title = html_quote(override_document_title) if override_document_title else doc.getTitle() or blank
doc_language = html_quote(override_document_language) if override_document_language else doc.getLanguage()
doc_content = doc_report(
display_report=True,
display_depth=doc_display_depth,
display_detail=doc_display_detail,
display_header=doc_display_header or 1,
display_comment=doc_display_comment,
requirement_url=doc_requirement_relative_url,
report_title=translateText(doc_report_title)
)
# test overrides
if override_batch_mode:
doc_modification_date = DateTime("1976-11-04")
doc_revision = "1"
if doc_language is not None:
doc.REQUEST['AcceptLanguage'].set(doc_language, 10)
if doc_language is None:
doc_language = blank
if doc_reference == blank:
doc_reference = "Report." + doc_title.replace(" ", ".")
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# ------------------------------- Theme ----------------------------------------
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="template_css/book")
# --------------------------- Source/Destination -------------------------------
doc_source = doc.Base_getSourceDict(
override_source_person_title=None,
override_source_organisation_title=None,
theme_logo_url=doc_theme.get("theme_logo_url", None)
)
# --------------------------- Content Upgrades ---------------------------------
# ============================= Format: html ===================================
if doc_format == "html":
html_file = doc.WebPage_createBook(
book_raw_tables=None,
book_raw_report=True,
book_theme=doc_theme.get("theme"),
book_title=doc_title,
book_language=doc_language,
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_template_css_url=doc_theme.get("template_css_url"),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_logo_title=doc_source.get("theme_logo_description"),
book_short_title=doc_short_title,
book_reference=doc_reference,
book_revision=doc_revision,
book_version=doc_version,
book_short_date=doc_short_date,
book_full_reference=doc_full_reference,
book_source_organisation_title=doc_source.get("organisation_title") or blank,
book_content=doc_content,
)
return doc.Base_finishWebPageCreation(
doc_download=doc_download,
doc_save=doc_save,
doc_version=override_document_version or doc_version or "001",
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_html_file=html_file
)
# ============================= Format: pdf ====================================
if doc_format == "pdf":
doc_content = doc.WebPage_createBookContent(
book_format=doc_format,
book_rendering_fix=doc_rendering_fix,
book_theme=doc_theme.get("theme"),
book_title=doc_title,
book_language=doc_language,
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_template_css_url=doc_theme.get("template_css_url"),
book_content=doc_content,
)
doc_head = doc.WebPage_createBookHeader(
book_theme=doc_theme.get("theme"),
book_title=doc_title,
book_language=doc_language,
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_template_css_url=doc_theme.get("template_css_url"),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_logo_title=doc_source.get("theme_logo_description"),
book_short_title=doc_short_title,
book_reference=doc_reference,
book_revision=doc_revision,
book_version=doc_version,
book_short_date=doc_short_date,
)
doc_foot = doc.WebPage_createBookFooter(
book_theme=doc_theme.get("theme"),
book_title=doc_title,
book_language=doc_language,
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_theme_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_theme_logo_alt=doc_theme.get("theme_logo_description"),
book_template_css_url=doc_theme.get("template_css_url"),
book_full_reference=doc_full_reference,
book_source_organisation_title=doc_source.get("organisation_title") or blank,
)
# ================ encode and build cloudoo elements =========================
header_embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_head, allow_script=True)
before_toc_data_list = []
xsl_style_sheet_data = blank
embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_content, allow_script=True)
footer_embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_foot, allow_script=True)
pdf_file = doc.Base_cloudoooDocumentConvert(embedded_html_data, "html", "pdf", conversion_kw=dict(
encoding="utf8",
margin_top=40,
margin_bottom=20,
toc=False,
before_toc_data_list=before_toc_data_list,
xsl_style_sheet_data=b64encode(xsl_style_sheet_data),
header_html_data=b64encode(header_embedded_html_data),
header_spacing=10,
footer_html_data=b64encode(footer_embedded_html_data),
footer_spacing=3,
)
)
return doc.WebPage_finishPdfCreation(
doc_download=doc_download,
doc_save=doc_save,
doc_version=override_document_version or doc_version or "001",
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
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewAsReport</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
================================================================================
Create a screenshot from a pdf file
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# frame which page from the pdf file should be captured
# doc_id image on which this screenshot should be saved
if doc_id is None:
return "Failed. Missing image id."
if context.getPortalType() != "PDF":
return "Failed. Not a pdf."
if context.getId().find("template_") == -1:
return "Failed. Not a template test item."
pdf_page = context
portal = pdf_page.getPortalObject()
system_preference = (
portal.portal_preferences.getActiveSystemPreference()
)
preferred_document_conversion_server_url = (
system_preference.getPreferredDocumentConversionServerUrl()
)
try:
system_preference.edit(
preferred_document_conversion_server_url="https://cloudooo.erp5.net/"
)
_, bmp_data = pdf_page.convert("bmp", frame=frame)
image = portal.portal_catalog(
portal_type="Image",
id=doc_id,
limit=1
)
image[0].edit(data=bmp_data)
return "Screenshot updated."
finally:
system_preference.edit(
preferred_document_conversion_server_url=preferred_document_conversion_server_url,
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>frame=None, doc_id=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_createScreenshot</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>Letter_createLetter</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>
<tal:comment replace="nothing">
"""
================================================================================
Generates the complete letter
================================================================================
"""
</tal:comment>
<tal:block tal:define="letter_display_head python: options.get('letter_display_head');
letter_theme python: options.get('letter_theme');
letter_title python: options.get('letter_title');
letter_language python: options.get('letter_language');
letter_theme_css_font_list python: options.get('letter_theme_css_font_list');
letter_theme_css_url python: options.get('letter_theme_css_url');
letter_theme_logo_url python: options.get('letter_theme_logo_url');
letter_theme_logo_alt python: options.get('letter_theme_logo_alt');
letter_template_css_url python: options.get('letter_template_css_url');
letter_timestamp python: options.get('letter_timestamp');
letter_source_company python: options.get('letter_source_company');
letter_source_company_corporate_name python: options.get('letter_source_company_corporate_name');
letter_source_company python: options.get('letter_source_company');
letter_source_company_capital python: options.get('letter_source_company_capital');
letter_source_company_capital_currency python: options.get('letter_source_company_capital_currency');
letter_source_registered_court python: options.get('letter_source_registered_court');
letter_source_ape_code python: options.get('letter_source_ape_code');
letter_source_address python: options.get('letter_source_address');
letter_source_country_code python: options.get('letter_source_country_code');
letter_source_postal_code python: options.get('letter_source_postal_code');
letter_source_city python: options.get('letter_source_city');
letter_destination_company python: options.get('letter_destination_company');
letter_destination_person python: options.get('letter_destination_person');
letter_destination_address python: options.get('letter_destination_address');
letter_destination_postal_code python: options.get('letter_destination_postal_code');
letter_destination_city python: options.get('letter_destination_city');
letter_destination_country python: options.get('letter_destination_country');
letter_content python: options.get('letter_content');
letter_display_source_address python: options.get('letter_display_source_address');
letter_source_company python: options.get('letter_source_company');
letter_source_address python: options.get('letter_source_address');
letter_source_postal_code python: options.get('letter_source_postal_code');
letter_source_city python: options.get('letter_source_city');
letter_source_country python: options.get('letter_source_country');
letter_source_vat python: options.get('letter_source_vat');
letter_source_corporate_registration python: options.get('letter_source_corporate_registration');
letter_source_phone python: options.get('letter_source_phone');
letter_source_fax python: options.get('letter_source_fax');
letter_source_mail python: options.get('letter_source_mail');
letter_source_website python: options.get('letter_source_website');
letter_source_bank python: options.get('letter_source_bank');
letter_source_bic python: options.get('letter_source_bic');
letter_source_iban python: options.get('letter_source_iban');">
<!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', letter_theme, ' ci-', letter_language])">
<head>
<meta charset="utf-8">
<title tal:content="letter_title"></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<tal:block tal:repeat="font_url letter_theme_css_font_list">
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<link rel="stylesheet" tal:attributes="href letter_theme_css_url" />
<link rel="stylesheet" tal:attributes="href letter_template_css_url" />
</head>
<body class="ci-letter">
<tal:block metal:use-macro="context/Letter_createLetterHeader/macros/letter_header" />
<tal:block metal:use-macro="context/Letter_createLetterContent/macros/letter_content" />
<tal:block metal:use-macro="context/Letter_createLetterFooter/macros/letter_footer" />
</body>
</html>
</tal:block>
\ No newline at end of file
<?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>Letter_createLetterContent</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>
<tal:comment replace="nothing">
"""
================================================================================
Generates the letter Content
================================================================================
"""
</tal:comment>
<tal:block tal:define="letter_display_head python: options.get('letter_display_head');
letter_theme python: options.get('letter_theme');
letter_title python: options.get('letter_title');
letter_language python: options.get('letter_language');
letter_theme_css_font_list python: options.get('letter_theme_css_font_list');
letter_theme_css_url python: options.get('letter_theme_css_url');
letter_theme_logo_url python: options.get('letter_theme_logo_url');
letter_theme_logo_alt python: options.get('letter_theme_logo_alt');
letter_template_css_url python: options.get('letter_template_css_url');
letter_timestamp python: options.get('letter_timestamp');
letter_source_company python: options.get('letter_source_company');
letter_source_address python: options.get('letter_source_address');
letter_source_country_code python: options.get('letter_source_country_code');
letter_source_postal_code python: options.get('letter_source_postal_code');
letter_source_city python: options.get('letter_source_city');
letter_destination_company python: options.get('letter_destination_company');
letter_destination_person python: options.get('letter_destination_person');
letter_destination_address python: options.get('letter_destination_address');
letter_destination_postal_code python: options.get('letter_destination_postal_code');
letter_destination_city python: options.get('letter_destination_city');
letter_destination_country python: options.get('letter_destination_country');
letter_display_source_address python: options.get('letter_display_source_address');
letter_content python: options.get('letter_content');">
<!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', letter_theme, ' ci-', letter_language])">
<head>
<meta charset="utf-8">
<title tal:content="letter_title"></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<tal:block tal:repeat="font_url letter_theme_css_font_list">
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<link rel="stylesheet" tal:attributes="href letter_theme_css_url" />
<link rel="stylesheet" tal:attributes="href letter_template_css_url" />
</head>
<body class="ci-letter">
<tal:block metal:use-macro="context/Letter_createLetterContent/macros/letter_content" />
</body>
</html>
</tal:block>
<tal:block tal:condition="python: False">
<tal:block metal:define-macro="letter_content">
<div class="ci-letter-head ci-letter-head-right">
<table>
<tbody>
<tal:block tal:condition="python: int(letter_display_head)">
<tr>
<td></td>
<td class="ci-letter-source">
<tal:block tal:condition="python: letter_display_source_address is not None">
<tal:block tal:condition="python: letter_source_company">
<span tal:content="letter_source_company"></span><span class="ci-letter-separator">-</span>
</tal:block>
<tal:block tal:condition="python: letter_source_address">
<span tal:content="letter_source_address"></span><span class="ci-letter-separator">-</span>
</tal:block>
<tal:block tal:condition="python: letter_source_country_code">
<span tal:content="letter_source_country_code"></span><span class="ci-letter-separator">-</span>
</tal:block>
<span tal:content="letter_source_postal_code"></span>&nbsp;
<span tal:content="letter_source_city"></span>
</tal:block>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td class="ci-letter-destination">
<span tal:content="python: letter_destination_company or ' '"></span>
<span tal:content="python: letter_destination_person or ' '"></span>
<span tal:content="python: letter_destination_address or ' '"></span>
<span tal:content="python: ''.join([letter_destination_postal_code, ' ', letter_destination_city])"></span>
<span tal:content="python: letter_destination_country or ' '"></span>
</td>
<td></td>
</tr>
</tal:block>
</tbody>
</table>
</div>
<div class="ci-letter-body" tal:content="structure letter_content"></div>
</tal:block>
</tal:block>
\ No newline at end of file
<?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>Letter_createLetterFooter</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>
"""
================================================================================
Return relevant (predecessor) context from which letter was created
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
# context_url: relative url of the context calling this script
from zExceptions import Unauthorized
if context_url is not None:
try:
underlying_context = context.restrictedTraverse(context_url)
underlying_portal_type = underlying_context.getPortalType()
if underlying_portal_type == "Letter":
for aggregate in underlying_context.getAggregateValueList() or []:
for predecessor in aggregate.getPredecessorValueList() or []:
if predecessor.getRelativeUrl() == context_url:
return aggregate
# restricted traverse => Unauthoried, Not found, aggregate => Attribue
except (AttributeError, KeyError, Unauthorized):
pass
return context
#setPredecessorValueList([object]) = referenced documents
#setSuccessorValueList([object]) = related documents
#getPredecessor()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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