留言板

Resource Importer FTL Language Not Set

Bruce Green,修改在8 年前。

Resource Importer FTL Language Not Set

New Member 帖子: 2 加入日期: 15-5-16 最近的帖子
When I import my Freemarker templates using the resource importer their language value set to Velocity. This causes subsequent problems when Liferay tries to run them with Velocity. After import I have to manually change their language setting to Freemarker for my pages to run correctly.

Is there a way to import them so that the language is set to Freemarker?
thumbnail
Andew Jardine,修改在8 年前。

RE: Resource Importer FTL Language Not Set

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Bruce,

Couple of things to check / try --

1. If you are using a maven project, with eclipse plugins, I beleive there is a bug where even if you choose FTL as your templating language, the pom.xml sets the language to vm. So swap that out.

2. You can specify the language in the liferay-look-and-feel.xml of the theme like so --


<!--?xml version="1.0"?-->



<look-and-feel>
    <compatibility>
        <version>6.2.0+</version>
    </compatibility>
    <theme id="sample-theme" name="Sample Theme">
    <template-extension>ftl</template-extension>
        <settings>
            <setting key="my-setting" value="my-value" />
        </settings>
    </theme>
</look-and-feel>


After those changes I would suggest you undeploy the theme and then redeploy. Can you try one or both of those and see if it helps?
thumbnail
Olivier Fock Si Ming,修改在8 年前。

RE: Resource Importer FTL Language Not Set

New Member 帖子: 4 加入日期: 15-9-8 最近的帖子
Hi, I just tried this.

The bug is still there on 6.2 GA4 CE using Maven SDK, and even with fixing the liferay-look-and-feel.xml, it still imports as VM

Maybe it's related to this old bug: https://issues.liferay.com/browse/LPS-54241?jql=text%20~%20%22resource%20importer%20velocity%22
thumbnail
Andrew Jardine,修改在8 年前。

RE: Resource Importer FTL Language Not Set

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Olivier,

Having a look at the github repo (branch for 6.2), at a glance, everything looks right to me. Check out this file: https://github.com/liferay/liferay-plugins/blob/6.2.x/webs/resources-importer-web/docroot/WEB-INF/src/com/liferay/resourcesimporter/util/FileSystemImporter.java

Have a look around like #167 -- and it looks "right" to me -- again, just taking glances of course. I would think that the GA4 release has one of the latest versions of the source, but perhaps its not. Couple of things I would try next --

1. Go into the Control Panel > Apps and the Purchased tab. Find the resources inporter plugin and make sure that the button to the right is not listed as "update". If it is showing update, then update it and perhaps the latest version will fix the issue.

2. Clone the repo on your side, set a breakpoint in that method and see if your steps line up with the code. If they don't, then the version you have deployed isn't the lasted -- so you can clone it, build it, deploy it and try again.

Lemme know what you find.
Scott Lawrence,修改在8 年前。

RE: Resource Importer FTL Language Not Set

New Member 帖子: 2 加入日期: 15-9-8 最近的帖子
I'm running into this as well.
Bruce Green,修改在8 年前。

RE: Resource Importer FTL Language Not Set

New Member 帖子: 2 加入日期: 15-5-16 最近的帖子
Being programmers we figured that we'd just debug the problem by installing our own version of the resource importer. We took the resource importer that comes with EE. That plugin includes it's source code . We took that, created a project, compiled and deployed it. To our great surprise the problem went away. The templates now imported as FTL instead of defaulting to VM.

We were sure that we had done something wrong. So we removed the plugin thinking something else was intercepting the import. When we did that importing would fail. When we put our version of the importer back things worked as we wanted. At this point we're just happy its working and have moved on.
thumbnail
Andrew Jardine,修改在8 年前。

RE: Resource Importer FTL Language Not Set

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
That sounds like maybe you didn't actually have the latest version maybe? Without the one you download and built yourselves installed, if you go into the control panel in the apps section -- does it give you an "update" option for the installed plugin?

EDIT: I just realized I already asked that - hahah - but you never did provide the answer emoticon