<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 4. Under The Hood</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.48"><link rel="home" href="index.html" title="MediaIndexer Document Management System"><link rel="up" href="index.html" title="MediaIndexer Document Management System"><link rel="previous" href="ch03s02.html" title="Maintaining Metadata"><link rel="next" href="ch04s02.html" title="File Handlers"></head><body text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Under The Hood</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="id2770682"></a>Chapter 4. Under The Hood</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch04.html#id2770726">Media Groups</a></dt><dt><a href="ch04s02.html">File Handlers</a></dt><dt><a href="ch04s03.html">Media Type Binding</a></dt><dt><a href="ch04s04.html">Includable Templates</a></dt></dl></div><p>MediaIndexer is designed to be modular and extendable so that
it can provide support for new media types easily. Different Media
files can contain specific attributes and they must be invoked by the
browser in different ways. For example, images and video files are
unique in many ways. Because of this invariance, MediaIndexer uses
an idiom of <span class="emphasis"><i>groups</i></span> and <span class="emphasis"><i>handlers</i></span>
to distinquish how each file should be categorized and displayed.</p><p>This chapter attempts to explain the definition of media groups,
file handlers, and how they relate to the files served by MediaIndexer.</p><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2770726"></a>Media Groups</h2></div></div><p>Media groups are classes which provides specific functionality
when listing many media files within a particular group. Such examples
include a <span class="emphasis"><i>Music Group</i></span>, <span class="emphasis"><i>Movie Group</i></span>,
and a <span class="emphasis"><i>Pictures Group</i></span>. A clear example of the
functionality provided by a group class is the Music group. In this
class, we add a checkbox next to each file listing, with the ability to
add music files to a playlist.</p><p>Group classes are only used when specific features such as a Playlist
is desired. In most cases, using the default group class is enough.</p><p>Creating a new media group is simply defining a new constant, associating
it with a class name. For example <span class="emphasis"><i>movies</i></span> assumes there
will be a file named <tt>group.music.php</tt> which contains a
PHP class named <span class="emphasis"><i>musicGroup</i></span>.</p><div class="figure"><p><b>Figure 4.1. Media Group Definitions</b></p><pre class="programlisting">
define("_GROUP_MUSIC", "music");
define("_GROUP_MOVIES", "movies");
define("_GROUP_DOCUMENTS", "documents");
</pre></div><p>Each group class must extend the default group class
<span class="emphasis"><i>defaultGroup</i></span>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Maintaining Metadata </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> File Handlers</td></tr></table></div></body></html>