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

eZ debug

Timing: Jan 18 2025 11:15:40
Script start
Timing: Jan 18 2025 11:15:40
Module start 'content'
Timing: Jan 18 2025 11:15:40
Module end 'content'
Timing: Jan 18 2025 11:15:40
Script end

Main resources:

Total runtime0.8564 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 587.8594180.8125
Module start 'content' 0.00700.7129 768.6719587.5078
Module end 'content' 0.71990.1364 1,356.1797341.3672
Script end 0.8564  1,697.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4881210.0002
Check MTime0.00160.1820210.0001
Mysql Total
Database connection0.00060.070110.0006
Mysqli_queries0.775090.49782030.0038
Looping result0.00230.26472010.0000
Template Total0.828596.720.4142
Template load0.00220.262520.0011
Template processing0.826296.472920.4131
Template load and register function0.00020.023810.0002
states
state_id_array0.00090.106310.0009
state_identifier_array0.00070.083220.0004
Override
Cache load0.00200.2296500.0000
Sytem overhead
Fetch class attribute can translate value0.00290.341330.0010
Fetch class attribute name0.00170.192770.0002
XML
Image XML parsing0.00110.126130.0004
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00370.4284290.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs