Laliwala IT Services

Laliwala IT Services
Website Development

Wednesday, February 23, 2011

Invoke a Java class in portal_normal.vm, liferay configure, liferay environment, community, forums, message, liferay works, liferay developer

Sam w : Hi,








Can anyone tell me how to invoke a java class in portal_normal.vm or in any *.vm?








eg. in portal_normal.vm, I want to do something like this:
















In order to call MyProductUtil.class, how to configure liferay environment so that the reference of its class is found in portal_normal.vm file?








Thanks

Sam






Mazhar Anwar :
You can achieve it by extending VelocityVariables.java in portal source.






Shagul Khajamohideen : Hi Sam,








The below links may help.








http://www.liferay.com/community/forums/-/message_boards/message/3376997








http://www.liferay.com/community/wiki/-/wiki/Main/Access+to+Liferay+services+in+Velocity






Sam w : The second link (ServiceLocator) might be something that I am looking for.








I think I can write something like this:
















Thanks very much for the reference.





I will try it out see if it works.








Thanks

Sam

No comments:

Post a Comment