piotr karaś

› Persistent variables - checked out

Well, I gave up my variable caching ideas, even if just for a while. I wanted to master the standard caching techniques (there had always been an excuse, some extension to write...). And I am very glad now because it starts to feel like having real control over my eZ implementations ;)

Among things that I've discovered were persistent variables, recommended by Gaetano in response to my var cache struggling, and completely unknown to me before. Even if not a complete substitute, still a very nice solution, one of those that you ask yourself how you could have lived without...

So what's so great about persistent variables without going into much detail?

Control

They don't require any additional control. Persistent variables are compiled as part of viewcache, which means that they only expire when the viewcache expires, and they naturally follow the smart viewcache clear rules as well. What more control needed than that?

Availability

They seem to be available at all times, if not cached before, calculated upon request for the full view that stores them.

This also means that expiry times of cache-blocks that depend on that data do not have to be synchronized in any way (not that it is even possible...). Gaetano mentioned the relationship between viewcache and cache-block clear being an important issue, but I haven't been able to spot any unwanted or problematic link, yet.

Cost

Persistent variables can indeed store a variety of data useful for further generating parts of the pagelayout. Even if the singular cost of viewcache generation goes slightly up, this is usually benefitial: once generated, the variables are simply there as long as needed. And in most cases all I need is some $node-related operations.

Even if some more expensive data is to be fetched, once you're through the effort of composing you persistent hash, it's there!

Some minor disadvantages.

Since the variables are physically serialized, it is impossible to pass complex objects, such as $node directly. You have to precisely choose which simple data you want (numbers, strings, arrays, hashes...). Luckily, arrays do just fine in most cases, so that's probably as much as one may need before going straight to a fetch outside of a full view.

Then, some includes seem to be able to damage a persistent var that had been generated few lines before, so you have to carefully test if the persistent var set is available in all the full views required. Haven't found an exact rule, yet.

If you're interested if a very nice use example, look here in the comments.

21/05/2008 6:50 pm (UTC)   Piotr Karaś   View entry   Digg!  digg it!   del.icio.us  del.icio.us

piotr karaś

› Upcomming Summer 2008 eZ

A busy week expected in the fourth week of June this year:

eZ Publish Community Developer Day, June 18th, 2008

Tutorials, break-out sessions, talks and presentations, barcamp... some topics announced till now include: performance and testing, improving usability & accessibility in eZ publish, web 2.0, OpenID, integration between ez publish and Ajax frameworks, Open office integration, eZ Components, eZ Find, TinyERP integration, microformats...

http://ez.no/developer/news/ez_publish_community_developer_day_june_18th_2008

eZ Conference & Awards, June 19-20th, 2008

The annual eZ Conference & Awards is the largest Open Source CMS event in Europe. This year marks the 6th annual eZ Conference and new this year is that it will be run together with the Open Nordic Conference and the Open Nordic Mobile event. This is without doubt, the biggest event ever held in Europe with main focus on Free Software.

All together more than 1000 people are expected to join during these days. The program will include keynote sessions, panel discussions and valuable exhibiting.

http://conference.ez.no/

PHP Vikinger, June 21st, 2008

PHP Vikinger is an unconference directed towards everyone who wants to learn more about PHP and likes to discuss and meet with new people. Unlike normal conferences, the talks at conferences are determined by the attendees, and not a program committee.

http://phpvikinger.org/

Can't wait!

This year will be my first time to join eZ Community during this series of events.

21/05/2008 6:36 pm (UTC)   Piotr Karaś   View entry   Digg!  digg it!   del.icio.us  del.icio.us

maxime thomas

› Little surevy : Who's coming ?

Hey buddy,

Are you coming to the eZ Conference this year ?

If yes please leave me a comment !

20/05/2008 8:23 am (UTC)   Maxime Thomas   View entry   Digg!  digg it!   del.icio.us  del.icio.us

maxime thomas

› Little survey : Who's coming ?

Hey buddy,

Are you coming to the eZ Conference this year ?

If yes please leave me a comment !

20/05/2008 8:23 am (UTC)   Maxime Thomas   View entry   Digg!  digg it!   del.icio.us  del.icio.us

ez projects

› PHP5 update of "extract" (csv export) extension

I've done an update for the ez4 (php5) version of the "extract" extension.

  • removed references
  • removed strict warnings
  • template bugfix

The code for eZ 3.x is moved to the branch directory.

19/05/2008 12:51 pm (UTC)   eZ Projects   View entry   Digg!  digg it!   del.icio.us  del.icio.us

łukasz serwatka  eZ systems employee

› Updated design

I have refreshed my personal website skin a bit. This time in blue. This is initial release so I might add some minor changes in near future based on received comments and feedback. During re-design process I have also removed some outdated content and improved usability like bigger font size which was to small in old design. Hopefully you will like it more then the old one. Feel free to post a comment with your opinion. I will be glad to hear what do you think.

18/05/2008 2:06 pm (UTC)   Łukasz Serwatka   View entry   Digg!  digg it!   del.icio.us  del.icio.us

community news (ez.no)  eZ systems employee

› New releases for extensions and add-ons

While work continues on the next maintenance releases for eZ Publish as well as eZ Publish 4.1, we provide you new final and beta releases for some extensions this week.

Final release of eZ Survey for eZ Publish 4.0

Through an open funding project, an enhanced version of the eZ Survey extension is available for download on the projects.ez.no site

Beta releases of eZ Online Editor and eZ Newsletter

A second beta release of the new eZ Online Editor 5.0 is also available. The final release will be bundled with the upcoming eZ Publish 4.1 version, but is also compatible with eZ Publish 4.0.

Furthermore, we urge you to try and report bugs on the beta version of an enhanced eZ Newsletter 1.6 release for eZ Publish 4.0

16/05/2008 10:50 pm (UTC)   Community news (ez.no)   View entry   Digg!  digg it!   del.icio.us  del.icio.us

maxime thomas

› jQuery Challenge - Part 2

It seems that the first version of the jQuery Who's Who library is finished. I present here what I've done and some feedbacks on the use of jQuery.

jQuery Who's Who 0.1

How it works

It is very simple to use. You just have to include the javascript files (jquery and jquery.whoswho) and the stylesheet files (a CSS file I provided for the example). Then you must configure it :

  • IMAGE_ID : this the id of the image you would like to tag.
  • JSON_URL : URL which will provide content to the list. The format of this file must be :
{
 10:{"first_name" : "Kylie","last_name" : "Minogue"},
 20:{"first_name" : "Robbie","last_name" : "Williams"},
 30:{"first_name" : "Mickael","last_name" : "Jackson"},
 40:{"first_name" : "Madonna","last_name" : ""},
 50:{"first_name" : "Christina","last_name" : "Aguilera"},
...
}
  • SQUARE_BOUNDARY : size of the square. By default, I set it to 100px.

I have tested it a lot but some bugs may remain. Just tell me.

Structure of the package

This is how I have organized the package :

  • data : some data for the tests
  • lib : where the libs are placed : jQuery 1.2.3 and jQuery Dump Plugin (for debug and dev purpose only)
  • packed : the packed versions of the jQuery Who's Who library and the CSS file.
  • source : the source. :-D
  • LICENSE : the license : GPL 3.0.
  • pack.bat / pack.sh : a little script to easily pack the files (reduces the files size to 50%). It requires the YUI Compressor (BSD).
  • README : the readme file, describes how to install this plugin.
  • test.html / test.packed.html : a test file to demonstrate the use of the jQuery Who's Who library.

Best practices

And a little feedback of my jQuery's use.

It's very easy to use it and to bind functions to events, however, this tutorial recomands to bind a function to an event only when it is required.

It may occur that the DOM you would like to access doesn't exist at the moment you are running it. It means that if your code is appending HTML after a DOM node on a button click, you would like to access and manipulate this new fresh inserted code. It is not possible unless you call the bind function at the perfect moment.

$(document).ready( function(){


$("#button").click(function(){


$("#test").append('
'); }); });

In this exemple, when we click on the button element (could be a real HTML input button, or not), jQuery inserts some HTML (a new div in this case) at the end of the inner HTML of the test element. So you have a new div which wasn't there before.

Then you can bind some event on this new element by adding code just after the append function has been called. The issue is that at each click, you will bind the event. Then after two clicks, the HTML code will be appended two times rather than one time as expected. The solution is to separate the functions adding content to the DOM and the functions that bind it. The way to do it is to concretely create a function outside the click bind and put our new bind inside it. Then, at the end of the click bind function, we just call the function we have created.

The other point is the way to develop and to debug your own application :

  • the visibility of the function and the variables is reduced to the anonymous function declared in the $(document).ready() call. So it's a bit difficult to access it from outside and to know what is the value of the variable. I've found the provided plugin on the net, it is very useful and allow to easily debug your application.

  • the use of FireBug allows to quickly test the javascript, line by line. Moreover, you can test a piece of script in the console command line and inspect it in the DOM Inspector.
Command line

 

DOM Inspector

 

Next Step

And finally, the next step is to integrate this library in eZPublish, I thought about some interesting features like a generic db connector to extract data from db and output JSON. By the way, it will use eZComponents...

13/05/2008 10:23 am (UTC)   Maxime Thomas   View entry   Digg!  digg it!   del.icio.us  del.icio.us

piotr karaś

› User-readable cache-block identifiers

Just as I'm struggling with cache optimization for one of the current projects, I discovered that it would be great if cache-block functionality had one more parameter - a user-defined and user-readable identifier. Being able to clear all the cache by calling this identifier would be a great enhancement. It would be enough if it was implemented at eZ API level, so that users were able to create their own actions (views) to handle it. This would be especially benefitial for caching of custom modules and views, outside content and content tree itself.

Life example: Imagine expensive custom views that require couple of hundreds of SQL queries per view or view/param combination, and can be accessed/managed by a) the owner (of something), b) all other users. Now, leaving these views uncached would be suicidal, and cache-blocks would be quite handy, and there would be only two cache blocks per view (since you either are the owner or not). Now, the additional expectation is that the owner will always have his view up-to-date, which means we can't really cache it for him. Wouldn't it be great to be able to create a button named "Refresh my view", which would cause one particular cache-block (or cache block group) be cleared? In that way, we could cache the owner's view as well, making it possible to let a manual clear only when needed ;)

10/05/2008 2:18 pm (UTC)   Piotr Karaś   View entry   Digg!  digg it!   del.icio.us  del.icio.us

łukasz serwatka  eZ systems employee

› Silverlight support in eZ Publish

As Microsoft Silverlight technology is becoming increasingly popular, it will be supported in the upcoming eZ Publish 4.1 release. Sites using the Website Interface and eZ Flow will include a Silverlight class and the corresponding view templates. Simply upload .xap files (compressed Silverlight package) as attributes in Silverlight objects; when such an object is viewed by a site visitor, your Silverlight media is loaded in the web browser (provided that the visitor has the Silverlight browser plugin installed). This is similar to how eZ Publish already supports .swf files via the Flash class. More information will be available as the next eZ Publish release date approaches.

08/05/2008 9:01 pm (UTC)   Łukasz Serwatka   View entry   Digg!  digg it!   del.icio.us  del.icio.us

eZ publish™ copyright © 1999-2005 eZ systems as