Mastering the Thumbnail Generator with Liferay 7 CE and DXP

The Thumbnail Generator aims to improve and facilitate the generation of thumbnails provided by Liferay.

This plugin was created during a project requiring a large number of thumbnails with precise dimensions in order to minimize the loading time of the web pages. Currently, Liferay is only capable of generating two different sizes of thumbnails, when a new image is uploaded on an application (using the dl.file.entry.thumbnail.custom* settings of portal-ext.proprties). This new plugin, however, allows you to have full control over the number of thumbnails created as well as the way they are generated.

This article is structured as follows. After briefly describing the main components of this plugin, I will explain how to configure it in order to manage an unlimited number of thumbnails with Liferay.

I. Describing the Plugin Components

The Listeners
The Thumbnail Generator uses two Model Listeners to listen to ”persistence events” like the creation, modification and deletion of documents in Liferay application. A document can match any file’s type (text, image, video, pdf, …). Later, you will learn how to configure the plugins in order to process only relevant documents.

The first Listener listens for the creation and modification of a document, then it creates or updates the document’s thumbnails. The second listens for the deletion of a document, and deletes the thumbnails associated with this document in the aftermath.

The Servlet Filter
The Servlet Filter intercepts all requests calling for a document of the application and performs a series of validation before returning a thumbnail in response. It will first analyze the parameters of the query in order to know if a thumbnail is requested. Next, the filter is going to verify that the thumbnail does exist in order to finally return it to the author of the request. If one of these checks fails, the query will be ignored by the filter and it will follow its normal course – i.e. returning the original document requested.

The ThumbnailService
Lastly, the ThumbnailService handles the creation/deletion of the thumbnails and organizes them in the storage system of Liferay, using the plugin’s configuration.

II. Using the Plugins

The use of the Thumbnail Generator entails configuring the plugins and retrieving the thumbnails.

The Thumbnail Generator’s configuration page (Menu => Control Panel => Configuration => System Settings => Thumbnail Configuration) allows you to define two options:

  • The format of the files that will be processed by the plugin.
    For example, to restrict the creation of thumbnails for JPG and PNG files, simply add these formats to the configuration and all the other files will not be taken into account by the plugin.
  • The command lines that will generate the thumbnails.
    In order to define a thumbnail and to generate it, you need to add a line in the configuration with the following syntax : ‘name:command‘. The name will later provide access to this thumbnail, the command corresponds to the command line that will generate the thumbnail (see ImageMagick’s documentation to explore all possible options). For example : ‘img_480:convert ${inputFile} -resize 480×270 ${outputFile}‘ will generate a thumbnail of dimension 480×270 and that will be retrievable through its name « img_480 ».

Thumbnail Generator configuration page

In the above screenshot, three different thumbnails will be created for each JPG and PNG files uploaded in the application.

The plugin’s configuration not only allows the user to control the number of thumbnails to be generated, but also the way in which they are created. In this scenario, the ‘convert command’ comes from the powerful image editing library ImageMagick. Instead of this command, we could have used any other commands executable on the machine hosting the Liferay application.

Thumbnails’ Retrieval
Once the plugin is deployed and configured, it is ready for use. Thumbnails will be automatically generated each time a document is uploaded into your application. In order to retrieve the thumbnail of the document, you just have to add the parameter “thumb={thumbnailName}” in the URL using this document.

An Example of Thumbnail Retrieval Process

  • The URL of a document (test.jpg) on a local instance of Liferay looks like this : http://localhost:8080/documents/20147/0/test.jpg/0d72d709-3e48-24b3-3fe6-e39a3c528725?version=1.0&t=1494431839298&imagePreview=1
  • The URL of a thumbnail associated to this document, named img_480, can be called this way : http://localhost:8080/documents/20147/0/test.jpg/0d72d709-3e48-24b3-3fe6-e39a3c528725?version=1.0&t=1494431839298&imagePreview=1&thumb=img_480

III. Administration

In order to give more control to the user in the management of this module, an administration page (your site > Configuration >  Thumbnails administration) has been created allowing you to perform some actions on the thumbnails:

  • Re-generate all the thumbnails
  • Delete all the thumbnails
  • Delete orphans thumbnails (Which are no longer linked to any documents but are still present due to a change in the configuration)

Thumbnail Generator administration

In conclusion, this brief tutorial introduces to you the Liferay’s utility app called Thumbnail Generator and describes how to use, configure, retrieve the thumbnails and administer the plugin. Should you have any further questions or comments please contact us.

The Future of Open Source Software in Broadcasting Industry: SMPTE BootCamp 2017


Savoir-faire Linux participated at the Society of Motion Picture and Television Engineers (SMPTE)’s BootCamp 2017 having the overarching topic of Media in the IP Era. This bootcamp was organized by the Montreal SMPTE Committee including the main actor, CBC (Radio-Canada), and was held at LÉcole de technologie supérieure (ÉTS), June 12-13, 2017.

Michel Proulx addressing the audience at SMPTE BootCamp 2017 in Montreal

The Event’s Focus and Our Role

The SMPTE, including the Montreal/Quebec chapter, has three key goals: educating players in the media and broadcasting industry, communicating the latest technological developments, as well as encouraging networking and interaction among industry stakeholders. This year, the SMPTE’s BootCamp 2017 rallied participants around the following topics:

a) IP transport and the SMPTE 2110 Standards,
b) Virtualization and software.

On this occasion, our open source software (OSS) consultants: Éloi Bail and Amir Taherizadeh, jointly delivered a talk entitled Open Source Software: A Tool for Digital Transformation in the Broadcasting Industry. The first part revealed the empirical results of our joint R&D project with Radio-Canada on “how to handle IP contents in the cloud”. This includes deploying FFmpeg OSS technology on a general purpose server in order to transmit raw data at speed of 3.5 Gbps without relying on specialized hardware broadcasting equipment. In addition, Éloi demonstrated to the audience the actual data transmission, and performance on the stage in real time with the help of two generic servers and a switch. This showcases for the participants the technical implications and potential of FFmpeg in broadcasting industry for the years to come.

Amir Taherizadeh and Éloi Bail while presenting on the stage.

The second part explored the nature, inherent attributes, myths, advantages, challenges, and licensing opportunities associated with OSS. It explains OSS as a relevant, significant, and ubiquitous tool in a variety of industries including, but not limited to, aerospace as well as media, entertainment and broadcasting industries. The aerospace industry presents an interesting case as it is somewhat comparable to broadcasting industry on three dimensions. It is a rather closed and highly standard-governed industry. It is capital intensive and advances rapidly. There is also a complex and symbiotic interrelationship between hardware and software components. Amir presented an example where the networking stack of the Linux kernel drives the multi-media equipment of an aircraft. This case demonstrates how value-added solutions can be created having adopted an open and collaborative value creation process. Indeed, OSS projects like the Linux kernel and FFmpeg are testimonies to collaborative software development where private companies and communities work together towards a common objective.

From left to right: Éloi Bail, Daniel Guevin (Radio-Canada), David Beaulieu (Radio-Canada), Amir Taherizadeh, Ash Charles, and Francois Legrand (Radio-Canada)

Overall, we really enjoyed being part of this event as it highlighted the opportunity for software transformation – including using open source software such as FFMpeg, GStreamer – in the broadcasting industry.

FOSDEM 2017 : our impressions

Packed amphitheatre for the keynote on the «Kubernetes on the road to GIFEE»

In the 2017’s FOSDEM event, held in Brussels, Soizik, Cécile, Clément, Adrien and Andreas represented Savoir-faire Linux. Here, they share briefly their experience and impressions from their participation in the event.

Soizik Froger, project manager

It was my first FOSDEM event, and I loved it. I have only one regret: I wish I could have attended every session, and talked with everyone!! It was a tremendous place for tech-savvy and free software lovers like me. Seeing those panelists with very high level of expertise has taught me a lesson about humility that comes with great knowledge.

I definitely give five stars to Frenchy Matthieu Totet’s talk on Graph Cycles. This is a passionate work on a real time graph on Twitter and how we can seize the fantastic potential of this technology!

I almost cried of joy at open Q&A session with members of the OpenJDK Governing Board: Mark Reinhold, Mario Torre, Andrew Haley, Georges Saab & Doug Lee (embedded). I secretly took a picture, and I’m sure I will keep it in front of my eyes until the next FOSDEM.

Open Q&A session with members of the OpenJDK Governing Board: Mark Reinhold, Mario Torre, Andrew Haley, Georges Saab & Doug Lee (embedded)

I give the best ‘orator palm’ to Christian Thalinger for his benchmarking of Compiler JIT Graal on Twitter services. It was such a clear and organized speech that a slow guy like me understood it all.

Finally, I discovered what technologies lie behind Ring. Our session was a great success. We were excited by the volume of the turn-out. We had a diverse and enthusiastic audience that posed questions about the architecture of Ring and its ambitious potential for scalability. High five to the Ring’s development team!

Cécile Delépine, Delegate Europe General Manager

That was my first FOSDEM too! It was a great opportunity to meet with the industry in a both cozy and professional environment.
My main focus was containers orchestration with Kubernetes, the fast growing Open Source community at the time being. FOSDEM is the place for technological intelligence, which I see as a BizDev not as an engineer.

Students and tech-related senior job seekers, please take note : FOSDEM is also a place for hiring talents (we invaded FOSDEM job corner with all our job posts for France and Canada). Our presentation on Ring , and Clement’s commitment to LemonLdap coupled with our presence on OW2 stand also significantly contributed to promoting our expertise at Savoir-faire Linux.

I wish I attended Mozilla conference too. What does motivate the open source community? This is the question posed by Rina Jensen, whose conclusions should be widely shared.

Some food for thoughts.

My five stars goes to Software Heritage, a project supported and initiated by Roberto Di Cosmo (INRIA, GTLL Systematic Member). The source code of our projects is a common good, thus it should be available to all and be centralized in one archive which does not depend un one solution and does not vary from one solution to another (Github, Bitbucket…)

Last but not least, I bought the book How Linux works and I almost finished the second chapter;-)

Clément Oudot, infrastructure and security expert

This year, I represented LemonLDAP::NG projet. I then met with Fusion Directory and Spoon communities., It was the first time we had an OW2 stand, and it showed that this consortium was not only Enterprise oriented but also community-oriented.

I was pleased by the large number of attendees at Perl stand and the packed Devroom.
I am still surprised to see Perl can attract so many people. What a wonderful turn-out for Perl!

During this weekend, I met with lots of people I knew from different communities : Framasoft, XMPP, OpenStack, VLC, PHP etc. That’s why I love going to FOSDEM!

The OW2 Stand with Clément Oudot (c), Cécile Delépine and Soizik Forger
Ring conference : What technologies lie behind Ring

Adrien Béraud, Ring system engineer
FOSDEM is an exciting and inspiring place. We met with lots of interesting people with interesting projects, There were too many people! [8000 people attended the event]

As for the Ring session, it was amazing to see how exciting the audience were. Last year, people discovered Ring, this year, they wanted to know a lot more about the technology. No wonder there were so many of them. Actually, there is a growing interest for distributed communication systems.

My five stars goes to Alok Anand, who presented Telepathy Connection Manager for Ring. He was able to develop it because he joined Google Summer of Code’s program which accommodated Ring from Savoir-faire Linux. Thanks to such a wonderful collaboration and such a nice program for young coders.

Andreas Traczyk, Ring developer

Like Soizic and Cecile, it was my first time at FOSDEM in Brussels. It surpassed all my expectations. There were so many passionate people, so many nerds in the same place;-) It was intense!

A packed room for Ring conference

I was really impressed by the turn-out of the audience during the Ring session, Although we did not haveso much time, we were well received, and the audience’s questions were challenging. Besides, I wish we had more space and more time!

My five stars for the best presentation goes to Daniel Pocock for his excellent talk on the real time communication solutions crowdfunding. It was so interesting, so inspiring.

The Open Source Awakens

WIRED said that ‘Open Source went nuclear‘ in 2015.  Join the xiRADIO lunch-time podcast on May 18, to explore the forces disrupting the software industry.

Today, more than 3 out of 4 companies run on open source software, a pace that keeps increasing (it doubled since 2010). Why so much interest? There exist a wide variety of reasons, we can resume in three big points for now. (Note to the purists: to further simplify, I’m putting Free Software and Open Source in the same bag.)

#1 – Open Source is good for customers.

Cisco-on-advantages-of-FLOSS_Cg-iEn8U0AErnevCisco @lewtucker arguing for Open Source at the recent OpenStack Summit
(Austin TX, April 26, 2016)

It is no surprise that Google, Facebook and other IT giants have built most of their entire business on Free/Libre Open Source Software. According to Sylvain Carle, former Twitter employee and FLOSS advocate, Twitter runs on about 95% of Open Source software. It’s a great way to bootstrap a company, and to scale fast. Lew Tucker, Cisco Cloud VP/CTO, explained why Open Source makes sense to his business partners at the recent OpenStack Summit. Open Source is less expensive (e.g. no vendor lock-in, no per-user or per-CPU fee that would not allow scaling exponentially), more productive (e.g. code reuse, sustainability, agility), and it levels the playing field for everyone to collaborate and to compete, thanks to industry standards.

#2 – Open Source is good for IT Services companies.

wipro-innersourceWipro’s recorded presentation at the recent OpenStack Summit (April 2016)

Open Source builds on a deep tradition of Savoir-faire (Know-How) considered as best practice in the software development industry. That’s why companies like PayPal adopted Open Source practices without necessarily adopting Open Source (strictly speaking Open Source refers to a type of software licensing). They call this practice InnerSource: “a great tool to help break down silos, encourage internal collaboration, accelerate new engineer on-boarding (…)”. One step ahead in sophistication, Wipro leveraged Open Source to improve employee engagement and expertise. The Open Source way encourages developers to collaborate and to learn new skills fast, which is life and blood for service companies selling their time and expertise.

#3 – Open Source is the new de facto outsourcing model.

KubernetesA short history of Kubernetes

Most software is so complex that it can’t be developed by a single individual. More recently, large companies also have started to question whether they should carry the burden of developing everything on their own. When Google open sourced Kubernetes, derived from Borg -an internal tool that made scalable updates possible for services like Gmail, most major industry players offered to partner almost immediately. Although it may sound crazy that Google wanted to share their secret sauce, in fact it wasn’t really. Google did not vanish. As a result, the entire industry started to work together on improving how Google deploys software, and how everyone else is. Google ended up outsourcing part of their R&D for free, while scoring big points on technical leadership and vision. Today’s new normal is that two-thirds of companies find a benefit in contributing to Open Source.

In conclusion, did Open Source win?

Lao Tzu explains the principle of Self Realization in the Tao as 无为 (Wú Wéi), or the art of non-doing. If we look back a few years ago, we can wonder what happened to the dualistic view between Proprietary and Open Source software. What happened to all the hate between one side calling the other a ‘cancer’, and the other complaining about an imposed software ‘tax’ on computing? There is no such thing as winning or losing in achieving the harmony of Tao.

If today’s world seems much wiser, it is also more pragmatic. Software is often times governed by a blend of Open Source and other licenses. For example, Microsoft has nearly become an Open Source company close to open source Windows, and contributing to GitHub “with love”.

Whenever peace and love rule, carefreeness should not turn in carelessness. We should worry that a great majority of code on GitHub lacks a license (which means the author was clueless or did not care), and some thinkers like Nadia Eghbal already speak about a post-Open Source world. In fact, like Monsieur Jourdain, in Moliere’s play, suddenly realizing he had been speaking prose all his life, we see many young developers using Open Source tools without even knowing what Open Source is.

For end-users, it may well be that nothing has changed. They have to continue relying on intelligent and enlightened software developers and companies, hoping they won’t have to trade their Freedom and Privacy for good design and convenience.

Update May 19: The podcast is available on Vimeo.

Government of Quebec passes historic motion to promote adoption of Free Software

Last Tuesday, the Quebec National Assembly adopted unanimously a motion welcoming any initiative supporting the dissemination and publishing of free software in Quebec. This motion also encourages the Government to continue its efforts to promote the adoption of free software by government ministries and agencies.

President of the Treasury Board Stéphane Bédard presents the motion at the National AssemblyLargely in part to the long term efforts of our president, free software evangelist Cyrille Béraud who tirelessly promotes and educates on the maturity and advantages of open source, the motion is the first of its kind which helps to raise the profile and acceptability of open source.

A recent research paper published by the Institute for Socio-Economic Research and information (IRIS) states that the Quebec government could as an example save $265 Million per year in license costing if the movement to open source was made, article found here.

So we now see the narrowing of the gap in enterprise software toward open source which will no doubt pinch the pockets of proprietary software sales in the short term and push open source adoption in the medium term.

Find out more (in French)

Talend and Savoir-faire Linux Present Open Data Management

talend_youtubeLast week, Susan Eckenberger and Jim Battista, two executives of Talend Inc., were in Montreal to meet some clients and selected guests in Savoir-faire Linux headquarters. We captured for you most of this meeting on video.

In this first part, Jim introduces Talend and explains how any business can leverage their information assets and undertake inexpensive projects of migration, consolidation, synchronization and data visualization thanks to Talend’s open source, integrated platform. His short presentation covers a brief overview of the corporation and solution history, the technology behind it, and the business model based on innovation sharing and collaboration.