Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
5ffe1b7a
Commit
5ffe1b7a
authored
Nov 02, 2021
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Move Software instance from Base Type to JSON Type
parent
b7a0e617
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
39 deletions
+69
-39
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
...eItem/portal_components/document.erp5.SoftwareInstance.py
+12
-2
master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml
...rtalTypeTemplateItem/portal_types/Software%20Instance.xml
+57
-37
No files found.
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
5ffe1b7a
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
erp5.component.document.Item
import
Item
from
erp5.component.document.Item
import
Item
from
erp5.component.document.JSONType
import
JSONType
from
lxml
import
etree
from
lxml
import
etree
import
collections
import
collections
...
@@ -50,7 +51,7 @@ class DisconnectedSoftwareTree(Exception):
...
@@ -50,7 +51,7 @@ class DisconnectedSoftwareTree(Exception):
class
CyclicSoftwareTree
(
Exception
):
class
CyclicSoftwareTree
(
Exception
):
pass
pass
class
SoftwareInstance
(
Item
):
class
SoftwareInstance
(
Item
,
JSONType
):
"""
"""
"""
"""
...
@@ -306,3 +307,12 @@ class SoftwareInstance(Item):
...
@@ -306,3 +307,12 @@ class SoftwareInstance(Item):
self
.
edit
(
successor_list
=
successor_list
,
self
.
edit
(
successor_list
=
successor_list
,
comment
=
'successor_list edited to unlink non commited instances'
)
comment
=
'successor_list edited to unlink non commited instances'
)
self
.
setLastData
(
instance_reference_xml
,
key
=
cache_reference
)
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
)
master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Software%20Instance.xml
View file @
5ffe1b7a
...
@@ -2,29 +2,16 @@
...
@@ -2,29 +2,16 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
Base
Type"
module=
"erp5.portal_type"
/>
<global
name=
"
JSON
Type"
module=
"erp5.portal_type"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_property_domain_dict
</string>
</key>
<key>
<string>
_property_domain_dict
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<item>
<key>
<string>
content_icon
</string>
</key>
<key>
<string>
content_icon
</string>
</key>
<value>
<string>
document.gif
</string>
</value>
<value>
<string>
document.gif
</string>
</value>
...
@@ -33,10 +20,6 @@
...
@@ -33,10 +20,6 @@
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string>
ERP5 default document. Supports synchronisation and XML.
</string>
</value>
<value>
<string>
ERP5 default document. Supports synchronisation and XML.
</string>
</value>
</item>
</item>
<item>
<key>
<string>
factory
</string>
</key>
<value>
<string>
addSoftwareInstance
</string>
</value>
</item>
<item>
<item>
<key>
<string>
group_list
</string>
</key>
<key>
<string>
group_list
</string>
</key>
<value>
<value>
...
@@ -45,26 +28,14 @@
...
@@ -45,26 +28,14 @@
</tuple>
</tuple>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string>
document_icon.gif
</string>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Software Instance
</string>
</value>
<value>
<string>
Software Instance
</string>
</value>
</item>
</item>
<item>
<key>
<string>
immediate_view
</string>
</key>
<value>
<string>
XMLObject_view
</string>
</value>
</item>
<item>
<item>
<key>
<string>
init_script
</string>
</key>
<key>
<string>
init_script
</string>
</key>
<value>
<string>
SoftwareInstance_init
</string>
</value>
<value>
<string>
SoftwareInstance_init
</string>
</value>
</item>
</item>
<item>
<key>
<string>
meta_type
</string>
</key>
<value>
<string>
ERP5 XML Object
</string>
</value>
</item>
<item>
<item>
<key>
<string>
permission
</string>
</key>
<key>
<string>
permission
</string>
</key>
<value>
<value>
...
@@ -73,11 +44,7 @@
...
@@ -73,11 +44,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Base Type
</string>
</value>
<value>
<string>
JSON Type
</string>
</value>
</item>
<item>
<key>
<string>
product
</string>
</key>
<value>
<string>
ERP5Type
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
searchable_text_property_id
</string>
</key>
<key>
<string>
searchable_text_property_id
</string>
</key>
...
@@ -112,6 +79,59 @@
...
@@ -112,6 +79,59 @@
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<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>
<pickle>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
</pickle>
</pickle>
...
@@ -128,7 +148,7 @@
...
@@ -128,7 +148,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
5"
aka=
"AAAAAAAAAAU
="
>
<pickle>
<pickle>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
<global
name=
"TranslationInformation"
module=
"Products.ERP5Type.TranslationProviderBase"
/>
</pickle>
</pickle>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment