How to use custom services method in liferay themes in velocity files like init_custom.vm
, portal_normal.vm
etc.
I see liferay provides a lot of variables of helper utility classes like $portalUtil
for PortalUtil
, $getterUtil
for GetterUtil
and so on, inside the init.vm
file.
So is it possible to get instance of my custom services like an instance of com.my.custom.service.MyCustomLocalServiceImpl
or services of liferay from UserLocalServiceImpl
?
Here is some psuedo code, to give an idea of what I need:
// this code calls method from MyCustomLocalServiceImpl class to fetch items
#set ($listOfItems = $myCustomLocalServiceUtil.getAllItems())
// this code calls method from UserLocalServiceImpl class to fetch users
#set ($listOfUsers = $userLocalServiceUtil.getUsers(0, 99))
Environment: Liferay 6.1 CE GA1