By Private Profile aad083ce on 2017-07-03 10:43 in GSoC 17 Media Manager

Venue : Glip

Time : 21/06/2017 UTC 16:30

 

List of Attendees Overview

 

Mentor

 

A

Student

 

A

Allon Moritz (Lead)

AM

x

Kasun Vithanage

KV

x

Yves Hoppe

YH

 

 

 

 

ord
David Neukirchen

DN

x

 

 

 

Puneet Kala

PK

 

 

 

 

Dimitris Grammatiko

DG

x

 

 

 

Other Attendees:

na

 

 

 

 

 

The Topics

Update done on previous week

In previous week members discussed about how files should be served from Media Manager to Articles and other places in frontend.

 

Kasun came up with a Method to generate permalinks and put them on the frontend to serve media files for public.

 

David asked Kasun to prepare a research document about how other CMS systems have implemented this feature.

 

Allon and David asked for a workflow document of proposed method

 

 

Plugin Research Report

Kasun has explored 15 plugins from different CMS systems to study about how clouds are integrated into their systems. It includes WordPress, Laravel, Joomla! 3, Durpal

 

Document can be viewed here.

 

Interface/Workflow Report

Kasun has prepared following interface/workflow report for proposal

 

Interface

function getPermalink($path);

 

This method is in MediaFileAdapterInterface which is implemented by every plugin.

The cause of method is to return a URL to display and manage media content. Developer must provide a way how files are served to Joomla! as it gives full control to your plugin.

 

This could be a

  • permanent link on a CDN

  • A stream from cloud

  • A file from a custom filter by you

  • Anything from your imagination even a dragon if you can summon(but keep size low since it may damage user’s machine)

 

Following things should be satisfied by the developer.

  • URL to a valid image

  • If URL is not a valid image then a method to fix broken links(if you directly stream from a cloud sometimes tokens can get expired)

 

For example when you want to insert an image this function will invoke for your file system and you can fetch the media file and return a reference to it. It could be something like

 

 

Workflow

This function is only invoked in a needed when user wanted to insert an image or something else. So in any case when Media Manager popups asking Select an image and user selects an image.

 

Those images are in MM has file paths relative to relevant adapters

Like

  • local:/path/to/file.jpg

  • asw3:/path/to/file.png

Those relative URLs need to be resolved for actual URLs for display image in the editor and to display them in frontend in an article.

 

getPermalink should be now invoked by editor to get a real URL for selected file. Plugin developer can decide how files being served, so a URL defined by him will be sent as response to editor.

 

It could be done with an AJAX request to fetch permalink

 

media.php?task=files&opt=permalink&file=aws-1778:/path/to/file.png

 

Controller will now fetch the query and execute getPermalink on relevant adapter and return the result to the ajax with permalink URL.

 

This need to add a new keyword to ajax request to use method with task=api.files as follows

 

opt=permalink

 

This will prevent creating a new task for this

 

 

This does not change the implementation of MM, it acts normal, for display image in MM it requires additional informations, but for this only the actual URL is needed to serve an image. MM use getFiles method to display images. To show thumbnails it is up to 3dp to select his own method for cache and display them(will discuss later)

 

Allon asked to generate Permalinks when File Metadata is sent to frontend. But Kasun said it will take lot of processing powers as we don’t know how developers will implement these methods. So once requested presenting file’s permalink to front end was accepted

 

 

In the meeting David suggested to add a method to serve Thumbnail Images also not to have a Backward Compability issue for plugins.

 

All members was agreed to stick to this method as it gives full flexibility for 3rd Party Developers.

 

After meeting Kasun suggested to use getUrl rather than getPermalink method name as it is more meaningful. By 3/3 votes of mentors it was accepted.

 

Kasun has his PR here :

 

https://github.com/joomla-projects/media-manager-improvement/pull/263