Commit 1d4bc3d4 authored by Klaus Wölfel's avatar Klaus Wölfel Committed by Klaus Wölfel

add aggregated portal type list to data transformation resource line

this way, a transformation can define which items to create in an analyis
parent f7f5e0e3
......@@ -47,6 +47,9 @@
<portal_type id="Data Supply Line">
<item>DataMovement</item>
</portal_type>
<portal_type id="Data Transformation Resource Line">
<item>Aggregated</item>
</portal_type>
<portal_type id="Device Configuration Type">
<item>TextDocument</item>
<item>Url</item>
......
......@@ -79,8 +79,8 @@
<string>my_reference</string>
<string>my_int_index</string>
<string>my_resource_title</string>
<string>my_use</string>
<string>my_variation_category_list</string>
<string>my_use</string>
</list>
</value>
</item>
......
......@@ -95,6 +95,7 @@
<string>my_reference</string>
<string>my_int_index</string>
<string>my_resource_title</string>
<string>my_aggregated_portal_type_list</string>
<string>my_trade_phase</string>
<string>my_use</string>
</list>
......
<?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>enabled</string>
<string>items</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_aggregated_portal_type_list</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>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</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">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_aggregated_portal_type_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewPDMFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</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>python: here.getResource() and here.getResourceValue().getAggregatedPortalTypeList()</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: here.getResource() and here.getResourceValue().getAggregatedPortalTypeList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -88,18 +88,19 @@ for movement in portal_catalog(query):
aggregate_set.update(related_movement.getAggregateSet())
if related_movement.getUse() == "big_data/ingestion/batch":
related_movement.getParentValue().deliver()
else:
# it is an output line
# create new item based on item_type
item_type = resource.getAggregatedPortalType()
module = portal.getDefaultModule(item_type)
item = module.newContent(portal_type = item_type,
title = transformation.getTitle(),
reference = "%s-%s" %(transformation.getTitle(),
data_ingestion.getReference()),
version = '001')
item.validate()
aggregate_set.add(item.getRelativeUrl())
# create new item based on item_type if it is not already aggregated
aggregate_type_set = set(
[portal.restrictedTraverse(a).getPortalType() for a in aggregate_set])
for item_type in transformation_line.getAggregatedPortalTypeList():
if item_type not in aggregate_type_set:
module = portal.getDefaultModule(item_type)
item = module.newContent(portal_type = item_type,
title = transformation.getTitle(),
reference = "%s-%s" %(transformation.getTitle(),
data_ingestion.getReference()),
version = '001')
item.validate()
aggregate_set.add(item.getRelativeUrl())
data_analysis.newContent(
portal_type = "Data Analysis Line",
......@@ -110,6 +111,7 @@ for movement in portal_catalog(query):
variation_category_list = transformation_line.getVariationCategoryList(),
quantity = quantity,
quantity_unit = transformation_line.getQuantityUnit(),
use = transformation_line.getUse(),
aggregate_set = aggregate_set)
data_analysis.start()
......@@ -16,6 +16,7 @@ Data Set | Predicate
Data Stream | OffsetIndex
Data Supply Line | DataMovement
Data Supply | Version
Data Transformation Resource Line | Aggregated
Device Configuration Type | TextDocument
Device Configuration Type | Url
Ingestion Policy | IngestionPolicy
......
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