Commit f7e1c15c authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_ingestion: new role and bug fixing

- new local role 'admin' with permission to delete (contributor and less can't)
- minor changes in external methods
- bug fixing if dataset ref has invalid chars
- bug fixing when checkin ingestion existence
- handling possible exception if duplicate ingestions
parent cb105ea3
......@@ -59,4 +59,6 @@ def processRawData(data_stream, data_array, data_descriptor):
os.remove(raw_file)
return "Raw data processed."
except Exception, e:
if os.path.exists(raw_file):
os.remove(raw_file)
return "Error while processing raw data: " + str(e)
from DateTime import DateTime
import os
from Products.ERP5Type.Log import log
directory = "var/log/ingestion"
......@@ -12,4 +13,5 @@ def logEntry(content):
os.makedirs(directory)
with open("%s/%s.log" % (directory, day), "a") as log_file:
log_file.write(entry)
log(entry)
log_file.write("-------------------\n")
\ No newline at end of file
......@@ -26,6 +26,12 @@
<key> <string>id</string> </key>
<value> <string>extension.erp5.ingestion_log</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension Component</string> </value>
......
......@@ -26,6 +26,12 @@
<key> <string>id</string> </key>
<value> <string>extension.erp5.unit_test_external</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension Component</string> </value>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
</role>
<role id='contributor'>
<item>Auditor</item>
</role>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
</role>
<role id='contributor'>
<item>Auditor</item>
</role>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Manager</item>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='contributor'>
<item>Manager</item>
<item>Auditor</item>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
</role>
<role id='contributor'>
<item>Auditor</item>
</role>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='contributor'>
<item>Auditor</item>
<item>Author</item>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='contributor'>
<item>Auditor</item>
<item>Author</item>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='contributor'>
<item>Auditor</item>
<item>Author</item>
......
<local_roles_item>
<local_roles>
<role id='admin'>
<item>Auditor</item>
</role>
<role id='contributor'>
<item>Auditor</item>
</role>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Assignment" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>function/admin</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Assignment</string> </value>
</item>
<item>
<key> <string>start_date</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510358400.0</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>stop_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>7979472000.0</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</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>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>assignment_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>open</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062924.49</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>open</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.15453.26045.43554</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062913.16</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Login" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>admin</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>password</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>ERP5 Login</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<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>
<item>
<key> <string>default</string> </key>
<value> <string>{SSHA}d4sfT10AURW1A0v+RZl8djpkiWG9KmzugrkK</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>login_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062974.65</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062974.67</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Career" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>function/admin</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_career</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Career</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</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>
<item>
<key> <string>career_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062868.09</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>draft</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529062868.09</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>function/admin</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>admin</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</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>
<item>
<key> <string>category_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529054662.92</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>embedded</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.15316.53199.37495</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1529054694.41</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Assignor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
</role>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author; Manager'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author; Manager'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author; Manager'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author; Manager'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author; Manager'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author; Manager'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author; Assignor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
</role>
......
<type_roles>
<role id='Auditor; Author'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor; Author; Manager'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor; Author; Manager'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>admin</property>
<multi_property id='category'>function/admin</multi_property>
</role>
<role id='Auditor'>
<property id='title'>contributor</property>
<multi_property id='category'>function/contributor</multi_property>
......
......@@ -60,7 +60,7 @@ for line_data_ingestion in portal_catalog(**query_dict):
simulation_state="stopped",
resource_relative_url = resource.getRelativeUrl())
for related_line in related_lines_list:
if(related_line.getParentValue().getReference() == data_ingestion.getReference()):
if(related_line.getParentValue().getReference() == data_ingestion.getReference() and related_line.getParentValue().getSimulationState() == "stopped"):
aggregate_set.update(related_line.getAggregateSet())
related_line.getParentValue().deliver()
log("DATA INGESTION DELIVERED")
......
......@@ -4,7 +4,8 @@ from Products.ERP5Type.Log import log
for data_analysis in portal_catalog(portal_type = "Data Analysis",
simulation_state = "planned"):
data_analysis.start()
log("DATA ANALYSIS STARTED")
data_analysis.activate(serialization_tag=str(data_analysis.getUid()))\
.DataAnalysis_executeDataOperation()
if data_analysis.getSimulationState() == "planned":
data_analysis.start()
log("DATA ANALYSIS STARTED")
data_analysis.activate(serialization_tag=str(data_analysis.getUid()))\
.DataAnalysis_executeDataOperation()
import re
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
try:
sanitised_reference = re.sub(r"[^a-zA-Z0-9]+", '-', data_set_reference)
if sanitised_reference != data_set_reference:
return { "status_code": 1, "error_message": "Error with dataset reference '%s': invalid dataset name. Only alphanumerics and '-' are allowed." %data_set_reference }
data_set = portal.data_set_module.get(data_set_reference)
if data_set is None or data_set.getReference().endswith("_invalid"):
return { "status_code": 0, "result": [] }
except Exception as e: # fails because unauthorized access
context.logEntry("[ERROR] At script getDataStreamList")
context.logEntry("[ERROR] " + str(e))
return { "status_code": 1, "error_message": "401 - Unauthorized access" }
return { "status_code": 1, "error_message": "401 - Unauthorized access. Please check your user credentials and try again." }
data_set = portal.data_set_module.get(data_set_reference)
if data_set is None:
......
......@@ -14,7 +14,7 @@ try:
context.logEntry("Attempt to do a new ingestion with reference: %s" % reference)
# remove supplier and eof from reference
data_ingestion_reference = '_'.join(reference.split('_')[1:-1])
data_ingestion_reference = '_'.join(reference.split('.')[1:])
data_ingestion = portal_catalog.getResultValue(
portal_type = 'Data Ingestion',
......
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