akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
950 stars 512 forks source link

Import/Export Attribute Group feature #4114

Closed a2xchip closed 8 years ago

a2xchip commented 8 years ago

Hello All! I'm curious is there plans to implement importer and exporter for attribute groups? If there is so - may somebody point me to the link of such PR or branch. May be i will be able to help with it too. I already checked enhanced connectors bundle and there are no such... Txh.

nidup commented 8 years ago

Hi @a2xchip !

In fact, we already import these kind of data during the installation (we don't export them for now).

In 1.5, we import them as yml file you can be interested by this batch_job configuration https://github.com/akeneo/pim-community-dev/blob/1.5/src/Pim/Bundle/InstallerBundle/Resources/config/batch_jobs.yml#L23

We're re-working the import system in the upcoming 1.6 to provide more standard csv imports cf https://github.com/akeneo/pim-community-dev/blob/master/src/Pim/Bundle/InstallerBundle/Resources/config/batch_jobs.yml#L23

These batch jobs are created during the install, used, then removed, you can declare them in your own connector to make them usable in the PIM.

a2xchip commented 8 years ago

Thank you. It was helpful! @nidup

a2xchip commented 8 years ago

@nidup Amazing! But I finished import attribute group connector without any code written )))

# batch_jobs.yml
connector:
    name: A2xConnector
    jobs:
        a2x_attribute_import:
            title: a2x.jobs.attribute_group_import.title
            type: import
            steps:
                import_step:
                    title: a2x.jobs.attribute_group_import.import.title
                    services:
                        reader: pim_connector.reader.file.csv
                        processor: pim_base_connector.processor.attribute_group
                        writer: a2x_connector.writer.doctrine.attribute_group
# writers.yml

parameters:
  pim_connector.writer.doctrine.base.class: Pim\Component\Connector\Writer\Doctrine\BaseWriter

services:
  a2x_connector.writer.doctrine.attribute_group:
        class: '%pim_connector.writer.doctrine.base.class%'
        arguments:
            - '@pim_catalog.saver.attribute_group'
            - '@akeneo_storage_utils.doctrine.object_detacher'

:+1:

nidup commented 8 years ago

Good news :tada: ! Don't hesitate if you need any further information.