TYPO3 Transition Tool
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


TYPO3 Transition Tool

Uploaded on

t's time to think about content migration from TYPO3v4 to Phoenix. Therefore, last year a Google Summer of Code Project was initiated which was about figuring out whether XSLT-driven......

t's time to think about content migration from TYPO3v4 to Phoenix. Therefore, last year a Google Summer of Code Project was initiated which was about figuring out whether XSLT-driven transformations of v4 XML contents to Phoenix-ready structures were feasible for production use. Until the T3DD12 workshop, a first prototype will be released which already brings some framework-alike structures, ready for testing on an existing v4-instance. Nonetheless, for covering the major part of all existing TYPO3v4 instances, there is still a lot of thoughts and development to be done. Thus, we want to recruit some interested developers and testers to the project for making the huge step forwards to Phoenix as nice and easy as it can possibly be. Therefore, we will introduce the audience to the problem, our general idea of solving it and provide some initial thoughts and directions to invest some work on.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Welcome
  • 2. Whats 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. OverviewAbout meThe Project • Lessen the Gap from v4 v6 to Phoenix • The initial idea • Google Summer of Code 2011 • Problems & SolutionsCurrent 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 ProjectLessen 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 hasnt 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" • XSLTProcessors debug output is rather "un-verbose" -> no solution yet :( (use Saxon for XSLT development) • ...
  • 10. Current StatusTYPO3 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 quickndirty adjustmentsSome example hookskillIndexColons (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 (OReilly) ◦ 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 TagsOutput1 <!-- select a nodes value -->2 <xsl:value-of select="{nodePath}"/>34 <!-- 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>34 <!-- div is called whenever a function uses <xsl:apply-templates select="/path/to/div/element" -->5 <xsl:template match="div"> <!-- do stuff --> </xsl:template>67 <!-- 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>1617 <!-- 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 XSLTSome 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
  • 32. Thank you!