Meet The Author

I'm Jitendra Rajput (Senior Consultant @ CIGNEX Datamatics) , A Programmer , Blogger , Technology Enthusiast and apart from this interested in making new friends , love music and love to play CHESS. Expressing my thoughts using blog.


Liferay Search Container

1 comment
I have posted couple of articles related to sort search container results in Liferay.

You can refer to my blog post Orderable Search Container In Liferay to sort database results using Liferay search container.

If you want to sort results coming from solr using search container then refer to this blog post Sort Solr Results Using Search Container.

But what if you don't have any database/solr results and still you want to user Liferay search container ? . For example let say if  you List<Long>  and you want to display the same using Liferay search container.

Read Portlet Preferences in Liferay

Leave a Comment
We know how to get preferences of current portlet from request object (renderRequest.getPreferences()) but some time we have requirement to read preferences of remote portlet placed on some other page.

Using PortletPreferenceLocalServiceUtil we can read preference of any portlet. We just need to take care while passing parameter like OWNER_ID ,OWNER_TYPE , Plid , and Default Preferences.

If the preferences are unique per group 


OWNER_TYPE : If the preferences are unique per group (Shared preferences between portlet placed on multiple page within same group) then pass groupId as OWNER_TYPE.

Plid : 0  (PortletKeys.PREFS_PLID_SHARED).

PortletId : PortletId of remote portlet.

If the preferences are unique per layout



Plid : Pass Plid of page where remote portlet is placed. If Blog portlet is placed on "/home" page then pass plid of "/home" page.

PortletId : PortletId of remote portlet.

Below is the example to read preferences of remote portlet.

In case if you are using any other method of PortletPreferecesLocalServiceUtil which returns com.liferay.portal.model.PortletPreferences instead of javax.portlet.PortletPreferences then using below code you can do the converstion from com.liferay.portal.model.PortletPreferences to javax.portlet.PortletPreferences.

Content Filtering By User Custom Attribute in Asset Publisher

Leave a Comment
This post will help you to configure assets based on user's custom attribute.

Steps are already available in LPS-19681 but in case if you face any difficulty while configuring the same you can follow this post.


Filter content based on user's custom attribute. If user A logged in from India then asset publisher to display contents for India. If user B logged in from USA then asset publisher to display content from USA.

Step 1 :

Create custom attribute for user with the type Text and name it as "Location".

Read more »

Portlet Location Tracker - v1.1 Released for Liferay 6.2 and Liferay 6.1

Leave a Comment
I am pleased to share that Portlet Location Tracker v1.1 has been released .

New release of Portlet Location Tracker now supports Liferay 6.2 as well.  In the v1.1 of Portlet Location Tracker we have added functionality to remove portlet from page.

Now user can remove any portlet from page in one shot using Portlet Location Tracker.

No need to browse pages to remove portlet just use Portlet Location Tracker , search for your portlet and from results remove from portlet from desired page.

Thank you ,
Jitendra Rajput
Consultant @ CIGNEX Datamatics 

Liferay - Override ServiceImpl Using Ext

Leave a Comment
It is recommended to implement hook to override any portal service but there are certain limitation if you are overriding portal service using hook.

Override a Portal Service using Hook

You won't be able to access any class of portal-impl.jar inside hook so its better to use ext-plugin in such case.

This post will describe how to override any service impl class using ext.

First of all create ext-plugin. Inside ext-impl/src create META-INF folder.

Create ext-spring.xml file. You might have question why we have to create xml file with this specific name. To know more on this you need to check spring.configs property of file.

Read more »
Previous PostOlder Posts Home