SlideShare a Scribd company logo
1 of 26
Download to read offline
Presentation title here
Integrate your data into
OroCRM
CSV Import and Export
Sergey Zhuravel
https://github.com/sergeyz
https://twitter.com/sergey_zv
Presentation title here
Outline
1. Import and export - process overview
a. Jobs overview
b. Import schema
c. Export schema
2. Basic B2B Customer import and export
a. Fields configuration
b. Data converter
c. Import/export Strategy
d. Strategy events
e. Import and validation processors
f. Button configuraion reference
g. Export processor
h. Export template processor
3. Import and export customization
a. Data Converter with tags support
b. Tags Normalizer
c. Strategy with tags support
Presentation title here
Jobs overview
Job
Step Step Step Step
Presentation title here
Import Process Schema
Step
Reader
Processor
Writer
DataConverter Serializer Strategy
Import and Export
Presentation title here
Export Process Schema
Step
Reader
Processor
Writer
DataConverterSerializer
Import and Export
Presentation title here
Basic B2B Customer import and
export
• Configurable entity import and export process is
managed by EntityConfigBundle. Field configuration
is avalialable in “importexport” configuration scope.
• Minimum import/export configuration should 4 defined
services (DataConverter, Strategy,
Import/ImportValidation and Export Processors).
• In addition, it is possible to define processor to export
file template for data import
Import and Export
Presentation title here
Fields configuration
header – csv column header configuration,
default values is field label (if other are not
defined)
/**
* @ConfigField(
* defaultValues={
* "importexport"={
* "header"="B2BCustomer name"
* }
* }
* )
*/
protected $name;
Import and Export
Presentation title here
Fields configuration
identity – field is used to search entity by
import strategy
/**
* @ConfigField(
* defaultValues={
* "importexport"={
* "identity"=true
* }
* }
* )
*/
protected $name;
Import and Export
Presentation title here
Fields configuration
order – manages column order
/**
* @ConfigField(
* defaultValues={
* "importexport"={
* "order"=10
* }
* }
* )
*/
protected $name;
Import and Export
Presentation title here
Fields configuration
excluded – allows to exclude field from export
and import process
/**
* @ConfigField(
* defaultValues={
* "importexport"={
* "excluded"=true
* }
* }
* )
*/
protected $name;
Import and Export
Presentation title here
Fields configuration
full – used to manage related entities export and
import.
•true - export and import related entity fields
•false – export and import related entity identity fields only
/**
* @ConfigField(
* defaultValues={
* "importexport"={
* "full"=true
* }
* }
* )
*/
protected $name;
Import and Export
Presentation title here
Fields configuration
Import and Export
Presentation title here
Data Converter
• Data converter is responsible for headers
mapping and converting imported data to
nested representation of entity and its
relations.
• Use customized or
ConfigurableTableDataConverter
orocrm_sales.importexport.data_converter.b2bcustomer:
parent: oro_importexport.data_converter.configurable
Import and Export git checkout tags/step-1
Presentation title here
Strategy
• Strategy responsible for processing import
logic.
• Use customized or
ConfigurableTableDataConverter
orocrm_sales.importexport.strategy.b2bcustomer.add_or_replace:
parent: oro_importexport.strategy.configurable_add_or_replace
Import and Export git checkout tags/step-2
Presentation title here
orocrm_sales.importexport.processor.import.b2bcustomer:
parent: oro_importexport.processor.import_abstract
calls:
- [setDataConverter, [@orocrm_sales.importexport.data_converter.b2bcustomer]]
- [setStrategy, [@orocrm_sales.importexport.strategy.b2bcustomer.add_or_replace]]
tags:
- { name: oro_importexport.processor, type: import, entity: %orocrm_sales.b2bcustomer.entity.class%,
alias: orocrm_sales_b2bcustomer }
- { name: oro_importexport.processor, type: import_validation, entity: %orocrm_sales.b2bcustomer.entity.
class%, alias: orocrm_sales_b2bcustomer }
Import and validation processors definition
example
Import and Export
Presentation title here
Button configuration reference
{% include 'OroImportExportBundle:ImportExport:buttons.html.twig' with {
entity_class: entity_class,
exportProcessor: 'orocrm_sales_b2bcustomer',
exportTemplateProcessor: 'orocrm_sales_b2bcustomer',
importProcessor: 'orocrm_sales_b2bcustomer',
dataGridName: gridName,
importTitle: 'orocrm.sales.b2bcustomer.import'|trans
} %}
return [
'entity_class' => $this->container->getParameter('orocrm_sales.b2bcustomer.entity.class')
];
Import and Export git checkout tags/step-4
Presentation title here
Export processor
Export processor denormalizes objects
and converts plain data using
DataConverter
orocrm_sales.importexport.processor.export.b2bcustomer:
parent: oro_importexport.processor.export_abstract
calls:
- [setDataConverter, [@orocrm_sales.importexport.data_converter.b2bcustomer]]
tags:
- { name: oro_importexport.processor, type: export, entity: %orocrm_sales.b2bcustomer.entity.class%,
alias: orocrm_sales_b2bcustomer }
Import and Export git checkout tags/step-5
Presentation title here
Export template processor
Use registered fixture to export an example file.
parameters:
orocrm_sales.importexport.template_fixture.b2bcustomer.class:
OroCRMBundleSalesBundleImportExportTemplateFixtureB2bCustomerFixture
services:
orocrm_sales.importexport.template_fixture.b2bcustomer:
class: %orocrm_sales.importexport.template_fixture.b2bcustomer.class%
tags:
- { name: oro_importexport.template_fixture }
orocrm_sales.importexport.template_fixture.data_converter.b2bcustomer:
parent: oro_importexport.data_converter.template_fixture.configurable
orocrm_sales.importexport.processor.export_template.b2bcustomer:
parent: oro_importexport.processor.export_abstract
calls:
- [setDataConverter, [@orocrm_sales.importexport.template_fixture.data_converter.b2bcustomer]]
tags:
- { name: oro_importexport.processor, type: export_template, entity: %orocrm_sales.b2bcustomer.
entity.class%, alias: orocrm_sales_b2bcustomer }
Import and Export git checkout tags/step-6
Presentation title here
Import and export customization
Import and Export
Three steps are required for adding tags to import and
exprort:
1. Create DataConverter with tags to Tags List header
conversion rule and two methods to convert tag names
list
2. Add Normalizer to load tags by their names
3. Add Strategy to save taggins
Presentation title here
Custom Data Converter
use OroBundleImportExportBundleConverterAbstractTableDataConverter;
class B2BCustomerDataConverter extends AbstractTableDataConverter
{
/**
* {@inheritdoc}
*/
protected function getHeaderConversionRules()
{
return [
'ID' => 'id',
'Name' => 'name',
'Channel' => 'channel:name',
];
}
/**
* {@inheritdoc}
*/
protected function getBackendHeader()
{
return ['id', 'name', 'channel'];
}
}
Import and Export git checkout tags/step-7
Presentation title here
Normalizers
• Import and export use extended Serializer Component.
• Serializer converts plain data to entities and back using
normalizers.
• Oro Serialier and Normalizers have additional parameter
“context” to make normalization process more flexible.
orocrm_sales.importexport.normalizer.b2bcustomer:
parent: oro_importexport.serializer.configurable_entity_normalizer
tags:
- { name: oro_importexport.normalizer }
Import and Export git checkout tags/step-8
Presentation title here
Custom Normalizer
use OroBundleImportExportBundleSerializerNormalizerDenormalizerInterface;
use OroBundleImportExportBundleSerializerNormalizerNormalizerInterface;
use OroCRMBundleSalesBundleEntityB2bCustomer;
class B2BCustomerNormalizer implements NormalizerInterface, DenormalizerInterface
{
/**
* {@inheritdoc}
*/
public function denormalize($data, $class, $format = null, array $context = [])
{
return new B2bCustomer();
}
/**
* {@inheritdoc}
*/
public function supportsDenormalization($data, $type, $format = null, array $context = [])
{
return $type === 'OroCRMBundleSalesBundleEntityB2bCustomer';
}
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = [])
{
/** @var B2BCustomer $object */
return ['name' => $object->getName()];
}
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null, array $context = [])
{
return $data instanceof B2bCustomer;
}
}
Import and Export
Presentation title here
Custom Strategy
use OroBundleImportExportBundleStrategyStrategyInterface
use OroCRMBundleSalesBundleEntityB2bCustomer;
class B2BCustomerStrategy extends StrategyInterface
{
/**
* @param B2BCustomer $entity
*
* {@inheritdoc}
*/
public function process($entity)
{
if (!$entity->getDataChannel()) {
return null;
}
return $entity;
}
}
Import and Export git checkout tags/step-9
Presentation title here
Strategy Events
namespace OroBundleImportExportBundleEvent;
use SymfonyComponentEventDispatcherEvent;
class StrategyEvent extends Event
{
const PROCESS_BEFORE = 'oro_importexport.strategy.process_before';
const PROCESS_AFTER = 'oro_importexport.strategy.process_after';
Import and Export
Presentation title here
Batch Job and services customization
● https://github.com/akeneo/BatchBundle
● http://docs.spring.io/spring-batch/reference/html/domain.html
● https://github.com/orocrm/OroCRMMailChimpBundle/tree/master/ImportExport/Step
Batch job events
● https://github.com/akeneo/BatchBundle/blob/master/Event/EventInterface.php
Documentation
● https://github.com/orocrm/documentation/blob/master/book/importexport.rst
● https://github.
com/orocrm/documentation/blob/master/cookbook/how_to_accelerate_import.rst
● https://github.
com/orocrm/platform/blob/master/src/Oro/Bundle/ImportExportBundle/Resources/doc/i
ndex.md
Sources
● https://github.com/sergeyz/crm-b2bcustomer-import
Information
Import and Export
Presentation title here
Q/A
Import and Export

More Related Content

What's hot

Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09Michelangelo van Dam
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in AngularYadong Xie
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFMax Katz
 
Securing JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenSecuring JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenDavid Chandler
 
Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述fangjiafu
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsMax Katz
 
Application package
Application packageApplication package
Application packageJAYAARC
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the TrenchesXavier Noria
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with codekamal kotecha
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13aminmesbahi
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patternsukdpe
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Michelangelo van Dam
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)ukdpe
 

What's hot (20)

ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
 
Spring jdbc
Spring jdbcSpring jdbc
Spring jdbc
 
Securing JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenSecuring JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top Ten
 
Web注入+http漏洞等描述
Web注入+http漏洞等描述Web注入+http漏洞等描述
Web注入+http漏洞等描述
 
RichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF ApplicationsRichFaces 4: Rich Ajax Components For Your JSF Applications
RichFaces 4: Rich Ajax Components For Your JSF Applications
 
Application package
Application packageApplication package
Application package
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the Trenches
 
Dynamic binding
Dynamic bindingDynamic binding
Dynamic binding
 
Add on packages
Add on packagesAdd on packages
Add on packages
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
Java Enterprise Edition
Java Enterprise EditionJava Enterprise Edition
Java Enterprise Edition
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Alv for web
Alv for webAlv for web
Alv for web
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)
 

Similar to Import export.odp

Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationMariAnne Woehrle
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergWalaa Eldin Moustafa
 
Customizing Change Management
Customizing Change ManagementCustomizing Change Management
Customizing Change ManagementAras
 
The Steel industry, Elixir, PostgreSQL & file_fdw
The Steel industry, Elixir, PostgreSQL & file_fdwThe Steel industry, Elixir, PostgreSQL & file_fdw
The Steel industry, Elixir, PostgreSQL & file_fdwFlorian Kraft
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Morgan Tocker
 
Calem Data Extraction and Migration
Calem Data Extraction and MigrationCalem Data Extraction and Migration
Calem Data Extraction and MigrationClay Li
 
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems gamemaker762
 
Tutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online DatabaseTutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online DatabaseDBrow Adm
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Reportnyin27
 
Augustus Overview Open Source Analytics
Augustus Overview  Open Source AnalyticsAugustus Overview  Open Source Analytics
Augustus Overview Open Source Analyticsjtrussell
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauAmasty
 
Advanced Web Form Practices - Miguel A. Castro
Advanced Web Form Practices - Miguel A. CastroAdvanced Web Form Practices - Miguel A. Castro
Advanced Web Form Practices - Miguel A. CastroMohammad Tayseer
 
Database Refactoring Sreeni Ananthakrishna 2006 Nov
Database Refactoring Sreeni Ananthakrishna 2006 NovDatabase Refactoring Sreeni Ananthakrishna 2006 Nov
Database Refactoring Sreeni Ananthakrishna 2006 Novmelbournepatterns
 
A multi submission importer for easyform
A multi submission importer for easyformA multi submission importer for easyform
A multi submission importer for easyformAnnette Lewis
 
Apex and Virtual Private Database
Apex and Virtual Private DatabaseApex and Virtual Private Database
Apex and Virtual Private DatabaseJeffrey Kemp
 
Efficient Order Export: Magento Extension by Amasty. User Guide.
Efficient Order Export: Magento Extension by Amasty. User Guide.Efficient Order Export: Magento Extension by Amasty. User Guide.
Efficient Order Export: Magento Extension by Amasty. User Guide.Amasty
 

Similar to Import export.odp (20)

Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
Aug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics IntegrationAug Xml Net Forum Dynamics Integration
Aug Xml Net Forum Dynamics Integration
 
Incremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and IcebergIncremental View Maintenance with Coral, DBT, and Iceberg
Incremental View Maintenance with Coral, DBT, and Iceberg
 
Customizing Change Management
Customizing Change ManagementCustomizing Change Management
Customizing Change Management
 
The Steel industry, Elixir, PostgreSQL & file_fdw
The Steel industry, Elixir, PostgreSQL & file_fdwThe Steel industry, Elixir, PostgreSQL & file_fdw
The Steel industry, Elixir, PostgreSQL & file_fdw
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 
Calem Data Extraction and Migration
Calem Data Extraction and MigrationCalem Data Extraction and Migration
Calem Data Extraction and Migration
 
C++ super market
C++ super marketC++ super market
C++ super market
 
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems Processes in Query Optimization in (ABMS) Advanced Database Management Systems
Processes in Query Optimization in (ABMS) Advanced Database Management Systems
 
Tutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online DatabaseTutorial - Learn SQL with Live Online Database
Tutorial - Learn SQL with Live Online Database
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
Augustus Overview Open Source Analytics
Augustus Overview  Open Source AnalyticsAugustus Overview  Open Source Analytics
Augustus Overview Open Source Analytics
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir Kalashnikau
 
Advanced Web Form Practices - Miguel A. Castro
Advanced Web Form Practices - Miguel A. CastroAdvanced Web Form Practices - Miguel A. Castro
Advanced Web Form Practices - Miguel A. Castro
 
Database Refactoring Sreeni Ananthakrishna 2006 Nov
Database Refactoring Sreeni Ananthakrishna 2006 NovDatabase Refactoring Sreeni Ananthakrishna 2006 Nov
Database Refactoring Sreeni Ananthakrishna 2006 Nov
 
A multi submission importer for easyform
A multi submission importer for easyformA multi submission importer for easyform
A multi submission importer for easyform
 
Apex and Virtual Private Database
Apex and Virtual Private DatabaseApex and Virtual Private Database
Apex and Virtual Private Database
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Efficient Order Export: Magento Extension by Amasty. User Guide.
Efficient Order Export: Magento Extension by Amasty. User Guide.Efficient Order Export: Magento Extension by Amasty. User Guide.
Efficient Order Export: Magento Extension by Amasty. User Guide.
 

More from Oro Inc.

Jary Carter Presents OroCRM
Jary Carter Presents OroCRMJary Carter Presents OroCRM
Jary Carter Presents OroCRMOro Inc.
 
Best Practices For Taking Your B2B Company Online
Best Practices For Taking Your B2B Company OnlineBest Practices For Taking Your B2B Company Online
Best Practices For Taking Your B2B Company OnlineOro Inc.
 
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017Oro Inc.
 
How to Close More Deals with B2B eCommerce Systems
How to Close More Deals with B2B eCommerce SystemsHow to Close More Deals with B2B eCommerce Systems
How to Close More Deals with B2B eCommerce SystemsOro Inc.
 
Email is the digital key - dotmailer, Oro MeetUp, Paris
Email is the digital key - dotmailer, Oro MeetUp, ParisEmail is the digital key - dotmailer, Oro MeetUp, Paris
Email is the digital key - dotmailer, Oro MeetUp, ParisOro Inc.
 
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, Paris
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, ParisB2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, Paris
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, ParisOro Inc.
 
Comment April Moto met en place une relation client multicanal et augmente so...
Comment April Moto met en place une relation client multicanal et augmente so...Comment April Moto met en place une relation client multicanal et augmente so...
Comment April Moto met en place une relation client multicanal et augmente so...Oro Inc.
 
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in Paris
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in ParisRevolutionizing CRM market & B2B eCommerce - Oro MeetUp in Paris
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in ParisOro Inc.
 
Oro Meetup London - Allies: How can we really turn data into profit?
Oro Meetup London - Allies: How can we really turn data into profit?Oro Meetup London - Allies: How can we really turn data into profit?
Oro Meetup London - Allies: How can we really turn data into profit?Oro Inc.
 
Oro London Meetup - dotmailer: Faster, smarter, better, email marketing
Oro London Meetup - dotmailer: Faster, smarter, better, email marketingOro London Meetup - dotmailer: Faster, smarter, better, email marketing
Oro London Meetup - dotmailer: Faster, smarter, better, email marketingOro Inc.
 
Oro Meetup in London - Oro product vision
Oro Meetup in London - Oro product visionOro Meetup in London - Oro product vision
Oro Meetup in London - Oro product visionOro Inc.
 
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”Oro Inc.
 
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...Oro Inc.
 
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”11.10.15 Webinar: “Improving Magento performance with Blackfire.io”
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”Oro Inc.
 
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM..."New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...Oro Inc.
 
Benefits of OroCRM + Magento Webinar
Benefits of OroCRM + Magento WebinarBenefits of OroCRM + Magento Webinar
Benefits of OroCRM + Magento WebinarOro Inc.
 
Benefits of Magento + OroCRM Webinar
Benefits of Magento + OroCRM WebinarBenefits of Magento + OroCRM Webinar
Benefits of Magento + OroCRM WebinarOro Inc.
 
OroCRM Multi-Channel Webinar
OroCRM Multi-Channel WebinarOroCRM Multi-Channel Webinar
OroCRM Multi-Channel WebinarOro Inc.
 
Powerful Customer Service with OroCRM + Zendesk
Powerful Customer Service with OroCRM + ZendeskPowerful Customer Service with OroCRM + Zendesk
Powerful Customer Service with OroCRM + ZendeskOro Inc.
 
Integration with presta shop webinar
Integration with presta shop webinarIntegration with presta shop webinar
Integration with presta shop webinarOro Inc.
 

More from Oro Inc. (20)

Jary Carter Presents OroCRM
Jary Carter Presents OroCRMJary Carter Presents OroCRM
Jary Carter Presents OroCRM
 
Best Practices For Taking Your B2B Company Online
Best Practices For Taking Your B2B Company OnlineBest Practices For Taking Your B2B Company Online
Best Practices For Taking Your B2B Company Online
 
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017
Oro Revolutionizes B2B Commerce - OroMeetup NL, 2017
 
How to Close More Deals with B2B eCommerce Systems
How to Close More Deals with B2B eCommerce SystemsHow to Close More Deals with B2B eCommerce Systems
How to Close More Deals with B2B eCommerce Systems
 
Email is the digital key - dotmailer, Oro MeetUp, Paris
Email is the digital key - dotmailer, Oro MeetUp, ParisEmail is the digital key - dotmailer, Oro MeetUp, Paris
Email is the digital key - dotmailer, Oro MeetUp, Paris
 
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, Paris
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, ParisB2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, Paris
B2B, soyez prêts pour la 2ème vague e-commerce - Akeneo, Oro MeetUp, Paris
 
Comment April Moto met en place une relation client multicanal et augmente so...
Comment April Moto met en place une relation client multicanal et augmente so...Comment April Moto met en place une relation client multicanal et augmente so...
Comment April Moto met en place une relation client multicanal et augmente so...
 
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in Paris
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in ParisRevolutionizing CRM market & B2B eCommerce - Oro MeetUp in Paris
Revolutionizing CRM market & B2B eCommerce - Oro MeetUp in Paris
 
Oro Meetup London - Allies: How can we really turn data into profit?
Oro Meetup London - Allies: How can we really turn data into profit?Oro Meetup London - Allies: How can we really turn data into profit?
Oro Meetup London - Allies: How can we really turn data into profit?
 
Oro London Meetup - dotmailer: Faster, smarter, better, email marketing
Oro London Meetup - dotmailer: Faster, smarter, better, email marketingOro London Meetup - dotmailer: Faster, smarter, better, email marketing
Oro London Meetup - dotmailer: Faster, smarter, better, email marketing
 
Oro Meetup in London - Oro product vision
Oro Meetup in London - Oro product visionOro Meetup in London - Oro product vision
Oro Meetup in London - Oro product vision
 
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”
Webinar: “Create the Ultimate Customer Experience with Prestashop + OroCRM”
 
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...
11.17.15 Webinar: “Merchants: deliver an outstanding experience to your custo...
 
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”11.10.15 Webinar: “Improving Magento performance with Blackfire.io”
11.10.15 Webinar: “Improving Magento performance with Blackfire.io”
 
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM..."New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...
"New OroCRM Release Demo: Discover what’s new in the latest release of OroCRM...
 
Benefits of OroCRM + Magento Webinar
Benefits of OroCRM + Magento WebinarBenefits of OroCRM + Magento Webinar
Benefits of OroCRM + Magento Webinar
 
Benefits of Magento + OroCRM Webinar
Benefits of Magento + OroCRM WebinarBenefits of Magento + OroCRM Webinar
Benefits of Magento + OroCRM Webinar
 
OroCRM Multi-Channel Webinar
OroCRM Multi-Channel WebinarOroCRM Multi-Channel Webinar
OroCRM Multi-Channel Webinar
 
Powerful Customer Service with OroCRM + Zendesk
Powerful Customer Service with OroCRM + ZendeskPowerful Customer Service with OroCRM + Zendesk
Powerful Customer Service with OroCRM + Zendesk
 
Integration with presta shop webinar
Integration with presta shop webinarIntegration with presta shop webinar
Integration with presta shop webinar
 

Import export.odp

  • 1. Presentation title here Integrate your data into OroCRM CSV Import and Export Sergey Zhuravel https://github.com/sergeyz https://twitter.com/sergey_zv
  • 2. Presentation title here Outline 1. Import and export - process overview a. Jobs overview b. Import schema c. Export schema 2. Basic B2B Customer import and export a. Fields configuration b. Data converter c. Import/export Strategy d. Strategy events e. Import and validation processors f. Button configuraion reference g. Export processor h. Export template processor 3. Import and export customization a. Data Converter with tags support b. Tags Normalizer c. Strategy with tags support
  • 3. Presentation title here Jobs overview Job Step Step Step Step
  • 4. Presentation title here Import Process Schema Step Reader Processor Writer DataConverter Serializer Strategy Import and Export
  • 5. Presentation title here Export Process Schema Step Reader Processor Writer DataConverterSerializer Import and Export
  • 6. Presentation title here Basic B2B Customer import and export • Configurable entity import and export process is managed by EntityConfigBundle. Field configuration is avalialable in “importexport” configuration scope. • Minimum import/export configuration should 4 defined services (DataConverter, Strategy, Import/ImportValidation and Export Processors). • In addition, it is possible to define processor to export file template for data import Import and Export
  • 7. Presentation title here Fields configuration header – csv column header configuration, default values is field label (if other are not defined) /** * @ConfigField( * defaultValues={ * "importexport"={ * "header"="B2BCustomer name" * } * } * ) */ protected $name; Import and Export
  • 8. Presentation title here Fields configuration identity – field is used to search entity by import strategy /** * @ConfigField( * defaultValues={ * "importexport"={ * "identity"=true * } * } * ) */ protected $name; Import and Export
  • 9. Presentation title here Fields configuration order – manages column order /** * @ConfigField( * defaultValues={ * "importexport"={ * "order"=10 * } * } * ) */ protected $name; Import and Export
  • 10. Presentation title here Fields configuration excluded – allows to exclude field from export and import process /** * @ConfigField( * defaultValues={ * "importexport"={ * "excluded"=true * } * } * ) */ protected $name; Import and Export
  • 11. Presentation title here Fields configuration full – used to manage related entities export and import. •true - export and import related entity fields •false – export and import related entity identity fields only /** * @ConfigField( * defaultValues={ * "importexport"={ * "full"=true * } * } * ) */ protected $name; Import and Export
  • 12. Presentation title here Fields configuration Import and Export
  • 13. Presentation title here Data Converter • Data converter is responsible for headers mapping and converting imported data to nested representation of entity and its relations. • Use customized or ConfigurableTableDataConverter orocrm_sales.importexport.data_converter.b2bcustomer: parent: oro_importexport.data_converter.configurable Import and Export git checkout tags/step-1
  • 14. Presentation title here Strategy • Strategy responsible for processing import logic. • Use customized or ConfigurableTableDataConverter orocrm_sales.importexport.strategy.b2bcustomer.add_or_replace: parent: oro_importexport.strategy.configurable_add_or_replace Import and Export git checkout tags/step-2
  • 15. Presentation title here orocrm_sales.importexport.processor.import.b2bcustomer: parent: oro_importexport.processor.import_abstract calls: - [setDataConverter, [@orocrm_sales.importexport.data_converter.b2bcustomer]] - [setStrategy, [@orocrm_sales.importexport.strategy.b2bcustomer.add_or_replace]] tags: - { name: oro_importexport.processor, type: import, entity: %orocrm_sales.b2bcustomer.entity.class%, alias: orocrm_sales_b2bcustomer } - { name: oro_importexport.processor, type: import_validation, entity: %orocrm_sales.b2bcustomer.entity. class%, alias: orocrm_sales_b2bcustomer } Import and validation processors definition example Import and Export
  • 16. Presentation title here Button configuration reference {% include 'OroImportExportBundle:ImportExport:buttons.html.twig' with { entity_class: entity_class, exportProcessor: 'orocrm_sales_b2bcustomer', exportTemplateProcessor: 'orocrm_sales_b2bcustomer', importProcessor: 'orocrm_sales_b2bcustomer', dataGridName: gridName, importTitle: 'orocrm.sales.b2bcustomer.import'|trans } %} return [ 'entity_class' => $this->container->getParameter('orocrm_sales.b2bcustomer.entity.class') ]; Import and Export git checkout tags/step-4
  • 17. Presentation title here Export processor Export processor denormalizes objects and converts plain data using DataConverter orocrm_sales.importexport.processor.export.b2bcustomer: parent: oro_importexport.processor.export_abstract calls: - [setDataConverter, [@orocrm_sales.importexport.data_converter.b2bcustomer]] tags: - { name: oro_importexport.processor, type: export, entity: %orocrm_sales.b2bcustomer.entity.class%, alias: orocrm_sales_b2bcustomer } Import and Export git checkout tags/step-5
  • 18. Presentation title here Export template processor Use registered fixture to export an example file. parameters: orocrm_sales.importexport.template_fixture.b2bcustomer.class: OroCRMBundleSalesBundleImportExportTemplateFixtureB2bCustomerFixture services: orocrm_sales.importexport.template_fixture.b2bcustomer: class: %orocrm_sales.importexport.template_fixture.b2bcustomer.class% tags: - { name: oro_importexport.template_fixture } orocrm_sales.importexport.template_fixture.data_converter.b2bcustomer: parent: oro_importexport.data_converter.template_fixture.configurable orocrm_sales.importexport.processor.export_template.b2bcustomer: parent: oro_importexport.processor.export_abstract calls: - [setDataConverter, [@orocrm_sales.importexport.template_fixture.data_converter.b2bcustomer]] tags: - { name: oro_importexport.processor, type: export_template, entity: %orocrm_sales.b2bcustomer. entity.class%, alias: orocrm_sales_b2bcustomer } Import and Export git checkout tags/step-6
  • 19. Presentation title here Import and export customization Import and Export Three steps are required for adding tags to import and exprort: 1. Create DataConverter with tags to Tags List header conversion rule and two methods to convert tag names list 2. Add Normalizer to load tags by their names 3. Add Strategy to save taggins
  • 20. Presentation title here Custom Data Converter use OroBundleImportExportBundleConverterAbstractTableDataConverter; class B2BCustomerDataConverter extends AbstractTableDataConverter { /** * {@inheritdoc} */ protected function getHeaderConversionRules() { return [ 'ID' => 'id', 'Name' => 'name', 'Channel' => 'channel:name', ]; } /** * {@inheritdoc} */ protected function getBackendHeader() { return ['id', 'name', 'channel']; } } Import and Export git checkout tags/step-7
  • 21. Presentation title here Normalizers • Import and export use extended Serializer Component. • Serializer converts plain data to entities and back using normalizers. • Oro Serialier and Normalizers have additional parameter “context” to make normalization process more flexible. orocrm_sales.importexport.normalizer.b2bcustomer: parent: oro_importexport.serializer.configurable_entity_normalizer tags: - { name: oro_importexport.normalizer } Import and Export git checkout tags/step-8
  • 22. Presentation title here Custom Normalizer use OroBundleImportExportBundleSerializerNormalizerDenormalizerInterface; use OroBundleImportExportBundleSerializerNormalizerNormalizerInterface; use OroCRMBundleSalesBundleEntityB2bCustomer; class B2BCustomerNormalizer implements NormalizerInterface, DenormalizerInterface { /** * {@inheritdoc} */ public function denormalize($data, $class, $format = null, array $context = []) { return new B2bCustomer(); } /** * {@inheritdoc} */ public function supportsDenormalization($data, $type, $format = null, array $context = []) { return $type === 'OroCRMBundleSalesBundleEntityB2bCustomer'; } /** * {@inheritdoc} */ public function normalize($object, $format = null, array $context = []) { /** @var B2BCustomer $object */ return ['name' => $object->getName()]; } /** * {@inheritdoc} */ public function supportsNormalization($data, $format = null, array $context = []) { return $data instanceof B2bCustomer; } } Import and Export
  • 23. Presentation title here Custom Strategy use OroBundleImportExportBundleStrategyStrategyInterface use OroCRMBundleSalesBundleEntityB2bCustomer; class B2BCustomerStrategy extends StrategyInterface { /** * @param B2BCustomer $entity * * {@inheritdoc} */ public function process($entity) { if (!$entity->getDataChannel()) { return null; } return $entity; } } Import and Export git checkout tags/step-9
  • 24. Presentation title here Strategy Events namespace OroBundleImportExportBundleEvent; use SymfonyComponentEventDispatcherEvent; class StrategyEvent extends Event { const PROCESS_BEFORE = 'oro_importexport.strategy.process_before'; const PROCESS_AFTER = 'oro_importexport.strategy.process_after'; Import and Export
  • 25. Presentation title here Batch Job and services customization ● https://github.com/akeneo/BatchBundle ● http://docs.spring.io/spring-batch/reference/html/domain.html ● https://github.com/orocrm/OroCRMMailChimpBundle/tree/master/ImportExport/Step Batch job events ● https://github.com/akeneo/BatchBundle/blob/master/Event/EventInterface.php Documentation ● https://github.com/orocrm/documentation/blob/master/book/importexport.rst ● https://github. com/orocrm/documentation/blob/master/cookbook/how_to_accelerate_import.rst ● https://github. com/orocrm/platform/blob/master/src/Oro/Bundle/ImportExportBundle/Resources/doc/i ndex.md Sources ● https://github.com/sergeyz/crm-b2bcustomer-import Information Import and Export