I worked Application Display Templates on liferay 6.2, I use freemarker help pagination the dynamics data list of liferay. When I upgrade to liferay 7, it is a problem. Liferay 7 use code <#assign records = ddlDisplayTemplateHelper.getRecords(reserved_record_set_id)>
for get a records.
Old code:
<#assign DDLRecordLocalService = serviceLocator.findService("com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService")> <#assign records = DDLRecordLocalService.getRecords(reserved_record_set_id)> <#assign totalRecord = DDLRecordLocalService.getRecordsCount(reserved_record_set_id, 0) >
It doesn't work.
So I try <#assign serviceLocator = staticUtil["com.liferay.portal.template.ServiceLocator"]>
but staticUtil
get an error.
The following has evaluated to null or missing: ==> staticUtil [in template "20115#20159#21387" at line 9, column 27] Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing
In portal-ext.properties I have added:
freemarker.engine.restricted.classes=
freemarker.engine.restricted.packages=
freemarker.engine.restricted.variables=