Liferay : How to see which portlets are composing a page? - liferay

I'm new to liferay.
I imported a big lar into my liferay instance but, for the moment, have none of the required portlets : there are a lot of portlets in the project I'm joining.
Currently, I have the site structure, but the pages display the message that the portlet is not here (logical).
For comprehension purposes, I wanted to build my portlets one after the other, on the need, to see them appear by the grace of liferay ;-)
But for that I wanted to know which portlet is missing.
This thread : How can i find - which portlets are deployed on which pages in Liferay 6.1? explain how to achieve this through the DB.
Is there really no built-in solution to do it through the liferay interface? Have we really to hack in the DB to get the info or install plugin?
Thanks!

In your browser console, Liferay.Portlet.list contains all portlets in the page.
This value is generated by themeDisplay.getLayoutTypePortlet().getAllPortlets() on the server.

As an alternative you can also look at the HTML code of the page and look for elements with the class portlet-boundary. For example this belongs to an instance of the Journal Content Portlet (Portlet name 56):
<div class="portlet-boundary portlet-boundary_56_ portlet-static portlet-static-end portlet-borderless portlet-journal-content full-screen" id="p_p_id_56_INSTANCE_WdRdMGe86kDa_">

Related

Liferay: How can I get the pages of the site in a web content?

I have a portal in Liferay 6.2, and need to design the velocity template of a web content that must have a menu listing the pages (linked names) of the site where is present.
My questions are:
Is this possible?
What would be the correct way to do this?
Would it be better to make a portlet instead of a web content for this purpose?
Thanks for the help.
It feels a bit like you are trying to solve many problems in a single template - consider to compose the UI from many different elements (e.g. custom portlets) rather than building the one structure/template that fits all requirements.
That being said, as there's also the chance that your template doesn't do more than just displaying the current navigation: You have two options: The out-of-the-box Navigation portlet is quite configurable, you might be able to utilize that one instead of implementing anything yourself (check the configuration options).
And lastly, if you want to implement for yourself: Get hold of the themeDisplay object. With getLayout() you'll get the current page, while getLayouts() you'll get all pages of the current site and can enumerate them. However, there's one problem: You typically don't have access to the themeDisplay object from a CMS template. But there are several ways to still get to the data (search the Liferay forums for cms template themedisplay). Also, an Application Display Template will be a lot more powerful - and you can also check how the layouts collection is built - just search for usage of ThemeDisplay.setLayouts in Liferay's source code. But with ADT we're diverting from your original question.
Liferay offers a sitemap portlet out-of-the-box which lists pages of a site. You can configure it and define your own application display template (ADT).

Liferay Search static text within all portlets

I would like to know if built in functionality exists or how to implement functionality to search the static text of JSPs not web content of all deployed portlets in liferay from a centralised portlet (or theme). Unfortunately, there does not seem to be help regarding this issue.
Thanks.
This could be helpful. You must get rid of long and ugly URLs and use Liferay API's mentioned in that Wiki.

Portlet content is not shown in Liferay

I've recently started working with portlets, and trying to have experience with several portal engines. I have a basic hello world portlet (extending GenericPortlet and basically doing the same as in all tutorials) that works perfectly with Pluto 2.
I deployed the same portlet to Liferay 6.0, and added it to a page in the portal. Strangely, the portlet frame appears without any content. According to the logs, the portlet init() is called, but doView() is not, thus there's no portlet content in the resulted HTML page.
My question is: should the same portlet work out of the box with Liferay, too? If not, what non-standard descriptors are mandatory for deploying a portlet to Liferay? If yes, what may be the problem? I've seen portlet content height issues mentioned in some forums, but this may not be the problem: the content is not hidden, it's not generated at all.
While checking the relevant file contents to paste here as asked, I realized that my web.xml is empty (as it should be according to Liferay tutorials), but a maven plugin generates pluto-specific invoker definitions into it as defined in my pom.xml. As a result, the generated pluto-specific PlutoInvoker mappings screwed it all up. So it was solved easily, thanks for reading the question though.

Liferay : custom Web content Display List Portlet

I'm beginner in Liferay, and I need to customize the portlet webcontent display list.
I added a portlet in my page Home, and I managed to see the recent news that I created.
The news is displayed in a table (title, author and date display).
I want to display the news like this:
- The date of the news (above the title of the news)
- The title of the news (which is a link to the news)
I tried to create a structure, but I do not see commits its work?
Thank you to enlighten me?
PS: sorry for this English !!
Liferay is available in source - did you look at the implementation of the webcontent list portlet? You can either create a jsp hook for that portlet or just reimplement a similar one based on what you find in there...
As you say you'd like to customize Webcontent display list I assume you don't want its default behaviour. Once you know what to change in this portlet, read about jsp hooks, create a hook with the jsp changes you'd like (if it's limited to jsp changes) and deploy it.
Liferay's development documentation should have the information that you need, otherwise continue in the wiki on liferay.com
Edit: Also, you might want to look at AssetPublisher - maybe this provides a few more options for formatting your output.
Generally Liferay web content in journalarticle table. I have referred Liferay 6.0 Version.
Now, for showing liferay custom portlet view, you should use Liferay Portlet Creation and Liferay Service Builder.
Here are two useful article on those -
1> Liferay MVC Portlet
2> Liferay Service Builder
Now make the service for journalarticle table and use those in your portlet.
Some useful fields of journalarticle table for your reference are - title, createDate etc.

Liferay - theme across all portlets?

If I create multiple portlets with liferay, how can I have 1 theme control the look of all of them?
Thanks
The Liferay's templating system consists of Velocity/Freemarker templates that renders particular html segments of portlets on a page. It is essentially one theme that styles everything.
If you choose to use JSPs on server side and Alloy UI framework on client side, even your portlet would have the same look and feel as the rest of the portal because Liferay JSP taglibs and Alloy UI both use the same CSS classes that the classic/default Liferay theme is expecting and made for.

Resources