Introduction #

Custom attributes is a new feature introduced in Liferay v5.2 that allows extending the profile of users and organizations with fields to store custom information. Custom attributes are also available as a service that can be used from custom portlets to add this feature to any stored entity.

Usage 5.x #

The following picture shows the form that an administrator can use to create a new custom attribute: Once the custom attribute has been created it will appear in the user profile within My Account and the User administration UI:

Usage 6.x #

Navigate to the Control Panel as an administrator and select "Custom Fields" form the left side. You can now edit the custom fields for different types of content. For example if you add a custom field for Organizations you can edit an organization and add content under the "Custom fields" tab on the right.

How is it implemented? #

Custom attributes are implemented using Liferay's ExpandoService. This means that all the data introduced in custom attributes is safely stored within the database and fully indexed using Lucene.

2 Anhänge
92987 Angesehen
Durchschnitt (4 Stimmen)
Die durchschnittliche Bewertung ist 2.25 von max. 5 Sternen.
Antworten im Thread Autor Datum
It is nice for simple additions. More complex... Tobias Marx 2. Februar 2010 02:29
@Tobias This is not entirley true, you can... Maarten Scholl 26. Februar 2013 01:54

It is nice for simple additions. More complex objects can not be added. For example you want to add "plans" to this that look like this:

public class Plan {

private Date startDate;
private Date endDate;
private String title;
private String description;


Gepostet am 02.02.10 02:29.

This is not entirley true, you can save such an object by serializing it to xml and then save it in a custom attribute.
When retrieving the information you can then deserialize it to retrieve the object instance.

A libray as XStream could be very helpfull for this purpose!


Kim Zeevaarders
Gepostet am 26.02.13 01:54.