Review: Learning eZ publish 3
If you’ve ever gone exploring the wealth of Open Source applications built with PHP, there’s a good chance you’ve heard of eZ publish, the CMS/application framework that has all the features you’re looking for.
eZ publish has even turned up on SitePoint a number of times; back in November 2002 with eZ publish: PHP’s Killer App (covering version 2.x), along with an Interview with BÃ¥rd Farstad of eZ systems; then later, in June 2003, an evaluation of version 3.x by Sebastian van der Vliet.
eZ publish version 3.x, released in March 2003, was a radical overhaul that bore only the vaguest resemblance to previous version, but designed with growth in mind, and shaped by developer experiences with version 2.x. A year and a half later, we’re already at version 3.4, and the new design is starting to "settle down" while the feature list grows. At the same time, eZ systems has gone from strength to strength, picking up Derick Rethans (author of XDebug) along the way.
Perhaps it’s an indication of eZ Publish’s maturity and scale that it’s now the subject of a book: Learning eZ publish 3: Building Content Management Solutions (full details are provided at the end of this article) — a first for an application written in PHP (with the exception of Comprehensive PHP PEAR::DB).
Historically, documentation has always been eZ publish’s weakest link, for the same reasons any software project team would cite. The consequence is that those fluent in PHP, with time to spare, must trawl the source code. For the rest, it means head scratching and hoping the community can lend a hand.
Although eZ Publish’s online documentation has improved dramatically since version 2.x, thanks largely to community effort and contributions, there are still gaps — the material provided is somewhere between a FAQ and a reference manual; the "big picture" is missing.
Enter: "Learning eZ publish 3", written by a number of high profile members of the eZ publish community who are intimate with eZ publish’s internals and have first hand experience of building and deploying sites with eZ publish.
The book is organised around technical topics, each one handled in depth with a general progression that follows the learning experience of the reader. The last two chapters are case studies, which serve to round out the material of earlier chapters and provide the reader with a mental framework that will help structure the process of building a site with eZ publish.
Chapter 1: Installing eZ publish
The book dives straight into the installation of eZ publish, presumably to give readers an environment in which they can practice while working through later chapters.
A base level of knowledge is assumed: the authors expect that you have enough experience to set up PHP, Apache and MySQL (or have a working environment), and that you’re familiar with tools like cron (though none of this knowledge is hard to find).
The installation description focuses on the Web-based installer that comes with eZ publish, explaining the significance of the choices with which you’re presented. Given this information, combined with some tips on common problems you might encounter when installing eZ publish, you should survive the install process without losing sleep.
Be warned that the material at this stage seems to be geared to eZ publish 3.3 and the process has changed in version 3.4. Otherwise, on a critical point, a lot of the space occupied by this chapter goes to screen shots of the installer, some of which could have been omitted, the text description being more than adequate.
Chapter 2: Content Management with eZ publish
One of the aspects of eZ publish 3.x that can be hard to grasp, and intimidating for beginners, is its approach to handling content. It uses a structure that’s abstract to both the content itself and to the schema of the database in which the content is stored.
This chapter provides the fundamentals. It begins by asking, "What is Content Management?" then examines the key terms and concepts in eZ publish’s content model: the notion of "content objects" and their blueprint "content classes", and how they relate to the "node tree". Authorization, permissions and roles are also introduced along with workflows, templates and basic site administrator duties, the objective being to give the reader an overview.
Although there’s a lot of theory to take in, the end of the chapter takes you through the building of a simple example site, and gives you a practical taste of the key points discussed so far.
Chapter 3: Displaying Content with eZ publish Templates
In building a site with eZ publish, a large part of the effort goes into the design and customization of user interface templates via the raw (X)HTML code.
"Learning eZ publish 3" dedicates an entire chapter to the exploration of the template engine, beginning with a useful conceptual discussion and helpful block diagrams that represent a page in terms of the templates used to generate it. The chapter then moves on to define the template language: operators, variable scope, constructs like loops, and so on, as well as summarizing "kernel" functions eZ publish exposes to the template engine.
Issues like template performance and caching are given attention and, perhaps most useful to get readers moving quickly, a collection of "Common Template Tasks" is provided, illustrating how to build functionality such as Breadcrumb Navigation and handle the display of dates and times with relevant snippets of template code.
Chapter 4: A Glimpse into the Core
If you want to build sites for someone other than yourself, an understanding of what eZ publish is doing "behind the scenes" of the templates and administration tools is ideal, as it will help you assess performance requirements and areas in which your support or intervention may be required.
This chapter aims to introduce the reader to eZ publish’s design as a PHP application. It’s the first time snippets of PHP source code turn up in the text, along with UML diagrams that illustrate relationships between classes and their role in eZ publish.
Knowledge of PHP is assumed and the discussion focuses on a number of topics specific to the eZ publish "kernel" (the core PHP code), such as how permissions are handled, and how PHP objects are stored in a database.
While this chapter does serve as a useful starting point to understanding the core of eZ publish, giving you a place to begin exploring the source code yourself, I found the discussion here a little too specific and lacking in an overall context or comparison to the design of other systems. A higher level discussion of eZ publish’s architecture would have been useful, with reference to relevant design patterns and perhaps insight into why a particular design decision was taken.
That said, it’s not necessary to have a complete understanding of eZ publish’s internals to be able to build a successful site with it, and the information provided here successfully sets the foundations for the next chapter…
Chapter 5: Extending eZ publish
eZ publish is designed with extensibility in mind and, although it already packs in a lot of functionality and a growing collection of community contributions, you may find yourself in need of something that eZ publish doesn’t yet have.
This chapter provides the essential details you need to know to develop your own extensions to eZ publish in PHP. It begins with the structure that’s used to organise extensions in the file system, then moves to discuss how common tasks such as browser redirection and template processing are handled in eZ publish. Topics like eZ publish and workflows are examined from the perspective of a PHP developer, and the chapter finishes up with an examination of SOAP and RSS support in eZ publish.
Again, there’s a lot of information to take in here, much of it stuff you’re more likely to refer to as you develop, than attempt to grasp all in one go. The pieces start to fit together with the following chapter.
Chapter 6: Extension Development
This chapter starts off nicely with another conceptual framework to help you "mentally structure" the process of building an eZ publish extension. It then moves on to the practical example of building a "WorldPay Extension" that would allow an online shop to process payments via WorldPay. The explanation is clear and leads the reader through the build step by step. The example also usefully expands on the notion of eZ publish workflows and triggers.
A second example explores development of a new eZ publish "data type" (eZ publish extends the basic types found in PHP with data types like "email", as a means to organise tasks such as validation). In walking the reader though the stages in the extensions development, further attention is given to eZ publish’s persistence APIs, serving as a useful illustration of how to work with databases in eZ publish.
The rest of the chapter discusses integration of extensions with eZ publish as a whole, and examines opportunities and strategies for code re-use, illustrating the point by building a SOAP client that uses Google’s search service.
The examples provided in this chapter are well chosen and well explained, putting readers in touch with APIs and elements of eZ publish they’re likely to need to work with as they build an extension. Combined with the preceding two chapters, this one justifies the price of the book, filling gaps where the online documentation is patchy and lacking in detail.
Chapter 7: Deploying eZ publish
Where Chapter 1 concentrated on getting a working eZ publish installation up and running as quickly as possible, this chapter discusses the issues that surround the deployment of eZ publish in a live environment.
The chapter begins with discussion of general deployment "strategy", highlighting the main considerations, from hardware requirements to security issues and the sensitive data you should do your best to protect. While some of the comments here are worthwhile and thought-provoking, others are obvious to the point of patronizing. The text also contains some empty "forms" to help you define your requirements, which look suspiciously like space-fillers.
The second half of the chapter goes some way to redeeming the first by examining technical issues such as the management of database backups and PHP accelerators that have been proven to work with eZ publish. The information provided should help those who are new to PHP, but I can’t say there was anything I personally found particularly enlightening and the range of subjects mentioned is too wide to tackle any to a useful level of detail.
Overall, I’d have to say this is the weakest chapter in the book. Personally, I’d have liked to see more discussion of technical issues and "risks" specific to eZ publish, particularly a discussion of the maintenance of eZ publish, and how the developer can deal with problems such as importing and exporting content to and from the database, and overcoming broken foreign key "constraints" in MySQL.
Chapter 8: Center for Design at RMIT Case Study
The first of two case studies examines re-building the Website of The Center for Design, part of the Royal Melbourne Institute of Technology. The end result can be seen at http://www.cfd.rmit.edu.au/.
This chapter begins by taking a step back from eZ publish. First, it explores the design requirements of the project, as well as the various stages of interface design. The process of working with the client is also recounted, along with successes and struggles along the way.
Having qualitatively explored the project, the author moves on to the details of implementation specific to eZ publish, and rounds off with honest conclusions, lessons learnt and an assessment of the time taken to reach various milestones in the implementation.
This chapter makes the book for me. It provided not just valuable insight into eZ publish, but also a successful "recipe" to deal with clients and handle the various stages in building a site using the technology. It should be possible for teams that are just getting started with eZ publish to generalize the strategy used here, reduce their own risk of failure, and avoid being overwhelmed by all that eZ publish has to offer.
Chapter 9: Creating a Standards-Complaint eZ publish Site
The final chapter of the book, also a case study, examines the replacement the existing, static Website of the Department of Geomatic Engineering at University College London (UCL): http://www.ge.ucl.ac.uk/ with eZ publish.
The primary focus of this study is the use of eZ publish templates to build a user interface that’s XHTML compliant and uses CSS to separate style from content. The lead-in provides short introductions to XHTML and CSS, most of which won’t be news to those who frequent SitePoint, but which are worth re-stating
Having put the project in context, the discussion moves on to the requirements for the user interface and content structure, and translates them into eZ publish templates. The template examples provided should prove useful as further snippets, from which the reader can gain ideas; they’re also valuable as they suggest a workable CSS strategy for eZ publish, including naming conventions and preferred identifiers.
The chapter finishes by touching on performance issues and approaches to caching and the optimization of eZ publish’s performance.
Although this chapter cannot be so readily generalized into an overall strategy as the case study in Chapter 8, the focus on template design is valuable. It provided insight that should help readers grasp the template language more quickly, and understand how it fits into the bigger picture of a site.
Who Should Read it?
"Learning eZ publish 3" is geared for the technically minded who have already decided eZ publish itself meets their general requirements. It does not attempt to "sell" eZ publish, but focuses on the technical and strategic issues you’ll be faced with as a developer, designer or administrator.
Depending on the chapter you’re reading, a some understanding of PHP is required, and readers ideally should be able to manage basic platform-related tasks such as working with the UNIX command line and MySQL, and configuring Apache. At the same time, the authors have wisely avoiding re-producing material that can be found, in depth, elsewhere, which has allowed the text to stay focused on eZ publish.
Style and Feel
Though out the narrative, this text adopts the first person plural, "we", in addressing the reader and has a straightforward style that’s effective in communicating the issues, though it can be somewhat dry at times.
As with all technical books that are written by multiple authors, "Learning eZ publish 3" provides the reader with the chance to gain from different authors’ perspectives and insights at the cost of disjointed segues between subjects and chapters. Thankfully, "Learning eZ publish 3" is well structured, its chapters organised to avoid repetition and allow the reader to progress from earlier material.
One minor practical gripe is that there’s not a lot of white space or clear visual structuring in this book, which makes finding your place while "thumbing around" a little tricky. Of course, blank paper costs money so good old page numbers will have to do.
Overall, I think this is a good book. It contains a lot of valuable information, much of which is either missing from the online documentation, or is too "ad hoc" to ensure a clear understanding. The book manages to gel into a clear structure that’s relevant to those working with eZ publish.
Be prepared to have an eZ publish installation readily available for hacking while reading the book, if you want to get the most out of it.
There are points, such as Chapter 7, at which there’s room for improvement, but hopefully this book will continue to evolve alongside eZ publish itself. Some other things that would be nice to see (depending on publishing costs) would be an eZ publish API reference, along the lines of the O’Reilly Nutshell books, and more insight into the maintenance of an eZ publish site (dealing with upgrades, managing the database etc.). A follow-up to the case studies that recounted the team’s experiences after the sites had some online miles under their belts would also be valuable.
Bottom line: if you’re excited by eZ publish 3, but are frustrated by the documentation, "Learning eZ publish" is what you’re looking for.
Learning eZ publish 3: Building Content Management Solutions
Publisher: Packt Publishing
Authors: Paul Borgermans, Tony Wood, Paul Forsyth, Martin Bauer, Bjoern Dieding, Ben Pirt
Pages: 337 + 20 appendices