An Overview of Liferay Services - Part 1

Whenever you work with Liferay and you do more then just adding portlets to a page you will need to work with Liferay Services. They provide CRUD - access to all Users, Roles, Groups, Blogs, Forum Entries etc etc etc. This series of entries has the aim to provide an overview to let you find out quickly the Service that you need to get the data that you want. Just a hint: Whenever you access a Service you will most likely do it by using the "XXLocalServiceUtil" - helper classes that Liferay provides. I will link this series on the front page of my blog so it will be very fast accessible.

Getting the Addresses of Users

If you want to get the address details of Users, you will use the AddressLocalServiceUtil. The table you are looking for is "address" and the entity (of course) also "Address". The address table contains only address information like street, city, a region id and a country id. If you need information about the region and country itself you will need other Services.

table name: Address
entity: Address
Service class: AddressLocalServiceUtil

Getting Blogs 

If you want to retrieve all Blogs posted by Users you can use the BlogsEntryLocalServiceUtil. The table is called "blogsentry". The blogsentry table contains all you need to know about blogs - including the createDate. The content of the blog is in html format, so be sure to strip this before you process it.

table name: BlogsEntry
entity: BlogsEntry
Service class: BlogyEntryLocalServiceUtil

Getting Infos about Chats

If you want to retrieve data about chats ( the chat portlet is available from liferay) you can do this by queriyng two tables "chat_entry" and "chat_status". The first table contains the chat messages (they won´t get deleted), the second contains the status of people that chat (online, offline etc.). The second table is very handy if you want to display the online status of people in the portal.

table name: chat_entry
entity: Entry
Service class: EntryLocalServiceUtil

table name: chat_status
entity: Status
Service class: StatusLocalServiceUtil

Here is a summary

Model DescriptionLiferay ServiceTable Name
Addresses of all registered UsersAddressLocalServiceUtiladdress
All Blog entriesBlogsEntryLocalServiceUtiladdress
All chats heldEntryLocalServiceUtilchat_entry
Online Status of Liferay Portal UsersStatusLocalServiceUtilchat_status

If you like this tutorial it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.