Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Embedding a custom instancable portlet in jsp Lior Hadaya 19 août 2012 06:11
RE: Embedding a custom instancable portlet in jsp David H Nebinger 19 août 2012 07:29
RE: Embedding a custom instancable portlet in jsp Satheesh Ravi 19 août 2012 09:17
RE: Embedding a custom instancable portlet in jsp Lior Hadaya 19 août 2012 23:00
RE: Embedding a custom instancable portlet in jsp Lior Hadaya 19 août 2012 22:57
RE: Embedding a custom instancable portlet in jsp Hebatu Allah Fahmy 18 septembre 2012 06:39
RE: Embedding a custom instancable portlet in jsp Lior Hadaya 18 septembre 2012 21:26
RE: Embedding a custom instancable portlet in jsp Bart Simpson 19 septembre 2012 00:02
RE: Embedding a custom instancable portlet in jsp Lior Hadaya 19 septembre 2012 22:41
RE: Embedding a custom instancable portlet in jsp Bart Simpson 20 septembre 2012 21:20
RE: Embedding a custom instancable portlet in jsp Hebatu Allah Fahmy 23 septembre 2012 01:31
RE: Embedding a custom instancable portlet in jsp Bart Simpson 23 septembre 2012 21:33
RE: Embedding a custom instancable portlet in jsp Lior Hadaya 11 octobre 2012 00:52
RE: Embedding a custom instancable portlet in jsp Bart Simpson 11 octobre 2012 01:46
RE: Embedding a custom instancable portlet in jsp subhash lamba 16 juillet 2013 23:05
RE: Embedding a custom instancable portlet in jsp Juan Gonzalez 17 juillet 2013 01:57
RE: Embedding a custom instancable portlet in jsp subhash lamba 17 juillet 2013 02:12
RE: Embedding a custom instancable portlet in jsp Juan Gonzalez 17 juillet 2013 02:12
RE: Embedding a custom instancable portlet in jsp subhash lamba 17 juillet 2013 02:19
RE: Embedding a custom instancable portlet in jsp Juan Gonzalez 17 juillet 2013 02:22
RE: Embedding a custom instancable portlet in jsp subhash lamba 17 juillet 2013 03:03
RE: Embedding a custom instancable portlet in jsp Juan Gonzalez 17 juillet 2013 03:06
RE: Embedding a custom instancable portlet in jsp subhash lamba 17 juillet 2013 03:11
RE: Embedding a custom instancable portlet in jsp subhash lamba 17 juillet 2013 03:11
RE: Embedding a custom instancable portlet in jsp Juan Gonzalez 17 juillet 2013 03:14
Lior Hadaya
Embedding a custom instancable portlet in jsp
19 août 2012 06:11
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

Hi,

I'm using Liferay EE 6.1.20 and I am creating a hook which overrides \html\portal\layout\view\portlet.jsp.
In my override I want to add a static portlet to the jsp, which is a custom portlet I developed and it is instanceable.
I tried to use the liferay-portlet:runtime tag using just the name of the portlet but it did not work:
<liferay-portlet:runtime portletName="MyPortletName" />
It showed a message saying that the portlet has been undeployed.

If I understand correctly, since the portlet is instanceable I needed to specify the instance ID as part of the portlet name when I use the liferay-portlet:runtime tag - but I don't know how to generate a new instance id.

I tried to add the portlet manually to a page and then copy it's id from the look & feel / advanced styling tab, and it worked like this:
<liferay-portlet:runtime portletName="MyPortletName_WAR_ccihasiportalnavigationwebui04_INSTANCE_I2Ywg8MtPXQ1" />
This generated the portlet statically on the page but I couldn't add another instance of the same portlet to the page.

What's even more strange to me is when I placed "73" as the portletName which is the name of Liferay's OOTB instanceable Breadcrumbs portlet, it did work.
Do I really need to generate the instance id somehow if I want to use the runtime tag with my own custom portlet? if so how can I do it?

Thanks,
Lior
David H Nebinger
RE: Embedding a custom instancable portlet in jsp
19 août 2012 07:29
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11787

Date d'inscription: 1 septembre 2006

Publications Récentes

Well, it could be a matter of availability for the hook...

The breadcrumb portlet is part of the Liferay core and therefore is in the Liferay context. Your portlet, instantiable or not, is outside of that context and may not be available at load time.

Just a guess...
Satheesh Ravi
RE: Embedding a custom instancable portlet in jsp
19 août 2012 09:17
Réponse

Satheesh Ravi

Rang: Junior Member

Publications: 35

Date d'inscription: 24 novembre 2011

Publications Récentes

Hi,
Everything is possible in liferay. But what you are doing isn't advisable! If any two portlets are tightly coupled it may create problem during run time. My advice is find an alternative method for doing the same.



Regards,
Satheesh
Lior Hadaya
RE: Embedding a custom instancable portlet in jsp
19 août 2012 22:57
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

Hi David, thanks for replying.

What do you mean by the portlet not being available at load time? Is there anything I can do to make it available?
I changed my portlet to non-instanceable and used this tag which worked:
<liferay-portlet:runtime portletName="myPortletName_WAR_myportletnamewebui" />

Why is problematic when the portlet is instanceable? is it simply not possible to use the runtime tag for an instanceable custom portlet? if so is there an alternative?
Lior Hadaya
RE: Embedding a custom instancable portlet in jsp
19 août 2012 23:00
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

Hi Satheesh, thanks for replying.

I agree that copying the instance id from another portlet into the runtime tag is not advisable and not practical either. Can you suggest an alternative way of doing it?
Hebatu Allah Fahmy
RE: Embedding a custom instancable portlet in jsp
18 septembre 2012 06:39
Réponse

Hebatu Allah Fahmy

Rang: Junior Member

Publications: 41

Date d'inscription: 6 août 2012

Publications Récentes

Have you solved it , because I face the same problem !!
Lior Hadaya
RE: Embedding a custom instancable portlet in jsp
18 septembre 2012 21:26
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

No, I haven't. I'm only embedding non-instanceable portlets for the time being.
Bart Simpson
RE: Embedding a custom instancable portlet in jsp
19 septembre 2012 00:02
Réponse

Bart Simpson

Rang: Liferay Master

Publications: 524

Date d'inscription: 29 août 2011

Publications Récentes

In you liferay-portlet.xml for you instanceable portlet add the following line and check if it works:-

1<add-default-resource>true</add-default-resource>
Lior Hadaya
RE: Embedding a custom instancable portlet in jsp
19 septembre 2012 22:41
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

Hi Paul,

After adding this line what am I supposed to do with the runtime statement?
<liferay-portlet:runtime portletName="MyPortletName_WAR_myportletnamewebui04_INSTANCE_I2Ywg8MtPXQ1" />

Thanks
Bart Simpson
RE: Embedding a custom instancable portlet in jsp
20 septembre 2012 21:20
Réponse

Bart Simpson

Rang: Liferay Master

Publications: 524

Date d'inscription: 29 août 2011

Publications Récentes

You just add the portlet without instance id in it. So
1<liferay-portlet:runtime portletName="MyPortletName_WAR_myportletnamewebui04_INSTANCE_I2Ywg8MtPXQ1" />
will change to something like
1<liferay-portlet:runtime portletName="MyPortletName_WAR_myportletnamewebui04" />

I am anxious to know the results. emoticon
Hebatu Allah Fahmy
RE: Embedding a custom instancable portlet in jsp
23 septembre 2012 01:31
Réponse

Hebatu Allah Fahmy

Rang: Junior Member

Publications: 41

Date d'inscription: 6 août 2012

Publications Récentes

I have tried this in including asset publisher
instead of
<liferay-portlet:runtime portletName="#portlet_101_INSTANCE_XaF30gFyQsyD" />

I have used
<liferay-portlet:runtime portletName="portlet_101" />

and I have set <add-default-resource>true</add-default-resource> inside liferay-portlet.xml
as following
<portlet>
<portlet-name>TestPortlet</portlet-name>
<icon>/icon.png</icon>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>TestPortlet-portlet</css-class-wrapper>
<add-default-resource>true</add-default-resource>
</portlet>

but the following exception appears to me in the server :-

NoSuchResourceException portlet101#ADD_TO_PAGE

here is all my liferay-portlet.xml
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd">

<liferay-portlet-app>
<portlet>
<portlet-name>TestPortlet</portlet-name>
<icon>/icon.png</icon>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>TestPortlet-portlet</css-class-wrapper>
<add-default-resource>true</add-default-resource>
</portlet>
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>
</role-mapper>
<role-mapper>
<role-name>guest</role-name>
<role-link>Guest</role-link>
</role-mapper>
<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
<role-mapper>
<role-name>user</role-name>
<role-link>User</role-link>
</role-mapper>

</liferay-portlet-app>


and i am using mvc portlet with jsp view

what is the problem ?

any help will be appreciated

Thanks in advance .
Bart Simpson
RE: Embedding a custom instancable portlet in jsp
23 septembre 2012 21:33
Réponse

Bart Simpson

Rang: Liferay Master

Publications: 524

Date d'inscription: 29 août 2011

Publications Récentes

The solution I suggested was for adding a custom portlet and so was the problem described by the original poster. The situation you have is slightly different and has been discussed in many other threads like this one http://www.liferay.com/community/forums/-/message_boards/message/10936029 , please search for a similar thread.
Lior Hadaya
RE: Embedding a custom instancable portlet in jsp
11 octobre 2012 00:52
Réponse

Lior Hadaya

Rang: Regular Member

Publications: 138

Date d'inscription: 24 janvier 2012

Publications Récentes

Bart Simpson:
You just add the portlet without instance id in it. So
1<liferay-portlet:runtime portletName="MyPortletName_WAR_myportletnamewebui04_INSTANCE_I2Ywg8MtPXQ1" />
will change to something like
1<liferay-portlet:runtime portletName="MyPortletName_WAR_myportletnamewebui04" />

I am anxious to know the results. emoticon


Your solution worked! emoticon

Is there any downside to setting add-default-resource to true?
I tried to look it up but didn't really understand the meaning..

"add-default-resource
If the add-default-resource value is set to false, and the portlet does not belong to the page but has been dynamically added, then the user will see that he does not have permissions to view the portlet. If the add-default-resource value is set to true, the default portlet resources and permissions are added to the page. The user can then view the portlet. Most portlets are harmless and can benefit from this flexibility. However, to prevent security loop holes, the default value is false."
http://docs.liferay.com/portal/4.2/official/liferay-portlet-development-guide-4.2/multipage/ch02.html

Thanks
Bart Simpson
RE: Embedding a custom instancable portlet in jsp
11 octobre 2012 01:46
Réponse

Bart Simpson

Rang: Liferay Master

Publications: 524

Date d'inscription: 29 août 2011

Publications Récentes

s there any downside to setting add-default-resource to true?
I tried to look it up but didn't really understand the meaning..

Yeah that is some magic emoticon I need to debug and check..in time I will emoticon
subhash lamba
RE: Embedding a custom instancable portlet in jsp
16 juillet 2013 23:05
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

i followed same procedure but i got error like

 1javax.servlet.jsp.JspException: ServletException in '/html/common/themes/portlet.jsp': File &quot;/html/common/themes/portlet.jsp&quot; not found
 2    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
 3    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
 4    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1559)
 5    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 6    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 7    at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
 8    at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
 9    at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
10    at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:5158)
11    at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1569)
12    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:165)
13    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:203)
14    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.processPortlet(RuntimePortletImpl.java:190)
15    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:87)
16    at com.liferay.taglib.portletext.RuntimeTag.doTag(RuntimeTag.java:111)
17    at com.liferay.taglib.portletext.RuntimeTag.doEndTag(RuntimeTag.java:150)
18    at org.apache.jsp.WEB_002dINF.html.jsp.view_jsp._jspx_meth_liferay_002dportlet_005fruntime_005f0(view_jsp.java:442)
19    at org.apache.jsp.WEB_002dINF.html.jsp.view_jsp._jspService(view_jsp.java:324)
20    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
21    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
22    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
23    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
24    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
25    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
26    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
27    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
28    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
29    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
30    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
31    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
32    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
33    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
34    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
35    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
36    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229)
37    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
38    at org.springframework.web.servlet.ViewRendererServlet.renderView(ViewRendererServlet.java:114)
39    at org.springframework.web.servlet.ViewRendererServlet.processRequest(ViewRendererServlet.java:86)
40    at org.springframework.web.servlet.ViewRendererServlet.doGet(ViewRendererServlet.java:66)
41    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
42    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
43    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
44    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
45    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
46    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
47    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
48    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
49    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
50    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
51    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
52    at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:323)
53    at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:105)
54    at org.springframework.web.portlet.DispatcherPortlet.doDispatch(DispatcherPortlet.java:1194)
55    at org.springframework.web.portlet.DispatcherPortlet.doRender(DispatcherPortlet.java:1175)
56    at org.springframework.web.portlet.DispatcherPortlet.render(DispatcherPortlet.java:1130)
57    at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:789)
58    at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:522)
59    at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:470)
60    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
61    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
62    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
63    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
64    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
65    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
66    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
67    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
68    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
69    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
70    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
71    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
72    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
73    at


please help to solve this problem.
Juan Gonzalez
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 01:57
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2947

Date d'inscription: 28 octobre 2008

Publications Récentes

It's solved in current master branch and will be available in next version:

http://issues.liferay.com/browse/LPS-31508
subhash lamba
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 02:12
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

Hi .. Juan Gonzalez
Error gone because i set <add-default-resource>false</add-default-resource> in my portlet but sub-portlet is not visible.
there is not error but inner portlet also not visible.emoticon
Juan Gonzalez
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 02:12
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2947

Date d'inscription: 28 octobre 2008

Publications Récentes

Yep, it's already solved, so you'd have to wait a bit...
subhash lamba
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 02:19
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

for now... what?
what should i do??
I am running out of time
Juan Gonzalez
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 02:22
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2947

Date d'inscription: 28 octobre 2008

Publications Récentes

You can purchase for a EE license (so you can get patches), or patch by yourself. You can get the changes in github by searching for "LPS-31508".
subhash lamba
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 03:03
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

LPS-31508 according to this i chages in two tld filed but there are not any changes same problem are there..
Juan Gonzalez
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 03:06
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2947

Date d'inscription: 28 octobre 2008

Publications Récentes

Sorry don't understand...
subhash lamba
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 03:11
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

https://github.com/liferay/liferay-portal/tree/master/portal-web/docroot/WEB-INF/tld

there are two tld file copy it and paste in update in my tld folder but there are same effect.
Nd how to patch in liferay to update it. can u tell me plz?
subhash lamba
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 03:11
Réponse

subhash lamba

Rang: Regular Member

Publications: 136

Date d'inscription: 7 juillet 2013

Publications Récentes

https://github.com/liferay/liferay-portal/tree/master/portal-web/docroot/WEB-INF/tld

there are two tld file copy it and paste in update in my tld folder but there are same effect.
Nd how to patch in liferay to update it. can u tell me plz?
Juan Gonzalez
RE: Embedding a custom instancable portlet in jsp
17 juillet 2013 03:14
Réponse

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Publications: 2947

Date d'inscription: 28 octobre 2008

Publications Récentes

There are some threads and wiki about how to patch, sorry.

There are also some tools for finding git commits, so you know what you have to patch.