In my previous post, I was talking about main practice on designing content tree on eZPublish and some limitations due to the current architecture of this CMS.

It seems that this matter of concern was shared by a lot of people, in particular at eZSystems as Paul Borgermans has shown us during the eZDeveloper Meeting. See there.

The project V is the full reimplementation of eZPublish core to lighten it and make it more powerful and flexible. Looking back the evolution of eZPublish, a such great upgrade did not happened from the 3.x series, since 4.x was just a porting to PHP5. Thanks to new tools like a bug tracker or a testing suite, eZSystems has set a mature development system which can produce software of higher quality than before. So the difference between 3.x and 4.x is few bugs and PHP5.

What's next ? The Project V has the ambition to provide two things :

  • a very modular and flexible Unix-like micro kernel. It will allow you to access more efficiently its API and will be based on ezComponents, specifically on the MVCTools component. This particular feature might let you use other components than the ezComponents : Smarty for another template engine or Doctrine / Propel for the persistence layer. It meets up with functionalities of another product we know well.
  • a bundle of RAD tools to ease and quicken the development.

As it will be a complete different kernel, extensions will be different. To ease this migration, the engine of the Project V will appear as soon as 4.2 : the broker would bring the possibility to choose between old and new behaviour.

Quite exciting !

This post is about different things. It came from a long talk with Damien Pitard, web architect at Prisma Presse, which began with the difference of concept between using content as children rather than putting it in the direct content. For example, if you have an article related to companies, you can organize differently your content :

  • You can upgrade your article to put some extra data, like a matrix attribute. There's no limit with this kind of data type : you are sure to store what you want inside the content. So the point is that all your data, related data and main data will be together. The only issue is that this kind of data type does not exist if you consider more complex data type.
  • Another point is to make your article class like a container and create a new class called company with two or three attributes. By this way, you can add as many companies under your article node and with few template codes, show them. There is no limit with the number of content or the complexity of you content. However, the main issue is that maybe the company does not have a real existence on your web site. It means that you maybe don't want to have a page with a full view of your company. This is the source of a lot of SEO related issues and bug.

There is also a third but not right solution : you can mix basic data types in your content to reach what you would like to have. For example, you have a content with attributes Title, Subtitle 1, Text 1, Subtitle 2, Text 2 and so on. The main issue, even if you got almost what you need, is that you might be limited by the number of attributes. What will happen if you're asked for a subtitle 32 and text 32 ?

As eZPublish is a great product, we just challenged it in a regular way : what we want is to fill customers need and what we have is in eZPublish. We went by two phases : how we use eZPublish and how we would like to change in it.

Underlying concepts

The more you make technical specifications for eZPublish projects, the more you find strange solutions to reach your aim. Looking back, we both made experiments with eZPublish and as the versions went up, we understood some points about the main matter : the content.

This is how the content is typically used in eZPublish :

  • To store content. We can find this kind of content at the end of the tree, the leaves. There is nothing under them and they are the representation of a page in the CMS. In eZPublish, you expect to have a lot this kind but it's not exactly what happens on projects.

This show a typical organization with content nodes (Article content type).

  • To structure the content. You can find some contents which are only set up with one attribute, a text line, to make it clickable in the back office. The main point is that it doesn't its own content. A counter example is the Folder content provided in standard by eZSystems in their packages (eZWebin or eZFlow). This class is composed with other attributes like a Description field or a date. It adds content to the website and isn't here to represent a way to categorize your content. This is what you may be tempted to do but it causes several issues.

This is how is organized the content with structure content types.

  • To syndicate the content. You'll use a content to be the start node of your tree to syndicate content which is under. For example, the typical homepage does not own content or is just a structure node which will put nodes back up. eZSystems has provided a great interface to do this but it still remain on nodes with the Front Page class.

This shows the organization with syndication content types.

What we have understood is that the main a key of a CMS is to provide a page for a content, and in eZ, as you are free to organize you content (you're not guided), you can make great mistakes.

Content rules to make your content rules

Those are the rules that may have to be respected but which are not always and that contribute to provide main issues on standard features :

  • Don't use structure nodes or syndication nodes in your tree. It doesn't supply any content. Make a module instead.
  • One content is one page. This will allow you to easily organize your tree and consolidate your content in one and indivisible content. If you decide to display your content in some complex layout, it will ease the separation between the content linked to the uri and the other kind of information. Consequences of this rule are that each content must represent only one page and that your content have to be a complete content, not scattered in few pages. There is a lot of advantages to proceed like this :
    • it's easier to publish content and to set the SEO rules (No duplication in pages).
    • all part of your content can be visible in the same page : you won't have to cheat with redirection or include templates to correct this.
    • your tree is lighter.
    • your content is complete.
  • Don't make relations between content that does not need a real representation of itself. For example, don't try to link a content that is only shown as a line in a folder override. It implies that you will have to make an override for the full view which doesn't mean anything. All types of relation are concerned : child relation and content relation.
  • Use transversal categorization like a category data type or a tag data type to avoid useless tree nodes.

Powerful but useless

Finally, the most important in a CMS is to efficiently manage content. This truism shows that sometimes we forget the things which has to be perfect in the software and that is polluted by other provided features that are used in 10% of your projects. Those become useless features as long as you apply our rules :

  • The multi positioning system : this feature allows you to add several locations to an object. When you modify the content, the modification is affecting all the locations. However, it implies that you have a 1 to many relation between content objects and nodes. If you don't use multi positioning, you can merge the table of nodes and objects, increasing all your requests on content.
  • The class tables : this features is not longer useful provided that each time you make a modification in a class you have to modify the corresponding templates. Let stop deluding ourselves here, in an eZProject, developers don't make perfect templates with all the cases and your users doesn't modify the classes. It is possible to store it elsewhere like in an XML file that will be cached. If we remove this tables, the requests on content are improved.
  • Users and roles management : all users and groups are stored as content. Provided that all the modules use those ones, it is heavily eating up resources. As we have to manage it on line, it's better to keep the current interface but not to store it as content.

Conclusion

CMS are evolving quickly, users are asking new features everyday, high performance and availability level is becoming a standard and the software law of evolution is wreaking havoc. It is a matter of fact that eZPublish has a perfect conception model to store any content lying on a complex and full featured architecture. We are resigned : what has brought eZPublish to its CMS high rank will maybe lead it to the end. Nowadays, this model is reaching its limits and new CMS are coming out with light interfaces and light and flexible architectures.

This one has been discovered by one of my colleague, Chawalit Tangwongpiboon, while he was searching security holes in eZPublish.

Go on this page, choose a website and type at the end :

/content/browse/2

or

/user/register

or

/ezinfo/about

You can access all the tree of the website, or you can register yourself on the website or just access some information about versions and packages installed on this website.

Where does it come from ? Just from the override/site.ini where the definitions of the siteaccess rules are stored. It actually overrides your own roles and policies for the anonymous role. But by default, eZ allow anonymous user to access those modules. If you want to secure your site, the best way is to forbid access by modifying the rules :

[SiteAccessRules]
 Rules[]=Access;disable
 Rules[]=Module;user/register

It will disable the view for this module.

I have tested a lot of sites and almost all let those information and accesses out.

Terrific...

And I finally finished it, the new version is better, smaller, faster, stronger ?

Here are some screenshot of what it can do.

Some informations :

  • Click on the link to install the extension
  • To use it, you can click on the small icon on the bottom right corner, make CTRL+SHIFT+E combination or open the related sidebar in Firefox. Then just press Scan when you are on a page with debug inside.
  • Due to the differences between Firefox 2 and 3, it won't be updated fore Firefox 2. (And also because I'm lazy).
  • If there's no debug on the page, nothing happens.
  • If you got some trouble, you can mail me or just leave a message here.

You can download it on the official extension page on addons.mozilla.org. Please for this extension and leave a comment so it can be supported by the Mozilla Foundation.

Or you can download it here.

To install it, just click on it, Firefox will install it.

It's done. We loved it, they stop it. Bye bye eZPublish 3.x series...

Yes, a bit sad but how good for developpers ! There were some features that eZSystems improved in the 3.x and which made this great software a more evolutive and scalable software for everyone. Here are the features I remember the most :

3.6

  • LDAP handler : connect eZPublish on a LDAP directory and to automatically create users in the eZ subtree.
  • Reverse features : get the objects which are relating the current object.
  • Remove subtree : useful to delete entire subtree.

3.7

  • Siteaccess settings in the extensions : you can put siteaccess settings in the extension. It allows you to design reusable extensions, overriding standards.
  • Developpement Mode : in dev mode it's not necessary to clear cache at each time...

3.8

  • Internationalisation : it is possible to translate any content in any language without having a content reference translated in a given language.
  • Clustering : you can put several instance of eZ on several hosts to share the load.
  • Group approval for workflows.
  • Serialization for all datatypes.
  • eZInfo() function for extensions.

3.9

  • Auto upload for files in Online Editor.
  • Diff.

And now ?

Some upcoming goodies for us ! Version 3.10.1 and 4.0.1 will be updated and 4.1 is announced for Q3. It seems that eZ gets behind...

No ?

My badge at the eZConference

Few weeks ago, I participipated to the eZConference & Open Nordic 2008 in Skien in Norway. There's some things you must now about Norway :

  • It's difficult to get there, even by plane, or car or camel...
  • It's absurdly expensive (150€ to do 40km in cab)
  • There's no night
  • Most of Norvegian is speaking english, hopefully !
  • They eat caviar for breakfast
  • Salmon is absurdly cheap

By the way, as you can imagine, Norway is a big country with few persons in it. So there's a lot of space and they are very concerned by the quality of their life : cities are clean and services are perfect.

Open Nordic 2008

The conference stood in the Skien Ibsenhuset, a very large conference hall, where both conferences, eZConference and Open Nordic, happened.

The main subject on eZ were :

  • Multiple file upload in 4.1 : it has been made in complement of the webdav feature which does not work on all platforms (Did I say Windows ???).
  • OE 5 : integrating Tiny MCE, this WYSIWG editor rocks ! After having worked with HTMLArea, FCKEditor and the former OE, it seems to be the more powerfull and intuitive work ever done. At least, it is a very visible work.
  • Support for OpenOffice.org and Microsoft Office document import and export in eZ via a nested toolbar in the editor : you can open content directly on an eZ instance via a Java connector and modify it as you want. When you save it, it will send the data to the eZ instance and update your website. Very powerfull and I guess very similar to the Sharepoint feature.
  • Site factory and CSS Editor : two features which are made to ease the deployment and configuration of eZ websites. The first is a console tool allowing to deploy in one command an entire site with a specified configuration (it uses REST). The second one is a kind of webmaster gadget in full java which will allow people to modify their design in few clicks : you activate a design mode on your frontend and then you can select each element of the page and then change some defined css values, like background-color or what you want.
  • ezComponents integration : eZGuys are close to completely lighten the kernel libs by integrating the eZComponents. The most important change will happen when the integration of the ezcTemplate will be effective. It's a big step for the eZCommunity because we will have to deal with a strict template engine (at last !).
  • And some new components like Document and Search.

By the way, it was a great time, sharing our knowledge and drinking beers at the at the pub...

Nicolas Pastorino from eZSystems

Bård Farstad and Damien Pobel

Oslo

And then I travelled a bit to reach Oslo... Country, sea and half-light :

Countryside

Seaside

Opera

At night

Conclusion

It was a great trip, lot of emotions, lot of exchanges between people from different countries, and one pledge : next year I will be there, Monseigneur.

:-D

During a mission, I discovered jQuery : a javascript library providing facilities and strong functionnalities to static web pages.

jQuery

The use of this library is very simple. It has been made to use the developper's life and specially the maintenance of functionnalities. The javascript entered is shorter and more simple. It has few concepts so it is very quick to learn.

There is only one entry point in jQuery : the $ function. It allows you to access some standard functions to select nodes in the DOM, to manipulate them or to handle events.

The selectors are very useful because you can select almost every item in the DOM using id, css class or javascript variable name. Then, if there is more than one occurence, the function will result an array. Moreover, you can use XPath expression as filters, to reduce the number of object returned.

The strength of jQuery is the chainability of the functions. It allows to increase readability and maintenance of a javascript. You can also combine jQuery with classical JavaScript scripts.

The Challenge

To test this library, I've decided to develop an eZPublish extension integrating the jQuery library.

As a user case, I've chosen the Facebook tagging functionnality : you choose a picture, you tag your friends, you save it, hovering the head of a friend, the name is shown...

I have first worked offline to design the javascript. Here's a snapshot of what I have done : image gallery

Conclusion : it's very easy to come to grips with jQuery and a bit hard to debug. So I've searched and found a plugin to debug my script. See below.

Other interresting libraries...

I also heard about the ExtJS library which is a professional javascript library providing user interface components to build professional applications. jQuery is also experimenting this way by launching jQuery UI. It will be at the end equivalent I guess, but you will be able to still use the jQuery library as an independant library.

Ressources

Here's some ressource :

jQuery : http://www.jquery.com

Visual jQuery : http://www.visualjquery.com/1.1.2.html

Dump Plugin for jQuery : http://www.netgrow.com.au/files/javascript_dump.cfm

Javascript benchmark : http://flesler.blogspot.com/2008/04/benchmarking-javascript-variables-and.html

Still trying to find ways to improve eZPublish, I've thought about a simple process to resize pictures without having to download the picture, to resize in whatever image software and then, upload it again in eZPublish.

My aim is resizing and not scaling. It means that we are losing some information by cropping the picture that we are not losing by resizing. I'm just specifying this point because it's not a extension of the image.ini / image_class mechanism, but a new functionality which allow the user to cut himself a square in his picture. I guess a picture of the result is more obvious :

 

You can download it as usually on ez.no.

It uses a JavaScript library coded by David Spurr and the Scriptaculous library.

eZ Systems has included in their last release of eZ Publish a client for the Red5 video streaming server.

The documentation is a bit short and you don't necessary have all the elements to complete a full installation. After two hours of hanging about, I succeeded. :-D

Apache configuration

About the Apache configuration, you must add the following lines :

Listen 100

NameVirtualHost *:100

<VirtualHost localhost:100>

<Directory path\to\Red5\webapps>

Options FollowSymLinks

AllowOverride None

Allow From All

</Directory>

DocumentRoot path\to\Red5\webapps

ServerName localhost

</VirtualHost>

The first two lines are declaring to Apache the use of port 100 and that some virtual host will listen to it.

The second part is the virtual host as well, what I've added is the "Allow From All" directive that forbidd everyone to access the video. We can tune that.

Content configuration

The Red5 flash client is set up with the content published. In the eZ Flow site package, you have a content named "Live Recorder" which will support the recoder and which can be configured by editing its content. We have three attributes:

  • Name : the name of the content : whatever.
  • Stream Server : it is the URL to the Red5 server. The protocole used is RTMP (watch out the spelling) and you must finish it by a slash :
rtmp://localhost:1935/test/
  • File Server : it is the URL of the Apache file server which deserves the saved files. It's not streams/streams like in the screenshot.
http://localhost:100/test/streams/

And then you plug your webcam and you can start to make some funny films... live !

Conclusion

This feature is very powerful and stunning, however, I didn't find how we can put a live stream online and how we can list all the video we have taken.

Red5 Wiki

Main concept

A year ago, I was working on a project where we were confronted to a certain problematic. We had a lot of classes which really looked like each other and had the same schema of class. So, when we had to modify a class because an attribute was missing or not in the right datatype, we have been obliged to modify all classes and it's very very long when you've got a lot of content types. We were thinking at a solution : creating a class wich willl be a parent class for all the other classes. For exemple, your customer is selling furniture products via the webshop and here is a detail of how this solution could be applied :

  • You create a class Furniture Product with those very generic attributes : Name, Description and so on.
  • Actually, you have three types of furniture products, Table, Cupboard, Settee. In the normal way, you will have to create three different classes with common generic attributes and specific attributes. There, you will just create a class with the specific attributes, and choose via a list of classes from wich one you would like to inherit.
  • After that, when you are editing and publishing content, the content schema is based on the merge of the parent class attributes and the specific class attributes.

Implementation

To realize that, here's what I was thinking about :

  • Modify the SQL schema of the ezcontentclass table to add a integer attribute called parentclass_id.
  • Modify the kernel/classes/ezcontentclass.php file to add parentclass_id to the definition of the object.
  • Modify the kernel/classes/ezcontentclass_attribute.php file to process all the attributes, main class and parent class attributes, when we use a function.
  • Modify the design/admin/templates/class/edit.tpl file to add the list of classes who can be parent.
  • Modify the kernel/class/edit.php file to save the information.
eZ Publish™ copyright © 1999-2008 eZ Systems AS