Commit 008a4a13 authored by Ivan Tyagov's avatar Ivan Tyagov

Not needed.

parent c9445f61
"""
Each Data Stream can be grouped in a logical set with a dedicated portal type which represents the set.
For ebulk this portal type is "Data Set" but in theory it can be anything. Thus name of script is intentionally using 'Set'.
This script works for the default ingestion model used by ebulk:
- Data Ingestion
- Data Ingestion Line
(aggregate) -> Data Stream
(aggregate) -> Date Set
Note: for this to work we must working an index relation between Data Ingestion Line and Data Stream!
"""
data_stream = context.getObject()
data_ingestion_line = data_stream.portal_catalog.getResultValue(
portal_type = "Data Ingestion Line",
aggregate_uid = context.getObject().getUid())
#context.log("DS=%s , DI=%s" %(data_stream, data_ingestion_line))
if data_ingestion_line is not None:
#context.log(data_ingestion_line.getRelativeUrl())
data_set = data_ingestion_line.getAggregateValue(portal_type = "Data Set")
if data_set is not None:
#context.log("set_uid=%s" %data_set.getUid())
return data_set.getUid()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataStream_getSetUid</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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