Commit 2916ee5a authored by Ivan Tyagov's avatar Ivan Tyagov

WIP.

parent 041b0055
......@@ -4,6 +4,15 @@ Simple script for OPCUA POC
import json
from erp5.component.module.Log import log
def getPropertyId(node_id):
# XXX: based on node_id guess property type, too! -i -> integer , s- string, etc,,
return node_id.replace(";", "")
# XXX: get rid of Proxy roles on this script when proper authentication is used!!!
# XXX: what should be the OPCUA container?
default_opcua_document = context.opcua_document_module["1"]
try:
data = context.REQUEST.data
except AttributeError:
......@@ -14,5 +23,6 @@ else:
# log only set requests for now
node_id = data['node']
node_value = data['val']
log("Set '%s' = '%s'" %(node_id, node_value))
log("Set '%s' = '%s' to %s as %s" %(node_id, node_value, default_opcua_document, getPropertyId(node_id)))
log(data)
# XXX: set to "ERP5 OPCUA Document" property
......@@ -52,6 +52,14 @@
<key> <string>_params</string> </key>
<value> <string>*args, **kwargs</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_handleOPCUARequest</string> </value>
......
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