OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Import CsvFileReader

This topic contains 6 replies, has 2 voices, and was last updated by  stalxed 5 years, 10 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
  • #33527
    Yevhen Shyshkin
    Yevhen Shyshkin

    Hello, stalxed.

    There are two ways to do that:

    1) preferable solution: you can pass these variables to execution context – see this code;

    2) another solution: you can extend this reader, override variables and use it in batch job configuration.



    Thank you for answer!

    I use importexport configuration like in this bundle:

    For example, how from OroCRMContactBundle pass this variables to execution context?
    I spent a few hours, but did not understand how to do it.



    I think I cant do it from here
    In documentation he called after the read operation.
    Or am I wrong?
    If I’m not mistaken, where else can I set the context variables?(before call the function initializeFromContext in CsvFileReader).



    I found solution:
    1) Need create listener:

    2) Need register listener:

    Yevhen Shyshkin
    Yevhen Shyshkin

    Good job, stalxed!

    Just a several tips:
    – alongside with “import_validation” type you should alter configuration for “import” type
    – instead of hardcoded types you can use constants ProcessorRegistry::TYPE_IMPORT_VALIDATION and ProcessorRegistry::TYPE_IMPORT



    Thanks Yevhen Shyshkin!

    I improved the code:

    Now can registe few services:

    I hope someone can help.
    I would be glad if you publish in a cookbook documentation.

Viewing 6 replies - 1 through 6 (of 6 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No