embed portlet in template for liferay -
i using liferay 6.1 ce (liferay portal community edition 6.1.1 ce ga2 (paton / build 6101 / july 31, 2012))
when want embed example navigation portlet in template through code:
$processor.processportlet("71_instance_xyz1")
it shows same code in page not portlet!
after searching, understand there bug in templateprocessor
class in portal-impl/src/com/liferay/portlet/layoutconfiguration/util/velocity/templateprocessor.java
file
templateprocessor.processportlet()
ignores supplied portletid.
can solve problem hook or extension?
if no how can solve problem?
when embedding portlet in template receive following error in log:
09:23:22,898 error [http-bio-8080-exec-2][liferaymethodexceptioneventhandler:33] java.lang.nullpointerexception java.lang.nullpointerexception @ com.liferay.portal.model.portletconstants.getrootportletid(portletconstants.java:85) @ com.liferay.portal.service.impl.portletlocalserviceimpl.getportletbyid(portletlocalserviceimpl.java:403) @ sun.reflect.generatedmethodaccessor254.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.liferay.portal.spring.aop.servicebeanmethodinvocation.proceed(servicebeanmethodinvocation.java:122) @ com.liferay.portal.spring.aop.servicebeanaopproxy.invoke(servicebeanaopproxy.java:211) @ $proxy65.getportletbyid(unknown source) @ com.liferay.portal.service.portletlocalserviceutil.getportletbyid(portletlocalserviceutil.java:353) @ com.liferay.portlet.layoutconfiguration.util.runtimeportletimpl.processportlet(runtimeportletimpl.java:115) @ com.liferay.portlet.layoutconfiguration.util.runtimeportletimpl.processportlet(runtimeportletimpl.java:203) @ com.liferay.portlet.layoutconfiguration.util.runtimeportletimpl.processportlet(runtimeportletimpl.java:190) @ com.liferay.portlet.layoutconfiguration.util.runtimeportletutil.processportlet(runtimeportletutil.java:87)
the following code works me in both theme (.vm file) , layouttemplate (.tpl file)
$theme.runtime("my_portlet_war_myportlet")
Comments
Post a Comment