Home Web-development Plone 3 Multimedia

Plone 3 Multimedia

By Tom Gross
books-svg-icon Book
Subscription
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
Subscription
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Plone and Multimedia
About this book

Plone is a free and open source content management system built on top of the Zope application server. Multimedia provides us with stunning interactive user experiences and many design options, but it requires discipline and knowledge to utilize it effectively so that we do not alienate our audiences. By providing an overview of multimedia content together with a practical focus on how to process it in the web context, this book will be your ideal partner when turning your Plone site into a full-featured multimedia Internet presence.

From watermarked images, integrated Silverlight-applications over geotagged content and rich podcasts to protected video-on-demand solutions this book provides a rich repository of tools and techniques to add full multimedia power to Plone. This step-by-step guide will show you how to collaborate with many external web resources to build a powerful interactive Plone site that perfectly meet your needs.

Multimedia data is a very important part of the Internet, considering the amount of storage and bandwidth taken. This book will show you how to turn your multimedia data in valuable multimedia content by using the mature and extensible open source CMS Plone.

With its content-centric approach Plone allows specialized use-case scenarios for image, audio, video, Flash and Silverlight applications. The initial chapters focus on managing image, audio, video, and flash content for your Plone website. We then plunge into content control and syndication.

The book will show you how to structure your content by tagging, rating, and geolocating. It will give you insights on how to upload, store, and serve your multimedia content in an effective way.

Publication date:
May 2010
Publisher
Packt
Pages
372
ISBN
9781847197665

 

Chapter 1. Plone and Multimedia

Multimedia is the dominant part of the World Wide Web as we face it today. Every site has at least some images to give the site visitor a better "picture" of the presented content. Web-based multimedia services such as YouTube, Flickr, and Picasa are growing rapidly and there seems to be no end in sight.

Plone is a Web Content Management System written to serve big amounts of web content in a secure and professional manner. Do these two concepts go together? Can Plone meet the requirements of a shiny multimedia web?

This book will show you how to turn your multimedia data into valuable web content with Plone. It will show you how to utilize third-party products to make the most out of your favorite CMS. Let's start with some general discussion about the topics that this book will cover.

 

Some definitions


Before we can dig into the topic, we need some definitions of the key terms. These terms will follow us through the book.

CMS

CMS stands for Content Management System. It is a general term covering several types of software intended to store, manage, and provide digital data. Digital data that is managed by a CMS is referred to as content.

There are several types of content management systems: Document management systems, Digital Records Management systems, Electronic Content Management systems, web-based content management systems, and others.

Plone is a classic web-based CMS. Editing and viewing of the content is completely done through the Web. Although there are other means of feeding Plone with data and getting it in and out again, the web browser is the main interface for the interaction of humans with Plone.

In the book, we will see alternative methods for interacting with Plone.

ZCA

The ZCA is the Zope Component Architecture. It was introduced with Zope 3 and is now part of Zope 2, and therefore of Plone with the help of the Five product (2+3).

This strategy, which shares many ideas with the Mozilla Component Architecture, allows us the use of adapters and utilities.

With adapters, we can do so-called aspect oriented programming. An adapter represents a certain aspect of a context object. A simple example of an adapter is a size adapter that calculates the size of an object. How this is done depends on the nature of the context. It can be as simple as calling the len method on the context, or there can be a complex function behind it. A simple adapter call (without the definition and the registration) looks like this:

>>> ISize(context)
>>> 587

Adapters can have more than one context. These adapters are called multi-adapters. One example is a BrowserView, which takes a content object and the request as context. BrowserViews are certain aspects of the content in a publishing situation.

Utilities are methods or classes (Callables) stored in a registry and, therefore, easy to acquire. An example of a utility is a vocabulary. The underlying method returns an iterator of term objects. These term objects may be used for choice or selection widgets.

Note

A good introduction to the ZCA can be found in Philipp von Weitershausen's book Web Component Development with Zope 3. The book is slightly outdated, but still a good source for learning the ZCA with examples.

In this book we will focus on products utilizing the ZCA, if possible. These products are more flexible, and overriding an adapter for custom purposes is easier and better than monkey patching.

WWW

The WWW (World Wide Web) is the playground of Plone. Many web pages use the domain name "www", but this is not meant here.

What is meant here is the sum of all web pages and portals that are reachable with a web browser. Technically speaking, this is everything with an URL. Usually URLs accessible with a web browser utilize HTTP (HyperText Transfer Protocol) or FTP (File Transfer Protocol).

Buildout

The term buildout is used for two things: a piece of software, correctly spelled as zc.buildout, and a concept for configuring software using zc.buildout.

Since version 3.0, Plone is distributed with a buildout. In the common use of the term, buildout refers to one or more files used for configuration. This file is usually called buildout.cfg and contains all the necessary bits and pieces for fetching the Plone application from online resources and configuring it. This file can be extended to install and configure arbitrary add-on products.

There are ready available buildouts for special use cases such as publication management with Plone, a video suite for Plone, and a newsletter application with Plone; or they can be put together with ZopeSkel templates.

Possibly, the shortest buildout for setting up Plone 3.3.3 is this:

[buildout]
parts =
    zope2
    instance
extends = 
   http://dist.plone.org/release/3.3.3/versions.cfg
versions = versions

[zope2]
recipe = plone.recipe.zope2install
url = ${versions:zope2-url}

[instance]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
http-address = 8080
eggs = 
    Plone

The code examples in this book are available together with readymade buildouts, which set up Plone and the necessary multimedia parts.

 

What is multimedia?


According to Wikipedia, multimedia is:

... media and content that uses a combination of different content forms. The term can be used as a noun (a medium with multiple content forms) or as an adjective describing a medium as having multiple content forms. The term is used in contrast to media, which only use traditional forms of printed or hand-produced material. Multimedia includes a combination of text, audio, still images, animation, video, and interactivity content forms.

This is a very formal definition. In common language use, "multimedia" is simply images, audio, video, and animations (including interactive ones). Today, we face multimedia in many aspects of our daily life. Probably most of us have a digital camera. We play with interactive multimedia terminals when we go to the museum. We watch DVD movies now and then, and last but not least we use the World Wide Web to enjoy and share multimedia of all different forms.

The Web did not always have the multimedia capabilities that it has today. It started merely as a text and image platform with the brilliant idea of hyperlinks.

With the growth of the Web, the requirements followed. People wanted to publish other forms of media. The browser companies reacted and Netscape, the leading browser manufacturer at that time, introduced the embed element and Microsoft the object element to include arbitrary multimedia contents into a web page. Embedding a multimedia object (a MIDI soundfile) in Netscape looks like this:

<embed src="beatles.mid" />

Including a sound file in Microsoft looks like this:

<objectclassid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="FileName" value="liar.wav" /></object>

This method is still the common technique to include multimedia content into an HTML page. While the object element was included into the HTML standard, the embed element was never officially supported. Still it is a common way to include multimedia contents into Mozilla-based browsers (the successors of the Netscape browser). It is possible to merge the embed and the object element to get maximum availability on different browsers. We will learn how we can achieve this for audio, video, and Flash content in this book.

In HTML5, the situation will change completely. With this version there will be dedicated elements for audio and video. Including audio will be as simple as this:

<audio src="mozart.ogg" controls="controls">Your browser does not support the audio element.</audio>

And video:

<video src="movie.ogg" controls="controls">Your browser does not support the video tag</video>

Today, the common browsers only partially support HTML5, and the W3C consortium does not recommend it yet.

In the Web, there are other ways of distributing multimedia content than on HTML pages. One common way to do it is with syndication. Multimedia feeds are used to provide audio and video content on a regular basis. This technique is known as podcast or vodcast. In this book, we will see how to present our multimedia content from Plone in a syndication feed.

In this book, we will deal with the following types of multimedia in the first place:

  • Images: The classic type of multimedia. Besides playing with some metadata we fetch from our digital camera, we will see how we can display images in an appealing gallery in the Web.

  • Audios: We will learn about different audio formats and their qualification for web usage. Audio is usually included into web pages with small player applets, and we will see how.

  • Videos: Videos are really multimedia, as they combine moving images and audio. We will see how to include videos from content stored in our Plone CMS and from content fetched from external sources. We will learn the differences between downloading and streaming, and see how to embed video player applets into our Plone-served web pages.

  • Flash and SilverLight: Flash and SilverLight are interactive forms of multimedia. To function properly through the Web, some requirements have to be met. We will see how to meet these with Plone.

 

Why Plone?


If you are reading this book, you have heard of Plone and used it before. You want to know how to extend the great content management features with multimedia goodies. Why is Plone suitable for managing multimedia content? First of all, Plone is a great CMS. It is:

  • Secure: Plone builds on the Zope application server. In contrast to other Web-based systems, security is an integral component of the application. Every object in the object database is protected and all content in Plone can be allocated to a security workflow.

  • Stable: Plone is a mature system, which has been around now for many years and is widely used all over the world. A strong community fixes the bugs quickly.

  • Easy to work with: With the CMS features of Plone, no HTML knowledge is necessary to publish web content. Most configuration settings for administrators and integrators are accessible through the Web.

  • Professional: There are Plone consultant companies in many countries. Web solutions using Plone can be found in many intranets and extranets.

  • Extensible: One of the most interesting advantages of Plone for us is the ability to extend it. There are hundreds of small and big add-ons for turning Plone in a weblog, newsletter tool, or even a complete multimedia solution.

These features make Plone suitable for many different use cases dealing with the problem of getting binary data into and out of the WWW.

For data storage, Plone uses the Zope Object DataBase (ZODB), which is an object-oriented database written in Python and C. It is especially good at storing objects, but is not so good at storing large files.

Unfortunately, multimedia data tends to be stored in large files. One minute of CD-quality audio takes around 10 megabytes. There are compression methods for images, audio, and video but a one-minute audio encoded with the MP3 format still takes 1 megabyte.

Fortunately, there are methods for storing and accessing multimedia data outside the ZODB. In Chapter 9, we will learn how to do this.

Since version 3.8, the ZODB has had BLOB (Binary Large Object) support. Large binary data is not stored in the internal structure, but on the filesystem. This makes storage and publishing more efficient. In Plone 4, this will be the standard backend for the File and Image content types. In Chapter 9, we will see how we can use the BLOB features with Plone 3.3.

Plone Content

Plone comes with eight content types useful for creating web content: Folder, Collection, Page, Event, News Item, Link, File, and Image.

Folder and Collection are not real content on their own. Their purpose is to structure content. Yet they play an important role in Plone because we can define views on them showing certain aspects of the content included. This can be an image gallery view, a blog view, a tabular listing, a summary view, or even an RSS feed view used for syndication of the content.

While a Folder is an object in which data is actually stored, a Collection is an object that gathers the main information about different objects. This information is collected from various content objects of the portal with the help of the catalog.

All other content types are web content and depending on the definition of multimedia, they are multimedia or can contain multimedia.

News items are meant to promote news on the website. They can contain rich text and an image with a caption. They are made for special purposes and are not appropriate for general multimedia content.

The Event content type is for calendric events. It has a start and an end date, and some additional information concerning the event. It is not appropriate for the storage of multimedia content. In a complete multimedia platform, it may still play an important role. Consider a website of a band. It stores some demo material as MP3, and announces concerts and CD releases as Events.

The Plone4Artists initiative provides an enhanced version of the Event content type that supports recurring events.

The most important content type in real-life situations is probably the Page. A Page is simply an HTML page edited with a Visual Editor. According to the definition of multimedia, a text is multimedia already—especially if it contains other visual elements such as images or videos. In the common usage of the term, a Page is seldom recognized as multimedia.

The most important content types for multimedia are Image and File. The role of the Image content type is quickly told. Its purpose is to wrap a digital image to be treated as web content. Therefore, it comes with a set of metadata, some predefined scales, and the ability to be included into a Page.

The File content type is a container for all other data that does not fit in another category. Arbitrary files can be uploaded into Plone via the Web. These files are displayed if possible (text) or provided as download (binary). Except for the usual metadata, this is it for a default installation of Plone.

One important datum that is stored with a File is its MIME type. This helps other products to distinguish between audios, videos, and other forms of multimedia, and activate certain components and views available for this type.

It is notable that neither the Image nor the File content types have a workflow attached by default. It is assumed that content objects of this type are always available to the public audience of the site. Still, it is possible to define a workflow for one or both of these content types.

Luckily, the behavior of Plone's content types can easily be enhanced with the help of the ZCA. With some readymade add-ons, it is possible to have specialized File content for audio, video, or Flash. With some Python knowledge, it is not too difficult to write a custom add-on for the multimedia forms of the future.

Finally, there is the Link content type. With this, it is possible to store references to arbitrary points in the WWW locatable by an URL. The standard behavior of Links is to go to its stored location. But it is possible to change this. Some multimedia add-ons for Plone utilize the Link content type for referring to external multimedia resources, especially audio and video. The display of the content is handled by a customized Plone view of the Link object, but the content is stored and published from the external location. This saves bandwidth and storage space.

 

How do they fit?


Now we know about multimedia in the Web context, and we know about Plone and its advantages. But do they go together? Isn't it like breaking a butterfly on a wheel to use a full-featured Content Management System like Plone for adding some specific multimedia tags to an HTML page?

No, it is not! Adding these tags is not sufficient in many cases. Like other content, it is protected by permissions and not all users are allowed to access every item. Multimedia content may pass through a publishing workflow like textual content.

We need instruments to upload multimedia content from the creator to the server. And we want alternate views on our multimedia content. We want to download the binary file, we want an embedded player, and we want a syndicated feed.

For all these tasks, a sophisticated Content Management System is a number one requirement. And Plone can do it! For some of the use cases, it needs a little help from other products, but that's the way it is build—good at managing content and extensible. Let's glance on the common multimedia extensions.

Plone4Artists

The main initiative, which aims at bringing multimedia features to Plone, is Plone4Artists. Nate Aune, who is a musician himself, brought up the idea to have a complete bundled add-on for Plone serving all the needs for musicians and other artists.

The first implementation dates back to 2005 and was targeted at Plone 2.0. The Plone4Artists suite was a set of content types, one for each form of multimedia: ATVideo, ATAudio, and ATPhoto.

With the rise of the ZCA, the products were rewritten and the content types were dropped. The version of P4A that was implemented for Plone 2.5 reuses the existing content type File and attaches all multimedia specific parts via the ZCA onto the content type. For Plone 3.0, all the relevant products where repackaged in the p4a namespace. Then the development slowed down a little bit and some packages even became orphaned.

Recently, the code repository moved over from plone4artists.org to the collective repository. This decision reactivated the contribution to the project.

The whole bundle now consists of the following parts:

  • p4a.ploneimage: Enhancements for the Image content type. Some photo-specific metadata is attached to the image. Most of the code evolved from the ATPhoto product. This is probably the most unfinished package of all. The basic functionality is there, though.

  • p4a.ploneaudio: Enhancements for the File content type to bring audio features. The code for this package evolved from ATAudio and brings embedded players, additional metadata for audio content, and basic support for podcasting.

  • p4a.plonevideo: Enhancements for the File content type to bring video features. This package is meant for videos stored inside Plone as content. Most of the code is taken from ATVideo. It comes with embedded players for various video formats and basic support for vodcasting.

  • p4a.plonevideoembed: Enhancements for the Link content type. This product is meant to include external video sources, such as YouTube, Metacafe, or Yahoo video into Plone. It comes with views to integrate videos from the external sources into the desired context.

  • p4a.plonecalendar and p4a.ploneevent: Probably the best maintained part of the p4a bundle. These products bring extensions to the Folder and the Event content type. They allow a Folder with Events to act as a calendar with all the necessary logic and views. Additionally, recurring events are supported.

  • p4a.plonetagging: Another more or less orphaned but working solution for an alternative content tagging solution based on the ZCA.

 

Summary


In this chapter, we did some position fixing about the subject. We saw what multimedia is all about and what we can expect from Plone. We found some reasons why we can, and should, use our favorite Open Source CMS Plone for some additional multimedia candy.

The common approach for turning Plone into a "multimedia web machine" is to use the Plone4Artists products. These add-on products turn the core content types of Plone into multimedia-enhanced ones.

With Plone and its core features, it is possible to turn binary data into valuable web content. In the following chapters, we will see how we can achieve this. Let's start with images in the next chapter.

About the Author
  • Tom Gross

    Tom Gross is a long-time Zope and Plone user and developer. Since Plone 4.0 he has been a core-contributor and he took responsibility for the rewrite of the reference browser widget. Besides his development and consultant work in Australia, Germany, and Switzerland he writes technical and philosophical (audio)books.

    Browse publications by this author
Plone 3 Multimedia
Unlock this book and the full library FREE for 7 days
Start now