OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions How do I create a custom connector for a channel

This topic contains 1 reply, has 2 voices, and was last updated by  Alexandr Smaga 9 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.

  • Creator
    Topic
  • #28062

    lennart
    Participant

    Hi,

    I managed to successfully create a new channel type. I can create a channel and fill in 4 fields with names of .csv files. The filenames are saved successfully to oro_integration_transport.

    Now I want add my custom channel to the JobQueue. The job should retrieve the 4 filenames and then read the .csv files which are located at a certain location. Something like the Magentobundle but with .csv instead of soap. I tried to make a custom connector but im stuck. I have set the reader in my in batch_jobs.yml to my custom connector and registered the connector in my importexport.yml. I don’t understand what my connector class and transport (init and call methods) class should contain.

    thanks,

    Lennart

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #28063

    Alexandr Smaga
    Participant

    Hi.

    Let me try to clarify.

    Lets imagine that your “csv transport” are compatible with 3 different connectors: product, customer, customer group. Each of connector should read data using transport from some files, so filenames are setting of the transport. They are correctly stored in oro_integration_transport entity.
    Before your transport is ready to use it should be configured by setting that are related to one of channel instance (configured channel). To achieve this behavior method init are added to TransportInterface. Argument of this method is transport setting entity.

    In order to abstract from implementation of transport method call was added. Basically you can define own action names, that you can also support in any compatible connector. For example your product connector needs to retrieve data to import. It calls method call with action name ‘productAction’ and some set of params. CSV connector checks if this action supported and if it’s then reads data from filename(comes from settings in method init).
    Some time after you want to read the same data direct from DB. You should implement DBTransport that will also supports ‘productAction’ but will read data from DB using some set of settings(comes from settings in method init).

    Hope my explanation is clear.

    Best wishes!

Viewing 1 replies (of 1 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top