CJW Network Home

CJW Mediaconnector Extension

Friday September 07 2012: Jan Meier

CJW Mediaconnector Extension

CJW Mediaconnector is an eZ Publish extension for file upload and file management on external servers. You can use simple network file systems like FTP or WebDAV or external cloud storage services like Youtube or Slideshare.

Download at projects.ez.no/cjw_mediaconnector

The CJW Mediaconnector extension defines a new "cjwmediaconnector" datatype.

It is based on and forked from the ezmedia datatype and has a lot of additional hooks. These are for triggering actions like "save" of "delete" of files on external storages. The database table for persistant objects is modified to meet the special needs for file meta data.

You can extend the extension for new demands and services with the easy plug-in architecture. Specific services requirements are implemented in the corresponding plug-in.

Currently there are three services implemented:

  • FTP
  • WebDAV
  • Youtube

These are working reference implementations with can be used for new plug-in developments and which can be improved, too. Writing new plug-ins is very easy, just take for example the FTP plug-in as a starting point. The complexity comes only from the service which you want to implement.

Installation:

  1. Extension download at projects.ez.no/cjw_mediaconnector
  2. Please check your PHP installation: Is the php-curl available?
  3. Unpack the downloaded extension "cjw_mediaconnector" under "extension" directory in your eZ Publish installation
  4. Import database table. Use the following command from your eZ Publish root folder, replacing "user", "password", "host" and "database" with correct values and removing double quotes or use a MySQL Admin tool: mysql -u "user" -p"password" -h"host" "database" < extensions/cjw_mediaconnector/sql/mysql/schema.sql
  5. Activate the extension by using the admin interface ( Setup -> Extensions ) or by prepending cjw_mediaconnector to ActiveAccessExtensions[] in "settings/override/site.ini.append.php":
    [ExtensionSettings]
    ActiveAccessExtensions[]=cjw_mediaconnector
  6. Override and adjust the "cjw_mediaconnector.ini" ("extensions/cjw_mediaconnector/cjw_mediaconnector.ini" -> "settings/override/cjw_mediaconnector.ini.append.php") for your current project
  7. Regenerate autoload array: Run the following command from your eZ Publish root folder: php bin/php/ezpgenerateautoloads.php --extension or go to Setup -> Extensions and click the "Regenerate autoload arrays" button
  8. Clear all caches (from admin 'Setup' tab or from command line).
  9. create a new file content class with the cjw_mediaconnector datatype
  10. try and enjoy

The CJW Mediaconnector extension is still beta but in production use, there is still room for improvement, you are welcome for this.

Download at projects.ez.no/cjw_mediaconnector

In part two of this article serie, I'll describe the use case "CJW Mediaconnector extension with Youtube as a storage backend.

Coolscreen.de - internet development, audits and consulting Jac Systeme - software development, support and maintenance Webmanufaktur - alles ausser gewöhnlich eZ Publish Silver Partner