Commit 5c4d999d authored by Jérome Perrin's avatar Jérome Perrin

Initial checkin.

This style is not fully implemented. It was just a prototype to benchmark big
report generation in pdf with oood



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15053 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89914698
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.Folder</string>
<string>Folder</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_registered_skin_selections</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>tokens</string> </value>
</item>
</dictionary>
<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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>business_template_registered_skin_selections</string> </key>
<value>
<tuple>
<string>CSV</string>
</tuple>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_ods_style</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>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" XXX this is a copy of erp5_pdf_style\'s one.\n
This is currently not used\n
\n
Is it possible to have openoffice calculate widths when rendering ? \n
\n
\n
"""\n
\n
\n
from DateTime import DateTime\n
\n
# if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict\n
# magic key, this will be used as column width, instead of calculating.\n
if listbox is not None:\n
cache = context.REQUEST.other.get(\n
\'%s/%s/ListBox_getColumnWithDict\' % (\n
listbox.aq_parent.getId(), listbox.getId()), None)\n
if cache is not None:\n
return cache\n
\n
N_ = context.Base_translateString\n
\n
# XXX this is just a copy / paste of the old implementation\n
# dirty code : if we are in domain or report tree, just use the old one, otherwise\n
# use the new one that gives better results in list mode.\n
if is_domain_tree_mode or is_report_tree_mode : \n
result = {}\n
\n
# 0.5 is too small and can crash pdf generation\n
min_column_width = 1\n
\n
for listboxline in listboxline_list:\n
if 1 : #not listboxline.isTitleLine():\n
line_width = 0\n
col_count = 0\n
if is_report_tree_mode:\n
col_count += 1\n
column_property = listboxline.getSectionName()\n
if column_property is None: \n
string_property = \'\'\n
else:\n
string_property = str(column_property)\n
line_width += len(string_property) + section_width * (listboxline.getSectionDepth() - 1)\n
for column_id, column_property in listboxline.getColumnItemList(): \n
col_count += 1\n
if column_property is None: \n
string_property = \'\'\n
else:\n
string_property = str(column_property)\n
line_width += len(string_property)\n
for column_id, column_property in listboxline.getColumnItemList():\n
if column_property is None: \n
string_property = \'\'\n
else:\n
string_property = str(column_property)\n
result[column_id] = max(result.get(column_id, min_column_width),\n
min( frame_width * 2 / col_count, \n
frame_width * len(str(string_property)) / max(line_width, 1)))\n
if is_report_tree_mode:\n
column_property = listboxline.getSectionName()\n
if column_property is None: \n
string_property = \'\'\n
else:\n
string_property = str(column_property)\n
column_id = \'section_name\'\n
result[column_id] = max(result.get(column_id,min_column_width), min(frame_width * 3 / col_count, frame_width * (len(str(string_property)) + section_width * (listboxline.getSectionDepth() - 1)) / max(line_width, 1)))\n
\n
total_col_width = 0.0\n
for column_id in result.keys():\n
if result[column_id] == 0.0:\n
result[column_id] = 1.0\n
for column_id in result.keys():\n
if column_id != \'section_name\' or is_report_tree_mode:\n
total_col_width += result[column_id]\n
for column_id in result.keys():\n
if column_id != \'section_name\' or is_report_tree_mode:\n
result[column_id] = result[column_id] * frame_width / total_col_width \n
\n
return result\n
\n
## End of dirty patch ###############################################\n
\n
\n
\n
# 0.5 is too small and can crash pdf generation\n
min_column_width = 1\n
\n
max_line_len = {}\n
number = (int, float, long)\n
for listboxline in listboxline_list:\n
col_count = 0\n
for column_id, column_property in listboxline.getColumnItemList():\n
col_count += 1\n
if isinstance(column_property, unicode):\n
column_property = column_property.encode(\'utf8\')\n
if isinstance(column_property, number):\n
string_property = "%s+++" % (column_property)\n
elif isinstance(column_property, DateTime):\n
string_property = column_property.strftime(\'%Y/%m/%d++\')\n
else:\n
string_property = str(column_property or \'\')\n
if listboxline.isStatLine():\n
string_property = "%s+++++" % string_property\n
elif listboxline.isTitleLine():\n
string_property = "%s++++++++" % str(N_(string_property))\n
new_column_max_len = max(len(string_property),\n
max_line_len.get(column_id, 0))\n
update_dict = {}\n
update_dict[column_id] = new_column_max_len\n
max_line_len.update(update_dict)\n
\n
total_max_len = float(sum(max_line_len.values()))\n
result = {}\n
for column_id, max_len in max_line_len.items() :\n
result[column_id] = min(\n
max((max(max_len, 1) / total_max_len) * frame_width,\n
min_column_width),\n
frame_width / col_count + 5)\n
\n
return result\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=19.0, section_width=4.0, listbox=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>listboxline_list</string>
<string>is_domain_tree_mode</string>
<string>is_report_tree_mode</string>
<string>frame_width</string>
<string>section_width</string>
<string>listbox</string>
<string>DateTime</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>cache</string>
<string>N_</string>
<string>result</string>
<string>min_column_width</string>
<string>_getiter_</string>
<string>listboxline</string>
<string>line_width</string>
<string>col_count</string>
<string>column_property</string>
<string>string_property</string>
<string>str</string>
<string>len</string>
<string>column_id</string>
<string>max</string>
<string>min</string>
<string>_write_</string>
<string>total_col_width</string>
<string>_getitem_</string>
<string>max_line_len</string>
<string>int</string>
<string>float</string>
<string>long</string>
<string>number</string>
<string>isinstance</string>
<string>unicode</string>
<string>new_column_max_len</string>
<string>update_dict</string>
<string>sum</string>
<string>total_max_len</string>
<string>max_len</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<float>19.0</float>
<float>4.0</float>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ListBox_getColumnWithDict</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5OOo.OOoTemplate</string>
<string>OOoTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>OLE_documents_zipstring</string> </key>
<value> <string encoding="base64">UEsDBBQAAAAIALGO1TbMBk1mQgEAAFEHAAAVAAAATUVUQS1JTkYvbWFuaWZlc3QueG1stZVLasMw
EED3PYXR3lbbVTFxAi30BOkBJvLYEeiHZhSS21cO5NM2lKZYOw1I741GGmmx2ltT7TCS9q4TT82j
qNAp32s3duJj/V6/iNXyYWHB6QGJ29OgyuscncNOpOhaD6SpdWCRWlatD+h6r5JFx+3X+e1kWj5U
F/CgDdZ5YjxUFxn2Gmo+BOwEhGC0As55yp3rm6OruVY0FCJCT1tEFhfIkIypA/C2E1LIu5y3KW/e
DXpM8ZgLPUti4EQbiGXwoBQazKGPUqUYp53mYhZ3FREMxgNjIXjwIYV8E1IhfPRjRCp30lPqxeDs
vSkG1xZGJPmq2UKgoo472d+fDUpu6p4m6UZdC/6Ww51yxj3LqVdvwrOf/9fMv3OJDwZpdqxFhtke
nvU22Y0DbUjyadgEN84Nn7ewyJz/xXNpF/LHt7j8BFBLAQIUABQAAAAIALGO1TbMBk1mQgEAAFEH
AAAVAAAAAAAAAAAAAAAAAAAAAABNRVRBLUlORi9tYW5pZmVzdC54bWxQSwUGAAAAAAEAAQBDAAAA
dQEAAAAA</string> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<office:document-content xmlns:draw=\'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\'\n
xmlns:office=\'urn:oasis:names:tc:opendocument:xmlns:office:1.0\'\n
xmlns:text=\'urn:oasis:names:tc:opendocument:xmlns:text:1.0\'\n
xmlns:ooo=\'http://openoffice.org/2004/office\'\n
xmlns:number=\'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\'\n
xmlns:dc=\'http://purl.org/dc/elements/1.1/\'\n
xmlns:meta=\'urn:oasis:names:tc:opendocument:xmlns:meta:1.0\'\n
xmlns:table=\'urn:oasis:names:tc:opendocument:xmlns:table:1.0\'\n
xmlns:dr3d=\'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\'\n
xmlns:fo=\'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\'\n
xmlns:style=\'urn:oasis:names:tc:opendocument:xmlns:style:1.0\'\n
xmlns:xforms=\'http://www.w3.org/2002/xforms\'\n
xmlns:form=\'urn:oasis:names:tc:opendocument:xmlns:form:1.0\'\n
xmlns:script=\'urn:oasis:names:tc:opendocument:xmlns:script:1.0\'\n
xmlns:ooow=\'http://openoffice.org/2004/writer\'\n
xmlns:svg=\'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\'\n
xmlns:chart=\'urn:oasis:names:tc:opendocument:xmlns:chart:1.0\'\n
xmlns:dom=\'http://www.w3.org/2001/xml-events\'\n
xmlns:xlink=\'http://www.w3.org/1999/xlink\'\n
xmlns:xsd=\'http://www.w3.org/2001/XMLSchema\'\n
xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\'\n
xmlns:oooc=\'http://openoffice.org/2004/calc\'\n
xmlns:math=\'http://www.w3.org/1998/Math/MathML\'\n
xmlns:tal=\'http://xml.zope.org/namespaces/tal\'\n
xmlns:i18n=\'http://xml.zope.org/namespaces/i18n\'\n
xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n
tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n
office:version=\'1.0\'>\n
<office:scripts/>\n
<office:font-face-decls>\n
<style:font-face svg:font-family=\'Arial\' style:font-family-generic=\'swiss\' style:name=\'Arial\' style:font-pitch=\'variable\'/>\n
<style:font-face svg:font-family="\'DejaVu Sans\'" style:font-family-generic=\'system\' style:name=\'DejaVu Sans\' style:font-pitch=\'variable\'/>\n
<style:font-face svg:font-family=\'Lucidasans\' style:font-family-generic=\'system\' style:name=\'Lucidasans\' style:font-pitch=\'variable\'/>\n
</office:font-face-decls>\n
<office:automatic-styles>\n
<style:style style:family=\'table-column\' style:name=\'co1\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'6.59cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co2\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'4.727cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co3\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'5.117cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co4\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'2.267cm\'/>\n
</style:style>\n
\n
<!-- XXX how to calculate row heights ?\n
can it be done by OOo ?\n
XXX this must be a macro !\n
{{{\n
-->\n
<style:style style:family=\'table-row\' style:name=\'ro1\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'2.575cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro2\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.894cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro3\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.877cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro4\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'false\' style:row-height=\'0.644cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro5\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'false\' style:row-height=\'0.951cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro6\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.503cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro7\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.538cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro8\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.453cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro9\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.496cm\'/>\n
</style:style>\n
<style:style style:family=\'table\' style:name=\'ta1\' style:master-page-name=\'Default\'>\n
<style:table-properties style:writing-mode=\'lr-tb\' table:display=\'true\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce1\'>\n
<style:table-cell-properties fo:wrap-option=\'wrap\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce2\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'report-content-heading2\' style:family=\'table-cell\' style:name=\'ce3\'>\n
<style:text-properties fo:font-size=\'12pt\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'report-stat2\' style:family=\'table-cell\' style:name=\'ce4\'>\n
<style:table-cell-properties fo:border-left=\'0.002cm solid #000000\' fo:border-bottom=\'none\' fo:border-right=\'none\' fo:border-top=\'none\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce5\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\' fo:margin-left=\'0cm\'/>\n
<style:text-properties fo:font-size=\'20pt\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce6\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\' fo:margin-left=\'0cm\'/>\n
</style:style>\n
</office:automatic-styles> <!-- }}} -->\n
<office:body>\n
<office:spreadsheet>\n
\n
<table:table table:style-name=\'ta1\' \n
table:print=\'false\'\n
table:name=\'Sheet1\'\n
i18n:attributes=\'table:name\'\n
i18n:domain=\'ui\'\n
tal:attributes=\'table:name python:form.getProperty("title")\'>\n
\n
<tal:block metal:define-macro="master">\n
<!-- header -->\n
<!-- body -->\n
<!-- footer -->\n
\n
<!-- XXX no, easier: -->\n
<tal:block metal:define-macro="form_layout"\n
tal:define="dummy python: request.set(\'here\', here);\n
listbox python:form.get_fields_in_group(\'bottom\')[0];">\n
<tal:block tal:condition="python: listbox.meta_type == \'ListBox\'">\n
<tal:block metal:use-macro="here/listbox_ods_macro/macros/listbox"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table>\n
</office:spreadsheet>\n
</office:body>\n
</office:document-content> <!-- vim: filetype=xml tw=1000 foldmethod=marker\n
-->\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/vnd.oasis.opendocument.spreadsheet</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>ooo_stylesheet</string> </key>
<value> <string>Base_getODSStyleSheet</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>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block xmlns:draw=\'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\'\n
xmlns:office=\'urn:oasis:names:tc:opendocument:xmlns:office:1.0\'\n
xmlns:text=\'urn:oasis:names:tc:opendocument:xmlns:text:1.0\'\n
xmlns:ooo=\'http://openoffice.org/2004/office\'\n
xmlns:number=\'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\'\n
xmlns:dc=\'http://purl.org/dc/elements/1.1/\'\n
xmlns:meta=\'urn:oasis:names:tc:opendocument:xmlns:meta:1.0\'\n
xmlns:table=\'urn:oasis:names:tc:opendocument:xmlns:table:1.0\'\n
xmlns:dr3d=\'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\'\n
xmlns:fo=\'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\'\n
xmlns:style=\'urn:oasis:names:tc:opendocument:xmlns:style:1.0\'\n
xmlns:xforms=\'http://www.w3.org/2002/xforms\'\n
xmlns:form=\'urn:oasis:names:tc:opendocument:xmlns:form:1.0\'\n
xmlns:script=\'urn:oasis:names:tc:opendocument:xmlns:script:1.0\'\n
xmlns:ooow=\'http://openoffice.org/2004/writer\'\n
xmlns:svg=\'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\'\n
xmlns:chart=\'urn:oasis:names:tc:opendocument:xmlns:chart:1.0\'\n
xmlns:dom=\'http://www.w3.org/2001/xml-events\'\n
xmlns:xlink=\'http://www.w3.org/1999/xlink\'\n
xmlns:xsd=\'http://www.w3.org/2001/XMLSchema\'\n
xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\'\n
xmlns:oooc=\'http://openoffice.org/2004/calc\'\n
xmlns:math=\'http://www.w3.org/1998/Math/MathML\'\n
xmlns:tal=\'http://xml.zope.org/namespaces/tal\'\n
xmlns:i18n=\'http://xml.zope.org/namespaces/i18n\'\n
xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n
office:version=\'1.0\'\n
tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n
metal:define-macro="listbox">\n
<tal:block tal:define="listboxline_list python:listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);\n
selection_name python:listbox.get_value(\'selection_name\', REQUEST=request);\n
editable_columns python:listbox.get_value(\'editable_columns\', REQUEST=request);\n
editable_field_list python:dict([(column[0], getattr(listbox.aq_parent, \'listbox_%s\' % column[0], None)) for column in editable_columns]);\n
selection python:here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n
is_domain_tree_mode selection/domain_tree_mode | nothing;\n
is_report_tree_mode selection/report_tree_mode | nothing;"\n
i18n:domain="ui">\n
\n
\n
<tal:block tal:define="global column_width python:here.ListBox_getColumnWithDict(listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=21, listbox=listbox)"/>\n
\n
<!--\n
<table:table table:style-name=\'ta1\' \n
table:print=\'false\'\n
table:name=\'Sheet1\'\n
tal:attributes=\'table:name python:listbox.get_value("title")\'>\n
-->\n
<table:table-column table:style-name=\'co3\' table:default-cell-style-name=\'Default\'/>\n
\n
\n
\n
\n
<tal:block tal:repeat="listboxline python: listboxline_list">\n
<table:table-row table:style-name=\'ro1\'>\n
\n
\n
<!-- title {{{ -->\n
<tal:block tal:condition="listboxline/isTitleLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1];\n
column_id python: column_item[0]">\n
<tal:block tal:condition="column_property">\n
<table:table-cell table:style-name=\'report-column-title\' office:value-type=\'string\'>\n
<text:p i18n:translate="" tal:content="column_property"/>\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="not:column_property">\n
<table:table-cell table:style-name=\'report-column-title\' office:value-type=\'string\'>\n
<text:p/>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<!-- }}} -->\n
\n
<!-- DataLine {{{ -->\n
<tal:block tal:condition="listboxline/isDataLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1];\n
column_id python: column_item[0];\n
is_list python:same_type(column_property, []) or same_type(column_property, ())">\n
<tal:block tal:condition="python: is_list">\n
<table:table-cell table:style-name=\'report-column-content\' office:value-type=\'string\'>\n
<text:p>XXX list not supported TODO</text:p>\n
</table:table-cell>\n
</tal:block>\n
\n
<tal:block tal:condition="python: column_property is not None and not is_list"\n
tal:define="field python: None # XXX editable_field_list.get(column_id, None)" >\n
<tal:block tal:condition="field"\n
tal:content="structure python:field.render_ods(column_property)">\n
</tal:block>\n
<tal:block tal:condition="not: field">\n
<table:table-cell\n
table:style-name=\'report-column-content\'\n
tal:attributes="table:style-name python:isinstance(column_property, (int, long, float)) and \'report-content-currency3\' or \'report-content-heading3\';\n
office:value-type python:isinstance(column_property, (int, long, float)) and \'float\' or \'string\';\n
office:value python:isinstance(column_property, str) and unicode(column_property, \'utf8\') or column_property;"\n
office:value-type=\'string\'>\n
<text:p tal:content="column_property"/>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
\n
<tal:block tal:condition="python: column_property is None">\n
<table:table-cell table:style-name=\'report-content-heading3\' office:value-type=\'string\'>\n
<text:p/>\n
</table:table-cell>\n
<tal:block>\n
\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<!-- }}} -->\n
\n
<!--\n
<tal:block tal:condition="python: listboxline.isStatLine() or listboxline.isSummaryLine()">\n
<tal:block tal:repeat="column_item python: listboxline.getColumnItemList()">\n
<tal:block tal:define="column_property python: column_item[1];\n
column_id python: column_item[0]">\n
<tal:block tal:condition="python: column_property is not None">\n
<td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])"\n
tal:define="field python: editable_field_list.get(column_id, None)">\n
<para tal:condition="python: field is None"\n
style="TableLastLine" tal:content="string:${column_property}"\n
tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableLastLineRightAligned\' or \'TableLastLineLeftAligned\'" />\n
<para tal:condition="python: field is not None"\n
style="TableLastLine" tal:content="python: field.render_pdf(column_property)"\n
tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableLastLineRightAligned\' or \'TableLastLineLeftAligned\'" />\n
</td>\n
</tal:block>\n
<tal:block tal:condition="python: column_property is None">\n
<td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])">\n
<para style="TableLastLine"> </para>\n
</td>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
\n
</tr>\n
</tal:block>\n
\n
-->\n
\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</tal:block>\n
<!-- </table:table> -->\n
</tal:block>\n
</tal:block><!-- vim: tw=1000 filetype=xml\n
-->\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/xml</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_ods_macro</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>
<tuple>
<tuple>
<string>Products.ERP5OOo.OOoTemplate</string>
<string>OOoTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>OLE_documents_zipstring</string> </key>
<value> <string encoding="base64">UEsDBBQAAAAIALGO1TbMBk1mQgEAAFEHAAAVAAAATUVUQS1JTkYvbWFuaWZlc3QueG1stZVLasMw
EED3PYXR3lbbVTFxAi30BOkBJvLYEeiHZhSS21cO5NM2lKZYOw1I741GGmmx2ltT7TCS9q4TT82j
qNAp32s3duJj/V6/iNXyYWHB6QGJ29OgyuscncNOpOhaD6SpdWCRWlatD+h6r5JFx+3X+e1kWj5U
F/CgDdZ5YjxUFxn2Gmo+BOwEhGC0As55yp3rm6OruVY0FCJCT1tEFhfIkIypA/C2E1LIu5y3KW/e
DXpM8ZgLPUti4EQbiGXwoBQazKGPUqUYp53mYhZ3FREMxgNjIXjwIYV8E1IhfPRjRCp30lPqxeDs
vSkG1xZGJPmq2UKgoo472d+fDUpu6p4m6UZdC/6Ww51yxj3LqVdvwrOf/9fMv3OJDwZpdqxFhtke
nvU22Y0DbUjyadgEN84Nn7ewyJz/xXNpF/LHt7j8BFBLAQIUABQAAAAIALGO1TbMBk1mQgEAAFEH
AAAVAAAAAAAAAAAAAAAAAAAAAABNRVRBLUlORi9tYW5pZmVzdC54bWxQSwUGAAAAAAEAAQBDAAAA
dQEAAAAA</string> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<office:document-content xmlns:draw=\'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\'\n
xmlns:office=\'urn:oasis:names:tc:opendocument:xmlns:office:1.0\'\n
xmlns:text=\'urn:oasis:names:tc:opendocument:xmlns:text:1.0\'\n
xmlns:ooo=\'http://openoffice.org/2004/office\'\n
xmlns:number=\'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\'\n
xmlns:dc=\'http://purl.org/dc/elements/1.1/\'\n
xmlns:meta=\'urn:oasis:names:tc:opendocument:xmlns:meta:1.0\'\n
xmlns:table=\'urn:oasis:names:tc:opendocument:xmlns:table:1.0\'\n
xmlns:dr3d=\'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\'\n
xmlns:fo=\'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\'\n
xmlns:style=\'urn:oasis:names:tc:opendocument:xmlns:style:1.0\'\n
xmlns:xforms=\'http://www.w3.org/2002/xforms\'\n
xmlns:form=\'urn:oasis:names:tc:opendocument:xmlns:form:1.0\'\n
xmlns:script=\'urn:oasis:names:tc:opendocument:xmlns:script:1.0\'\n
xmlns:ooow=\'http://openoffice.org/2004/writer\'\n
xmlns:svg=\'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\'\n
xmlns:chart=\'urn:oasis:names:tc:opendocument:xmlns:chart:1.0\'\n
xmlns:dom=\'http://www.w3.org/2001/xml-events\'\n
xmlns:xlink=\'http://www.w3.org/1999/xlink\'\n
xmlns:xsd=\'http://www.w3.org/2001/XMLSchema\'\n
xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\'\n
xmlns:oooc=\'http://openoffice.org/2004/calc\'\n
xmlns:math=\'http://www.w3.org/1998/Math/MathML\'\n
xmlns:tal=\'http://xml.zope.org/namespaces/tal\'\n
xmlns:i18n=\'http://xml.zope.org/namespaces/i18n\'\n
xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n
tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n
tal:define=\'report_item_list python:report_method();\n
report_item_list_len python:len(report_item_list);\n
global report_item_count python: 0;\n
dummy python:context.log("Starting report with %d report sections" % report_item_list_len);\'\n
office:version=\'1.0\'>\n
<office:scripts/>\n
<office:font-face-decls>\n
<style:font-face svg:font-family=\'Arial\' style:font-family-generic=\'swiss\' style:name=\'Arial\' style:font-pitch=\'variable\'/>\n
<style:font-face svg:font-family="\'DejaVu Sans\'" style:font-family-generic=\'system\' style:name=\'DejaVu Sans\' style:font-pitch=\'variable\'/>\n
<style:font-face svg:font-family=\'Lucidasans\' style:font-family-generic=\'system\' style:name=\'Lucidasans\' style:font-pitch=\'variable\'/>\n
</office:font-face-decls>\n
<office:automatic-styles>\n
<style:style style:family=\'table-column\' style:name=\'co1\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'6.59cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co2\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'4.727cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co3\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'5.117cm\'/>\n
</style:style>\n
<style:style style:family=\'table-column\' style:name=\'co4\'>\n
<style:table-column-properties fo:break-before=\'auto\' style:column-width=\'2.267cm\'/>\n
</style:style>\n
\n
<!-- XXX how to calculate row heights ?\n
can it be done by OOo ?\n
-->\n
<style:style style:family=\'table-row\' style:name=\'ro1\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'2.575cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro2\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.894cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro3\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.877cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro4\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'false\' style:row-height=\'0.644cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro5\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'false\' style:row-height=\'0.951cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro6\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.503cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro7\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.538cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro8\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.453cm\'/>\n
</style:style>\n
<style:style style:family=\'table-row\' style:name=\'ro9\'>\n
<style:table-row-properties fo:break-before=\'auto\' style:use-optimal-row-height=\'true\' style:row-height=\'0.496cm\'/>\n
</style:style>\n
<style:style style:family=\'table\' style:name=\'ta1\' style:master-page-name=\'Default\'>\n
<style:table-properties style:writing-mode=\'lr-tb\' table:display=\'true\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce1\'>\n
<style:table-cell-properties fo:wrap-option=\'wrap\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce2\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'report-content-heading2\' style:family=\'table-cell\' style:name=\'ce3\'>\n
<style:text-properties fo:font-size=\'12pt\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'report-stat2\' style:family=\'table-cell\' style:name=\'ce4\'>\n
<style:table-cell-properties fo:border-left=\'0.002cm solid #000000\' fo:border-bottom=\'none\' fo:border-right=\'none\' fo:border-top=\'none\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce5\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\' fo:margin-left=\'0cm\'/>\n
<style:text-properties fo:font-size=\'20pt\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Default\' style:family=\'table-cell\' style:name=\'ce6\'>\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
<style:paragraph-properties fo:text-align=\'center\' fo:margin-left=\'0cm\'/>\n
</style:style>\n
</office:automatic-styles>\n
<office:body>\n
<office:spreadsheet>\n
\n
<!-- table for report title and parameters -->\n
<table:table table:style-name=\'ta1\' \n
tal:attributes="table:name python:form.getProperty(\'title\')"\n
table:print=\'false\' table:name=\'Sheet1\'>\n
\n
<!-- report title -->\n
</table:table>\n
\n
<table:table table:style-name=\'ta1\' \n
table:print=\'false\' table:name=\'Report\'>\n
\n
<tal:block tal:define="portal_object here/portal_url/getPortalObject">\n
<tal:block tal:repeat="report_item report_item_list">\n
<tal:block tal:define="here python:report_item.getObject(portal_object);\n
dummy python:report_item.pushReport(portal_object)">\n
<!--\n
<table:table table:style-name=\'ta1\' \n
tal:attributes="table:name report_item/getTitle;"\n
table:print=\'false\' table:name=\'Sheet1\'>\n
-->\n
<table:table-row/> \n
<table:table-row tal:condition="report_item/getTitle">\n
<!-- XXX use section level\n
tal:attributes="style python:\'Heading%s\' % report_item.getLevel()\n
\n
XXX spanned on as many column that listbox has columns (same for covered cell after\n
--> \n
<table:table-cell table:number-columns-spanned=\'4\' table:style-name=\'report-title\' office:value-type=\'string\'>\n
<text:p i18n:translate="" tal:content="report_item/getTitle"/>\n
</table:table-cell>\n
<table:covered-table-cell table:number-columns-repeated=\'3\'/>\n
</table:table-row>\n
\n
<tal:block tal:condition="report_item/getFormId">\n
<tal:block tal:define="form python:getattr(here, report_item.getFormId())" >\n
<!-- \n
<tal:block tal:condition="python:form.pt == \'form_view\'">\n
<tal:block metal:use-macro="form/form_view/macros/form_layout"/></tal:block>\n
<tal:block tal:condition="python:form.pt == \'form_list\'">\n
<tal:block metal:use-macro="form/form_list/macros/form_layout"/></tal:block>\n
-->\n
<tal:block metal:use-macro="form/form_list/macros/form_layout"/>\n
</tal:block></tal:block>\n
<!-- </table:table> -->\n
</tal:block>\n
\n
<tal:block tal:define="dummy python:report_item.popReport(portal_object);\n
global report_item_count python: report_item_count + 1;\n
debug python:context.log(\'%s sections done\' % report_item_count)"/>\n
</tal:block>\n
</tal:block>\n
\n
</table:table>\n
\n
</office:spreadsheet>\n
</office:body>\n
</office:document-content> <!-- vim: filetype=xml tw=1000 foldmethod=marker\n
-->\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/vnd.oasis.opendocument.spreadsheet</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>report_view</string> </value>
</item>
<item>
<key> <string>ooo_stylesheet</string> </key>
<value> <string>Base_getODSStyleSheet</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2007-06-28 jerome
initial prototype
\ No newline at end of file
This style is not fully implemented. It was just a prototype to benchmark big report generated in pdf with oood
\ No newline at end of file
Copyright (c) 2007 Nexedi SA
\ No newline at end of file
A prototype of a style creating OpenOffice's ods files.
\ No newline at end of file
GPL
\ No newline at end of file
jerome
\ No newline at end of file
None
\ No newline at end of file
3
\ No newline at end of file
None
\ No newline at end of file
erp5_ods_style
\ No newline at end of file
erp5_ods_style
\ No newline at end of file
0.0.1
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment