質問

Is there any way to use .java Classes in liferay theme? I want to use a class of java to converting dates. So how can I include java classes to my liferay 6 theme and use it on portal_normal.vm velocity?

Thanks.

役に立ちましたか?

解決 2

No, it's not possible to have java code within liferay theme.

You already have dateUtil reference within velocity context to have some date utilities. Refer to DateUtil_IW class for method list.

Inject new util class in velocity it's quite complex to explain, you have to build an ext plugin. It's better to build a portlet plugin and embed it within theme.

他のヒント

Well, You can certainly achieve it, and I don't think it is complex. Step by step instructions to call your java class from theme vm are given here. You can also use Liferay's dateUtil as @Daniele mentioned -or- go though Velocity reference if any of the advanced functions suit your requirements..

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top