39,59 €
eZ Publish provides developers with a structure to build highly impressive applications and then quickly deploy them into a live environment. eZ Publish is complex, with a steep learning curve, but with the right direction it offers great flexibility and power. What makes eZ Publish special is not the long list of features, but what's going on behind the scenes.
Created specifically for newcomers to eZ Publish, and using an example Magazine web site, this book focuses on designing, building and deploying eZ Publish to create an enterprise site quickly and easily.
This tutorial takes eZ Publish's steep learning curve head-on, and walks you through the process of designing and building content-rich web sites. It makes the unrivalled power and flexibility of eZ Publish accessible to all developers.
The book is organized around technical topics, which are handled in depth, with a general progression that follows the learning experience of the reader, and features a single magazine web site project from installation to completion and deployment. This hands-on guide helps the reader to understand the Content Management System to create a web 2.0-ready web site by creating new extensions or overriding the existing ones. In turn, it helps you to become confident when working in the eZ Publish administration area and offers an environment in which you can practice while working through the chapters.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 250
Veröffentlichungsjahr: 2009
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2009
Production Reference: 1151009
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-904811-64-0
www.packtpub.com
Cover Image by Vinayak Chittar (<[email protected]>)
Authors
Francesco Fullone
Francesco Trucchia
Reviewer
Maxime Thomas
Acquisition Editor
James Lumsden
Development Editor
Amey Kanse
Technical Editor
Bhupali Khule
Copy Editor
Sneha Kulkarni
Indexer
Monica Ajmera
Editorial Team Leader
Akshara Aware
Project Team Leader
Lata Basantani
Project Coordinator
Rajashree Hamine
Proofreader
Dirk Manuel
Graphics
Nilesh R Mohite
Production Coordinator
Dolly Dasilva
Cover Work
Dolly Dasilva
Francesco Fullone is a geek who, in his spare time, acts as the founder and the CEO of Ideato, a Web 2.0 company based in Italy. He is a senior consultant, skilled in Agile methods and any kind of PHP development.
Francesco is also the president of the Italian PHP User Group (GrUSP) and an evangelist on open source software and PHP technologies. You can meet him in Italy at one of the tech conferences, where he usually participates as a speaker or a staff member.
Francesco would like to thank the Ideato family for the help given during the testing of the book's code, the Packt staff for their patience towards a new author and Diana, who supported him in this "adventure".
Francesco Trucchia, after taking a degree in computer science, worked for some years as a web engineer on small, medium, and large projects for some Italian companies.
He is now the co-founder and the CTO of Ideato, a PHP Italian company that is expert in web software development, systems integration, and Agile methods.
Francesco likes to develop with Agile methods. He has introduced these practices in Ideato for their software's lifecycle process, and has received a lot of positive feedback for it.
Francesco would like to thank his company, Ideato, that gave him the opportunity to write this book, all the Pack editorial staff, particularly Rajashree, Bhupali, Amey, and Sneha for their great patience, assistance, and professionalism, the eZ System company for the great work that they are doing to make eZ Publish the best Open Source CMS, his family and his fiancée Chiara who supported and encouraged him every day on writing this book.
Maxime Thomas has a degree in computer science from ESIAL University in Nancy, France. He worked for two years as a developer in a French company specializing in IT services, which has given him his web culture and has contributed to his knowledge of the basic rules of design for websites. For two years now, he's been responsible of the open source CMS offers at a major IT service company, mainly working with offers for the media sector. He has been certified in eZ Publish since 2007 and shares his ideas on his blog, which is available at http://www.wascou.org/wascou/Blogs/Maxime-THOMAS.
I would like to thank the people with whom I can share information about eZ Publish: Xavier, Damien, and Benoit. I also would like to thank Vincent, who has changed my opinion on open source software, and eZ Publish in particular. Finally, I would like to thank Ana for her every day support.
Welcome to our book on building websites with eZ Publish. Before starting to learn how to use it to create a site, let's take a short moment to better understand the overall context of content management on the internet.
In recent years, we have seen the evolution of the Content Management Systems, or CMSes. This kind of software from a simple set of tools for managing text and pages of a website, has had to adapt and evolve to become more flexible. Nowadays, CMSes need to be extensible, and use plugins or vertical modules to cater for different needs.
The concept of a web page has moved from being a mere graphical representation of information to a point where we can decouple the content from the presentation. In turn, we can also decouple content from its publication media. Today, a single item of content can be represented in boundless ways (for example, through the use of Cascading Style Sheets, or CSS), and can be made accessible from almost any device, through such things as RSS, Microformat, and so on.
Disciplines such as IA (Information Architecture) have made great strides in determining how content should be managed. New information structures have been developed across the years, from the simple and limited hierarchy of categories, to multi-structured and more complex data organizations now used in any context.
In short, the Internet has become a 360-degree communication platform, which increasingly uses various media in a single context. But the internet is also all about content, which can be represented in a lot of different ways.
This is a big problem for developers who have to create and manage sites. These new concepts have introduced new challenges for the management of websites.
In fact, the rigidity of managing information, as characterized by the old CMS generation, has led many developers to seek new solutions—solutions that are customizable according to the needs of the moment.
eZ Publish was born for new media and enterprise content publishing. This product can be used by all levels of developer to build corporate websites, intranets, web shops, and media portals. eZ Publish is 100% open-source, available either as a free download or as an enterprise solution (as eZ Publish Premium with support, guarantees, and maintenance for companies that need advanced help).
In the first year of its life, eZ Publish moved from a Content Management System approach to a Content Management Framework approach. A Content Management Framework, or CMF, can be defined as an application programming interface for creating a customized Content Management System.
In this book, we will be building an enterprise website with eZ Publish. eZ Publish is well-suited to a project like this due to its structured content model and versioning capabilities, as well as pre-built functionality that ensures rapid and professional deployment with minimal fuss.
eZ Publish has some key features:
This book will focus on the delivery of a standards-based enterprise website for a magazine adopting eZ Publish for the first time. The book will feature a single magazine project from installation through to completion and deployment of the eZ Publish website.
This book is divided into three main areas: set-up, creating content, and managing it. We won't follow a linear approach but instead will try to see what we need in any given area to accomplish our tasks and then, chapter by chapter, we will drill down into concepts when needed.
Chapter 1, Installing eZ Publish: This chapter will look at the processes involved in installing eZ Publish for the magazine project, including hosting requirements. The choices that need to be made during installation will also be covered.
Chapter 2, Creating Our Site Accesses: What are siteaccesses? When we work on a customer site it is useful to have different environments available to show your customer what we are doing. In this chapter, we'll create some simple site access rules to manage these areas. We will also take a deeper look at what site accesses are, and how they work.
Chapter 3, Defining and Creating Content Classes: This chapter will introduce us to the standard content classes of eZ Publish. We will also learn to create the required classes, for the additional structured content, as defined by the project.
Chapter 4, Creating Content Structure: This chapter will look at creating the default content structure for the magazine, as well as adding some initial content, so that we can see the structure and layout of various default content classes. We'll also introduce the eZ Publish backend and its functionality.
Chapter 5Creating an Extension: We will create an extension to hold all of our customizations for this project, which is much better than working in the standard folders and will help us in any future system upgrade.
Chapter 6Template Design: In this chapter, we will see how to apply a template to a single content or to a node folder. We will also take a look at the template overrides, and creating a design extension.
Chapter 7Template Content Classes: Custom templates for content approval and checkout processes are important concepts in many eZ Publish undertakings, and will be featured in this chapter. We will also create a custom template for both a standard class and a custom class.
Chapter 8Adding Community Forums: In this chapter we'll take a look at the built-in forums available through the ezwebin packages. We will implement these content classes and templates, and then work on them further, adding functionality that was not previously included in eZ Publish 4.0, but which will be useful to the magazine.
Chapter 9Internationalization and localization: This chapter provides a brief overview of the internationalization capabilities of eZ Publish. We will implement some additional language translations for our customers who may be visiting and looking to enroll at the magazine.
Chapter 10Creating Roles and Privileges: After all of this defining and creating, we need to actually get useful content into the system. There are a number of approaches to do so, and this chapter will cover the main ones in detail, with a short discussion on other methods.
Chapter 11Cache configuration: The cache system is one of the most important subsystems of eZ Publish. In this chapter, we will explain how to use it and how to customize it for our needs.
Chapter 12Deployment: The deployment chapter investigates the processes associated with deploying our development site to production.
Appendix A, APC Tuning for eZ Publish: eZ Publish, to publish the web pages, has to elaborate a lot of data. This work, in some cases, can be a CPU-eater and may slow down the response of the server. For this reason, we will learn how to install and use an opcode cache system, such as APC.
Appendix B, Advance Debugging: During the development of the eZ Publish site, it is very important to receive immediate feedback about what we are doing. We will learn how to enable and use the code debugger and the template debugger that are included in the CMF.
Appendix C, eZ Publish Extensions: We will introduce some of the best extensions developed by the eZ Publish community.
Unless otherwise stated, the environment used in the examples, and referred to throughout the book, is a LAMP platform with PHP 5.2.x, MySQL 5.x and eZ Publish 4.0.1. We'll use the shipped eZ webin template that eZ System offers bundled with the CMF.
If you need to work on a site with a complex publishing workfl ow, or have to manage an enterprise level site and want to use eZ Publish from scratch and without requiring hardcore programming skills, this is the book you need.
You will learn how to install, manage and customize the eZ Publish platform. This book is for you if you are not a PHP-guru, and you don't want to study the eZ Publish core functionality.
In general, however, you'll get more out of the book if you know a little PHP, understand some concepts of Object Oriented Programming, and have a general familiarity with CMS concepts.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through the use of the include directive."
A block of code will be set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be shown in bold:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "Click on the Setup tab on top menu."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to <[email protected]>, and mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/files/code/1640_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Enterprise content management (ECM) is a set of technologies used to capture, store, preserve and deliver content and documents related to organizational processes.
This definition is taken from http://en.wikipedia.org/wiki/ Enterprise_content_management.
In this chapter, we will introduce the eZ Publish software. We will then prepare the development server by downloading the software and creating a database, and we will follow the installation wizard to have eZ Publish running on our server.
eZ Publish is an Enterprise Content Management System. It helps to build corporate websites, intranets, web shops, and media portals. Moreover, eZ Publish is 100% open source, available either as a free download or as an enterprise solution—eZ Publish Premium—with support, guarantees, and maintenance.
This software is designed to be used by small, medium, and large companies. It provides a lot of advanced features that can be used, by default, to create professional and secure solutions.
The software allows websites to be fully extended and modified, and unlike other CMSes, it's a truly scalable system.
eZ Publish supports, out of the box, the following features:
eZ Publish is more than a simple CMS; it is a Content Management Framework (CMF). This means that it is much more flexible, extendable, and reusable.
A content management framework is an Application Programming Interface (API) for creating a customized content management system.
The eZ Publish kernel is crafted on top of eZ CMF, a content management framework fully developed by eZ System. This framework makes the eZ Publish functionality stable, secure, and well engineered. And thanks to the CMF, it is possible to extend and personalize the CMS features to provide specific tasks or create mashups and integrations with other open source products, such as CRMs, financial software, or e-commerce platforms.
The most recent releases of eZ Publish also use eZ Components, a set of independent components that will eventually replace all of the core functionality of eZ CMF. With eZ Publish 4.0, it is possible to develop extensions using these components that give a powerful API for each use.
As we have said in the preface, it is very important to understand that eZ Publish offers (as downloaded) three main features:
Website packages are designed by the eZ System to use the main engine to help users deploy different sites with different scopes: a community site, a static one, or an intranet application. The three main packages are Plain Site, eZ Webin, and eZ Flow.
Whereas the first one is only a skeleton, on top of which a developer can craft his or her own application, the other two allow developers to use a lot of functionality without touching an IDE.
eZ Webin is a package that contains all of the functionality required to build a complete Web 2.0 site. It is fully documented by eZ System, and this documentation can be found at http://ez.no/doc/extensions/website_interface. eZ Webin is very useful for creating a site from scratch.
To build our site, we will use this package in the next chapters, customizing the site wherever needed.
eZ Webin includes:
Vibrant sites are all about content flow—getting the most engaging and timely content streams onto the site's critical portal pages. Built on top of eZ Publish as a result of collaboration and experience with media customers, the eZ Flow extension (http://ez.no/doc/extensions/ez_flow) enables editors to build complex page layouts and pre-plan the publication schedule to ensure a constant flow of rich content. In short, eZ Flow brings modern portal management possibilities to eZ Publish.
eZ Flow is a web package that provides the following added functionalities:
Before we start using the CMS/F, we have to check if our system is ready for it. As our first task, we will have to see if the hosting requirements are fulfilled. Then we will configure the PHP interpreter according to eZ Publish's needs.
One of the most important things to understand is that hosting plays a very important role in managing eZ Publish. The minimum requirements for installing eZ Publish, in terms of both software and hardware, are discussed in the subsequent sections.
The installation requires about 50 MB on your hard disk, but as always, the more space you reserve for the system the better. For a good system experience, we suggest some minimum values: at least 1GHz CPU and 512 MB of dedicated RAM.
As with any other software application developed in PHP, eZ Publish also needs some configuration to better work with the interpreter. The most important is the one related to memory usage and timezone settings. Moreover, the same settings should be applied to both the command-line site and to the Apache (or IIS) module.
eZ Publish needs at least 64 MB (but 128 is preferred) in order to complete the Setup Wizard. If you are using PHP 5.2.0 or an earlier version, you'll have to increase the default memory_limit setting, which is located in the php.ini configuration file (don't forget to restart Apache after editing php.ini). Normal operation requires about 16 MB. However, it is highly recommended that you keep the 64 MB setting as eZ Publish consumes a lot more memory as soon as you re-index the search, execute upgrade scripts, and so on.
