eZ Publish nextgen

11,915 views

Published on

Any piece of software can only be as good as its foundations. To rise as high as we need it to, we decided eZ Publish needed new ones. Today, we will tell you how these are architectured, and give you a glimpse of their possibilities.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
11,915
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
23
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

eZ Publish nextgen

  1. 1. eZ Publish Nextgen Knock knock. Who’s there ? The Future !samedi 15 octobre 11
  2. 2. Current  architecture What’s  wrong  with  it  ?  Why  ?samedi 15 octobre 11
  3. 3. Current  architecturesamedi 15 octobre 11
  4. 4. Current  architecture • RDBMS  dependent,  and  strongly  bound  to  the  database  structure • PHP  4  ages  legacy  : o Weak  OOP  concepts  (no  interfaces,  no  abstract,  no  excepGons,  no  magic,  no  dependency   injecGon,  everything  is  public) o Global  variables  usage  (for  singletons  on  in-­‐memory  cache) o (And  also  some  dirty  workarounds) • Low  level  API o Hard  to  catch o SomeGmes  dangerous  to  manipulate  directly  (for  data  integrity) o No  real  API  doc,  hence  no  developer  doc • Hardly  testablesamedi 15 octobre 11
  5. 5. Consequences • Evoluons  are  very  me-­‐consuming • Maintaining  backward  compability  is  very  complex • No  possible  support  for  NoSQL • Impossible  to  perform  RDBMS  specific  opmizaons   (nave  funcons  and  procedures,  like  in  Oracle,  or  even   latest  MySQL) • Bad  API  usage  (and  "Black  Magic")samedi 15 octobre 11
  6. 6. New  architecture «This  is  a  revoluGon»  ©  S.J.samedi 15 octobre 11
  7. 7. Layers...samedi 15 octobre 11
  8. 8. New  architecture  overview • Kicked  off  with  Domain  Driven  Design  methodologies • Storage  system  agnosc • Extensible • Secure • Easy  to  use • Modern  (PHP  5.3,  namespaces,  design  paUerns...)samedi 15 octobre 11
  9. 9. samedi 15 octobre 11
  10. 10. Do  you  speak  eZ  Publish  ? The  refined  domain  definion  comes  up  with  new  terms: Content  Object Content Node Loca/on Content  Object  A1ribute Field Content  Class Content  Type Content  Class  A1ribute Field  Defini/on Datatype Field  Type Easier  to  understand  for  newcomers  and  non-­‐technical  people  (Domain  design  approach)samedi 15 octobre 11
  11. 11. Public  API • Public  API  is  the  ONLY  API  any  developer  should  use  directly • Any  developer  =  eZ  Engineers  included  (kernel  modules) • Should  be  sexy  and  very  easy  to  use • High  level,  so  that  the  developer  doesnt  care  about  the   backend • It  interacts  seamlessly  with  the  business  layer  in  the  backendsamedi 15 octobre 11
  12. 12. Business  layer • This  is  the  layer  where  most  of  the  logic  is  implemented • It  is  completely  storage  agnos/c,  as  it  uses  the  content   persistence  API. • It  uses  the  Content  Repository  to  manipulate  the  CMS  data. • It  doesnt  delegate  logic  to  the  content  persistence  API.samedi 15 octobre 11
  13. 13. Persistence  layer • Starts  as  a  set  of  interfaces. • These  interfaces  are  implemented  by  every  content   repositories  (aka  Storage  Engines). • Ensures  full  abstrac/on  between  the  business  layer  and  the   storage  mechanisms. • Contains  as  liUle  logic  as  possible.  It  cares  about  data,  only   data.  Logic  is  in  the  business  layer.samedi 15 octobre 11
  14. 14. Storage  engines • Storage  engines  implement  the  Content  Persistence   Interfaces • Each  storage  engine  corresponds  to  a  type  of  data  storage o Classic  RDBMS  (MySQL,  PostgreSQL...) o Document  oriented  storage  (NoSQL) o ... • Internals  are  completely  hidden,  and  can  use  anything:  ORM,   ezcDatabase,  REST,  SOAP...samedi 15 octobre 11
  15. 15. Do  you  speak  eZ  Publish  ? New,  fancy  terms • Repository:  Centralized,  virtual  storage  system.  Implemented   by  storage.  Also  used  for  binary  files. • Domain  Object  (aka  DO):  High  level  PHP  object  exposed  in   public  API:  Content,  Locaon,  Field,  etc. • Service:  Interacon  components  from  the  Business  Layer:   Content,  Locaon,  etc.samedi 15 octobre 11
  16. 16. Legacy  Storage  Engine • eZ  Publish  4  database  Persistence  Layer  implementaon   • Implemented  from  scratch.  Shiny  ! • Uses  the  Zeta  Components  (ezcDatabase  +  ezcQuery) • Tested  to  be  two-­‐ways  compa/ble  with  eZ  Publish  4: ➡ content  created  from  ezp4  is  available  in  the  API ➡ content  created  from  the  API  is  available  in  ezp4 • No  migra/on  required  !samedi 15 octobre 11
  17. 17. Code  ! That’s  why  we’re  here,  right  ?samedi 15 octobre 11
  18. 18. samedi 15 octobre 11
  19. 19. Create  content <?php use ezpBaseServiceContainer,     ezpBaseConfiguration,     ezpContentFieldTypeUrl; // Get the repository, and configure the user to use $sc = new ServiceContainer( Configuration::getInstance( service )->getAll() ); $repository = $sc->getRepository(); $contentService = $repository->getContentService(); $repository->setUser( $repository->getUserService()->load( 14 ) ); // Build a new folder // $folder will be a DO, ezpContent $folder = $contentService->init( folder, eng-GB ); $folder->fields[name] = News; $folder->fields[description] = <p>My <strong>ubber cool</strong> description !</p>; $folder->fields[link] = new UrlValue( http://ez.no, eZ Systems ); $folder->addParent( $repository->getLocationService()->load( 2 ) ); $folder = $contentService->create( $folder ); $contentService->publish( $folder->versions[1] );samedi 15 octobre 11
  20. 20. Load  content <?php use ezpBaseServiceContainer,     ezpBaseConfiguration; $sc = new ServiceContainer( Configuration::getInstance( service )->getAll() ); $repository = $sc->getRepository(); $contentService = $repository->getContentService(); try {     $content = $contentService->load( 60 ); } catch ( ezpBaseExceptionNotFound $e ) {     echo "Content could not be found in the repository !n";     exit; } // Loop against fields. // $identifier is the attribute identifier // $value is the corresponding value object echo "Content {$content} has following fields:n"; foreach ( $content->fields as $identifier => $value ) {     echo "Field {$identifier}: {$value}n"; // Using $value __toString() }samedi 15 octobre 11
  21. 21. Fetch  content <?phpuse ezpBaseServiceContainer,    ezpBaseConfiguration,    ezpContent,    ezpContentQuery;$sc = new ServiceContainer( Configuration::getInstance( service )->getAll() );$qb = new ezpContentQueryBuilder;$contentService = $sc->getRepository()->getContentService();// a full criteria$qb->addCriteria(    $qb->fullText->like( eZ Publish ),    $qb->urlAlias->like( /cms/amazing/* ),    $qb->contentType->eq( blog_post ),    $qb->field->eq( author, community@ez.no ))->addSortClause(    $qb->sort->field( blog_post, title, Query::SORT_ASC ),    $qb->sort->dateCreated( Query::SORT_DESC ))->setOffset( 0 )->setLimit( 10 );$contentList = $contentService->find( $qb->getQuery() );samedi 15 octobre 11
  22. 22. Field  types • Now  spliUed  in  (at  least)  2  objects: • Type • Value • Dedicated  PHP  namespace • Interfaces  to  determine  which  features  the  field  type   implement  (Searchable,  Collectable...) • Converters  for  Legacy  storage  enginesamedi 15 octobre 11
  23. 23. Roadmap • Full  language/translaon  support • Finish  migrang  datatypes • HTTP  layer  +  modules • REST  API  implementaon  based  on  the  new  API • Opmized  storage  enginessamedi 15 octobre 11
  24. 24. Now  it’s  your  turn  ! •Get it : http://github.com/ezsystems/ezp-next •Blame it : http://issues.ez.no/ezpublish (ezpnext component) •Discuss it : http://share.ez.no/forums/new-php-api •Own it : Make a GitHub pull request ! Soon to come: wiki based cookbook, blog posts.samedi 15 octobre 11

×