Commit 69143a1a authored by Ivan Tyagov's avatar Ivan Tyagov

Create a default placeholder if not existing.

parent 068db638
""" """
OPCUA to ERP5 OPCUA Document setter / getter glue script. OPCUA to ERP5 OPCUA Document setter / getter glue script.
""" """
import json import json
from erp5.component.module.Log import log from erp5.component.module.Log import log
...@@ -19,7 +20,11 @@ def convertNodeValue(node_id, node_value): ...@@ -19,7 +20,11 @@ def convertNodeValue(node_id, node_value):
return node_value return node_value
# XXX: what should be the OPCUA container? # XXX: what should be the OPCUA container?
default_opcua_document = context.opcua_document_module["1"] default_id = "1"
default_opcua_document = context.opcua_document_module.get(default_id, None)
if default_opcua_document is None:
context.opcua_document_module.newContent(portal_type = "OPCUA Document",
id = default_id)
# do selection of oepration in a REST fashion based in HTTP method # do selection of oepration in a REST fashion based in HTTP method
http_method = context.REQUEST.method http_method = context.REQUEST.method
......
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