Portlet content is not shown in Liferay - 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.

Related

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

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_">

Call Custom aAction from Liferay Theme

I have A Custom Theme project & A Custom portlet project in liferay.
I want to call a custom action which is in Custom portlet from navigation.vm File of Theme Project.
actionurl is : /c/journal/upload_article which is called from same portlet project successfully.
How to call this from theme project?
Any help is really appreciated.
It sounds weird to "call" an action from a theme. If you embed a form to upload content on every page, naturally, you'd need a target for the upload. But still, the theme seems to be the wrong place to do so.
Nevertheless: It seems that you're using a non-custom URL for uploading (/c/journal/upload_article). You can do so from wherever in HTML. The big question then is: Where will you end up after the upload, as it doesn't happen from within a page.
If you need a proper portlet URL on an individual page, and want to return to the same page, the best way forward is to embed a portlet in the theme (which makes a great search term for Liferay's documentation). From that portlet you can utilize Liferay's API to do what you're trying to achieve. Make it a very lightweight portlet, because, well, it will be embedded on every single page.

Converting Vignette Portlets to Liferay Portlets

As the title states, i'm trying to convert these Vignette portlets into Liferay portlets.
Is there any documentation on this anywhere? I've searched the entire Internet
-When trying to deploy my WARs right off the bat, I'm getting a "missing liferay.plugin.packet.xml" which tells me the entire portlet must be reconfigured to work with Liferay.
-Running Liferay 6.1.1 ga2 on Web Logic 12c server
Cheers!
You mean "liferay-plugin-package.xml", don't you?
You will find such a file in the source of Liferay at /portal-web/docroot/WEB-INF/liferay-plugin-package.xml. For other examples just download sources from other Portlets (Github or Liferay-Marketplace).
Besides some other values, this file defines how Liferay should handle your war (layout-template, portlet, theme).
EDIT: As the marketplace does not allow (plz see the comment in: liferay-plugin-package_6_1_0.dtd) portlets having an liferay-plugin-package.xml, I would recommend to use the corresponding properties file.
Reference file (in the portal sources): /definitions/liferay-plugin-package_6_1_0.properties

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.

Setting up a new website with Liferay Portal - basic steps?

I know this is not specifically a programming question, but programmers will often have to do this work.
How do I create a website with Liferay portal - the docs are pretty light on this fundamental issue and are all for version 4.4. I am using version 5.2 and the docs don't seem to be relevant.
Do you know what the basic steps are. So far I have logged in as the bruno user and can see the 7cogs website and edit it. But I now need to create my own website (for my company) and be able to develop portlets to add to the parts of the page.
Further I notice that the docs talk about doing work in Eclipse. If our website is all static HTML, (the reason we want liferay is mainly so that we can edit content items using its content management tools), then will there be any need for Java dev, or will it all be drag n drop and clicking to get setup. Any guidance will be much appreciated.
Liferay can be used as a simple CMS, without much Java knowledge : creating, editing and positioning of web content fragments are drag'n'drop and use of the included rich text editor.
But to start using Liferay for your company, there are two main steps : a technical configuration (database, etc.), and a look'n'feel customization.
The technical part
First of all, you should get rid of the 7cogs website : this is called a hook in the Liferay wording. To do that, if you are using Tomcat for the application server, just delete the 7cogs directory as stated here.
You can now create the configuration file for your installation : it's a simple text properties file, named portal-ext.properties and placed in the webapps/ROOT/WEB-INF/classes folder of your tomcat installation.
This file handles most of the configuration of the Liferay portal, for example :
the name of your company
if you want to display a terms of use page on first login
if you want anybody to be able to create an account on your portal
the database where the data will be stored
To do this, the properties in the portal-ext.properties override default properties found in a embedded portal.properties file located in the jar file portal-impl.jar, in the webapps/ROOT/WEB-INF/lib directory. Just unzip the jar file in a temporary folder to access the portal.properties file.
A sample portal-ext.properties file :
company.default.web.id=yourcompany.com
terms.of.use.required=false
company.security.strangers=false
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
Once done, you can startup your application server. As the default admin (named test, something you can change in the portal-ext.properties file), you can access to the centralized web "control center", located in the "dock" (the strange menu labelled "welcome Test" in the upper right part of any page once logged in).
I would advise you to read the administration guide, useful for most administrative tasks.
The "branding" part
Liferay uses "Themes" to automatically decorate the portal pages (logo, navigation, portlet borders...) using images, CSS, Javascript (JQuery) and the templating language Velocity. The themes are bundled in a .war file, like a standard web application, and deployed on the fly either via the control center or by dropping the file in the deploy directory of the server.
Liferay can use several themes at the same time, one for each community (a group of pages, users and content) for example.
Creating your own theme can be done afterwards, using the "Plugins SDK".
The Wiki, forums and blogs can be very useful.

Resources