diff --git a/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py b/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py index cab5b389a9866a51b0e4cabcc659da0f5f7aa060..8a65e9e8e6cb13cc4070387da5f580f8e733e22f 100644 --- a/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py +++ b/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py @@ -28,6 +28,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions from erp5.component.document.Item import Item +from erp5.component.document.JSONType import JSONType from lxml import etree import collections @@ -50,7 +51,7 @@ class DisconnectedSoftwareTree(Exception): class CyclicSoftwareTree(Exception): pass -class SoftwareInstance(Item): +class SoftwareInstance(Item, JSONType): """ """ @@ -305,4 +306,13 @@ class SoftwareInstance(Item): self.getReference(), successor_list), error=False) self.edit(successor_list=successor_list, comment='successor_list edited to unlink non commited instances') - self.setLastData(instance_reference_xml, key=cache_reference) \ No newline at end of file + self.setLastData(instance_reference_xml, key=cache_reference) + + security.declareProtected(Permissions.AccessContentsInformation, + 'asJSONText') + def asJSONText(self): + return self.getJsonContent() + + security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText') + def fromJSONText(self, json_content): + return self.setJsonContent(json_content) diff --git a/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.xml b/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.xml index b70c6b062c7d673e7c4a51ce720bb2e0df72fa77..2d12209a18ef70ebfe916fdb671a3e28d123eb68 100644 --- a/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.xml +++ b/master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.xml @@ -6,6 +6,12 @@ </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>SoftwareInstance</string> </value> @@ -49,13 +55,28 @@ <item> <key> <string>workflow_history</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + <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> @@ -68,7 +89,7 @@ <item> <key> <string>component_validation_workflow</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> </dictionary> @@ -77,7 +98,7 @@ </dictionary> </pickle> </record> - <record id="3" aka="AAAAAAAAAAM="> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> </pickle> diff --git a/master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml b/master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml index 3738bb3dc7b366c00ff6adce49b0a89c410a7220..088f2ed4954f3ba4c45e36906bc8ccdaf7c1b1ae 100644 --- a/master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml +++ b/master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml @@ -2,27 +2,14 @@ <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> - <global name="Base Type" module="erp5.portal_type"/> + <global name="JSON Type" module="erp5.portal_type"/> </pickle> <pickle> <dictionary> <item> <key> <string>_property_domain_dict</string> </key> <value> - <dictionary> - <item> - <key> <string>short_title</string> </key> - <value> - <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> - </value> - </item> - <item> - <key> <string>title</string> </key> - <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> - </value> - </item> - </dictionary> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> </value> </item> <item> @@ -33,10 +20,6 @@ <key> <string>description</string> </key> <value> <string>ERP5 default document. Supports synchronisation and XML.</string> </value> </item> - <item> - <key> <string>factory</string> </key> - <value> <string>addSoftwareInstance</string> </value> - </item> <item> <key> <string>group_list</string> </key> <value> @@ -45,26 +28,14 @@ </tuple> </value> </item> - <item> - <key> <string>icon</string> </key> - <value> <string>document_icon.gif</string> </value> - </item> <item> <key> <string>id</string> </key> <value> <string>Software Instance</string> </value> </item> - <item> - <key> <string>immediate_view</string> </key> - <value> <string>XMLObject_view</string> </value> - </item> <item> <key> <string>init_script</string> </key> <value> <string>SoftwareInstance_init</string> </value> </item> - <item> - <key> <string>meta_type</string> </key> - <value> <string>ERP5 XML Object</string> </value> - </item> <item> <key> <string>permission</string> </key> <value> @@ -73,11 +44,7 @@ </item> <item> <key> <string>portal_type</string> </key> - <value> <string>Base Type</string> </value> - </item> - <item> - <key> <string>product</string> </key> - <value> <string>ERP5Type</string> </value> + <value> <string>JSON Type</string> </value> </item> <item> <key> <string>searchable_text_property_id</string> </key> @@ -112,6 +79,59 @@ </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> + <item> + <key> <string>description</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>description</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> </pickle> @@ -128,7 +148,7 @@ </dictionary> </pickle> </record> - <record id="3" aka="AAAAAAAAAAM="> + <record id="5" aka="AAAAAAAAAAU="> <pickle> <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> </pickle>