Follow along with http://davereid.github.io/2013-08-10

About me

  • Senior Engineer at Palantir.net
  • Twitter: @davereid
  • IRC: davereid
  • Maintain almost 2% of contrib modules
  • Core subsystem maintainer
  • Two adorable cats
  • New dad as of Oct 2012: @OliverReid

About my cats: @RodneyTheCat

Description

About my cats: Athena

Description

What is File Entity?

What is File Entity?

  • UI for adding and managing files as individual items
  • File types
  • Allows you to add fields to files
  • Fix core assumptions

ZOMG NEW 2.X THINGS!

https://i.chzbgr.com/maxW500/6416002048/h60E20153/

ZOMG NEW: Configurable file types

ZOMG NEW: Upload UX

ZOMG NEW: Accessibility

ZOMG NEW: Accessibility

ZOMG NEW: File replacement

ZOMG NEW: File access API

file_entity_access('view', $file, $account);

function hook_file_entity_access($op, $file, $account) {
  $type = is_string($file) ? $file : $file->type;

  if ($op !== 'create' && (REQUEST_TIME - $file->timestamp) < 3600) {
    // If the file was uploaded in the last hour, deny access to it.
    return FILE_ENTITY_ACCESS_DENY;
  }

  // Returning nothing from this function would have the same effect.
  return FILE_ENTITY_ACCESS_IGNORE;
}

function hook_query_file_entity_access_alter(QueryAlterableInterface $query) {
  // Only show files that have been uploaded more than an hour ago.
  $query->condition('timestamp', REQUEST_TIME - 3600, '<=');
}

ZOMG NEW: File metadata API

Non-editable data in key/value storage. Remove metadata from field storage.

Image dimensions example:

// Before
$file->image_dimensions['width'] = 300;
$file->image_dimensions['height'] = 200;

// After
$file->data['width'] = 300;
$file->data['height'] = 200;

hook_file_metadata_info() {
  $info['width']  = array('label' => t('Width'));
  $info['height'] = array('label' => t('Height'));
  return $info;
}

NEW: Misc

  • Download link formatter
  • Views field handlers, filters, sorts
  • URL alias support, including Pathauto

What's left in File Entity to do?

File entity: What's left?

  • HTML5 simple formatters
  • HTML5 uploading (Plupload for reals)
  • File usage fix in core
  • Ensure access API works with queries
  • Cleanup, document
  • Port to D8 and prepare for D9 merge early

What is Media?

What is Media?

  • Media widget for file/image fields
  • Media browser
  • Web files
  • WYSIWYG integration w/ usage tracking
  • Media field type

ZOMG NEW 2.X THINGS AGAIN YAY!

NEW: Views-powered browser

Disappointing slide is disappointing

NEW: OMZG COMPETITORS!

What's left in Media to do?

Media: What's left?

  • Fix integration with CKEditor 4+
  • Improved UX for uploading and browsing in content
  • Project coordination

Cool stuff happening in Media ecosystem

Cool: File entity inline

Cool: File entity paths

Cool: File lock

Cool: Remote stream wrapper

Cool: oEmbed

Media Initiative!

PSSST. THIS IS WHERE YOU CAN HELP

What is the initiative?

When can you help?

  • Code sprints
    • Aug 11, 2013: DrupalCorn, Iowa City IA
    • Aug 15-17, 2013: Midwest Developer Summit, Chicago IL
  • Next Thursday 20:00 UTC IRC meeting in #drupal-media
  • ANYTIME!

Thank You! Questions?

Tweet your after thoughts to @davereid.