繁体   English   中英

将模板从 velocity 迁移到 freemarker

[英]migrate template from velocity to 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>```

美国骑兵很古老。 抱歉,您必须手工完成大部分工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM