Search code examples
liferay-6

Liferay Template for DDL


Under Site-Administration->Content->Dynamic Data Lists-> Manage Data Definition->Manage Templates I like to create a new Freemaker template. In this template I like to call the class GetterUtil:

 <#assign DDLRecordLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService")>

<#assign GetterUtil = serviceLocator.findService("com.liferay.portal.kernel.util.GetterUtil")>

If I do so I get the following error:

serviceLocator.findService("com.liferay.portal.kernel.util.GetterUtil") is undefined. It cannot be assigned to GetterUtil

At the end I want to call

  long formDDMTemplateId = GetterUtil.getLong((String)row.getParameter("formDDMTemplateId"));

in my DDL Template. This line comes from dynamic_data_lists/record_action.jsp.

Is the object row equal to the object cur_record from this post?


Solution

  • GetterUtil is not Liferay Service, it's just an util class. Inside DDL template it is bound as a getterUtil variable, eg: getterUtil.getString("asdf").