【发布时间】:2016-04-21 02:05:07
【问题描述】:
我有带有结构和模板的内容,我想访问内容的标签以在模板中显示它。 在以前的资产发布者应用程序显示模板中,我得到了带有 ServiceLocator 的标签,如下所示:
<#list entries as entry>
<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetEntryLocalService") />
<#assign assetTagLocalService = serviceLocator.findService("com.liferay.portlet.asset.service.AssetTagLocalService") />
<#assign assetTags = assetTagLocalService.getEntryTags(entry.getEntryId()) />
<#list assetTags as tag>
<#if tag.getName() != "startseite">
${tag.getName()}
</#if>
</#list>
</#list>
在我的模板中,我用.vars['reserved-article-id'].data 交换了条目,但随后出现错误:
方法 public final java.util.List com.sun.proxy.$Proxy562.getEntryTags(long) throws com.liferay.portal.kernel.exception.SystemException 在 com.liferay.portlet.asset 上调用时抛出异常。 service.impl.AssetTagLocalServiceImpl@6bc73e2b
你如何让它在模板中工作?
【问题讨论】:
标签: liferay freemarker