Commit acb01e51 authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_base: Rework ORS and client project management

parent 6b1151f7
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_fast_input</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>fast_input_ors_update</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update ORS Configurations</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DataAcquisitionUnitModule_viewFastInputOrsUpdateDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>add_ors_to_project</string> </value> <value> <string>register_ors_client_project</string> </value>
</item> </item>
<item> <item>
<key> <string>permissions</string> </key> <key> <string>permissions</string> </key>
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
</item> </item>
<item> <item>
<key> <string>priority</string> </key> <key> <string>priority</string> </key>
<value> <float>1.0</float> </value> <value> <float>2.0</float> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Add ORS to Project</string> </value> <value> <string>Register ORS Client Project</string> </value>
</item> </item>
<item> <item>
<key> <string>visible</string> </key> <key> <string>visible</string> </key>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Project_viewNewOrsDialog</string> </value> <value> <string>string:${object_url}/ProjectModule_viewRegisterOrsClientProjectDialog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python:portal.Base_checkPermission(\'data_acquisition_unit_module\', \'Add portal content\')</string> </value> <value> <string>python:portal.Base_checkPermission(\'project_module\', \'Add portal content\')</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
if not reference: if not reference:
raise ValueError('reference is not defined') raise ValueError('reference is not defined')
ors_fluentd_tag_prefix = "ors."
if not reference.startswith(ors_fluentd_tag_prefix):
raise ValueError('reference %s is not a valid ORS fluentd tag' % reference)
reference = reference[len(ors_fluentd_tag_prefix):]
return { return {
'resource_reference' : context.data_product_module.ors_enb_log_data.getReference(), 'resource_reference' : context.data_product_module.ors_enb_log_data.getReference(),
'specialise_reference': reference, 'specialise_reference': reference,
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1018.50482.31264.35293</string> </value> <value> <string>1019.8193.45534.31283</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1724230234.35</float> <float>1725631523.71</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
portal = context.getPortalObject()
destination_project_list = portal.project_module.objectValues(portal_type='Project')
destination_project_title_list = [['', '']]
for project in destination_project_list:
destination_project_title_list.append([project.getTitle(), project.getRelativeUrl()])
return destination_project_title_list
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>ors_tag, ors_title, form_id=None, **kw</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Project_newOrs</string> </value> <value> <string>Base_getDialogDestinationProjectItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
import json
import random
portal = context.getPortalObject()
client_function = 'function/user'
password_length = 16
system_random = random.SystemRandom()
alphabet = string.ascii_letters + string.digits
client_init_password = ''.join(system_random.choice(alphabet) for i in range(password_length))
project = context.portal_catalog.getResultValue(
portal_type='Project',
# Do not test for title collision
reference=project_reference,
validation_state='validated'
)
if project:
error_msg = "Client project %s already registered." % project_reference
response_dict = dict(error_msg=error_msg)
return json.dumps(response_dict)
user = context.portal_catalog.getResultValue(
portal_type='Person',
reference=client_username,
validation_state='validated'
)
if user:
error_msg = "Client account username not available: %s." % client_username
response_dict = dict(error_msg=error_msg)
return json.dumps(response_dict)
ors_reference = 'ors.' + ors_tag
# Search for DAU across all client projects to prevent tag collision
data_acquisition_unit = context.portal_catalog.getResultValue(
portal_type='Data Acquisition Unit',
reference=ors_reference,
# Do not test for title collision
validation_state='validated'
)
if data_acquisition_unit:
error_msg = "ORS with tag %s already registered." % ors_tag
response_dict = dict(error_msg=error_msg)
return json.dumps(response_dict)
project = portal.project_module.newContent(
portal_type='Project',
reference=project_reference,
title=project_title,
)
project.validate()
destination_project = project.getRelativeUrl()
user = portal.person_module.newContent(portal_type='Person', reference=client_username)
user.newContent(portal_type='Assignment', destination_project=destination_project, function=client_function).open()
user.newContent(portal_type='ERP5 Login', reference=client_username, password=client_init_password).validate()
user.validate()
data_acquisition_unit = portal.data_acquisition_unit_module.newContent(
portal_type='Data Acquisition Unit',
reference=ors_reference,
title=ors_title
)
data_acquisition_unit.validate()
data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(destination_project, batch=1)
response_dict = dict(username=client_username, init_password=client_init_password)
return json.dumps(response_dict)
...@@ -78,6 +78,10 @@ ...@@ -78,6 +78,10 @@
<list> <list>
<string>my_dialog_mode_reference</string> <string>my_dialog_mode_reference</string>
<string>my_dialog_mode_title</string> <string>my_dialog_mode_title</string>
<string>my_view_mode_listbox_destination_project_title</string>
<string>my_dialog_mode_email</string>
<string>my_view_mode_listbox_reference</string>
<string>my_view_mode_listbox_title</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_dialog_mode_email</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_email_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_dialog_mode_reference</string> </value> <value> <string>my_dialog_mode_reference</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>items</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_listbox_destination_project_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The project to which this transaction is related to on the client side.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>(tales)</string>
<string>(tales)</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Client Project</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>context/Base_getDialogDestinationProjectItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(x, x) for x in context.getPortalProjectTypeList()]</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_listbox_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_listbox_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
data_acquisition_unit_list = context.contentValues(portal_type='Data Acquisition Unit')
listbox_item_list = []
for data_acquisition_unit in data_acquisition_unit_list:
destination_project = None
for related_data_supply_line in data_acquisition_unit.Base_getRelatedObjectList(portal_type='Data Supply Line'):
related_data_supply = related_data_supply_line.getParentValue()
if related_data_supply:
destination_project = related_data_supply.getDestinationProject()
context_obj = data_acquisition_unit.asContext(destination_project=destination_project)
listbox_item_list.append(context_obj)
return listbox_item_list
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>lines_num=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataAcquisitionUnitModule_getFastInputOrsConfigurationList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
for listbox_item in listbox:
if 'listbox_key' in listbox_item:
data_acquisition_unit_url = listbox_item['listbox_key']
title = listbox_item['title']
destination_project = listbox_item['destination_project']
data_acquisition_unit = portal.restrictedTraverse(data_acquisition_unit_url)
data_acquisition_unit.setTitle(title)
for related_data_supply_line in data_acquisition_unit.Base_getRelatedObjectList(portal_type='Data Supply Line'):
related_data_supply = related_data_supply_line.getParentValue()
if related_data_supply:
related_data_supply.setDestinationProject(destination_project)
else:
portal_status_message = "No related Data Supply found for %s." % data_acquisition_unit.getReference()
kw['keep_items'] = dict(
portal_status_message=portal_status_message,
portal_status_level='error'
)
return context.Base_redirect('view', **kw)
return context.Base_redirect('view', keep_items={'portal_status_message': 'Data Acquisition Units successfully updated.'})
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>listbox=(), **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataAcquisitionUnitModule_updateFastInputOrsConfigurationList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>DataAcquisitionUnitModule_updateFastInputOrsConfigurationList</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string>multipart/form-data</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_destination_project</string>
<string>listbox_reference</string>
<string>listbox_title</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataAcquisitionUnitModule_viewFastInputOrsUpdateDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DataAcquisitionUnitModule_viewFastInputOrsUpdateDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update ORS Configurations</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_destination_project</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The project to which the corresponding Data Supply is related on the client side.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_destination_project_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWendelinTelecomFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value>
<list>
<tuple>
<string>Project</string>
<string>Project</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The internal reference of the object.</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWendelinTelecomFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The name of the object.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWendelinTelecomFieldLibrary</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
'''
Creates a pre-configured Data Supply related to a Data Acquisition Unit representing an ORS.
The related Data Supply has the same reference as the Data Acquisition Unit.
The script first checks if the Data Supply already exists, and will create it if it doesn't.
If batch == 1, the Data Supply object is returned in both cases of the above check.
Otherwise, the user is redirected to the Data Supply's view page.
'''
if not context.getReference(): if not context.getReference():
return context.Base_redirect('view',keep_items={'portal_status_message': 'Reference is not defined'}) return context.Base_redirect('view', keep_items={'portal_status_message': 'Reference is not defined.', 'portal_status_level': 'error'})
reference = context.getReference() reference = context.getReference()
...@@ -8,19 +17,17 @@ data_supply = context.portal_catalog.getResultValue( ...@@ -8,19 +17,17 @@ data_supply = context.portal_catalog.getResultValue(
reference=reference, reference=reference,
validation_state='validated' validation_state='validated'
) )
if data_supply: if data_supply:
if batch: if batch:
return data_supply return data_supply
return data_supply.Base_redirect('view',keep_items={'portal_status_message': 'Data Supply already created'}) return data_supply.Base_redirect('view', keep_items={'portal_status_message': 'Data Supply already exists.'})
data_supply = context.data_supply_module.newContent( data_supply = context.data_supply_module.newContent(
portal_type='Data Supply', portal_type='Data Supply',
reference=reference, reference=reference,
source='organisation_module/open_radio_station', source='organisation_module/open_radio_station',
source_section='organisation_module/open_radio_station', source_section='organisation_module/open_radio_station',
destination='organisation_module/rapid_space_data_center', destination='organisation_module/rapid_space_data_center'
destination_project=destination_project
) )
data_supply.newContent( data_supply.newContent(
...@@ -32,7 +39,6 @@ data_supply.newContent( ...@@ -32,7 +39,6 @@ data_supply.newContent(
use='big_data/ingestion/stream', use='big_data/ingestion/stream',
resource="data_product_module/ors_enb_log_data" resource="data_product_module/ors_enb_log_data"
).validate() ).validate()
data_supply.newContent( data_supply.newContent(
portal_type='Data Supply Line', portal_type='Data Supply Line',
title='Ingest ORS eNB Log Data', title='Ingest ORS eNB Log Data',
...@@ -47,4 +53,4 @@ data_supply.validate() ...@@ -47,4 +53,4 @@ data_supply.validate()
if batch: if batch:
return data_supply return data_supply
return data_supply.Base_redirect('view', keep_items={'portal_status_message': 'Data Supply is created'}) return data_supply.Base_redirect('view', keep_items={'portal_status_message': 'Data Supply successfully created.'})
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>destination_project=None, batch=0, **kw</string> </value> <value> <string>batch=0, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_getEUtranDataArrayKey</string> </value> <value> <string>DataAcquisitionUnit_getERabDataArrayKey</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_getERabDataArrayKey</string> </value> <value> <string>DataAcquisitionUnit_getEUtranDataArrayKey</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: [(\'data_array_key\', context.Base_getERabDataArrayKey())]</string> </value> <value> <string>python: [(\'data_array_key\', context.DataAcquisitionUnit_getERabDataArrayKey())]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: [(\'data_array_key\', context.Base_getEUtranDataArrayKey())]</string> </value> <value> <string>python: [(\'data_array_key\', context.DataAcquisitionUnit_getEUtranDataArrayKey())]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
'''
Creates a Data Acquisition Unit, as well as the corresponding Data Supply, with the provided ORS tag as reference.
This script returns a JSON response, as it is intended to be called by Wendelin Telecom slave instances
requested by ORSs in order to register themselves on the platform.
'''
import json
portal = context.getPortalObject()
response_dict = {}
# Check if ORS is already registered
data_acquisition_unit = context.portal_catalog.getResultValue(
portal_type='Data Acquisition Unit',
reference=ors_tag,
validation_state='validated'
)
if data_acquisition_unit:
error_msg = "ORS with tag %s already exists." % ors_tag
response_dict = dict(error_msg=error_msg)
return json.dumps(response_dict)
ors_tag_components = ors_tag.split('_')
if len(ors_tag_components) != 3:
error_msg = "Invalid ORS tag %s found" % ors_tag
response_dict = dict(error_msg=error_msg)
return json.dumps(response_dict)
ors_hostname, ors_comp_id = ors_tag_components[0], ors_tag_components[1]
ors_tag_prefix = '%s_%s' % (ors_hostname, ors_comp_id)
# Detect the case where an existing ORS has changed the last component of its tag:
# Search for all Data Acquisition Units with the same first two tag components and get their related destination_project
related_data_acquisition_unit_list = [
related_data_acquisition_unit for related_data_acquisition_unit \
in portal.data_acquisition_unit_module.contentValues(filter={'portal_type': 'Data Acquisition Unit'}) \
if related_data_acquisition_unit.getReference().startswith(ors_tag_prefix)
]
destination_project = None
if related_data_acquisition_unit_list:
related_destination_project_list = []
for related_data_acquisition_unit in related_data_acquisition_unit_list:
related_data_supply = related_data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
related_destination_project = related_data_supply.getDestinationProject()
if related_destination_project:
related_destination_project_list.append(related_destination_project)
# If there is only one destination_project found, link the new Data Acquisition Unit to it
# Else, do not do anything automatically: this case will have to be resolved manually
related_destination_project_set = set(related_destination_project_list)
if len(related_destination_project_set) == 1:
destination_project = related_destination_project_set.pop()
data_acquisition_unit = portal.data_acquisition_unit_module.newContent(
portal_type='Data Acquisition Unit',
reference=ors_tag
)
data_acquisition_unit.validate()
data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(batch=1)
data_supply.setDestinationProject(destination_project)
return json.dumps(response_dict)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>ors_tag</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_registerOrs</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
'''
Creates a Project representing a client project, as well as an associated ERP5 Person
corresponding to the client's user account.
The Person will be given the provided email address,
an active assignment with the appropriate function and project,
as well as an ERP5 Login initialized with a random password that will need to be reset.
'''
import random
portal = context.getPortalObject()
project = context.portal_catalog.getResultValue(
portal_type='Project',
# Do not test for title collision
reference=project_reference,
validation_state='validated'
)
if project:
portal_status_message = "Project with reference %s already exists." % project_reference
kw['keep_items'] = dict(
portal_status_message=portal_status_message,
portal_status_level='error'
)
return context.Base_redirect(form_id, **kw)
# Email field in action form checks that the email address is valid
# For all other cases, let the caller handle the error
client_user_reference = client_email.split('@')[0]
client_user = context.portal_catalog.getResultValue(
portal_type='Person',
reference=client_user_reference,
validation_state='validated'
)
if client_user:
portal_status_message = "Person with reference %s already exists." % client_user_reference
kw['keep_items'] = dict(
portal_status_message=portal_status_message,
portal_status_level='error'
)
return context.Base_redirect(form_id, **kw)
project = portal.project_module.newContent(
portal_type='Project',
reference=project_reference,
title=project_title,
)
project.validate()
destination_project = project.getRelativeUrl()
password_length = 20
client_init_password = ''.join(random.SystemRandom().sample(string.ascii_letters + string.digits, password_length))
client_function = 'user'
client_user = portal.person_module.newContent(
portal_type='Person',
reference=client_user_reference,
default_email_text=client_email
)
client_user.newContent(portal_type='Assignment', destination_project=destination_project, function=client_function).open()
client_user.newContent(portal_type='ERP5 Login', reference=client_email, password=client_init_password).validate()
client_user.validate()
portal_status_message = "ORS Client Project successfully registered."
kw['keep_items'] = dict(
portal_status_message=portal_status_message
)
return context.Base_redirect(form_id, **kw)
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>project_reference, project_title, client_username, ors_tag, ors_title, form_id=None, **kw</string> </value> <value> <string>project_reference, project_title, client_email, form_id=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_registerOrsClientProject</string> </value> <value> <string>ProjectModule_registerOrsClientProject</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>Project_newOrs</string> </value> <value> <string>ProjectModule_registerOrsClientProject</string> </value>
</item> </item>
<item> <item>
<key> <string>action_title</string> </key> <key> <string>action_title</string> </key>
...@@ -76,8 +76,9 @@ ...@@ -76,8 +76,9 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>your_ors_tag</string> <string>your_project_reference</string>
<string>your_ors_title</string> <string>your_project_title</string>
<string>your_client_email</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Project_viewNewOrsDialog</string> </value> <value> <string>ProjectModule_viewRegisterOrsClientProjectDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>Project_viewNewOrsDialog</string> </value> <value> <string>ProjectModule_viewRegisterOrsClientProjectDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
...@@ -116,7 +117,7 @@ ...@@ -116,7 +117,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Add ORS to Project</string> </value> <value> <string>Register ORS Client Project</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>required</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_client_email</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_email</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWendelinTelecomFieldLibrary</string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Client Email Address</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>required</string> <string>required</string>
<string>title</string> <string>title</string>
</list> </list>
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_ors_tag</string> </value> <value> <string>your_project_reference</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -65,10 +64,6 @@ ...@@ -65,10 +64,6 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The fluentbit tag of the ORS to link to the project.</string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_reference</string> </value> <value> <string>my_dialog_mode_reference</string> </value>
...@@ -83,7 +78,7 @@ ...@@ -83,7 +78,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>ORS Tag</string> </value> <value> <string>Project Reference</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>description</string>
<string>required</string> <string>required</string>
<string>title</string> <string>title</string>
</list> </list>
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_ors_title</string> </value> <value> <string>your_project_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -65,10 +64,6 @@ ...@@ -65,10 +64,6 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The title of the ORS to link to the project.</string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_title</string> </value> <value> <string>my_dialog_mode_title</string> </value>
...@@ -83,7 +78,7 @@ ...@@ -83,7 +78,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>ORS Title</string> </value> <value> <string>Project Title</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
portal = context.getPortalObject()
destination_project = context.getRelativeUrl()
ors_reference = 'ors.' + ors_tag
data_acquisition_unit = context.portal_catalog.getResultValue(
portal_type='Data Acquisition Unit',
reference=ors_reference,
# Do not test for title collision: irrelevant
validation_state='validated'
)
if data_acquisition_unit:
portal_status_message = "ORS with tag %s already registered." % ors_tag
kw['keep_items'] = dict(
portal_status_message=portal_status_message,
portal_status_level='error'
)
return context.Base_redirect(form_id, **kw)
data_acquisition_unit = portal.data_acquisition_unit_module.newContent(
portal_type='Data Acquisition Unit',
reference=ors_reference,
title=ors_title
)
data_acquisition_unit.validate()
data_supply = data_acquisition_unit.DataAcquisitionUnit_createOrsDataSupply(destination_project, batch=1)
portal_status_message = "New ORS successfully added to project."
kw['keep_items'] = dict(portal_status_message=portal_status_message)
return context.Base_redirect(form_id, **kw)
Data Acquisition Unit Module | fast_input_ors_update
Data Acquisition Unit | create_ors_data_supply Data Acquisition Unit | create_ors_data_supply
Data Acquisition Unit | view_e_rab_accessibility_kpi Data Acquisition Unit | view_e_rab_accessibility_kpi
Data Acquisition Unit | view_e_utran_ip_throughput_kpi Data Acquisition Unit | view_e_utran_ip_throughput_kpi
Project | add_ors_to_project Project Module | register_ors_client_project
\ No newline at end of file \ No newline at end of file
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