Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Givika valluri
Opening Portlet Inside Portlet
July 24, 2012 1:29 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

Hi EveryOne,



How Can we implement Portlet Inside Portlet.


Please Help me out.
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
July 24, 2012 1:37 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

Do you want to show portet inside portlet ?
If yes then you can use nested portlet of liferay.

If you wan to develop multiple portlets inside one portlet bundle then you may have to make manual entries in portlet.xml and liferay-portlet.xml file.
Priyanka Dhingra
RE: Opening Portlet Inside Portlet
July 24, 2012 3:03 AM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Yes Jignesh is right
you can use nested portlet..
within the nested portlet, you can have layout settings just as you have in any page.
just drag and drop your portlet as in the following link
http://www.liferay.com/community/wiki/-/wiki/Main/Nested+Portlets+Portlet
Hitoshi Ozawa
RE: Opening Portlet Inside Portlet
July 24, 2012 3:56 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If you want to implement another portlet within your portlet, check the popup example.
http://www.liferay.com/community/wiki/-/wiki/Main/Using+Pop-up+in+Liferay
Givika valluri
RE: Opening Portlet Inside Portlet
July 26, 2012 6:59 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

Hi Jignesh,


Thanks For Reply,

Yes, I want to implement multiple portlets inside one portlet bundle then How can i make manual entries in portlet.xml and liferay-portlet.xml file.e
Can You Please Help me out on this,


Thanks in Advance,
Hitoshi Ozawa
RE: Opening Portlet Inside Portlet
July 26, 2012 7:04 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

You mean multiple portlet inside one 1 war. Just add <portlet> declaration for each portlet in the portal.xml file.
Givika valluri
RE: Opening Portlet Inside Portlet
July 26, 2012 7:38 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

HI Hitosi,


Thanks for reply,


Yes, ineed to place multiple portlet in one custom portlet.


Thanks in Advance,
Givika valluri
RE: Opening Portlet Inside Portlet
July 26, 2012 7:42 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

Hi Hitoshi,

Please help me out on this Can you explain Briefly
how to place multiple portlet


Thanks in Advance,
Hitoshi Ozawa
RE: Opening Portlet Inside Portlet
July 26, 2012 2:54 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Just look at konwledge-base-portlet\WEB-INF\portlet.xml file. There are several <portlet> tags in there for each portlet.
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
July 26, 2012 10:05 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

Please see sample portlet.xml and liferay-portlet.xml file here which have been used for SO-portlet:
SO-portlet consisting more than one portlets under one war file.

liferay-portlet.xml

 1
 2<?xml version="1.0"?>
 3<!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">
 4
 5<liferay-portlet-app>
 6    <portlet>
 7        <portlet-name>1</portlet-name>
 8        <friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
 9        <friendly-url-mapping>user_activities</friendly-url-mapping>
10        <friendly-url-routes>com/liferay/portal/kernel/portlet/rss-friendly-url-routes.xml</friendly-url-routes>
11        <header-portlet-css>/activities/css/main.css</header-portlet-css>
12        <css-class-wrapper>so-portlet-activities</css-class-wrapper>
13    </portlet>
14    <portlet>
15        <portlet-name>2</portlet-name>
16        <header-portlet-css>/invite_members/css/main.css</header-portlet-css>
17        <header-portlet-javascript>/invite_members/js/main.js</header-portlet-javascript>
18        <css-class-wrapper>so-portlet-invite-members</css-class-wrapper>
19        <system>true</system>
20    </portlet>
21    <portlet>
22        <portlet-name>4</portlet-name>
23        <system>true</system>
24    </portlet>
25    <portlet>
26        <portlet-name>5</portlet-name>
27        <configuration-action-class>com.liferay.portal.kernel.portlet.DefaultConfigurationAction</configuration-action-class>
28        <preferences-unique-per-layout>false</preferences-unique-per-layout>
29        <preferences-owned-by-group>true</preferences-owned-by-group>
30        <header-portlet-css>/sites/css/main.css</header-portlet-css>
31        <header-portlet-javascript>/sites/js/main.js</header-portlet-javascript>
32        <css-class-wrapper>so-portlet-sites</css-class-wrapper>
33        <add-default-resource>true</add-default-resource>
34    </portlet>
35    <portlet>
36        <portlet-name>6</portlet-name>
37        <header-portlet-css>/notifications/css/main.css</header-portlet-css>
38        <css-class-wrapper>so-portlet-notifications</css-class-wrapper>
39        <add-default-resource>true</add-default-resource>
40        <system>true</system>
41    </portlet>
42    <portlet>
43        <portlet-name>7</portlet-name>
44        <use-default-template>false</use-default-template>
45        <header-portlet-css>/dockbar_notifications/css/main.css</header-portlet-css>
46        <css-class-wrapper>so-portlet-dockbar-notifications</css-class-wrapper>
47        <add-default-resource>true</add-default-resource>
48        <system>true</system>
49    </portlet>
50    <role-mapper>
51        <role-name>administrator</role-name>
52        <role-link>Administrator</role-link>
53    </role-mapper>
54    <role-mapper>
55        <role-name>guest</role-name>
56        <role-link>Guest</role-link>
57    </role-mapper>
58    <role-mapper>
59        <role-name>power-user</role-name>
60        <role-link>Power User</role-link>
61    </role-mapper>
62    <role-mapper>
63        <role-name>user</role-name>
64        <role-link>User</role-link>
65    </role-mapper>
66</liferay-portlet-app>



portlet.xml
  1
  2<?xml version="1.0"?>
  3
  4<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">
  5    <portlet>
  6        <portlet-name>1</portlet-name>
  7        <display-name>Activities</display-name>
  8        <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
  9        <init-param>
 10            <name>view-template</name>
 11            <value>/activities/view.jsp</value>
 12        </init-param>
 13        <expiration-cache>0</expiration-cache>
 14        <supports>
 15            <mime-type>text/html</mime-type>
 16        </supports>
 17        <resource-bundle>content.Language</resource-bundle>
 18        <portlet-info>
 19            <title>Activities</title>
 20            <short-title>Activities</short-title>
 21            <keywords>Activities</keywords>
 22        </portlet-info>
 23        <security-role-ref>
 24            <role-name>administrator</role-name>
 25        </security-role-ref>
 26        <security-role-ref>
 27            <role-name>guest</role-name>
 28        </security-role-ref>
 29        <security-role-ref>
 30            <role-name>power-user</role-name>
 31        </security-role-ref>
 32        <security-role-ref>
 33            <role-name>user</role-name>
 34        </security-role-ref>
 35    </portlet>
 36    <portlet>
 37        <portlet-name>2</portlet-name>
 38        <display-name>Invite Members</display-name>
 39        <portlet-class>com.liferay.so.invitemembers.portlet.InviteMembersPortlet</portlet-class>
 40        <init-param>
 41            <name>view-template</name>
 42            <value>/invite_members/view.jsp</value>
 43        </init-param>
 44        <expiration-cache>0</expiration-cache>
 45        <supports>
 46            <mime-type>text/html</mime-type>
 47        </supports>
 48        <resource-bundle>content.Language</resource-bundle>
 49        <portlet-info>
 50            <title>Invite Members</title>
 51            <short-title>Invite Members</short-title>
 52            <keywords>Invite Members</keywords>
 53        </portlet-info>
 54        <security-role-ref>
 55            <role-name>administrator</role-name>
 56        </security-role-ref>
 57        <security-role-ref>
 58            <role-name>guest</role-name>
 59        </security-role-ref>
 60        <security-role-ref>
 61            <role-name>power-user</role-name>
 62        </security-role-ref>
 63        <security-role-ref>
 64            <role-name>user</role-name>
 65        </security-role-ref>
 66        <supported-public-render-parameter>invitedMembersCount</supported-public-render-parameter>
 67    </portlet>
 68    <portlet>
 69        <portlet-name>4</portlet-name>
 70        <display-name>Projects</display-name>
 71        <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
 72        <expiration-cache>0</expiration-cache>
 73        <supports>
 74            <mime-type>text/html</mime-type>
 75        </supports>
 76        <resource-bundle>content.Language</resource-bundle>
 77        <portlet-info>
 78            <title>Projects</title>
 79            <short-title>Projects</short-title>
 80            <keywords>Projects</keywords>
 81        </portlet-info>
 82        <security-role-ref>
 83            <role-name>administrator</role-name>
 84        </security-role-ref>
 85        <security-role-ref>
 86            <role-name>guest</role-name>
 87        </security-role-ref>
 88        <security-role-ref>
 89            <role-name>power-user</role-name>
 90        </security-role-ref>
 91        <security-role-ref>
 92            <role-name>user</role-name>
 93        </security-role-ref>
 94    </portlet>
 95    <portlet>
 96        <portlet-name>5</portlet-name>
 97        <display-name>Sites</display-name>
 98        <portlet-class>com.liferay.so.sites.portlet.SitesPortlet</portlet-class>
 99        <init-param>
100            <name>config-template</name>
101            <value>/sites/configuration.jsp</value>
102        </init-param>
103        <init-param>
104            <name>view-template</name>
105            <value>/sites/view.jsp</value>
106        </init-param>
107        <expiration-cache>0</expiration-cache>
108        <supports>
109            <mime-type>text/html</mime-type>
110        </supports>
111        <resource-bundle>content.Language</resource-bundle>
112        <portlet-info>
113            <title>Sites</title>
114            <short-title>Sites</short-title>
115            <keywords>Sites</keywords>
116        </portlet-info>
117        <security-role-ref>
118            <role-name>administrator</role-name>
119        </security-role-ref>
120        <security-role-ref>
121            <role-name>guest</role-name>
122        </security-role-ref>
123        <security-role-ref>
124            <role-name>power-user</role-name>
125        </security-role-ref>
126        <security-role-ref>
127            <role-name>user</role-name>
128        </security-role-ref>
129    </portlet>
130    <portlet>
131        <portlet-name>6</portlet-name>
132        <display-name>Notification</display-name>
133        <portlet-class>com.liferay.so.notifications.portlet.NotificationsPortlet</portlet-class>
134        <init-param>
135            <name>view-template</name>
136            <value>/notifications/view.jsp</value>
137        </init-param>
138        <expiration-cache>0</expiration-cache>
139        <supports>
140            <mime-type>text/html</mime-type>
141        </supports>
142        <resource-bundle>content.Language</resource-bundle>
143        <portlet-info>
144            <title>Notifications</title>
145            <short-title>Notifications</short-title>
146            <keywords>Notifications</keywords>
147        </portlet-info>
148        <security-role-ref>
149            <role-name>administrator</role-name>
150        </security-role-ref>
151        <security-role-ref>
152            <role-name>guest</role-name>
153        </security-role-ref>
154        <security-role-ref>
155            <role-name>power-user</role-name>
156        </security-role-ref>
157        <security-role-ref>
158            <role-name>user</role-name>
159        </security-role-ref>
160    </portlet>
161    <portlet>
162        <portlet-name>7</portlet-name>
163        <display-name>Dockbar Notification</display-name>
164        <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
165        <init-param>
166            <name>view-template</name>
167            <value>/dockbar_notifications/view.jsp</value>
168        </init-param>
169        <expiration-cache>0</expiration-cache>
170        <supports>
171            <mime-type>text/html</mime-type>
172        </supports>
173        <resource-bundle>content.Language</resource-bundle>
174        <portlet-info>
175            <title>Dockbar Notifications</title>
176            <short-title>Dockbar Notifications</short-title>
177            <keywords>Dockbar Notifications</keywords>
178        </portlet-info>
179        <security-role-ref>
180            <role-name>administrator</role-name>
181        </security-role-ref>
182        <security-role-ref>
183            <role-name>guest</role-name>
184        </security-role-ref>
185        <security-role-ref>
186            <role-name>power-user</role-name>
187        </security-role-ref>
188        <security-role-ref>
189            <role-name>user</role-name>
190        </security-role-ref>
191    </portlet>
192    <public-render-parameter>
193        <identifier>invitedMembersCount</identifier>
194        <qname xmlns:x="http://www.liferay.com/public-render-parameters">x:invitedMembersCount</qname>
195    </public-render-parameter>
196</portlet-app>


Hope this would help you to understand your requirement.
Givika valluri
RE: Opening Portlet Inside Portlet
July 27, 2012 2:38 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

Hi Jignesh,


Thanks for Quick Reply,


Can You Please Check my code Jignesh, it is not effecting any thing and also no errors ,
Please help me out on this Jignesh,


liferay-portlet.xml
-----------------------------

<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.0.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">

<liferay-portlet-app>
<portlet>

<portlet-name>test</portlet-name>

<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>so-portlet-test</css-class-wrapper>
</portlet>
<portlet>
<portlet-name>Service_Request</portlet-name>

<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>so-portlet-Service_Request</css-class-wrapper>
<system>true</system>
</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>


portlet.xml
-----------------------


<?xml version="1.0"?>

<portlet-app
version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
>
<portlet>
<portlet-name>test</portlet-name>
<display-name>Test</display-name>
<portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Test</title>
<short-title>Test</short-title>
<keywords>Test</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

<portlet>
<portlet-name>Service_Request</portlet-name>
<display-name>Service Request</display-name>
<portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>content.Language</resource-bundle>
<portlet-info>
<title>Service Request</title>
<short-title>Service Request</short-title>
<keywords>Service Request</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>

</portlet-app>


Thanks in Advance.


</liferay-portlet-app>
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
July 27, 2012 3:56 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

Here you are reffering wrong view.jsp path.
Please provide proper path like test/view.jsp OR Service_Request/view.jsp whew test and Service_Request will be folders name
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
July 27, 2012 6:53 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

Hi Sipra,

See attached Sample war file in which i have embed 2 portlets.
Hope it would help and resolve your issue.
Attachments: test1-portlet.zip (22.3k)
Jaynil A Bagdai
RE: Opening Portlet Inside Portlet
July 30, 2012 11:54 AM
Answer

Jaynil A Bagdai

Rank: Regular Member

Posts: 120

Join Date: March 3, 2012

Recent Posts

Givika valluri:
Hi EveryOne,



How Can we implement Portlet Inside Portlet.


Please Help me out.


Hi Givika,

As I wanted to have the same implementation and I make it possible with just help of portlet id.
No need to configure many things, no need to write messy code.

Please refer code snippet described in below link.
Liferay Portlet inside Portlet

I hope this will help you.

Thanks,
Jaynil
Givika valluri
RE: Opening Portlet Inside Portlet
August 1, 2012 1:32 AM
Answer

Givika valluri

Rank: Junior Member

Posts: 49

Join Date: March 29, 2012

Recent Posts

Hi Jaynil,


Can you Please send me some Sample Portlet.

Please Help Me Jaynil.

Thanks in Advance,

My gmailId : bindusipra@gmail.com

Please send me on this Gmail if you have the Sample Code.
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
August 1, 2012 4:31 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

Sipra

Here is the test portlet : Test portlet
ashish pradhan
RE: Opening Portlet Inside Portlet
August 2, 2012 2:22 AM
Answer

ashish pradhan

Rank: Junior Member

Posts: 54

Join Date: March 17, 2012

Recent Posts

Hi Jignesh,


Test Portlet is not opening,
Jignesh Vachhani
RE: Opening Portlet Inside Portlet
August 2, 2012 10:28 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 796

Join Date: March 10, 2008

Recent Posts

You can download it from above post where I have attached link
Sat C
RE: Opening Portlet Inside Portlet
October 26, 2012 11:15 AM
Answer

Sat C

Rank: New Member

Posts: 14

Join Date: December 22, 2011

Recent Posts

Do you still have the example .. i cannot access it ..

-csat