SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Migrating from TYPO3 CMS 
to TYPO3 Flow 
10th International TYPO3 Conference, October 9th, Berlin 
CC BY Serge Melki 
https://www.flickr.com/photos/sergemelki/8156340258 
Martin Helmich 
m.helmich@mittwald.de
CC BY-SA Niteshift 
http://commons.wikimedia.org/wiki/File:Balow_Kuhweide_2008-04-28_121.jpg
TYPO3 
Flow 
TYPO3 
Neos 
? 
TYPO3 
CMS
why!? 
CC BY Morgan 
https://www.flickr.com/photos/meddygarnet/3528509573
CC BY Crisada 
https://www.flickr.com/photos/chrisada/2415541623
CC BY Pascal 
https://www.flickr.com/photos/pasukaru76/6310053615
CC BY-SA Malene Thyssen 
http://commons.wikimedia.org/wiki/File:Brown_bear_(Ursus_arctos_arctos)_running.jpg
CC BY Emma Bishop 
https://www.flickr.com/photos/emmabishop/6360703145
Extensions 
Typoscript 
Content
Migrating content 
Read 
https://speakerdeck.com/kdambekalns/migrating-from-typo3-cms-to-typo3-neos
Migrating typoscript 
just don‘t
although... 
page 
= 
PAGE 
page 
{ 
10 
= 
TEMPLATE 
10 
{ 
template 
= 
FILE 
template.file 
= 
fileadmin/site.html 
marks 
{ 
CONTENT 
< 
styles.content.get 
CONTENT_RIGHT 
< 
styles.content.getRight 
} 
} 
} 
page 
= 
TYPO3.Neos:Page 
{ 
body 
{ 
templatePath 
= 
'resource://My.Site/.../Site.html' 
content 
{ 
main 
= 
PrimaryContent 
{ 
nodePath 
= 
'main' 
} 
right 
= 
ContentCollection 
{ 
nodePath 
= 
'right' 
} 
}
Render 
TS2 
Parse 
TS 
Apply 
trans-formations
How to convert an 
Extbase 
extension to 
TYPO3 FLOW
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
? 
Classes/ 
Controller/ 
Domain/ 
… 
Configuration/ 
TypoScript/ 
TCA/ 
Resources/ 
Public/ 
Private/ 
ext_emconf.php 
ext_tables.php 
ext_tables.sql 
Classes/ 
Controller/ 
Domain/ 
… 
Configuration/ 
Migrations/ 
Mysql/ 
Resources/ 
Public/ 
Private/ 
composer.json
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
class 
Tx_MyExt_Domain_Model_Car 
extends 
Tx_Extbase_DomainObject_AbstractEntity 
{ 
/** 
* 
@var 
string 
* 
@validate 
notempty 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Tx_MyExt_Domain_Model_Manufacturer 
*/ 
protected 
$manufacturer; 
} 
namespace 
MyExtDomainModel; 
use 
TYPO3FlowAnnotations 
as 
Flow; 
use 
DoctrineORMMapping 
as 
ORM; 
/** 
* 
@FlowEntity 
*/ 
class 
Car 
{ 
/** 
* 
@var 
string 
* 
@FlowValidate('NotEmpty') 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Manufacturer 
* 
@ORMManyToOne 
*/ 
protected 
$manufacturer; 
}
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
class 
Tx_MyExt_Domain_Model_Car 
extends 
Tx_Extbase_DomainObject_AbstractEntity 
{ 
/** 
* 
@var 
string 
* 
@validate 
notempty 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Tx_MyExt_Domain_Model_Manufacturer 
*/ 
protected 
$manufacturer; 
} 
namespace 
MyExtDomainModel; 
use 
TYPO3FlowAnnotations 
as 
Flow; 
use 
DoctrineORMMapping 
as 
ORM; 
/** 
* 
@FlowEntity 
*/ 
class 
Car 
{ 
/** 
* 
@var 
string 
* 
@FlowValidate('NotEmpty') 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Manufacturer 
* 
@ORMManyToOne 
*/ 
protected 
$manufacturer; 
} 
Namespacify classes 
when necessary
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
class 
Tx_MyExt_Domain_Model_Car 
extends 
Tx_Extbase_DomainObject_AbstractEntity 
{ 
/** 
* 
@var 
string 
* 
@validate 
notempty 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Tx_MyExt_Domain_Model_Manufacturer 
*/ 
protected 
$manufacturer; 
} 
namespace 
MyExtDomainModel; 
use 
TYPO3FlowAnnotations 
as 
Flow; 
use 
DoctrineORMMapping 
as 
ORM; 
/** 
* 
@FlowEntity 
*/ 
class 
Car 
{ 
/** 
* 
@var 
string 
* 
@FlowValidate('NotEmpty') 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Manufacturer 
* 
@ORMManyToOne 
*/ 
protected 
$manufacturer; 
} 
Determine domain object type 
by class inheritance and add 
annotation
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
class 
Tx_MyExt_Domain_Model_Car 
extends 
Tx_Extbase_DomainObject_AbstractEntity 
{ 
/** 
* 
@var 
string 
* 
@validate 
notempty 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Tx_MyExt_Domain_Model_Manufacturer 
*/ 
protected 
$manufacturer; 
} 
namespace 
MyExtDomainModel; 
use 
TYPO3FlowAnnotations 
as 
Flow; 
use 
Convert DoctrineORMannotations. 
Mapping 
as 
ORM; 
/** 
* 
@FlowEntity 
*/ 
class 
Car 
{ 
/** 
* 
@var 
string 
* 
@FlowValidate('NotEmpty') 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Manufacturer 
* 
@ORMManyToOne 
*/ 
protected 
$manufacturer; 
}
TYPO3 CMS 
(Extbase) 
TYPO3 Flow 
class 
Tx_MyExt_Domain_Model_Car 
extends 
Tx_Extbase_DomainObject_AbstractEntity 
{ 
/** 
* 
@var 
string 
* 
@validate 
notempty 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Tx_MyExt_Domain_Model_Manufacturer 
*/ 
protected 
$manufacturer; 
} 
namespace 
MyExtDomainModel; 
use 
TYPO3FlowAnnotations 
as 
Flow; 
use 
DoctrineORMMapping 
as 
ORM; 
/** 
* 
@FlowEntity 
*/ 
class 
Car 
{ 
/** 
Determine association 
cardinality from TCA 
* 
@var 
string 
* 
@FlowValidate('NotEmpty') 
*/ 
protected 
$licenseNumber; 
/** 
* 
@var 
Manufacturer 
* 
@ORMManyToOne 
*/ 
protected 
$manufacturer; 
}
some other stuff to think about 
Convert locallang 
to XLIFF 
create doctrine 
migrations 
from ext_tables.sql 
domain models 
extending TYPO3 classes 
usage of TYPO3 APIs 
(aka. the infamous t3lib_div) 
different value object 
handling
How to convert an 
pibase 
extension to 
TYPO3 FLOW
TYPO3 CMS 
(pibase) 
TYPO3 Flow 
lib/ 
pi1/ 
class.tx_myext_pi1.php 
static/ 
res/ 
ext_emconf.php 
ext_tables.php 
ext_tables.sql 
Classes/ 
Controller/ 
Domain/ 
Plugin/ 
… 
Configuration/ 
Migrations/ 
Mysql/ 
Resources/ 
Public/ 
Private/ 
composer.json 
?
class 
tx_myext_pi1 
extends 
tslib_pibase 
{ 
public 
function 
main($conf, 
$content) 
{ 
$mainTemplate 
= 
$this-­‐>cObj-­‐>fileResource(...); 
$rowTemplate 
= 
$this-­‐>cObj-­‐>fileResource(...); 
$userRes 
= 
$GLOBALS['TYPO3_DB']-­‐>exec_SELECTquery( 
'*', 
'tx_myext_users', 
'deleted=0 
AND 
active=1' 
); 
while($user 
= 
$GLOBALS['TYPO3_DB']-­‐>sql_fetch_assoc($userRes)) 
{ 
$markers 
= 
[ 
"###NAME###" 
=> 
$user['name'], 
"###EMAIL###" 
=> 
$user['email'] 
]; 
$content 
.= 
$this-­‐>cObj-­‐>substituteMarkerArray( 
$rowTemplate, 
$markers 
); 
} 
$markers 
= 
['###USERS###' 
=> 
$content]; 
return 
$this-­‐>cObj-­‐>substituteMarkerArray($mainTemplate, 
$markers); 
} 
}
The world of pain 
Doctrine 2 ORM 
Doctrine 2 DBAL 
(old code) 
Flow 
Resource 
Mgmt. 
Flow 
MVC 
Stack 
Pain abstraction layer
namespace 
MyExtPlugin; 
class 
UserListPlugin 
extends 
MwT3CompatPluginBasePlugin 
{ 
public 
function 
main($conf, 
$content) 
{ 
$mainTemplate 
= 
$this-­‐>cObj-­‐>fileResource(...); 
$rowTemplate 
= 
$this-­‐>cObj-­‐>fileResource(...); 
$userRes 
= 
$this-­‐>database-­‐>exec_SELECTquery( 
'*', 
'tx_myext_users', 
'deleted=0 
AND 
active=1' 
); 
while($user 
= 
$this-­‐>database-­‐>sql_fetch_assoc($userRes)) 
{ 
$markers 
= 
[ 
"###NAME###" 
=> 
$user['name'], 
"###EMAIL###" 
=> 
$user['email'] 
]; 
$content 
.= 
$this-­‐>cObj-­‐>substituteMarkerArray( 
$rowTemplate, 
$markers 
); 
} 
$markers 
= 
['###USERS###' 
=> 
$content]; 
return 
$this-­‐>cObj-­‐>substituteMarkerArray($mainTemplate, 
$markers); 
} 
}
demo time 
CC BY Kenny Louie 
https://www.flickr.com/photos/kwl/4743024076
try it 
https://github.com/mittwald/flow-metamorph
This work is licensed under a Creative 
Commons Attribution-ShareAlike 4.0 
International License. 
http://creativecommons.org/licenses/by-sa/4.0/

Weitere ähnliche Inhalte

Was ist angesagt?

Symfony2: Get your project started
Symfony2: Get your project startedSymfony2: Get your project started
Symfony2: Get your project started
Ryan Weaver
 

Was ist angesagt? (16)

TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coreTYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
 
DIWE - File handling with PHP
DIWE - File handling with PHPDIWE - File handling with PHP
DIWE - File handling with PHP
 
Builder and BuildKit
Builder and BuildKitBuilder and BuildKit
Builder and BuildKit
 
Creating a phar
Creating a pharCreating a phar
Creating a phar
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Migrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifierMigrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifier
 
Symfony2: Get your project started
Symfony2: Get your project startedSymfony2: Get your project started
Symfony2: Get your project started
 
Learning Git with Workflows
Learning Git with WorkflowsLearning Git with Workflows
Learning Git with Workflows
 
Work shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemWork shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystem
 
Building robust and friendly command line applications in go
Building robust and friendly command line applications in goBuilding robust and friendly command line applications in go
Building robust and friendly command line applications in go
 
Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007
 
TYPO3 Scheduler
TYPO3 SchedulerTYPO3 Scheduler
TYPO3 Scheduler
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
Learning Python from Data
Learning Python from DataLearning Python from Data
Learning Python from Data
 
Advanced debugging  techniques in different environments
Advanced debugging  techniques in different environmentsAdvanced debugging  techniques in different environments
Advanced debugging  techniques in different environments
 
Php logging
Php loggingPhp logging
Php logging
 

Andere mochten auch

TYPO3 Flow - PHP Framework for Developer Happiness
TYPO3 Flow - PHP Framework for Developer HappinessTYPO3 Flow - PHP Framework for Developer Happiness
TYPO3 Flow - PHP Framework for Developer Happiness
Christian Müller
 

Andere mochten auch (12)

TYPO3 Flow 2.0 (International PHP Conference 2013)
TYPO3 Flow 2.0 (International PHP Conference 2013)TYPO3 Flow 2.0 (International PHP Conference 2013)
TYPO3 Flow 2.0 (International PHP Conference 2013)
 
TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013
 
TYPO3 Flow a solid foundation for medialib.tv
TYPO3 Flow a solid foundation for medialib.tvTYPO3 Flow a solid foundation for medialib.tv
TYPO3 Flow a solid foundation for medialib.tv
 
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
 
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
 
T3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surfT3CON12 Flow and TYPO3 deployment with surf
T3CON12 Flow and TYPO3 deployment with surf
 
TYPO3 5.0 Experience Concept
TYPO3 5.0 Experience ConceptTYPO3 5.0 Experience Concept
TYPO3 5.0 Experience Concept
 
TYPO3 Flow - PHP Framework for Developer Happiness
TYPO3 Flow - PHP Framework for Developer HappinessTYPO3 Flow - PHP Framework for Developer Happiness
TYPO3 Flow - PHP Framework for Developer Happiness
 
Testing TYPO3 Flow Applications with Behat
Testing TYPO3 Flow Applications with BehatTesting TYPO3 Flow Applications with Behat
Testing TYPO3 Flow Applications with Behat
 
TYPO3 Neos - past, present and future (T3CON14EU)
TYPO3 Neos - past, present and future (T3CON14EU)TYPO3 Neos - past, present and future (T3CON14EU)
TYPO3 Neos - past, present and future (T3CON14EU)
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 

Ähnlich wie T3CON14EU: Migrating from TYPO3 CMS to TYPO3 Flow

Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
 
#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template
Hadziq Fabroyir
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxom
Ted Leung
 

Ähnlich wie T3CON14EU: Migrating from TYPO3 CMS to TYPO3 Flow (20)

IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)
 
Doctrine in FLOW3
Doctrine in FLOW3Doctrine in FLOW3
Doctrine in FLOW3
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)
 
#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template
 
H2O 3 REST API Overview
H2O 3 REST API OverviewH2O 3 REST API Overview
H2O 3 REST API Overview
 
H2O 3 REST API Overview
H2O 3 REST API OverviewH2O 3 REST API Overview
H2O 3 REST API Overview
 
TYPO3 6.2 for extension developer
TYPO3 6.2 for extension developerTYPO3 6.2 for extension developer
TYPO3 6.2 for extension developer
 
Swift Cloud Workshop - Swift Microservices
Swift Cloud Workshop - Swift MicroservicesSwift Cloud Workshop - Swift Microservices
Swift Cloud Workshop - Swift Microservices
 
Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)
 
The Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 SitepackagesThe Anatomy of TYPO3 Sitepackages
The Anatomy of TYPO3 Sitepackages
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
 
How to connect redis and mule esb using spring data redis module
How to connect redis and mule esb using spring data redis moduleHow to connect redis and mule esb using spring data redis module
How to connect redis and mule esb using spring data redis module
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxom
 

Kürzlich hochgeladen

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

T3CON14EU: Migrating from TYPO3 CMS to TYPO3 Flow

  • 1. Migrating from TYPO3 CMS to TYPO3 Flow 10th International TYPO3 Conference, October 9th, Berlin CC BY Serge Melki https://www.flickr.com/photos/sergemelki/8156340258 Martin Helmich m.helmich@mittwald.de
  • 2.
  • 3.
  • 4. CC BY-SA Niteshift http://commons.wikimedia.org/wiki/File:Balow_Kuhweide_2008-04-28_121.jpg
  • 5. TYPO3 Flow TYPO3 Neos ? TYPO3 CMS
  • 6. why!? CC BY Morgan https://www.flickr.com/photos/meddygarnet/3528509573
  • 7. CC BY Crisada https://www.flickr.com/photos/chrisada/2415541623
  • 8. CC BY Pascal https://www.flickr.com/photos/pasukaru76/6310053615
  • 9. CC BY-SA Malene Thyssen http://commons.wikimedia.org/wiki/File:Brown_bear_(Ursus_arctos_arctos)_running.jpg
  • 10. CC BY Emma Bishop https://www.flickr.com/photos/emmabishop/6360703145
  • 12. Migrating content Read https://speakerdeck.com/kdambekalns/migrating-from-typo3-cms-to-typo3-neos
  • 14. although... page = PAGE page { 10 = TEMPLATE 10 { template = FILE template.file = fileadmin/site.html marks { CONTENT < styles.content.get CONTENT_RIGHT < styles.content.getRight } } } page = TYPO3.Neos:Page { body { templatePath = 'resource://My.Site/.../Site.html' content { main = PrimaryContent { nodePath = 'main' } right = ContentCollection { nodePath = 'right' } }
  • 15. Render TS2 Parse TS Apply trans-formations
  • 16. How to convert an Extbase extension to TYPO3 FLOW
  • 17. TYPO3 CMS (Extbase) TYPO3 Flow ? Classes/ Controller/ Domain/ … Configuration/ TypoScript/ TCA/ Resources/ Public/ Private/ ext_emconf.php ext_tables.php ext_tables.sql Classes/ Controller/ Domain/ … Configuration/ Migrations/ Mysql/ Resources/ Public/ Private/ composer.json
  • 18. TYPO3 CMS (Extbase) TYPO3 Flow class Tx_MyExt_Domain_Model_Car extends Tx_Extbase_DomainObject_AbstractEntity { /** * @var string * @validate notempty */ protected $licenseNumber; /** * @var Tx_MyExt_Domain_Model_Manufacturer */ protected $manufacturer; } namespace MyExtDomainModel; use TYPO3FlowAnnotations as Flow; use DoctrineORMMapping as ORM; /** * @FlowEntity */ class Car { /** * @var string * @FlowValidate('NotEmpty') */ protected $licenseNumber; /** * @var Manufacturer * @ORMManyToOne */ protected $manufacturer; }
  • 19. TYPO3 CMS (Extbase) TYPO3 Flow class Tx_MyExt_Domain_Model_Car extends Tx_Extbase_DomainObject_AbstractEntity { /** * @var string * @validate notempty */ protected $licenseNumber; /** * @var Tx_MyExt_Domain_Model_Manufacturer */ protected $manufacturer; } namespace MyExtDomainModel; use TYPO3FlowAnnotations as Flow; use DoctrineORMMapping as ORM; /** * @FlowEntity */ class Car { /** * @var string * @FlowValidate('NotEmpty') */ protected $licenseNumber; /** * @var Manufacturer * @ORMManyToOne */ protected $manufacturer; } Namespacify classes when necessary
  • 20. TYPO3 CMS (Extbase) TYPO3 Flow class Tx_MyExt_Domain_Model_Car extends Tx_Extbase_DomainObject_AbstractEntity { /** * @var string * @validate notempty */ protected $licenseNumber; /** * @var Tx_MyExt_Domain_Model_Manufacturer */ protected $manufacturer; } namespace MyExtDomainModel; use TYPO3FlowAnnotations as Flow; use DoctrineORMMapping as ORM; /** * @FlowEntity */ class Car { /** * @var string * @FlowValidate('NotEmpty') */ protected $licenseNumber; /** * @var Manufacturer * @ORMManyToOne */ protected $manufacturer; } Determine domain object type by class inheritance and add annotation
  • 21. TYPO3 CMS (Extbase) TYPO3 Flow class Tx_MyExt_Domain_Model_Car extends Tx_Extbase_DomainObject_AbstractEntity { /** * @var string * @validate notempty */ protected $licenseNumber; /** * @var Tx_MyExt_Domain_Model_Manufacturer */ protected $manufacturer; } namespace MyExtDomainModel; use TYPO3FlowAnnotations as Flow; use Convert DoctrineORMannotations. Mapping as ORM; /** * @FlowEntity */ class Car { /** * @var string * @FlowValidate('NotEmpty') */ protected $licenseNumber; /** * @var Manufacturer * @ORMManyToOne */ protected $manufacturer; }
  • 22. TYPO3 CMS (Extbase) TYPO3 Flow class Tx_MyExt_Domain_Model_Car extends Tx_Extbase_DomainObject_AbstractEntity { /** * @var string * @validate notempty */ protected $licenseNumber; /** * @var Tx_MyExt_Domain_Model_Manufacturer */ protected $manufacturer; } namespace MyExtDomainModel; use TYPO3FlowAnnotations as Flow; use DoctrineORMMapping as ORM; /** * @FlowEntity */ class Car { /** Determine association cardinality from TCA * @var string * @FlowValidate('NotEmpty') */ protected $licenseNumber; /** * @var Manufacturer * @ORMManyToOne */ protected $manufacturer; }
  • 23. some other stuff to think about Convert locallang to XLIFF create doctrine migrations from ext_tables.sql domain models extending TYPO3 classes usage of TYPO3 APIs (aka. the infamous t3lib_div) different value object handling
  • 24. How to convert an pibase extension to TYPO3 FLOW
  • 25. TYPO3 CMS (pibase) TYPO3 Flow lib/ pi1/ class.tx_myext_pi1.php static/ res/ ext_emconf.php ext_tables.php ext_tables.sql Classes/ Controller/ Domain/ Plugin/ … Configuration/ Migrations/ Mysql/ Resources/ Public/ Private/ composer.json ?
  • 26. class tx_myext_pi1 extends tslib_pibase { public function main($conf, $content) { $mainTemplate = $this-­‐>cObj-­‐>fileResource(...); $rowTemplate = $this-­‐>cObj-­‐>fileResource(...); $userRes = $GLOBALS['TYPO3_DB']-­‐>exec_SELECTquery( '*', 'tx_myext_users', 'deleted=0 AND active=1' ); while($user = $GLOBALS['TYPO3_DB']-­‐>sql_fetch_assoc($userRes)) { $markers = [ "###NAME###" => $user['name'], "###EMAIL###" => $user['email'] ]; $content .= $this-­‐>cObj-­‐>substituteMarkerArray( $rowTemplate, $markers ); } $markers = ['###USERS###' => $content]; return $this-­‐>cObj-­‐>substituteMarkerArray($mainTemplate, $markers); } }
  • 27. The world of pain Doctrine 2 ORM Doctrine 2 DBAL (old code) Flow Resource Mgmt. Flow MVC Stack Pain abstraction layer
  • 28. namespace MyExtPlugin; class UserListPlugin extends MwT3CompatPluginBasePlugin { public function main($conf, $content) { $mainTemplate = $this-­‐>cObj-­‐>fileResource(...); $rowTemplate = $this-­‐>cObj-­‐>fileResource(...); $userRes = $this-­‐>database-­‐>exec_SELECTquery( '*', 'tx_myext_users', 'deleted=0 AND active=1' ); while($user = $this-­‐>database-­‐>sql_fetch_assoc($userRes)) { $markers = [ "###NAME###" => $user['name'], "###EMAIL###" => $user['email'] ]; $content .= $this-­‐>cObj-­‐>substituteMarkerArray( $rowTemplate, $markers ); } $markers = ['###USERS###' => $content]; return $this-­‐>cObj-­‐>substituteMarkerArray($mainTemplate, $markers); } }
  • 29.
  • 30. demo time CC BY Kenny Louie https://www.flickr.com/photos/kwl/4743024076
  • 32.
  • 33. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-sa/4.0/