SlideShare a Scribd company logo
1 of 32
Download to read offline
Welcome
What's this about?
• The Berlin Manifesto constitutes that the transition from v4v6 to Phoenix will be easily possible

• Content Transition is a big part of that

• Last year a GSoC project was initiated for working on that problem

• Therefore: This is for presenting first solutions and inviting some man-power
Warmup Questionnaire
• Who of you proably wants to use Phoenix in future?

• Who wants a nice way of reusing her existing content in Phoenix?

• Who knows XSLT?

• Who has development experience with XSLT

• Who thinks i should stop bugging you with silly questions?
Overview
About me
The Project
 • Lessen the Gap from v4 v6 to Phoenix

 • The initial idea

 • Google Summer of Code 2011

 • Problems & Solutions

Current Status
 • A prototypical v4 v6 Extension being able to export contents of pages and tt_content
Shameless self-plug
• Nicolas Forgerit

• Student/Freelancer from Karlsruhe

• Love sports & coffee

• Crawl the web for information way too much of my time

                github.com/crusoe

                nicolas.forgerit@gmail.com

                @forgerit


• My mentor: Christian Müller

• Core Dev TYPO3/Freelancer from Bonn

• Owner of kitsunet.de
The Project
Lessen the Gap from v4 v6 to Phoenix
 • Content Transition

 • Export contents of a v4 v6 instance and import to Phoenix

 • Use existing interfaces

 • Make it flexible and configurable
What again was this GSoC stuff?
 • fellowship given out by Google to provide Open Source projects

 • TYPO3 had been a sub-project 4 years in a row until 2011

 • Unfortunately, TYPO3 hasn't been accepted for 2012 :( (Drupal was, WP not)
The initial idea
 • use the well-known SYSEXT:impexp for generating XML data

 • make exported data Phoenix-ready

 • use XSLT to transform the exported data

 • provide generated data as Phoenix packet and/or webservice
Problems & Solutions
 • PHPs XSLTProcessor is rather old -> fill missing gaps with PHP+Regex

 • Phoenix CTypes were not ready until about 3 weeks ago -> make CTypes configurable as
   "Snippets"

 • XSLTProcessor's debug output is rather "un-verbose" -> no solution yet :( (use Saxon for XSLT
   development)

 • ...
Current Status
TYPO3 Transition Tool
• A prototypical v4 v6 Extension

• Do the (common) work in just a few clicks

• Make it extendable (via XSLT & PHP)

• Try to make the code looking clean
The Transition Steps
 • Step 1: Preparing the data

     ◦ Set Output Filename

     ◦ Select to-be-exported Database Tables

     ◦ Set Initial Page-Subtree Node (usually pid 0 for getting the whole Pagetree)

 • Step 2: Transform the data

     ◦ Provide v4 v6 => Phoenix Content Type configuration

     ◦ Select to-be-used PHP-Hooks

 • Step 3: Export the data

     ◦ Download Sites.xml

     ◦ Download packet

     ◦ Publish generated Data as Webservice
General Transformation Procedure
• have a base stylsheet which does the general procedure

• fetch all the user-chosen snippets and copy them into the base

• execute defined "pre-transformation" PHP-Hooks on the data

• run the XSLT Processor

• execute defined "post-transformation" PHP-Hooks on the xslt-processed data
Code!
view it on T3 Forge or Github.
Base XSLT Stylesheet
 • kind of a "base" stylesheet containing several markers

 • applies the general rules

 • holds several markers which are to be replaced by the right snippets/contents
Code!
view it on T3 Forge or Github.
Content Types XSLT Snippets
• non-valid XSLT scripts (slices of them)

• work just in context of T3TT

• modular and independent from each other

• automagically fetched and traversed by the XSLT Processor
Code!
view it on T3 Forge or Github.
PHP Hooks
• filling gaps of XSLT v1

• kinda "meta-language" for XSLT

• can be easily added to a PHP file

• T3TT splits the to-be-altered Datafile into lines

• ... which can be changed e.g. via PCRE
PHP Hooks (pt. 2)
 • needed before as well as after the XSLT transformation

 • provide a way to do some quick'n'dirty adjustments

Some example hooks

killIndexColons (pre)

1   <!-- transform -->
2   <tablerow index="tt_content:1" type="array">
3   <!-- to -->
4   <tablerow index="tt_content" id="1" type="array">

since XSLT v1 cannot "regex" attribute values. (v2 can!)
PHP Hooks (pt. 3)
unescapeHtmlSpecialCharsOfFlexformValues (pre)

make Flexform transformations XSLT applicable (i.e. undo HSC) (currently not working :[ )

 1   <!-- transform -->
 2   &lt;T3FlexForms&gt;
 3       &lt;data&gt;
 4           &lt;sheet index=&quot;sDEF&quot;&gt;
 5               ...
 6   <!-- to -->
 7   <T3FlexForms>
 8       <data>
 9           <sheet index="sDEF">
10               ...

normalizeNodeNames (post)

check that nodeName="{value}" contains Phoenix-compatible characters

!
assert   that nodeName-value
     -   is not empty
     -   matches ([-_a-zA-Z0-9])
     -   contains no whitespaces
     -   ...
Code!
view it on T3 Forge or Github.
XSLT Intro
• Why XSLT?

• The big pic:

   ◦ XPath

   ◦ <xsl:element> and <xsl:value-of>

   ◦ declarative

   ◦ pseudo-functional

• Tools

   ◦ Saxon

   ◦ XSLTCake

   ◦ Oxygen Editor (expensive!)

   ◦ phpStorm can execute XPath expressions

   ◦ Your Browser!
XSLT Intro (pt. 2)
• Resources

   ◦ en.wikipedia.org on XSLT

   ◦ Beginning XSLT and XPath - Transforming XML Documents and Data

   ◦ XSLT (O'Reilly)

   ◦ XSLT Cookbook

   ◦ W3C XSLT v1

   ◦ W3C XSLT v2
XPath on an HTML DOM
• Selecting the html node: / (root node)

• Select title node: /head/title

• Axes: child::* (standard), self::* , parent::* and attribute::/@

• Restrict the Selection to a div containing the attribute class="visible" : [@class='visible']

• Link several restrictions logically with and and or
Some built-in XSLT Functions
• On currently selected node:

   ◦ name: name()

   ◦ value: text()

   ◦ concatenate strings: concat()
Important XSL Tags
Output
1     <!-- select a node's value -->
2 <xsl:value-of select="{nodePath}"/>
3
4     <!-- construct a div with class 'visible' -->
5 <xsl:element name="{elementName}">
6     <xsl:attribute name="class">visible</xsl:attribute>
7 </xsl:element>
Important XSL Tags (pt. 2)
(Sub-)Templates (~ Functions)
1     <!-- 'myTemplate' can only be manually called by another function -->
2 <xsl:template name="myTemplate"> <!-- do stuff --></xsl:template>
3
4     <!-- 'div' is called whenever a function uses <xsl:apply-templates select="/path/to/div/element" -->
5 <xsl:template match="div"> <!-- do stuff --> </xsl:template>
6
7     <!-- apply templates on selected nodes -->
8 <xsl:apply-templates select="/path/to/div/element"/>
Important XSL Tags (pt. 3)
Some Imperatives
 1       <!-- loop over each node of selected node set 'myNodes'-->
 2   <xsl:for-each select="/path/to/myNodes"><!-- do stuff --></xsl:for-each>
 3
 4       <!-- switch-case-alike -->
 5   <xsl:choose>
 6       <xsl:when test="ContitionA">
 7           <!-- do stuff when ConditionA is true -->
 8       </xsl:when>
 9       <xsl:when test="ConditionB">
10           <!-- do stuff when ConditionB is true -->
11       </xsl:when>
12       <xsl:otherwise>
13           <!-- stuff that is done if neither ConditionA nor ConditionB were true -->
14       </xsl:otherwise>
15   </xsl:choose>
16
17       <!-- if -->
18   <xsl:if test="someTestCondition"> <!-- do stuff if if is true --> </xsl:if>
Important XSL Tags (pt. 4)
Initial Declarations
 1   <?xml version="1.0" encoding="UTF-8"?>
 2   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 3   <xsl:output
 4       method="xml"
 5       version="1.0"
 6       encoding="UTF-8"
 7       omit-xml-declaration="no"
 8       indent="yes"
 9       cdata-section-elements="source text"
10   />
Fooling around with XSLT
Some possible tasks
• Use XSLTCake.com

• Format your v4 v6 Contents to browsable HTML

• Make a .PDF containing all your v4 v6 Pages

• Look at Phoenix CTypes and how to generate them
We need you!
Participation
 • Test the T3TT extension and send in bug reports

 • Add support for new extensions
Thank you!

More Related Content

What's hot

Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
WO Community
 
How mysql handles ORDER BY, GROUP BY, and DISTINCT
How mysql handles ORDER BY, GROUP BY, and DISTINCTHow mysql handles ORDER BY, GROUP BY, and DISTINCT
How mysql handles ORDER BY, GROUP BY, and DISTINCT
Sergey Petrunya
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
WO Community
 
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Lucidworks
 

What's hot (20)

Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
Lift talk
Lift talkLift talk
Lift talk
 
Real time fulltext search with sphinx
Real time fulltext search with sphinxReal time fulltext search with sphinx
Real time fulltext search with sphinx
 
Using Sphinx for Search in PHP
Using Sphinx for Search in PHPUsing Sphinx for Search in PHP
Using Sphinx for Search in PHP
 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuning
 
3 years with Clojure
3 years with Clojure3 years with Clojure
3 years with Clojure
 
Cassandra 3 new features 2016
Cassandra 3 new features 2016Cassandra 3 new features 2016
Cassandra 3 new features 2016
 
How mysql handles ORDER BY, GROUP BY, and DISTINCT
How mysql handles ORDER BY, GROUP BY, and DISTINCTHow mysql handles ORDER BY, GROUP BY, and DISTINCT
How mysql handles ORDER BY, GROUP BY, and DISTINCT
 
Cassandra 3 new features @ Geecon Krakow 2016
Cassandra 3 new features  @ Geecon Krakow 2016Cassandra 3 new features  @ Geecon Krakow 2016
Cassandra 3 new features @ Geecon Krakow 2016
 
NSLogger network logging extension
NSLogger network logging extensionNSLogger network logging extension
NSLogger network logging extension
 
From XML to eBooks Part 2: The Details
From XML to eBooks Part 2: The DetailsFrom XML to eBooks Part 2: The Details
From XML to eBooks Part 2: The Details
 
Ce e nou in Rails 4
Ce e nou in Rails 4Ce e nou in Rails 4
Ce e nou in Rails 4
 
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
 
Cassandra drivers and libraries
Cassandra drivers and librariesCassandra drivers and libraries
Cassandra drivers and libraries
 
Dexador Rises
Dexador RisesDexador Rises
Dexador Rises
 
Cassandra Drivers and Tools
Cassandra Drivers and ToolsCassandra Drivers and Tools
Cassandra Drivers and Tools
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino API
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 

Viewers also liked

NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiemNVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
Ziemeļkurzemes NVO atbalsta centrs
 
Najduzi most na svetu
Najduzi most na svetuNajduzi most na svetu
Najduzi most na svetu
Petar Cicak
 
Industry Evening 2013 Presentation
Industry Evening 2013 PresentationIndustry Evening 2013 Presentation
Industry Evening 2013 Presentation
Michael Frith
 
Liberalism: Ancient and Modern Leo Strauss
Liberalism: Ancient and Modern Leo StraussLiberalism: Ancient and Modern Leo Strauss
Liberalism: Ancient and Modern Leo Strauss
Gianinna Siuffi
 
Microsoft interview walkthrough
Microsoft interview walkthroughMicrosoft interview walkthrough
Microsoft interview walkthrough
Aayush Bahuguna
 

Viewers also liked (17)

Rich and poor
Rich and poorRich and poor
Rich and poor
 
Talsu novada krīžu centrs
Talsu novada krīžu centrsTalsu novada krīžu centrs
Talsu novada krīžu centrs
 
Madurez e inmadurez
Madurez e inmadurezMadurez e inmadurez
Madurez e inmadurez
 
Biedrība "Vīnoga"
Biedrība "Vīnoga"Biedrība "Vīnoga"
Biedrība "Vīnoga"
 
Liberalism final
Liberalism finalLiberalism final
Liberalism final
 
Labas pāarmaiņas
Labas pāarmaiņasLabas pāarmaiņas
Labas pāarmaiņas
 
Talsu Komersantu Klubs
Talsu Komersantu KlubsTalsu Komersantu Klubs
Talsu Komersantu Klubs
 
Latvijas Neredzīgo biedrība
Latvijas Neredzīgo biedrībaLatvijas Neredzīgo biedrība
Latvijas Neredzīgo biedrība
 
Saldus pensionāru biedrība
Saldus pensionāru biedrībaSaldus pensionāru biedrība
Saldus pensionāru biedrība
 
NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiemNVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
NVO un pašvaldības sadarbība, finanšu iespējas kopīgiem projektiem
 
Najduzi most na svetu
Najduzi most na svetuNajduzi most na svetu
Najduzi most na svetu
 
아쇼카
아쇼카아쇼카
아쇼카
 
Leyes aplicadas al turismo
Leyes aplicadas al turismoLeyes aplicadas al turismo
Leyes aplicadas al turismo
 
Industry Evening 2013 Presentation
Industry Evening 2013 PresentationIndustry Evening 2013 Presentation
Industry Evening 2013 Presentation
 
Liberalism: Ancient and Modern Leo Strauss
Liberalism: Ancient and Modern Leo StraussLiberalism: Ancient and Modern Leo Strauss
Liberalism: Ancient and Modern Leo Strauss
 
Microsoft interview walkthrough
Microsoft interview walkthroughMicrosoft interview walkthrough
Microsoft interview walkthrough
 
Z kurzemes nvo_atbalsta_centrs_030712_talsi
Z kurzemes nvo_atbalsta_centrs_030712_talsiZ kurzemes nvo_atbalsta_centrs_030712_talsi
Z kurzemes nvo_atbalsta_centrs_030712_talsi
 

Similar to TYPO3 Transition Tool

Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
bartzon
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
Florent Georges
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
Angela Byron
 
Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp III
Dirk Ginader
 

Similar to TYPO3 Transition Tool (20)

TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
 
Front end for back end developers
Front end for back end developersFront end for back end developers
Front end for back end developers
 
CSS 201
CSS 201CSS 201
CSS 201
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
 
Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2Apache Camel K - Copenhagen v2
Apache Camel K - Copenhagen v2
 
Apache Camel K - Copenhagen
Apache Camel K - CopenhagenApache Camel K - Copenhagen
Apache Camel K - Copenhagen
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 
Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp III
 
Future-proof Development for Classic SharePoint
Future-proof Development for Classic SharePointFuture-proof Development for Classic SharePoint
Future-proof Development for Classic SharePoint
 
Linq To XML Overview
Linq To XML OverviewLinq To XML Overview
Linq To XML Overview
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

TYPO3 Transition Tool

  • 2. What's this about? • The Berlin Manifesto constitutes that the transition from v4v6 to Phoenix will be easily possible • Content Transition is a big part of that • Last year a GSoC project was initiated for working on that problem • Therefore: This is for presenting first solutions and inviting some man-power
  • 3. Warmup Questionnaire • Who of you proably wants to use Phoenix in future? • Who wants a nice way of reusing her existing content in Phoenix? • Who knows XSLT? • Who has development experience with XSLT • Who thinks i should stop bugging you with silly questions?
  • 4. Overview About me The Project • Lessen the Gap from v4 v6 to Phoenix • The initial idea • Google Summer of Code 2011 • Problems & Solutions Current Status • A prototypical v4 v6 Extension being able to export contents of pages and tt_content
  • 5. Shameless self-plug • Nicolas Forgerit • Student/Freelancer from Karlsruhe • Love sports & coffee • Crawl the web for information way too much of my time github.com/crusoe nicolas.forgerit@gmail.com @forgerit • My mentor: Christian Müller • Core Dev TYPO3/Freelancer from Bonn • Owner of kitsunet.de
  • 6. The Project Lessen the Gap from v4 v6 to Phoenix • Content Transition • Export contents of a v4 v6 instance and import to Phoenix • Use existing interfaces • Make it flexible and configurable
  • 7. What again was this GSoC stuff? • fellowship given out by Google to provide Open Source projects • TYPO3 had been a sub-project 4 years in a row until 2011 • Unfortunately, TYPO3 hasn't been accepted for 2012 :( (Drupal was, WP not)
  • 8. The initial idea • use the well-known SYSEXT:impexp for generating XML data • make exported data Phoenix-ready • use XSLT to transform the exported data • provide generated data as Phoenix packet and/or webservice
  • 9. Problems & Solutions • PHPs XSLTProcessor is rather old -> fill missing gaps with PHP+Regex • Phoenix CTypes were not ready until about 3 weeks ago -> make CTypes configurable as "Snippets" • XSLTProcessor's debug output is rather "un-verbose" -> no solution yet :( (use Saxon for XSLT development) • ...
  • 10. Current Status TYPO3 Transition Tool • A prototypical v4 v6 Extension • Do the (common) work in just a few clicks • Make it extendable (via XSLT & PHP) • Try to make the code looking clean
  • 11. The Transition Steps • Step 1: Preparing the data ◦ Set Output Filename ◦ Select to-be-exported Database Tables ◦ Set Initial Page-Subtree Node (usually pid 0 for getting the whole Pagetree) • Step 2: Transform the data ◦ Provide v4 v6 => Phoenix Content Type configuration ◦ Select to-be-used PHP-Hooks • Step 3: Export the data ◦ Download Sites.xml ◦ Download packet ◦ Publish generated Data as Webservice
  • 12. General Transformation Procedure • have a base stylsheet which does the general procedure • fetch all the user-chosen snippets and copy them into the base • execute defined "pre-transformation" PHP-Hooks on the data • run the XSLT Processor • execute defined "post-transformation" PHP-Hooks on the xslt-processed data
  • 13. Code! view it on T3 Forge or Github.
  • 14. Base XSLT Stylesheet • kind of a "base" stylesheet containing several markers • applies the general rules • holds several markers which are to be replaced by the right snippets/contents
  • 15. Code! view it on T3 Forge or Github.
  • 16. Content Types XSLT Snippets • non-valid XSLT scripts (slices of them) • work just in context of T3TT • modular and independent from each other • automagically fetched and traversed by the XSLT Processor
  • 17. Code! view it on T3 Forge or Github.
  • 18. PHP Hooks • filling gaps of XSLT v1 • kinda "meta-language" for XSLT • can be easily added to a PHP file • T3TT splits the to-be-altered Datafile into lines • ... which can be changed e.g. via PCRE
  • 19. PHP Hooks (pt. 2) • needed before as well as after the XSLT transformation • provide a way to do some quick'n'dirty adjustments Some example hooks killIndexColons (pre) 1 <!-- transform --> 2 <tablerow index="tt_content:1" type="array"> 3 <!-- to --> 4 <tablerow index="tt_content" id="1" type="array"> since XSLT v1 cannot "regex" attribute values. (v2 can!)
  • 20. PHP Hooks (pt. 3) unescapeHtmlSpecialCharsOfFlexformValues (pre) make Flexform transformations XSLT applicable (i.e. undo HSC) (currently not working :[ ) 1 <!-- transform --> 2 &lt;T3FlexForms&gt; 3 &lt;data&gt; 4 &lt;sheet index=&quot;sDEF&quot;&gt; 5 ... 6 <!-- to --> 7 <T3FlexForms> 8 <data> 9 <sheet index="sDEF"> 10 ... normalizeNodeNames (post) check that nodeName="{value}" contains Phoenix-compatible characters ! assert that nodeName-value - is not empty - matches ([-_a-zA-Z0-9]) - contains no whitespaces - ...
  • 21. Code! view it on T3 Forge or Github.
  • 22. XSLT Intro • Why XSLT? • The big pic: ◦ XPath ◦ <xsl:element> and <xsl:value-of> ◦ declarative ◦ pseudo-functional • Tools ◦ Saxon ◦ XSLTCake ◦ Oxygen Editor (expensive!) ◦ phpStorm can execute XPath expressions ◦ Your Browser!
  • 23. XSLT Intro (pt. 2) • Resources ◦ en.wikipedia.org on XSLT ◦ Beginning XSLT and XPath - Transforming XML Documents and Data ◦ XSLT (O'Reilly) ◦ XSLT Cookbook ◦ W3C XSLT v1 ◦ W3C XSLT v2
  • 24. XPath on an HTML DOM • Selecting the html node: / (root node) • Select title node: /head/title • Axes: child::* (standard), self::* , parent::* and attribute::/@ • Restrict the Selection to a div containing the attribute class="visible" : [@class='visible'] • Link several restrictions logically with and and or
  • 25. Some built-in XSLT Functions • On currently selected node: ◦ name: name() ◦ value: text() ◦ concatenate strings: concat()
  • 26. Important XSL Tags Output 1 <!-- select a node's value --> 2 <xsl:value-of select="{nodePath}"/> 3 4 <!-- construct a div with class 'visible' --> 5 <xsl:element name="{elementName}"> 6 <xsl:attribute name="class">visible</xsl:attribute> 7 </xsl:element>
  • 27. Important XSL Tags (pt. 2) (Sub-)Templates (~ Functions) 1 <!-- 'myTemplate' can only be manually called by another function --> 2 <xsl:template name="myTemplate"> <!-- do stuff --></xsl:template> 3 4 <!-- 'div' is called whenever a function uses <xsl:apply-templates select="/path/to/div/element" --> 5 <xsl:template match="div"> <!-- do stuff --> </xsl:template> 6 7 <!-- apply templates on selected nodes --> 8 <xsl:apply-templates select="/path/to/div/element"/>
  • 28. Important XSL Tags (pt. 3) Some Imperatives 1 <!-- loop over each node of selected node set 'myNodes'--> 2 <xsl:for-each select="/path/to/myNodes"><!-- do stuff --></xsl:for-each> 3 4 <!-- switch-case-alike --> 5 <xsl:choose> 6 <xsl:when test="ContitionA"> 7 <!-- do stuff when ConditionA is true --> 8 </xsl:when> 9 <xsl:when test="ConditionB"> 10 <!-- do stuff when ConditionB is true --> 11 </xsl:when> 12 <xsl:otherwise> 13 <!-- stuff that is done if neither ConditionA nor ConditionB were true --> 14 </xsl:otherwise> 15 </xsl:choose> 16 17 <!-- if --> 18 <xsl:if test="someTestCondition"> <!-- do stuff if if is true --> </xsl:if>
  • 29. Important XSL Tags (pt. 4) Initial Declarations 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 3 <xsl:output 4 method="xml" 5 version="1.0" 6 encoding="UTF-8" 7 omit-xml-declaration="no" 8 indent="yes" 9 cdata-section-elements="source text" 10 />
  • 30. Fooling around with XSLT Some possible tasks • Use XSLTCake.com • Format your v4 v6 Contents to browsable HTML • Make a .PDF containing all your v4 v6 Pages • Look at Phoenix CTypes and how to generate them
  • 31. We need you! Participation • Test the T3TT extension and send in bug reports • Add support for new extensions