Marco Napolitano

Passionate and addicted to technology

Cookies help us deliver our services.

By using our services, you agree to our use of cookies. Learn more

I understand

Liferay session sharing between guest and logged user

Today I'll show you how to solve a problem perhaps not too frequent but useful in some contexts.

The case history is quite simple to explain: while browsing a Liferay site as a Guest user I need to set some session variables and then, when the user logs in, these variables must remain in the session. Although there are several different ways to solve the problem with Liferay, I'll show you what I think to be the safest and most elegant one.

Read more: Liferay session sharing between guest and logged user

How to add an image to a custom entity

Surely you will have had to define a custom entity in the Service Builder to which to associate an image, such as an icon or a cover image.

Typically in these cases, you start to work with the Document Library by creating folders, sub-folders, permissions, trying to manage the entire flow of creating and updating the image itself.

But once again, Liferay's API help us and simplify our lives!

Read more: How to add an image to a custom entity

AlloyEditor Manager

Liferay 7 release has brought great news in content management scope: AlloyEditor.

This new WYSIWYG editor has certainly brought a breath of fresh air; however, those of you who have used it, have surely asked what happened to the buttons for text alignment, paragraph indentation or superscript.

These buttons, are supported by AlloyEditor, but they are not enabled by default and you need to write code to enable them!

Read more: AlloyEditor Manager

How to implement a custom Gogo shell command for Liferay 7

Liferay DXP (and its free counterpart Liferay 7) introduced many new features, first of all the OSGi integration. Among the many new tools provided there is a shell to interact with the OSGi container; I'm talking about Gogo shell (a subproject of Apache Felix) accessible with the command telnet localhost 11311.

Once accessed to the shell, we can see the list of all available commands simply by typing help; each command is formed by a scope (a kind of grouping) and a name.

So let's see how to create a custom command to be executed inside the Gogo shell.

Read more: How to implement a custom Gogo shell command for Liferay 7