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 @@ ...@@ -47,6 +47,9 @@
<portal_type id="Data Supply Line"> <portal_type id="Data Supply Line">
<item>DataMovement</item> <item>DataMovement</item>
</portal_type> </portal_type>
<portal_type id="Data Transformation Resource Line">
<item>Aggregated</item>
</portal_type>
<portal_type id="Device Configuration Type"> <portal_type id="Device Configuration Type">
<item>TextDocument</item> <item>TextDocument</item>
<item>Url</item> <item>Url</item>
......
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
<string>my_reference</string> <string>my_reference</string>
<string>my_int_index</string> <string>my_int_index</string>
<string>my_resource_title</string> <string>my_resource_title</string>
<string>my_use</string>
<string>my_variation_category_list</string> <string>my_variation_category_list</string>
<string>my_use</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<string>my_reference</string> <string>my_reference</string>
<string>my_int_index</string> <string>my_int_index</string>
<string>my_resource_title</string> <string>my_resource_title</string>
<string>my_aggregated_portal_type_list</string>
<string>my_trade_phase</string> <string>my_trade_phase</string>
<string>my_use</string> <string>my_use</string>
</list> </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): ...@@ -88,18 +88,19 @@ for movement in portal_catalog(query):
aggregate_set.update(related_movement.getAggregateSet()) aggregate_set.update(related_movement.getAggregateSet())
if related_movement.getUse() == "big_data/ingestion/batch": if related_movement.getUse() == "big_data/ingestion/batch":
related_movement.getParentValue().deliver() related_movement.getParentValue().deliver()
else: # create new item based on item_type if it is not already aggregated
# it is an output line aggregate_type_set = set(
# create new item based on item_type [portal.restrictedTraverse(a).getPortalType() for a in aggregate_set])
item_type = resource.getAggregatedPortalType() for item_type in transformation_line.getAggregatedPortalTypeList():
module = portal.getDefaultModule(item_type) if item_type not in aggregate_type_set:
item = module.newContent(portal_type = item_type, module = portal.getDefaultModule(item_type)
title = transformation.getTitle(), item = module.newContent(portal_type = item_type,
reference = "%s-%s" %(transformation.getTitle(), title = transformation.getTitle(),
data_ingestion.getReference()), reference = "%s-%s" %(transformation.getTitle(),
version = '001') data_ingestion.getReference()),
item.validate() version = '001')
aggregate_set.add(item.getRelativeUrl()) item.validate()
aggregate_set.add(item.getRelativeUrl())
data_analysis.newContent( data_analysis.newContent(
portal_type = "Data Analysis Line", portal_type = "Data Analysis Line",
...@@ -110,6 +111,7 @@ for movement in portal_catalog(query): ...@@ -110,6 +111,7 @@ for movement in portal_catalog(query):
variation_category_list = transformation_line.getVariationCategoryList(), variation_category_list = transformation_line.getVariationCategoryList(),
quantity = quantity, quantity = quantity,
quantity_unit = transformation_line.getQuantityUnit(), quantity_unit = transformation_line.getQuantityUnit(),
use = transformation_line.getUse(),
aggregate_set = aggregate_set) aggregate_set = aggregate_set)
data_analysis.start() data_analysis.start()
...@@ -16,6 +16,7 @@ Data Set | Predicate ...@@ -16,6 +16,7 @@ Data Set | Predicate
Data Stream | OffsetIndex Data Stream | OffsetIndex
Data Supply Line | DataMovement Data Supply Line | DataMovement
Data Supply | Version Data Supply | Version
Data Transformation Resource Line | Aggregated
Device Configuration Type | TextDocument Device Configuration Type | TextDocument
Device Configuration Type | Url Device Configuration Type | Url
Ingestion Policy | IngestionPolicy 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