OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums OroPlatform Export Entity does not work

This topic contains 3 replies, has 2 voices, and was last updated by Andrey Yatsenko Andrey Yatsenko 3 weeks, 6 days ago.

  • Creator
    Topic
  • #38135

    d.romeo
    Participant

    Hello,
    I tried to implement entity exporting using ORO Platform v1.10 and writing the following codes:

    importexport.yml

    parameters:
    application_market.importexport.template_fixture.user.class: Application\Bundle\MarketBundle\ImportExport\TemplateFixture\OrderFixture
    application_market.entity.class: Application\Bundle\AppBundle\Entity\Fiscal\Order

    services:
    application_market.importexport.data_converter:
    parent: oro_importexport.data_converter.configurable

    application_market.importexport.template_fixture.data_converter:
    parent: oro_importexport.data_converter.template_fixture.configurable

    # Export processor
    application_market.importexport.processor.export:
    parent: oro_importexport.processor.export_abstract
    calls:
    – [setDataConverter, [‘@application_market.importexport.data_converter’]]
    tags:
    – { name: oro_importexport.processor, type: export, entity: %application_market.entity.class%, alias: market_order }

    application_market.importexport.processor.export_template:
    parent: oro_importexport.processor.export_abstract
    calls:
    – [setDataConverter, [‘@application_market.importexport.template_fixture.data_converter’]]
    tags:
    – { name: oro_importexport.processor, type: export_template, entity: %application_market.entity.class%, alias: market_order }

    application_market.importexport.template_fixture.user:
    class: %application_market.importexport.template_fixture.user.class%
    tags:
    – { name: oro_importexport.template_fixture }

    OrderFixture.php

    <?php declare (strict_types = 1);

    namespace Application\Bundle\MarketBundle\ImportExport\TemplateFixture;

    use Application\Bundle\AppBundle\Entity\Fiscal\Order;
    use Oro\Bundle\ImportExportBundle\TemplateFixture\AbstractTemplateRepository;
    use Oro\Bundle\ImportExportBundle\TemplateFixture\TemplateFixtureInterface;

    class OrderFixture extends AbstractTemplateRepository implements TemplateFixtureInterface
    {
    /**
    * {@inheritdoc}
    */
    public function getEntityClass()
    {
    return Order::class;
    }

    /**
    * {@inheritdoc}
    */
    public function getData()
    {
    return $this->getEntityData(1);
    }

    /**
    * {@inheritdoc}
    */
    protected function createEntity($key)
    {
    return new Order();
    }

    /**
    * {@inheritdoc}
    */
    public function fillEntityData($key, $entity)
    {
    if (!$entity instanceof Order) {
    return;
    }

    parent::fillEntityData($key, $entity);
    }
    }

    index.html.twig

    {% extends ‘OroUIBundle:actions:index.html.twig’ %}
    {% import ‘OroUIBundle::macros.html.twig’ as UI %}

    {% set pageTitle = ‘application.market.order.entity_plural_label’|trans %}
    {% set gridName = ‘ben-orders-datagrid’ %}
    {% set orderExportAlias = ‘market_order’ %}
    {% set entityClass = ‘Application\\Bundle\\AppBundle\\Entity\\Fiscal\\Order’ %}

    {% block navButtons %}
    {% include ‘OroImportExportBundle:ImportExport:buttons.html.twig’ with {
    entity_class: entityClass,
    exportProcessor: orderExportAlias,
    exportTemplateProcessor: orderExportAlias,
    exportTitle: ‘Esporta’
    } %}
    {% endblock %}

    When I click on the export button, I see the message ‘Export started, please wait…’ without downloading the file.
    What is wrong?
    Thank.

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

You must be logged in to reply to this topic.

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

Yes No
sso for www.magecore.comsso for oroinc.comsso for oroinc.desso for oroinc.fr