Cookies help us deliver our services.

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

I understand

Liferay List Type Manager

If you have worked with Liferay for a while, you'll probably found yourselves working with ListType objects, the set of elements contained in the listtype table with which you can automatically populate the <select> tag.

However, there are no portlets for managing these elements and all operations must be done by hand directly on the database via SQL; this is rather uncomfortable and frustrating.

Read more: Liferay List Type Manager

Let's format file size

In a previous article (TextFormatter class) we have seen what is the class TextFormatter and how it works.

Now we'll see another method provided by this class, which can be used to make more human readable the size of a file or, more generally, any value that represents a size in bytes.

Read more: Let's format file size

EntityLocalServiceUtil: difference between getEntity and fetchEntity

Working with Service Builder, you'll certainly notice a lot of useful methods exposed by the persistence class EntityLocalServiceUtil; among the various generated methods, there are two of them used to retrieve an instance of a single entity starting from the primary key: getEntity and fetchEntity.

But what's the difference between these two methods?

Read more: EntityLocalServiceUtil: difference between getEntity and fetchEntity

Liferay TextFormatter class

Liferay, as you know, is full of utility classes to perform various functions; one of these classes is called TextFormatter and is extremely useful in the attribute names management, to conform to the standards imposed by Liferay.

Read more: Liferay TextFormatter class