This video is about using the Documents and Media portlet of Liferay for displaying a simple list of documents for download.
Showing a list of documents to users is easy in Liferay ... easy? It took me two hours to find out. So, let me save you time. Hi, my name is Andreas Hense and I'm making videos on business process automation. Today I'll show you how to present a list of documents - pdf, doc, etc. - for users to download. The problem in Liferay is that the documents and media app in its standard configuration leads to an overly complex user interface that makes it hard to download a document for a novice user. In this tutorial I'll show you one easy solution to the problem. So, let me show you what the problem is. Here on the left-hand side, you can see the Liferay portal. There is an ordinary user logged in and the user is looking at the documents and media portlet. So, you can see two documents here. All very nice with the preview etc and suppose the user now wants to download the document or at least look at the document. So, we click on the document here and it selects the document but there's nothing we can do with it. The next approach would be to click on the document pdf line here and then there is a bigger preview opening but still nowhere to download the document. So, what can we do? We can try to click on info and yes: now we have a download button! Isn't it possible to make that easier? So, my first approach was to look on the Internet and see how this can be changed. How the default behavior can be changed and So, I looked at this page "Displaying Files" here from the Liferay Help Center and there are four different things that can be done. So, we can show documents in a Document and Media App. I mean, that's what we are just doing. Display them in the media gallery, use the asset publisher, or insert them in an asset like a web content article or blogs entry and I thought that maybe the Documents and Media App is not the right place to do something as simple as showing documents for downloads. So, I tried the other three alternatives. Display them in the media gallery: the problem with the media gallery is that it works only for photos and movies etc. So, this doesn't really work for ordinary documents. They're just not shown. My second approach was to use the asset publisher but there were some problems with the links to the documents and there were some error messages So, that didn't work either and the fourth one, insert them in an asset like a web content article or blogs entry, I didn't really want to try that because I was afraid of problems with the visibility and the rights, the access rights to the document links. So, I was really looking for some time and then finally I found out that it was relatively easy to configure them in the documents and media app and I'll show you how to do this now. Okay, now we are logged in with our Liferay admin user and we go to this documents page and go to the documents and media portlet and go to the three dots here and there's something called configuration. So, the first thing that we will do is to show the actions. This is one setting we have to do we can remove the search and the related assets. Then in the display style views, we just leave this to list. So, we want to have a list and not the cards or table and then in the show columns, we just remove the things that we don't think are necessary and we disable ratings and comments and save and now if we refresh this page, we can see that the documents are shown in a list and here on the right hand side we have directly the download button. That's it! You may say that was obvious. Did you find another way of solving the problem? Let me know in the comments!