Commit 421d7d98 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ERP5OOo: Migrate FormPrintout and OOoTemplate to Portal Type as classes.

Likewise ERP5Form, there is no reason why these are not ERP5 object yet. This
change is done in preparation of migration to ZODB Components (the Document
will be migrated to ZODB Components thus requiring a dynamic class so that
the XML of FormPrintout instance can be imported).

This also adds the necessary Property Sheets for FormPrintout and OOoTemplate
as this is required by constructInstance() (IOW, properties are not set through
__init__() anymore but through edit()).
parent 24d6d161
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -36,4 +36,3 @@ for (section_value, node_uid, mirror_section_uid) in (
grouping_reference=grouping_reference
) or [])
return list(ungrouped_line_set)
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FormPrintout" module="Products.ERP5OOo.FormPrintout"/>
<global name="Form Printout" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -136,7 +136,7 @@ SEPARATELY_EXPORTED_PROPERTY_DICT = {
"File": (None, 0, "data"),
"Image": (None, 0, "data"),
"Interface Component": ("py", 0, "text_content"),
"OOoTemplate": ("oot", 1, "_text"),
"OOo Template": ("oot", 1, "_text"),
"Mixin Component": ("py", 0, "text_content"),
"Module Component": ("py", 0, "text_content"),
"PDF": ("pdf", 0, "data"),
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Form Printout</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>FormPrintout</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Type" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOo Template</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Type</string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>OOoTemplate</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="OOoTemplate" module="Products.ERP5OOo.OOoTemplate"/>
<global name="OOo Template" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -48,6 +48,7 @@ ERP5 Form
Event
Extension Component
Folder
Form Printout
Id Tool
Interface Component
Mapped Value
......@@ -57,6 +58,7 @@ Mixin Component
Module Component
Movement
Notification Tool
OOo Template
Order Tool
Password Tool
Predicate
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>FormPrintout</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>form_name_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoTemplate</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>A string which represents the mime type of the data</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>content_type_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'text/html\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/tales</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>filename_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'object/title_or_id\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ooo_script_name_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ooo_stylesheet_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'Base_getODTStyleSheet\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>xml_file_id_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: \'content.xml\'</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>ooo_xml_file_id</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -91,6 +91,7 @@ ExternalDocument
ExtraLocalRole
FlowCapacity
Folder
FormPrintout
Gadget
GeographicAddress
HtmlStylePreference
......@@ -113,6 +114,7 @@ Measure
MemcachedPlugin
Movement
MovementGroup
OOoTemplate
OpenOrder
Order
Organisation
......
......@@ -92,7 +92,13 @@ def addFormPrintout(self, id, title="", form_name='', template='',
template -- the name of a template which describes printout layout
"""
# add actual object
id = self._setObject(id, FormPrintout(id, title, form_name, template, filename))
type_info = self.getPortalObject().portal_types.getTypeInfo('Form Printout')
type_info.constructInstance(container=self,
id=id,
title=title,
form_name=form_name,
template=template,
filename=filename)
# respond to the add_and_edit button if necessary
add_and_edit(self, id, REQUEST)
return ''
......@@ -114,7 +120,8 @@ def add_and_edit(self, id, REQUEST):
u = "%s/%s" % (u, quote(id))
REQUEST.RESPONSE.redirect(u+'/manage_main')
class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
from Products.ERP5Type.Base import Base
class FormPrintout(Base, Implicit, Persistent, RoleManager, Item):
"""Form Printout
FormPrintout is one of a reporting system in ERP5.
......@@ -132,8 +139,8 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
styles.xml: supported
meta.xml: not supported yet
"""
meta_type = "ERP5 Form Printout"
portal_type = "Form Printout"
icon = "www/form_printout_icon.png"
# Declarative Security
......@@ -141,17 +148,10 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem)
_properties = ( {'id': 'template',
'type': 'string',
'mode': 'w'},
{'id': 'form_name',
'type': 'string',
'mode': 'w'},
{'id': 'filename',
'type': 'tales',
'mode': 'w',},)
, PropertySheet.SimpleItem
, PropertySheet.OOoTemplate
, PropertySheet.FormPrintout)
# Constructors
constructors = (manage_addFormPrintout, addFormPrintout)
......@@ -169,11 +169,6 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item, PropertyManager):
security.declareProtected('View management screens', 'manage_main')
manage_main = manage_editFormPrintout
# default attributes
template = None
form_name = None
filename = 'object/title_or_id'
def __init__(self, id, title='', form_name='', template='',
filename='object/title_or_id'):
"""Initialize id, title, form_name, template.
......
......@@ -70,13 +70,14 @@ def addOOoTemplate(self, id, title="", xml_file_id="content.xml", REQUEST=None):
Result -- empty string
"""
# add actual object
id = self._setObject(id, OOoTemplate(id, title, xml_file_id))
type_info = self.getPortalObject().portal_types.getTypeInfo('OOo Template')
obj = type_info.constructInstance(container=self, id=id, title=title, xml_file_id=xml_file_id)
if REQUEST is not None:
file = REQUEST.form.get('file')
if file.filename:
file_ = REQUEST.form.get('file')
if file_.filename:
# Get the template in the associated context and upload the file
getattr(self,id).pt_upload(REQUEST, file)
# respond to the add_and_edit button if necessary
obj.pt_upload(REQUEST, file)
# respond to the add_and_edit button if necessary
add_and_edit(self, id, REQUEST)
return ''
......@@ -122,7 +123,8 @@ def createOOoZopeEngine():
_engine = createOOoZopeEngine()
class OOoTemplate(ZopePageTemplate):
from Products.ERP5Type.Base import Base
class OOoTemplate(Base, ZopePageTemplate):
"""
A page template which is able to embed and OpenOffice
file (zip archive) and replace content.xml at render time
......@@ -139,6 +141,7 @@ class OOoTemplate(ZopePageTemplate):
- add interface for Cache (http/RAM)
"""
meta_type = "ERP5 OOo Template"
portal_type = "OOo Template"
icon = "www/OOo.png"
# NOTE: 100 is just pure random starting number
......@@ -155,20 +158,12 @@ class OOoTemplate(ZopePageTemplate):
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.SimpleItem)
, PropertySheet.SimpleItem
, PropertySheet.OOoTemplate)
# Constructors
constructors = (manage_addOOoTemplate, addOOoTemplate)
# Default Attributes
ooo_stylesheet = 'Base_getODTStyleSheet'
ooo_script_name = None
ooo_xml_file_id = 'content.xml'
# Default content type
#content_type = 'application/vnd.sun.xml.writer' # Writer type by default
content_type = 'text/html' # This is the only for now to produce valid XML
# Management interface
manage_options = ( ZopePageTemplate.manage_options +
(
......@@ -177,22 +172,15 @@ class OOoTemplate(ZopePageTemplate):
)
)
_properties= ZopePageTemplate._properties + (
{'id': 'filename',
'type': 'tales',
'mode': 'w',}, )
filename = 'object/title_or_id'
security.declareProtected('View management screens', 'formSettings')
formSettings = PageTemplateFile('www/formSettings', globals(),
__name__='formSettings')
formSettings._owner = None
def __init__(self, id, title, xml_file_id='content.xml', *args,**kw):
def __init__(self, id, title='', *args, **kw):
ZopePageTemplate.__init__(self, id, title, *args, **kw)
# we store the attachments of the uploaded document
self.OLE_documents_zipstring = None
self.ooo_xml_file_id = xml_file_id
# Recent Zope relies on the ZTK implementation of page templates,
# passing it a special expression evaluation context that converts strings
......@@ -234,7 +222,7 @@ class OOoTemplate(ZopePageTemplate):
memory_file.seek(0)
self.OLE_documents_zipstring = memory_file.read()
self.content_type = builder.getMimeType()
file = builder.prepareContentXml(self.ooo_xml_file_id)
file = builder.prepareContentXml(self.getXmlFileId())
return ZopePageTemplate.pt_upload(self, REQUEST, file)
if 'pt_edit' not in ZopePageTemplate.__dict__:
......@@ -258,9 +246,9 @@ class OOoTemplate(ZopePageTemplate):
"""
if SUPPORTS_WEBDAV_LOCKS and self.wl_isLocked():
raise ResourceLockedError, "File is locked via WebDAV"
self.ooo_stylesheet = ooo_stylesheet
self.ooo_script_name = script_name
self.ooo_xml_file_id = xml_file_id
self.setOooStylesheet(ooo_stylesheet)
self.setOooScriptName(script_name)
self.setXmlFileId(xml_file_id)
self.pt_setTitle(title)
#REQUEST.set('text', self.read()) # May not equal 'text'!
message = "Saved changes."
......@@ -305,7 +293,7 @@ class OOoTemplate(ZopePageTemplate):
dir_name = sub_document + '/' + dir_name
# Get the stylesheet of the embedded openoffice document
ooo_stylesheet = document.ooo_stylesheet
ooo_stylesheet = document.getOooStylesheet()
if ooo_stylesheet:
ooo_stylesheet = getattr(here, ooo_stylesheet)
# If ooo_stylesheet is dynamic, call it
......@@ -455,11 +443,11 @@ class OOoTemplate(ZopePageTemplate):
# Retrieve master document
ooo_document = None
# If script is setting, call it
if self.ooo_script_name:
ooo_script = getattr(here, self.ooo_script_name)
ooo_document = ooo_script(self.ooo_stylesheet)
if self.getOooScriptName():
ooo_script = getattr(here, self.getOooScriptName())
ooo_document = ooo_script(self.getOooStylesheet())
else:
ooo_document = getattr(here, self.ooo_stylesheet)
ooo_document = getattr(here, self.getOooStylesheet())
format = request.get('format')
try:
# If style is dynamic, call it
......@@ -509,7 +497,7 @@ class OOoTemplate(ZopePageTemplate):
content=document_dict['document'])
# Replace content.xml in master openoffice template
ooo_builder.replace(self.ooo_xml_file_id, doc_xml)
ooo_builder.replace(self.getXmlFileId(), doc_xml)
# Old templates correction
try:
......@@ -599,4 +587,6 @@ class OOoTemplate(ZopePageTemplate):
return self.title_or_id()
return self.getProperty('filename')
__call__ = ZopePageTemplate.__call__
InitializeClass(OOoTemplate)
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