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