将模板从velocity迁移到freemarker
我需要将一些模板从liferay 6.2中的velocity迁移到liferay 7.4 dxp的freemarker,我尝试使用USCavalry工具,但结果不完整,有人可以帮助我吗? 这是我使用我提到的工具获得的结果的示例,当我尝试测试模板时,我遇到了几个错误。
<#assign layoutId = request.get("theme-display").get("plid")>
<#-- get the service for layout-->
<#assign layoutService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
<#--convert the layout id into long-->
<#assign layoutLong = getterUtil.getLong(layoutId)>
<#--take a layout object-->
<#assign layout = layoutService.getLayout(layoutLong)><#assign pageName = layout.getName(locale)>
<#if layout.getExpandoBridge().getAttribute("isTabPage") == false>
<h1 id="genericPageTitle">
<span class="webContentPageTitle">${pageName}</span>
</h1>
</#if>
<#-- get Date object-->
<#assign modDate = dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss Z", reserved-article-modified-date.data, locale)>
<#-- get format Date-->
<#assign modDateFormat = dateTool.format("yyyy/MM/dd", modDate, locale)><#assign paramName = "error">
<#assign errorToShow = httpUtil.getParameter(request.get("attributes").CURRENT_COMPLETE_URL, paramName)>
<div class="webContentModifiedDate <#if layout.getExpandoBridge().getAttribute('isTabPage') == true> webContentModifiedDateTapPage </#if>">
<div class="webContentPrint" onclick="printElem('webContentMainDiv');"></div>
</div>
<div id="webContentMainDiv" class="webContentMainDiv">
<div class="portlet-msg-error">
${languageUtil.get(locale, errorKey.getData())}<br/>
<#if errorToShow != "">
<div id="portlet-msg-error-detail" style="margin-top:30px;">
${languageUtil.get(locale, "error.details")}<br/>
<b>
<i>${httpUtil.decodeURL(errorToShow)}<i>
</b>
</div>
</#if>
</div>
</div>```
I need to migrate some templates from velocity in liferay 6.2 to freemarker for liferay 7.4 dxp, I tried to use the USCavalry tool, but the result is not complete, can someone help me?
this is an example of the results I get with the tool I mentioned, when I try to test a template I get several errors.
<#assign layoutId = request.get("theme-display").get("plid")>
<#-- get the service for layout-->
<#assign layoutService = serviceLocator.findService("com.liferay.portal.kernel.service.LayoutLocalService")>
<#--convert the layout id into long-->
<#assign layoutLong = getterUtil.getLong(layoutId)>
<#--take a layout object-->
<#assign layout = layoutService.getLayout(layoutLong)><#assign pageName = layout.getName(locale)>
<#if layout.getExpandoBridge().getAttribute("isTabPage") == false>
<h1 id="genericPageTitle">
<span class="webContentPageTitle">${pageName}</span>
</h1>
</#if>
<#-- get Date object-->
<#assign modDate = dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss Z", reserved-article-modified-date.data, locale)>
<#-- get format Date-->
<#assign modDateFormat = dateTool.format("yyyy/MM/dd", modDate, locale)><#assign paramName = "error">
<#assign errorToShow = httpUtil.getParameter(request.get("attributes").CURRENT_COMPLETE_URL, paramName)>
<div class="webContentModifiedDate <#if layout.getExpandoBridge().getAttribute('isTabPage') == true> webContentModifiedDateTapPage </#if>">
<div class="webContentPrint" onclick="printElem('webContentMainDiv');"></div>
</div>
<div id="webContentMainDiv" class="webContentMainDiv">
<div class="portlet-msg-error">
${languageUtil.get(locale, errorKey.getData())}<br/>
<#if errorToShow != "">
<div id="portlet-msg-error-detail" style="margin-top:30px;">
${languageUtil.get(locale, "error.details")}<br/>
<b>
<i>${httpUtil.decodeURL(errorToShow)}<i>
</b>
</div>
</#if>
</div>
</div>```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
USCAVALRY是古老的。对不起,您必须手工完成大部分工作。
USCavalry is ancient. You have to do most of the work by hand, sorry.