Forums / Developer / New extension for integrating external audio content

New extension for integrating external audio content

Author Message

Olivier Guilyardi

Tuesday 07 April 2009 8:31:22 am

Hi,

I'm currently in charge of the development of a new eZ Publish extension which will allow to integrate external audio content from Telemeta, a Python (alpha) application we're currently developing for museum and research laboratories to manage and broadcast their audio archives.

Telemeta itself integrates an OAI-PMH Data Provider, which if you've never heard of it, is an HTTP+XML based web service well suited for transporting Dublin Core metadata. To make it even simpler, it for example allows to retrieve the author, title and date of an audio item archived in Telemeta, by item id.

Although I'm an experienced PHP (and PEAR) developer, I'm very new to eZ Publish, and starting to consider this looks like a whole operating system ;-)

To be honest I'm considerably disappointed by the state of the documentation about extension development. It seems to consist in more or less obsolete tutorials. There is no such thing as an extension development guide. Until now, the most up to date (read: compatible with ezp4) one I found is this:
http://ez.no/developer/articles/creating_datatypes_in_ez_publish_4

AFAICS, I need to develop a new datatype which will require the user to enter an audio item id. I also need to register a new ini file, where the admin can set the URL of the Telemeta OAI-PMH Data Provider. Given these parameters the extension should be able to retrieve some metadata + the url of the mp3 file, or fail with a "no such item" error.

However, I have trouble understanding how this will eventually integrate with the content management system. What I need is something which is similar to the Image feature, that is: the ability to insert audio item at various places in the body of a given article.

Each of these items should be presented with a bit of metadata (title, author, date) and a small flash (or js/html + soundmanager2) player.

But I just don't understand how to do this using the DataType + class system. Furthermore, the existing extensions which seem to provide some similar functionality don't seem to be compatible with eZ Publish >= 4, so that I can't base my work on them.

Any advice or pointer ?

Regards,

Łukasz Serwatka

Wednesday 08 April 2009 12:26:22 am

Hi,

Here is a old tutorial, it should give you an idea:
http://ez.no/ezpublish/documentation/development/extensions/datatypes

However do not use the code from tutorial as it is old. Generate code for new datatype in the eZ Publish Administration Interface Setup->RAD. This should give you a base code for new datatype valid with latest eZ Publish version.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Olivier Guilyardi

Wednesday 08 April 2009 4:01:59 am

Thank you for this answer.

However, I think I already understood how to create a new DataType by reading Thomas Koch's tutorial, as mentioned in my previous post.

The problem is that in his tutorial, the DataType are mainly use to allow adding an input field to a given class, and especially to an Article.

If I simply needed to add one audio item per article that would fit the job.

But as I explained before I need to allow adding several audio items into a given article <b>and</b> to make these items appear at arbitrary places inside the body of the article, just like images.

How to achieve this?

Łukasz Serwatka

Wednesday 08 April 2009 4:39:21 am

Hi again,

You can create a new content class dedicated to the audio content. Allow users to create content objects as instance from new class. Then in the edit mode you can add them as related content and using <embed> tag (similar to images) embed them in the body (xml block attribute) of article or whatever class you need it. You will need to make also embed template for displaying such embed content properly.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Olivier Guilyardi

Wednesday 08 April 2009 4:58:24 am

Okay, I'm now experimenting with embedding.

A few more questions before I start coding:

1 - Can my extension automatically register a class in addition to the data type, so that the admin doesn't need to create a new class by him/herself? If yes, how?

2 - How can I bundle the embed template in my extension and indicate that the content objects should be displayed using it?

3 - My audio player will certainly be based on soundmanager2 (http://www.schillmania.com/projects/soundmanager2/) and thus require js+swf dependencies to load in html head. How do I handle this?

4 - Is there something like registering a new 'Media type', knowing that my audio items won't need a file to be uploaded?

Olivier Guilyardi

Friday 17 April 2009 7:35:23 am

Hi,

small update: I'm finished.

The eZTelemeta 0.1 extension allows to integrate sound items from a Telemeta (http://telemeta.org) remote installation, together with metadata retrieved using the OAI-PMH xml dialect through HTTP. It has been tested with eZPublish 0.4.1 and Telemeta r437.

SVN repository:
http://telemeta.org/browser/trunk/tools/eztelemeta

Although it is a currently a bit specific to Telemeta and audio items, a fair amount of the code is generic and one should easily be able to adapt it for :

- integrating metadata coming from some sort of OAI-PMH data provider
- audio integration (embedding) using the included SoundManager2-based player

eZTelemeta is licensed under CeCILL, which is compatible with the GPL.

Bye