Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mike Lucek
Duplicating Portlet
September 8, 2008 1:35 PM
Answer

Mike Lucek

Rank: New Member

Posts: 22

Join Date: May 19, 2008

Recent Posts

I'm looking for a quck and dirty way to duplicate the built-in iFrame portlet each with their own default titles and URL's. I'm working up a demo and want to simulate 3 future portlets using the iFrame portlet, but don't have the time (right now) to convert our existing app/pages into portlets. This is for a look and feel demo as to how the page could look.

I want to demo to the user how to add 3 of our "custom" portlets to a page :

My Page 1 (iFrame) portlet 1 : default title "My Page 1" with default URL of "mypage1.html"

My Page 2 (iFrame) portlet 2 : default title "My Page 2" with default URL of "mypage2.html"

My Page 3 (iFrame) portlet 3 : default title "My Page 3" with default URL of "mypage3.html"

Any help is appreciated !!

Mike
Matt King
RE: [Liferay Forums][3. Development] Duplicating Portlet
September 8, 2008 2:00 PM
Answer

Matt King

Rank: Junior Member

Posts: 61

Join Date: July 10, 2008

Recent Posts

Create 3 copies of the iFrame portlet in ext (with different names, etc) and modify each one…not sure how “quick” this would be



From: Mike Lucek at Liferay's Community Forums [mailto:no-reply@liferay.com]
Sent: Monday, September 08, 2008 4:36 PM
To: mb.239390.1282931@events.liferay.com
Subject: [Liferay Forums][3. Development] Duplicating Portlet



I'm looking for a quck and dirty way to duplicate the built-in iFrame portlet each with their own default titles and URL's. I'm working up a demo and want to simulate 3 future portlets using the iFrame portlet, but don't have the time (right now) to convert our existing app/pages into portlets. This is for a look and feel demo as to how the page could look.

I want to demo to the user how to add 3 of our "custom" portlets to a page :

My Page 1 (iFrame) portlet 1 : default title "My Page 1" with default URL of "mypage1.html"

My Page 2 (iFrame) portlet 2 : default title "My Page 2" with default URL of "mypage2.html"

My Page 3 (iFrame) portlet 3 : default title "My Page 3" with default URL of "mypage3.html"

Any help is appreciated !!

Mike
--
Liferay Community Forum
mb.239390.1282931@events.liferay.com
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1282931

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.6.16/1654 - Release Date: 9/8/2008 7:01 AM
Mike Lucek
RE: [Liferay Forums][3. Development] Duplicating Portlet
September 8, 2008 3:30 PM
Answer

Mike Lucek

Rank: New Member

Posts: 22

Join Date: May 19, 2008

Recent Posts

One probably quick solution I found and should have looked at earlier is using the sun-iframe-portlet.xx.war. Just rename appropriately, reconfigure the preferences as needed. One problem is that the only editable preference is the URL. I'd also like to add the height & width of the resulting iframe. The iframe portlet link on Sun's web site is broken, and am still hunting for the source code that I can stuff into the plugins environment.

Matt King:
Create 3 copies of the iFrame portlet in ext (with different names, etc) and modify each one…not sure how “quick” this would be

Hmmm, I was thinking along those lines. Plus I after poking around the XML files (V5.0.1 anyay), that's exactly what's done with the Global Prayer Digest portlet :


<portlet>
<description xml:lang="EN">Portlet reusing com.liferay.portlet.iframe.IFramePortlet with set preferences</description>
<portlet-name>46</portlet-name>
<display-name>Gospel for Asia</display-name>
<portlet-class>com.liferay.portlet.iframe.IFramePortlet</portlet-class>
.....
<portlet-preferences>
<preference>
<name>src</name>
<value>http://www.gfa.org</value>
</preference>
</portlet-preferences>
...
</portlet>

and the Gospel for Asia portlet :


<portlet>
<description xml:lang="EN">Portlet reusing com.liferay.portlet.iframe.IFramePortlet with set preferences</description>
<portlet-name>46</portlet-name>
<display-name>Gospel for Asia</display-name>
<portlet-class>com.liferay.portlet.iframe.IFramePortlet</portlet-class>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<portlet-preferences>
<preference>
<name>src</name>
<value>http://www.gfa.org</value>
</preference>
</portlet-preferences>
......
</portlet>

Now if I can find out where the initial IFrame HTML attributes are being set/stored, I think this solution will work !

Think I may use the plugin environment since it'll be easier to deploy the resulting portlets rather then have to redeploy the whole ext enviroment.

Mike

Now
Mike Lucek
RE: [Liferay Forums][3. Development] Duplicating Portlet
September 8, 2008 4:32 PM
Answer

Mike Lucek

Rank: New Member

Posts: 22

Join Date: May 19, 2008

Recent Posts

initial IFrame HTML attributes are being set/stored

Answered my own question ... guess I like talking to myself emoticon

These can also be set in portlet-custom.xml or portlet-ext.xml (via the ext env)

 1
 2    <portlet>
 3        <portlet-name>48</portlet-name>
 4        <display-name>IFrame</display-name>
 5        <portlet-class>com.liferay.portlet.iframe.IFramePortlet</portlet-class>
 6        <expiration-cache>0</expiration-cache>
 7...
 8        <portlet-preferences>
 9            <preference>
10                <name>src</name>
11                <value></value>
12            </preference>
13....
14            [b]<preference>
15                <name>height-maximized</name>
16                <value>200</value>
17            </preference>
18            <preference>
19                <name>border</name>
20                <value>1</value>
21            </preference>[/b]
22
23                .......
24        </portlet-preferences>
Man V K
RE: Duplicating Portlet
April 15, 2009 12:58 AM
Answer

Man V K

Rank: Regular Member

Posts: 139

Join Date: December 4, 2007

Recent Posts

hi iam also trying to dupllicate the iframe portlet, every thing working, but when i plcae the duplicate portlet on the page

i can see two borders( or portlet is overlapping with same portlet) any suggessions ???

thanks
Dharmender Singh
RE: Duplicating Portlet
April 22, 2010 4:56 AM
Answer

Dharmender Singh

Rank: New Member

Posts: 3

Join Date: April 22, 2010

Recent Posts

Man V K:
hi iam also trying to dupllicate the iframe portlet, every thing working, but when i plcae the duplicate portlet on the page

i can see two borders( or portlet is overlapping with same portlet) any suggessions ???

thanks


Hi all,

I am also facing the same problem of "iframe portlet overlapping" while duplicating the iframe portlet.

Please anybody help me out, i need this help on the very urgent basis.

thanks in advance
Dharmender Singh
RE: Duplicating Portlet
April 22, 2010 10:09 PM
Answer

Dharmender Singh

Rank: New Member

Posts: 3

Join Date: April 22, 2010

Recent Posts

Dharmender Singh:
Man V K:
hi iam also trying to dupllicate the iframe portlet, every thing working, but when i plcae the duplicate portlet on the page

i can see two borders( or portlet is overlapping with same portlet) any suggessions ???

thanks


Hi all,

I am also facing the same problem of "iframe portlet overlapping" while duplicating the iframe portlet.

Please anybody help me out, i need this help on the very urgent basis.

thanks in advance


Is anybody there who can help me out from this problem... emoticon