Archive for July 2008

 
 

Microsoft and Open Source

During January I attended the Open Source Meets Business (OSMB) conference in Germany which happened to be on at the same place and time as the eZ Partner Conference, how convenient. During this time it was interesting to listen to Sam Ramji, the Director of the Open Source Software Lab at Microsoft talk about Microsoft’s strategy and new approach towards Open Source. It is interesting to see how it continues to unfold 6 months on….

We don’t want you to talk, Mr. Ballmer by ZDNet’s Dana Blankenhorn — We are past the point with Microsoft where open source needs to fear the Giant of Redmond. Despite Mr. Ballmer’s bluster, the company lacks the legal weaponry to destroy open source, with patents or anything else.

THiNAiR Initial Thoughts

During the past two weeks I have been trialing the NakedPhone service offering from a company called THiNAiR in New Zealand. Among their wide range of services, their NakedPhone VoIP service looks to be a great fit for a very early and undeveloped VoIP market in New Zealand.

Despite a few initial hiccups in the configuration and some issues with the upstream providers terminating calls I am pleased with the service, with a very low latency and crystal clear audio.

We will be expanding our use of THiNAiR services over the coming weeks and I will review the service in more detail as we look at their Hosted PBX services and other VoIP services.

eZ Publish Advanced Content Management Book released

eZ Press recently released a new book, eZ Publish Advanced Content Management, which was authored by Bergfrid Marie Skaara and Peter Keung.

I received my copy last week and I am looking forward to having the spare time in coming weeks to thoroughly read and review its contents. It should be interesting to see how this publication fits into the greater education of eZ community and partner members.

Plesk 8 Domain Backups

I have recently undertaken the management of a number of Plesk 8 based hosting machines and came across an interesting problem today when working with backups. On this machine I have several eZ Publish installations, one of which I was looking to copy to a local drive for testing purposes. FTP just seemed like a waste of time… perhaps I was wrong.

I logged into the administration panel of Plesk to find that the backup utilities were not installed by default, thankfully Plesk makes that operation rather easy, but I am still at a loss as to which genius thought backup wouldn’t be an important enough feature to install. Granted most serious hosts are using 3rd party backup solutions like R1Soft, but still…

Having resolved that issue I proceeded to backup the domain in question and download the resulting file… which was hidden away in the middle of nowhere inside a filesystem that looks more like a rabbit warren than an organised, enterprise hosting platform. Upon downloading the file I reached the next problem… what to do with it..?

It seems that Plesk/SWSoft/Parallels have decided tar.gz is too mainstream for their product, so they opted for something more exciting, something without an extension. I haven’t had a time to even investigate what this crazy system does, but suffice to say if you have StuffIt Expander you are in luck. Drag the file onto StuffIt and it decompresses it into what OS X believes to be a number of executable files. Drag the required files onto StuffIt to expand those into the files you require.

Is it just me, or does this seem stupid? Maybe Plesk got it right and they just forgot to inform us about this whiz bang thing they developed… anyone have any thoughts on this?

Viacom vs. Google

Well I can’t say I am overly surprised at this given the recent DMCA actions. It is of course a very scary move that sets a precedent no one particularly wants set.

Google will have to turn over every record of every video watched by YouTube users, including users’ names and IP addresses, to Viacom, which is suing Google for allowing clips of its copyright videos to appear on YouTube, a judge ruled Wednesday.

This should be considered a warning to any web startups considering storing user and usage data. How will your users feel if you are ordered to turn over your records of their actions?

It does however raise a much more important question… why would you want to keep storing that data?

eZKeyword Autocomplete

Nicolas Pastorino recently released the eZKeyword Autocomplete extension for eZ Publish 4 and I decided to give it a whirl.

Installation of the extension is very straightforward:

It doesn’t get much easier than that, but unfortunately it didn’t work. A quick review of the module.php showed that /ajaxbackend/autocomplete_keywords was being queried for keyword results. On loading up this url I encountered a PHP Fatal Error.

	 [Mon Jul 07 23:51:17 2008] [error] [client 202.0.51.250] PHP Fatal error:  Call to undefined function json_encode() in /home/andrewdu/public_html/extension/ezkeyword_autocomplete/modules/ajaxbackend/autocomplete_ezkeywords.php on line 66

It appears that the script was unable to find the json_encode function. Doh! json_encode was only added to PHP 5.2, which leaves a few of us still on PHP 5.1 with an extension that doesn’t work. Of course we can soon rectify this issue by providing a fallback function incase the json_encode function is not available on your system. I patched ezkeyword_autocomplete/modules/ajaxbackend/autocomplete_ezkeywords.php with the following function.

	if (!function_exists('json_encode'))
{
  function json_encode($a=false)
  {
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';

    if ($a === true) return 'true';
    if (is_scalar($a))
    {
      if (is_float($a))
      {
        // Always use "." for floats.

        return floatval(str_replace(",", ".", strval($a)));
      }

      if (is_string($a))
      {
        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';

      }
      else
        return $a;
    }
    $isList = true;
    for ($i = 0, reset($a); $i < count($a); $i++, next($a))

    {
      if (key($a) !== $i)
      {
        $isList = false;
        break;
      }

    }
    $result = array();
    if ($isList)
    {
      foreach ($a as $v) $result[] = json_encode($v);
      return '[' . join(',', $result) . ']';

    }
    else
    {
      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
      return '{' . join(',', $result) . '}';

    }
  }
}

The above takes care of our json_encode issue and the script should now work. Autocompletion of the keywords ensures that you pick appropriate existing keywords each time rather than cluttering up your keywords with many similar keywords.

In summary the extension works well and thanks should go out to Nicolas for such a great contribution.

Anglican Taonga website launch

Anglican Taonga, a magazine published by the Anglican Church in New Zealand, approached Quiqcorp back in late 2007 regarding the opportunity to web-enable their magazine. They were looking to take the next step in the evolution of communication and try to provide materials to their readership in a shorter timeframe with the ability to cover more features than possible within a usual print setting.

The result of this collaboration is Anglican Taonga, a simple but effective eZ Publish 4.0 deployment to suit the requirements of the client. In addition, they can grow into this solution as additional areas of the Church look to expand their online presence.

eZ XML/OE stole my line breaks

I am currently working on implementing syntax highlighting for my blog to make it easier to post snippets of code, at the moment they are less than readable.

I have built out new template operators and handled the syntax highlighting, but I have one niggly little problem prior to actually using the highlighting. It seems everytime I paste code into the literal tag within eZOE it strips out the line breaks. This unfortunately renders multiple lines of code into a garbled mess, essentially the same point I was at prior to wasting my time on this :)

I have played a little with the ezoe input parser and similar files but have yet to figure out why line breaks are stripped out, or why they are not recognised when pasted in as opposed to entered manually with shift+return.

If any one has any insight into this delightful little problem I would love to hear it.

eZ Publish DateTime Operator Missing Ordinal Support

In redeveloping my blog over the past days I came across the fact Ordinals are not supported by the default datetime implementation in the eZ Publish template language. While I consider this an important function, it is of course the first time I have gone looking for it ever… strange.

In any case some people will be asking, “What is an ordinal?”. Ordinals are a 2 letter english suffix that are often added to days of the month “st, nd, rd, th”. PHP supports these functions using the ‘S’ character in the date function. Unfortunately eZ Publish 4.0 does not support handling the ‘S’ character in the datetime template operator.

I have lodged an enhancement request on the issue tracker at http://issues.ez.no/13300

I haven’t submitted a patch for this enhancement as yet, and due to a lack of time I haven’t had an opportunity to investigate how easily such a modification could be made. As time permits I will update the issue with the appropriate patch.

Has anyone else missed this option from the datetime implementation?

Update: Yes, while it is possible of course to manage such an implementation through the template language with some messy logic tests it is just against my principles. It should be handled by the underlying system and passed back already formatted.

Blog updates

I have neglected to update my blog over the past weeks due to an increased workload (unbelievable) and a lack of inspiration. Over the past few days I have begun piecing my blog back together and trying to rebuild the functionality that broke between eZ Publish 3 and 4.

I have a renewed interest in sharing my experiences and over the coming days I will begin to release code and examples for how I have achieved some of the functionality found here on the blog. I have quite a few more extensions and changes to make over the coming weeks which I am hoping others within the community will also find useful.