Liferay 6.1 Release Candidate, Installation

As liferay 6.1 RC is released, i thought of giving it a quick try. Here are the new steps you will notice once you install and start the tomcat beside the regular installation steps mentioned in this article Quick Installation Instructions.

Continue reading

Ajax Call using Alloy UI

Lately I was trying to get data back from response once the Ajax Call is complete. There were few examples and i couldnt find them conclusive enough.  Here is the snippet of MVC Portlet in Liferay 6.  In this example i am sending a AJAX request with parameters and then getting few parameter back from response using Alloy UI Ajax Call.

Continue reading

Advertisement

Checking Community Roles in Liferay Themes

Here is small snippet of code to check community level role in Themes. You can write the following code in init_custom.vm

#* Check for Community role for logged in user. *#
#set ($blogEditorCummunityRole = 'Blog Editor')
#set ($userHasBlogEditorRole = 'false')
#* Get Role Local Service *#
#set ($roleLocalService = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#* Get All community Level Role for current community and Current Logged In User *#
#set ($communityRolesforUser = $roleLocalService.getUserGroupRoles($user_id,$group_id))
#* Iterate through the list of roles and Compare the Blog Editor Role *#
#foreach ($communityRoleforUser in $communityRolesforUser)
         #if ($communityRoleforUser.getName() == $blogEditorCummunityRole)
               #set ($userHasBlogEditorRole= 'true')
          #end
#end