I want to parse a csv, map the fields, and do perform some custom logic with the imported data, but I can't seem to figure out the Profile Actions XML.
The XML currently looks like this, along with my reasoning:
=> Firstly the Adapter checks if the file exists and creates the batch model.
<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"><![CDATA[stuff.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
=> Here the Parser parses the CSV and stores it into dataflow_import_data table for other actions to access/manipulate it.
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
</action>
=> Here the mapper converts the data stored in the dataflow_import_data table.
<action type="dataflow/convert_mapper_column" method="map">
<var name="map">
<map name="first_name"><![CDATA[Given Name]]></map>
<map name="last_name"><![CDATA[Family Name]]></map>
</var>
<var name="_only_specified">true</var>
</action>
=> And finally, I can perform my own logic. (this doesn't make much sense since the csv rows are already parsed, but there doesn't seem to be a right action for this.. )
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">false</var>
<var name="number_of_records">10</var>
<var name="adapter">mymodule/convert_adapter_myadapter</var>
<var name="method">saveRow</var>
</action>
Obviously, above won't work because (in the second action) convert_parser_csv doesn't have an adapter and method.
Can someone point me in the right direction to make the mapper work?