Extbase and Beyond

12,203
-1

Published on

With Extbase - a new framework for extension development introduced in TYPO3 4.3 - you are able to develop with the paradigms of FLOW3 today. During this talk, you get in touch with the features of the framework to understand how it supports your development process to develop clean code cost efficient in less time. Extbase is one cornerstone for a smooth transition to TYPO3 v5, another is reusable business domain knowledge in form of Generic Domain Models available in 4.x and 5.x. The Generic Domain Models will enable you to add a Semantic Web topping.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
12,203
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
39
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Extbase and Beyond

  1. 1. Extbase and Beyond Jochen Rau <jochen.rau@typoplanet.de> Irving, Texas May 22, 2010
  2. 2. Who is this?
  3. 3. Dipl.-Ing. Mechanical Engineering
  4. 4. infected with TYPO3 in 2OO1
  5. 5. Tübingen
  6. 6. 6O% selfemployed 6O% father
  7. 7. 8O% ---- selfemployed 6O% 6O% father
  8. 8. 5 years: Fraunhofer- Gesellschaft German Aerospace Center
  9. 9. 5 years: high school teacher
  10. 10. What is Extbase all about?
  11. 11. v4 2OO6
  12. 12. v5 v4
  13. 13. v5 v4
  14. 14. v5 v4
  15. 15. Extbase v5 v4
  16. 16. v5 v4
  17. 17. Extbase FLO W 4
  18. 18. Extbase 6O% FLO W 4
  19. 19. Extbase 25% FLO W 4
  20. 20. Extbase 25%W FLO 4
  21. 21. Extbase 2O% W FLO 4
  22. 22. Extbase W FLO 4
  23. 23. Extbase FLOW 3
  24. 24. What is Extbase all about?
  25. 25. Extbase
  26. 26. OOP A ggregate DDD Extbase V iew Entity Hel per M VC VfB R epository
  27. 27. Extbase Value
  28. 28. clean architecture domain driven modular patterns
  29. 29. rapid development use conventions stay focused be relieved
  30. 30. smooth transition you code data
  31. 31. What is Extbase all about?
  32. 32. tp://commons.wikimedia.org/wiki/File:Z%C3%BCrich_-_Seefeld_-_Heureka_IMG_1757.JPG
  33. 33. tx_ttnews 3397 tx_pbsurvey_pi1 253O tx_ttproducts_pi1 1O9O tx_mmforum_pi1 6126 tx_veguestbook_pi1 1156 tp://commons.wikimedia.org/wiki/File:Z%C3%BCrich_-_Seefeld_-_Heureka_IMG_1757.JPG
  34. 34. /** * Main news function: calls the init_news() function and decides by the given CODEs which of the * functions to display news should by called. * * @param string $content : function output is added to this * @param array $conf : configuration array * @return string $content: complete content generated by the tt_news plugin */ function main_news($content, $conf) { $this->local_cObj = t3lib_div::makeInstance('tslib_cObj'); // Local cObj. $this->init($conf); if ($this->conf['displayCurrentRecord']) { $this->config['code'] = $this->conf['defaultCode']?trim($this->conf['defaultCode']):'SINGLE'; $this->tt_news_uid = $this->cObj->data['uid']; } // get codes and decide which function is used to process the content $codes = t3lib_div::trimExplode(',', $this->config['code']?$this->config['code']:$this->conf['defaultCode'], 1); if (!count($codes)) { // no code at all $codes = array(); $noCode = true; } while (list(, $theCode) = each($codes)) { $theCode = (string)strtoupper(trim($theCode)); $this->theCode = $theCode; switch ($theCode) { case 'SINGLE': $content .= $this->displaySingle(); break; case 'VERSION_PREVIEW': $content .= $this->displayVersionPreview(); break; case 'LATEST': case 'LIST': case 'SEARCH': case 'XML': $content .= $this->displayList(); break; case 'AMENU': $content .= $this->newsArchiveMenu(); break; case 'CATMENU': $content .= $this->displayCatMenu(); break; default:
  35. 35. /** * Displays the "single view" of a news article. Is also used when displaying single news records with the "insert records" content element. * * @return string html-code for the "single view" */ function displaySingle() { $singleWhere = 'tt_news.uid=' . intval($this->tt_news_uid); $singleWhere .= ' AND type NOT IN(1,2)' . $this->enableFields; // only real news -> type=0 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'tt_news', $singleWhere); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); // get the translated record if the content language is not the default language if ($GLOBALS['TSFE']->sys_language_content) { $OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':''); $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_news', $row, $GLOBALS['TSFE']->sys_language_content, $OLmode); } if ($this->versioningEnabled) { // get workspaces Overlay $GLOBALS['TSFE']->sys_page->versionOL('tt_news',$row); // fix pid for record from workspace $GLOBALS['TSFE']->sys_page->fixVersioningPid('tt_news',$row); } $GLOBALS['TSFE']->displayedNews[]=$row['uid']; if (is_array($row) && ($row['pid'] > 0 || $this->vPrev)) { // never display versions of a news record (having pid=-1) for normal website users // Get the subpart code if ($this->conf['displayCurrentRecord']) { $item = trim($this->getNewsSubpart($this->templateCode, $this->spMarker('###TEMPLATE_SINGLE_RECORDINSERT###'), $row)); } if (!$item) { $item = $this->getNewsSubpart($this->templateCode, $this->spMarker('###TEMPLATE_SINGLE###'), $row); } // reset marker array $wrappedSubpartArray = array(); // build the backToList link if ($this->conf['useHRDates']) { $pointerName = 'pointer'; $wrappedSubpartArray['###LINK_ITEM###'] = explode('|', $this->pi_linkTP_keepPIvars('|', array( 'tt_news' => null, 'backPid' => null, $this->config['singleViewPointerName'] => null, 'pS' => null, 'pL' => null), $this->allowCaching, ($this->conf['dontUseBackPid']?1:0), $this->config['backPid']));
  36. 36. if ($this->conf ['useHRDates']) { $pointerName = 'pointer'; $wrappedSubpartArray ['###LINK_ITEM###'] = explode('|', $this- >pi_linkTP_keepPIvars ('|', array( 'tt_news' => null, 'backPid' => null, $this->config ['singleViewPointerName '] => null, 'pS' => null, 'pL' => null), $this- >allowCaching, ($this- >conf ['dontUseBackPid']? 1:0), $this->config ['backPid'])); } else { $wrappedSubpartArray ['###LINK_ITEM###'] = explode('|', $this- >pi_linkTP_keepPIvars ('|', array( 'tt_news' => null, 'backPid' => null, $this->config ['singleViewPointerName '] => null), $this- >allowCaching, ($this- >conf ['dontUseBackPid']? 1:0), $this->config ['backPid'])); } // set the title of the single view page to the title of the news record if ($this->conf ['substitutePagetitle'] ) { $GLOBALS['TSFE']->page ['title'] = $row ['title']; // set pagetitle for indexed search to news title $GLOBALS['TSFE']- >indexedDocTitle = $row ['title']; } if ($this->conf ['displaySingle.'] ['catOrderBy']) { $this->config ['catOrderBy'] = $this- >conf['displaySingle.'] ['catOrderBy']; } $markerArray = $this- >getItemMarkerArray ($row, 'displaySingle'); // Substitute $content = $this->cObj- >substituteMarkerArrayC ached($item, $markerArray, array(), $wrappedSubpartArray); } elseif ($this- >sys_language_mode == 'strict' && $this- >tt_news_uid && $GLOBALS['TSFE']- >sys_language_content) { // not existing translation $noTranslMsg = $this- >local_cObj->stdWrap ($this->pi_getLL ('noTranslMsg'), $this- >conf ['noNewsIdMsg_stdWrap.' ]); $content = $noTranslMsg; } elseif ($row['pid'] < 0) { // a non-public version of a record was requested $nonPlublicVersion = $this->local_cObj- >stdWrap($this- >pi_getLL ('nonPlublicVersionMsg' ), $this->conf ['nonPlublicVersionMsg_ stdWrap.']); $content = $nonPlublicVersion; } else { // if singleview is shown with no tt_news uid given from GETvars (&tx_ttnews[tt_news]=) an error message is displayed.
  37. 37. control flow business logic CRUD data render output other , eg. config
  38. 38. control flow business logic aggregate CRUD data render output other , eg. config
  39. 39. control flow business logic generalize CRUD data render output other , eg. config
  40. 40. partition
  41. 41. Extbase use & Fluid
  42. 42. control flow business logic CRUD data render output other , eg. config
  43. 43. Controller Domain Model Domain Repository View other , eg. config
  44. 44. TYPO3
  45. 45. 1 userFunc Extbase TYPO3 Dispatcher
  46. 46. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher Controller
  47. 47. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher Controller 3 findByTitle('MyBlog') Repository Domain Model Blog Post Comment Tag
  48. 48. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher Controller 3 findByTitle('MyBlog') Blog 4 Repository Domain Model Blog Post Comment Tag
  49. 49. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher Controller 3 assign(Blog) findByTitle('MyBlog') render() 5 Blog 4 View Repository Domain Model Blog Post Comment Tag
  50. 50. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher HTML Response Controller 6 3 assign(Blog) findByTitle('MyBlog') render() 5 Blog Response 4 View Repository Domain Model Blog Post Comment Tag
  51. 51. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher HTML Response Controller 6 3 assign(Blog) findByTitle('MyBlog') render() 5 Blog Response 4 View Repository Domain Model Blog Post Comment Tag
  52. 52. 1 2 userFunc Request BlogExample Extbase TYPO3 Dispatcher HTML Response Controller 6 3 assign(Blog) findByTitle('MyBlog') render() 5 Blog Response 4 View Repository Domain Model Blog Post Comment Tag
  53. 53. Hmmm. Much better. Lasagna code de Spagh etti co
  54. 54. What's coming
  55. 55. Performance SQL queries object tracking caching
  56. 56. Dev Experience speaking exceptions documentation kickstarter
  57. 57. Catalyse dispatcher persistence backend process for patches
  58. 58. And beyond Extbase?
  59. 59. IMHO
  60. 60. http://www.sxc.hu/photo/516864/ Generic Domain Models
  61. 61. WRUV I
  62. 62. William Street Rajan United States Virginia Indian
  63. 63. William Street Rajan United States Virginia Indian
  64. 64. William Street Rajan United States Virginia Indian x WRUVI William Street Rajan United States Virginia Indian
  65. 65. William Street Rajan United States Virginia Indian x WRUVI William Street Rajan United States Virginia Indian
  66. 66. William Street Rajan United States Virginia Indian x WRUVI William Street Rajan United States Virginia Indian
  67. 67. Organization Date Customer Event Invoice Publication Product Price Article Location Number Image Your Model
  68. 68. Generic Domain Models based on high quality, open standards OASIS CIQ 3.0 for persons, organizations, addresses, names BMEcat for product, suppliers, catalogs, prices iCalendar for calendar, events, dates etc. challenges XML2PHP interoperability consistent semantics @jochen: it's time for an example
  69. 69. Product Line Engineering
  70. 70. Generic Domain Models ViewHelpers Extbase Fluid TYPO3 v4
  71. 71. Extbase Fluid TYPO3 v4
  72. 72. Extbase Fluid TYPO3 v4
  73. 73. Extbase Fluid TYPO3 v4
  74. 74. Extbase Fluid TYPO3 v4
  75. 75. platform Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  76. 76. building blocks Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  77. 77. TYPO3 Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  78. 78. packages P P P P P P P P P P Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  79. 79. TYPO3 Social Site P P P P P P P P P P Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  80. 80. TYPO3 Enterprise P P P P P P P P P P Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  81. 81. TYPO3 Blog P P P P P P P P P P Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  82. 82. Product Line P P P P P P P P P P Generic Domain ViewHelpers Models Fluid TYPO3 v5 FLOW3
  83. 83. The meaning of things
  84. 84. http://webscience.org/people.html
  85. 85. Knublauch, Holger. KBeans Specification: Semantic Transparency for Components and Domain Models. Technical Report FAW-TR-01001, FAW Ulm, 2001.
  86. 86. Semantic annotations /** * A container for defining the unique characteristics of a person only * * @version $Id$ * @copyright Copyright belongs to the respective authors * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later * @prefix foaf: <http://xmlns.com/foaf/0.1/> * @prefix owl: <http://www.w3.org/2002/07/owl#> * @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> * @prefix core: <http://www.typo3.org/semantic/core/> * @prefix gen: <http://www.typo3.org/semantic/ext/generic/domain/model/> * @semantic gen:Person rdfs:subClassOf gen:Party * @semantic gen:Person owl:disjointWith gen:Organization * @semantic gen:Person core:isMemberOf gen:Organization */ class Tx_Generic_Domain_Model_Person extends Tx_Generic_Domain_Model_Party { /** * Party Names * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Generic_Domain_Model_PersonName> * @semantic gen:partyNames gen:areOfType foaf:name */ protected $partyNames; /**
  87. 87. Semantic Query with SPARQL ## Find all authors of News Articles that are posted on a page with the english title "Welcome" PREFIX core:<http:://www.typo3.org/ontology/core/#> PREFIX generic:<http:://www.typo3.org/ontology/ext/generic/#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT $person $article FROM <http:://localhost/repository.rdf> WHERE { $person rdfs:type generic:Person . $person core:authorOf $article . $article rdfs:type core:NewsArticle . $article core:isPlacedOn $page . $page core:title "Welcome"@en . }
  88. 88. [TYPO3-dev] The state of support for the Semantic Web / RDFA / Web 3.0 in TYPO3 Jochen Rau jochen.rau at typoplanet.de Mon Aug 31 16:26:51 CEST 2009 • Previous message: [TYPO3-dev] The state of support for the Semantic Web / RDFA / Web 3.0 in TYPO3 • Next message: [TYPO3-dev] The state of support for the Semantic Web / RDFA / Web 3.0 in TYPO3 • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] get Extbase ready ;-) de ne generic domain models bind objects to an ontology elaborate on the use cases of semantic content make the integration of semantic web technology a movement of the community
  89. 89. Bastian Waidelich Sebastian Kurfürst Sebastian Gebhard Than k You Steffen Kamper Felix Oertel Franz Ripfel and the TYPO3 V5 Team for all the inspiration and the beautiful code Ingmar Schlecht Patrick Lobacher Franz Koch Xavier Perseguers
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×