You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Dennis van der Laan <d....@rug.nl> on 2012/03/22 22:28:21 UTC

iframe height of opensocial gadgets

Hi all,

At the University of Groningen (The Netherlands) we are very busy
implementing a 'MyUniversity' portal for students and staff, which
should be ready in June/July of this year.
With the help of Jasha Joachimsthal we had a good kickstart setting up
Apache Rave for this project and are now implementing gadgets for
various information systems around the university (mail, calendar, news,
exam results, address book, etcetera). I think we'll be asking more
questions in the upcoming months...

My first question is that I noticed gadgets which have a 'height'
argument in the gadget moduleprefs, are not resized to that height. The
iframe created for those gadgets have a 'default' height of 250px. I
tried to search for the code where the iframe is created or the height
is set, but I was unable to find it. Can anybody confirm that the height
of the gadget iframe is not resized, based on the 'height' argument in
the ModulePrefs, or is the gadget module incorrect?

TIA,
Dennis

-- 
Dennis van der Laan, MSc
Centre for Information Technology
University of Groningen


Re: iframe height of opensocial gadgets

Posted by Dennis van der Laan <d....@rug.nl>.
On 23-3-2012 13:53, Jasha Joachimsthal wrote:
> 
>
> On 23 March 2012 13:42, Dennis van der Laan <d....@rug.nl> wrote:
>
>> On 23-3-2012 13:36, Jasha Joachimsthal wrote:
>>> On 23 March 2012 13:29, Franklin, Matthew B. <mf...@mitre.org>
>> wrote:
>>>>> -----Original Message-----
>>>>> From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>>>>> Sent: Friday, March 23, 2012 8:16 AM
>>>>> To: rave-dev@incubator.apache.org
>>>>> Subject: Re: iframe height of opensocial gadgets
>>>>>
>>>>> @Matt: dynamic height is supported in native gadgets, but Dennis is
>>>>> creating an iframe gadget where the iframe inside the gadget needs the
>>>> full
>>>>> height.
>>>> Not sure what you mean by full height.  Maybe I am missing something but
>>>> it sounds like the gadgets have a height attribute that is not currently
>>>> being respected by rave, which is overriding it with 250px.  We do want
>> to
>>>> support letting the gadget define a default height other than 250px.
>>>>
>>>>
>>> I don't mean the height attribute of the gadget definition, but the
>> height
>>> attribute of the <iframe> inside the gadget definition. That one is
>> unknown
>>> (or "100%"). The gadget itself doesn't know how much height the content
>> of
>>> the iframe needs and the iframe content itself cannot directly call it's
>>> parent because they run in different domains.
>> I don't know exactly what Jasha is saying. Do you mean that when we use
>> locked domains, the rpc-trick will not work for iframes within our
>> gadgets? I haven't tried this, so I can't confirm it.
>> What Matt is describing, is exactly what I want at this moment: if a
>> gadget defines a 'height' attribute in the gadget definition, the
>> created iframe (not by the gadget, but by Rave) should have this height
>> set as an attribute.
>>
>> Dennis
>>
>>>
>>>> -Matt
>>>>
>>>>> On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org>
>> wrote:
>>>>>>> -----Original Message-----
>>>>>>> From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
>>>>>>> Sent: Friday, March 23, 2012 6:43 AM
>>>>>>> To: rave-dev@incubator.apache.org
>>>>>>> Subject: Re: iframe height of opensocial gadgets
>>>>>>>
>>>>>>> Hi Jasha,
>>>>>>>
>>>>>>> On 23-3-2012 11:16, Jasha Joachimsthal wrote:
>>>>>>>> On 22 March 2012 22:28, Dennis van der Laan <
>> d.g.van.der.laan@rug.nl
>>>>>>> wrote:
>>>>>>>>> My first question is that I noticed gadgets which have a 'height'
>>>>>>>>> argument in the gadget moduleprefs, are not resized to that height.
>>>>> The
>>>>>>>>> iframe created for those gadgets have a 'default' height of 250px.
>> I
>>>>>>>>> tried to search for the code where the iframe is created or the
>>>> height
>>>>>>>>> is set, but I was unable to find it. Can anybody confirm that the
>>>>>> height
>>>>>>>>> of the gadget iframe is not resized, based on the 'height' argument
>>>> in
>>>>>>>>> the ModulePrefs, or is the gadget module incorrect?
>>>>>>>>>
>>>>>>>>>
>>>>>>>> The dynamic-height cannot detect how much height the iframe needs.
>>>>> You
>>>>>>>> should be able to let the iframe content notify the container to
>>>> resize
>>>>>> the
>>>>>>>> iframe with rpc relay calls. As an example the gadget definition in
>>>> [1]
>>>>>>>> registers the rpc and calls the adjustHeight. The content of the
>>>> iframe
>>>>>> is
>>>>>>>> rendered with [2]. The iframe content does an rpc call to the
>>>>>> adjustHeight.
>>>>>>>> As you may see, we've injected the Shindig host there, but at least
>>>> in
>>>>>> the
>>>>>>>> gadget it can be replaced with
>>>>>> gadgets.rpc.getOrigin(window.location.href)
>>>>>>>> (haven't checked for the iframe content).
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>>>> teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
>>>>>>>> [2]
>>>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>>>> teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>>>>>>> For most of our gadgets, we indeed use dynamic height, by letting the
>>>>>>> gadget call gadgets.window.adjustHeight(). The rpc-call by which an
>>>>>>> iframe can control the gadgets height is new to me, so thanks for
>> this
>>>>>>> example!
>>>>>>> Unfortunately, we also want to use off-the-shelf gadgets from third
>>>>>>> parties and they do not use these constructs. I guess providing a
>>>>>>> 'height' attribute in the ModulePrefs element is optional for a
>>>> platform
>>>>>>> to support, but because google at least supports it, most
>> iframe-based
>>>>>>> gadgets just provide a static height in their gadget definition.
>>>>>>> As I mentioned, Rave (or Shindig?) currently generates iframes with a
>>>>>>> default height of 250px, which is hardcoded in the html (not by using
>>>>>>> CSS). Can you point me to the code where this iframe is generated?
>>>> Maybe
>>>>>>> I can provide a patch for supporting the 'height' attribute.
>>>>>> Sounds like a bug.  I thought we had support for the height property
>> of
>>>>>> OpenSocial gadgets, so not sure why it isn't working.  If you want to
>>>> look
>>>>>> through rave_opensocial.js, find where the issue is and provide a
>> patch,
>>>>>> that would be great!  A jira ticket will need to be created for this
>>>> issue.
> Okay, now even I am confused.
> Dennis, do you have a gadget with an iframe inside the definition or are
> you talking about the iframe that is created by the portal/Shindig in which
> the gadget is rendered?
>
The second one... I'm very sorry to create so much confusion for a
relatively small issue. I guess I'm not too familiar with all the terms
you use and who creates what.
I think the confusion started because I thanked you for your rpc-trick,
which IS used when a gadget creates its own iframe (within the iframe
created by Rave?/Shindig?). We have gadgets doing that, so the rpc-trick
will come in handy, but is has nothing to do with a gadget definition
having a height attribute set in the ModulePrefs :)

-- 
Dennis van der Laan, MSc
Centre for Information Technology
University of Groningen


Re: iframe height of opensocial gadgets

Posted by Jasha Joachimsthal <j....@onehippo.com>.


On 23 March 2012 13:42, Dennis van der Laan <d....@rug.nl> wrote:

> On 23-3-2012 13:36, Jasha Joachimsthal wrote:
> > On 23 March 2012 13:29, Franklin, Matthew B. <mf...@mitre.org>
> wrote:
> >
> >>> -----Original Message-----
> >>> From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
> >>> Sent: Friday, March 23, 2012 8:16 AM
> >>> To: rave-dev@incubator.apache.org
> >>> Subject: Re: iframe height of opensocial gadgets
> >>>
> >>> @Matt: dynamic height is supported in native gadgets, but Dennis is
> >>> creating an iframe gadget where the iframe inside the gadget needs the
> >> full
> >>> height.
> >> Not sure what you mean by full height.  Maybe I am missing something but
> >> it sounds like the gadgets have a height attribute that is not currently
> >> being respected by rave, which is overriding it with 250px.  We do want
> to
> >> support letting the gadget define a default height other than 250px.
> >>
> >>
> > I don't mean the height attribute of the gadget definition, but the
> height
> > attribute of the <iframe> inside the gadget definition. That one is
> unknown
> > (or "100%"). The gadget itself doesn't know how much height the content
> of
> > the iframe needs and the iframe content itself cannot directly call it's
> > parent because they run in different domains.
> I don't know exactly what Jasha is saying. Do you mean that when we use
> locked domains, the rpc-trick will not work for iframes within our
> gadgets? I haven't tried this, so I can't confirm it.
> What Matt is describing, is exactly what I want at this moment: if a
> gadget defines a 'height' attribute in the gadget definition, the
> created iframe (not by the gadget, but by Rave) should have this height
> set as an attribute.
>
> Dennis
>
> >
> >
> >> -Matt
> >>
> >>>
> >>> On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org>
> wrote:
> >>>
> >>>>> -----Original Message-----
> >>>>> From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
> >>>>> Sent: Friday, March 23, 2012 6:43 AM
> >>>>> To: rave-dev@incubator.apache.org
> >>>>> Subject: Re: iframe height of opensocial gadgets
> >>>>>
> >>>>> Hi Jasha,
> >>>>>
> >>>>> On 23-3-2012 11:16, Jasha Joachimsthal wrote:
> >>>>>> On 22 March 2012 22:28, Dennis van der Laan <
> d.g.van.der.laan@rug.nl
> >>>>> wrote:
> >>>>>>> My first question is that I noticed gadgets which have a 'height'
> >>>>>>> argument in the gadget moduleprefs, are not resized to that height.
> >>> The
> >>>>>>> iframe created for those gadgets have a 'default' height of 250px.
> I
> >>>>>>> tried to search for the code where the iframe is created or the
> >> height
> >>>>>>> is set, but I was unable to find it. Can anybody confirm that the
> >>>> height
> >>>>>>> of the gadget iframe is not resized, based on the 'height' argument
> >> in
> >>>>>>> the ModulePrefs, or is the gadget module incorrect?
> >>>>>>>
> >>>>>>>
> >>>>>> The dynamic-height cannot detect how much height the iframe needs.
> >>> You
> >>>>>> should be able to let the iframe content notify the container to
> >> resize
> >>>> the
> >>>>>> iframe with rpc relay calls. As an example the gadget definition in
> >> [1]
> >>>>>> registers the rpc and calls the adjustHeight. The content of the
> >> iframe
> >>>> is
> >>>>>> rendered with [2]. The iframe content does an rpc call to the
> >>>> adjustHeight.
> >>>>>> As you may see, we've injected the Shindig host there, but at least
> >> in
> >>>> the
> >>>>>> gadget it can be replaced with
> >>>> gadgets.rpc.getOrigin(window.location.href)
> >>>>>> (haven't checked for the iframe content).
> >>>>>>
> >>>>>> [1]
> >>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >>>>> teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
> >>>>>> [2]
> >>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >>>>> teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
> >>>>>>
> >>>>> For most of our gadgets, we indeed use dynamic height, by letting the
> >>>>> gadget call gadgets.window.adjustHeight(). The rpc-call by which an
> >>>>> iframe can control the gadgets height is new to me, so thanks for
> this
> >>>>> example!
> >>>>> Unfortunately, we also want to use off-the-shelf gadgets from third
> >>>>> parties and they do not use these constructs. I guess providing a
> >>>>> 'height' attribute in the ModulePrefs element is optional for a
> >> platform
> >>>>> to support, but because google at least supports it, most
> iframe-based
> >>>>> gadgets just provide a static height in their gadget definition.
> >>>>> As I mentioned, Rave (or Shindig?) currently generates iframes with a
> >>>>> default height of 250px, which is hardcoded in the html (not by using
> >>>>> CSS). Can you point me to the code where this iframe is generated?
> >> Maybe
> >>>>> I can provide a patch for supporting the 'height' attribute.
> >>>> Sounds like a bug.  I thought we had support for the height property
> of
> >>>> OpenSocial gadgets, so not sure why it isn't working.  If you want to
> >> look
> >>>> through rave_opensocial.js, find where the issue is and provide a
> patch,
> >>>> that would be great!  A jira ticket will need to be created for this
> >> issue.
>

Okay, now even I am confused.
Dennis, do you have a gadget with an iframe inside the definition or are
you talking about the iframe that is created by the portal/Shindig in which
the gadget is rendered?

Re: iframe height of opensocial gadgets

Posted by Dennis van der Laan <d....@rug.nl>.
On 23-3-2012 13:36, Jasha Joachimsthal wrote:
> On 23 March 2012 13:29, Franklin, Matthew B. <mf...@mitre.org> wrote:
>
>>> -----Original Message-----
>>> From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>>> Sent: Friday, March 23, 2012 8:16 AM
>>> To: rave-dev@incubator.apache.org
>>> Subject: Re: iframe height of opensocial gadgets
>>>
>>> @Matt: dynamic height is supported in native gadgets, but Dennis is
>>> creating an iframe gadget where the iframe inside the gadget needs the
>> full
>>> height.
>> Not sure what you mean by full height.  Maybe I am missing something but
>> it sounds like the gadgets have a height attribute that is not currently
>> being respected by rave, which is overriding it with 250px.  We do want to
>> support letting the gadget define a default height other than 250px.
>>
>>
> I don't mean the height attribute of the gadget definition, but the height
> attribute of the <iframe> inside the gadget definition. That one is unknown
> (or "100%"). The gadget itself doesn't know how much height the content of
> the iframe needs and the iframe content itself cannot directly call it's
> parent because they run in different domains.
I don't know exactly what Jasha is saying. Do you mean that when we use
locked domains, the rpc-trick will not work for iframes within our
gadgets? I haven't tried this, so I can't confirm it.
What Matt is describing, is exactly what I want at this moment: if a
gadget defines a 'height' attribute in the gadget definition, the
created iframe (not by the gadget, but by Rave) should have this height
set as an attribute.

Dennis

>
>
>> -Matt
>>
>>>
>>> On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org> wrote:
>>>
>>>>> -----Original Message-----
>>>>> From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
>>>>> Sent: Friday, March 23, 2012 6:43 AM
>>>>> To: rave-dev@incubator.apache.org
>>>>> Subject: Re: iframe height of opensocial gadgets
>>>>>
>>>>> Hi Jasha,
>>>>>
>>>>> On 23-3-2012 11:16, Jasha Joachimsthal wrote:
>>>>>> On 22 March 2012 22:28, Dennis van der Laan <d.g.van.der.laan@rug.nl
>>>>> wrote:
>>>>>>> My first question is that I noticed gadgets which have a 'height'
>>>>>>> argument in the gadget moduleprefs, are not resized to that height.
>>> The
>>>>>>> iframe created for those gadgets have a 'default' height of 250px. I
>>>>>>> tried to search for the code where the iframe is created or the
>> height
>>>>>>> is set, but I was unable to find it. Can anybody confirm that the
>>>> height
>>>>>>> of the gadget iframe is not resized, based on the 'height' argument
>> in
>>>>>>> the ModulePrefs, or is the gadget module incorrect?
>>>>>>>
>>>>>>>
>>>>>> The dynamic-height cannot detect how much height the iframe needs.
>>> You
>>>>>> should be able to let the iframe content notify the container to
>> resize
>>>> the
>>>>>> iframe with rpc relay calls. As an example the gadget definition in
>> [1]
>>>>>> registers the rpc and calls the adjustHeight. The content of the
>> iframe
>>>> is
>>>>>> rendered with [2]. The iframe content does an rpc call to the
>>>> adjustHeight.
>>>>>> As you may see, we've injected the Shindig host there, but at least
>> in
>>>> the
>>>>>> gadget it can be replaced with
>>>> gadgets.rpc.getOrigin(window.location.href)
>>>>>> (haven't checked for the iframe content).
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>> teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
>>>>>> [2]
>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>> teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>>>>>>
>>>>> For most of our gadgets, we indeed use dynamic height, by letting the
>>>>> gadget call gadgets.window.adjustHeight(). The rpc-call by which an
>>>>> iframe can control the gadgets height is new to me, so thanks for this
>>>>> example!
>>>>> Unfortunately, we also want to use off-the-shelf gadgets from third
>>>>> parties and they do not use these constructs. I guess providing a
>>>>> 'height' attribute in the ModulePrefs element is optional for a
>> platform
>>>>> to support, but because google at least supports it, most iframe-based
>>>>> gadgets just provide a static height in their gadget definition.
>>>>> As I mentioned, Rave (or Shindig?) currently generates iframes with a
>>>>> default height of 250px, which is hardcoded in the html (not by using
>>>>> CSS). Can you point me to the code where this iframe is generated?
>> Maybe
>>>>> I can provide a patch for supporting the 'height' attribute.
>>>> Sounds like a bug.  I thought we had support for the height property of
>>>> OpenSocial gadgets, so not sure why it isn't working.  If you want to
>> look
>>>> through rave_opensocial.js, find where the issue is and provide a patch,
>>>> that would be great!  A jira ticket will need to be created for this
>> issue.
>>>>> --
>>>>> Dennis van der Laan, MSc
>>>>> Centre for Information Technology
>>>>> University of Groningen
>>>>


-- 
Dennis van der Laan


Re: iframe height of opensocial gadgets

Posted by Jasha Joachimsthal <j....@onehippo.com>.
On 23 March 2012 13:29, Franklin, Matthew B. <mf...@mitre.org> wrote:

> >-----Original Message-----
> >From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
> >Sent: Friday, March 23, 2012 8:16 AM
> >To: rave-dev@incubator.apache.org
> >Subject: Re: iframe height of opensocial gadgets
> >
> >@Matt: dynamic height is supported in native gadgets, but Dennis is
> >creating an iframe gadget where the iframe inside the gadget needs the
> full
> >height.
>
> Not sure what you mean by full height.  Maybe I am missing something but
> it sounds like the gadgets have a height attribute that is not currently
> being respected by rave, which is overriding it with 250px.  We do want to
> support letting the gadget define a default height other than 250px.
>
>
I don't mean the height attribute of the gadget definition, but the height
attribute of the <iframe> inside the gadget definition. That one is unknown
(or "100%"). The gadget itself doesn't know how much height the content of
the iframe needs and the iframe content itself cannot directly call it's
parent because they run in different domains.


> -Matt
>
> >
> >
> >On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org> wrote:
> >
> >> >-----Original Message-----
> >> >From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
> >> >Sent: Friday, March 23, 2012 6:43 AM
> >> >To: rave-dev@incubator.apache.org
> >> >Subject: Re: iframe height of opensocial gadgets
> >> >
> >> >Hi Jasha,
> >> >
> >> >On 23-3-2012 11:16, Jasha Joachimsthal wrote:
> >> >> On 22 March 2012 22:28, Dennis van der Laan <d.g.van.der.laan@rug.nl
> >
> >> >wrote:
> >> >>
> >> >>> My first question is that I noticed gadgets which have a 'height'
> >> >>> argument in the gadget moduleprefs, are not resized to that height.
> >The
> >> >>> iframe created for those gadgets have a 'default' height of 250px. I
> >> >>> tried to search for the code where the iframe is created or the
> height
> >> >>> is set, but I was unable to find it. Can anybody confirm that the
> >> height
> >> >>> of the gadget iframe is not resized, based on the 'height' argument
> in
> >> >>> the ModulePrefs, or is the gadget module incorrect?
> >> >>>
> >> >>>
> >> >> The dynamic-height cannot detect how much height the iframe needs.
> >You
> >> >> should be able to let the iframe content notify the container to
> resize
> >> the
> >> >> iframe with rpc relay calls. As an example the gadget definition in
> [1]
> >> >> registers the rpc and calls the adjustHeight. The content of the
> iframe
> >> is
> >> >> rendered with [2]. The iframe content does an rpc call to the
> >> adjustHeight.
> >> >> As you may see, we've injected the Shindig host there, but at least
> in
> >> the
> >> >> gadget it can be replaced with
> >> gadgets.rpc.getOrigin(window.location.href)
> >> >> (haven't checked for the iframe content).
> >> >>
> >> >> [1]
> >> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >> >teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
> >> >> [2]
> >> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >> >teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
> >> >>
> >> >>
> >> >For most of our gadgets, we indeed use dynamic height, by letting the
> >> >gadget call gadgets.window.adjustHeight(). The rpc-call by which an
> >> >iframe can control the gadgets height is new to me, so thanks for this
> >> >example!
> >> >Unfortunately, we also want to use off-the-shelf gadgets from third
> >> >parties and they do not use these constructs. I guess providing a
> >> >'height' attribute in the ModulePrefs element is optional for a
> platform
> >> >to support, but because google at least supports it, most iframe-based
> >> >gadgets just provide a static height in their gadget definition.
> >> >As I mentioned, Rave (or Shindig?) currently generates iframes with a
> >> >default height of 250px, which is hardcoded in the html (not by using
> >> >CSS). Can you point me to the code where this iframe is generated?
> Maybe
> >> >I can provide a patch for supporting the 'height' attribute.
> >>
> >> Sounds like a bug.  I thought we had support for the height property of
> >> OpenSocial gadgets, so not sure why it isn't working.  If you want to
> look
> >> through rave_opensocial.js, find where the issue is and provide a patch,
> >> that would be great!  A jira ticket will need to be created for this
> issue.
> >>
> >> >
> >> >--
> >> >Dennis van der Laan, MSc
> >> >Centre for Information Technology
> >> >University of Groningen
> >>
> >>
>

RE: iframe height of opensocial gadgets

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>Sent: Friday, March 23, 2012 8:16 AM
>To: rave-dev@incubator.apache.org
>Subject: Re: iframe height of opensocial gadgets
>
>@Matt: dynamic height is supported in native gadgets, but Dennis is
>creating an iframe gadget where the iframe inside the gadget needs the full
>height.

Not sure what you mean by full height.  Maybe I am missing something but it sounds like the gadgets have a height attribute that is not currently being respected by rave, which is overriding it with 250px.  We do want to support letting the gadget define a default height other than 250px.

-Matt

>
>
>On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org> wrote:
>
>> >-----Original Message-----
>> >From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
>> >Sent: Friday, March 23, 2012 6:43 AM
>> >To: rave-dev@incubator.apache.org
>> >Subject: Re: iframe height of opensocial gadgets
>> >
>> >Hi Jasha,
>> >
>> >On 23-3-2012 11:16, Jasha Joachimsthal wrote:
>> >> On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl>
>> >wrote:
>> >>
>> >>> My first question is that I noticed gadgets which have a 'height'
>> >>> argument in the gadget moduleprefs, are not resized to that height.
>The
>> >>> iframe created for those gadgets have a 'default' height of 250px. I
>> >>> tried to search for the code where the iframe is created or the height
>> >>> is set, but I was unable to find it. Can anybody confirm that the
>> height
>> >>> of the gadget iframe is not resized, based on the 'height' argument in
>> >>> the ModulePrefs, or is the gadget module incorrect?
>> >>>
>> >>>
>> >> The dynamic-height cannot detect how much height the iframe needs.
>You
>> >> should be able to let the iframe content notify the container to resize
>> the
>> >> iframe with rpc relay calls. As an example the gadget definition in [1]
>> >> registers the rpc and calls the adjustHeight. The content of the iframe
>> is
>> >> rendered with [2]. The iframe content does an rpc call to the
>> adjustHeight.
>> >> As you may see, we've injected the Shindig host there, but at least in
>> the
>> >> gadget it can be replaced with
>> gadgets.rpc.getOrigin(window.location.href)
>> >> (haven't checked for the iframe content).
>> >>
>> >> [1]
>> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>> >teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
>> >> [2]
>> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>> >teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>> >>
>> >>
>> >For most of our gadgets, we indeed use dynamic height, by letting the
>> >gadget call gadgets.window.adjustHeight(). The rpc-call by which an
>> >iframe can control the gadgets height is new to me, so thanks for this
>> >example!
>> >Unfortunately, we also want to use off-the-shelf gadgets from third
>> >parties and they do not use these constructs. I guess providing a
>> >'height' attribute in the ModulePrefs element is optional for a platform
>> >to support, but because google at least supports it, most iframe-based
>> >gadgets just provide a static height in their gadget definition.
>> >As I mentioned, Rave (or Shindig?) currently generates iframes with a
>> >default height of 250px, which is hardcoded in the html (not by using
>> >CSS). Can you point me to the code where this iframe is generated? Maybe
>> >I can provide a patch for supporting the 'height' attribute.
>>
>> Sounds like a bug.  I thought we had support for the height property of
>> OpenSocial gadgets, so not sure why it isn't working.  If you want to look
>> through rave_opensocial.js, find where the issue is and provide a patch,
>> that would be great!  A jira ticket will need to be created for this issue.
>>
>> >
>> >--
>> >Dennis van der Laan, MSc
>> >Centre for Information Technology
>> >University of Groningen
>>
>>

Re: iframe height of opensocial gadgets

Posted by Jasha Joachimsthal <j....@onehippo.com>.
@Matt: dynamic height is supported in native gadgets, but Dennis is
creating an iframe gadget where the iframe inside the gadget needs the full
height.


On 23 March 2012 12:49, Franklin, Matthew B. <mf...@mitre.org> wrote:

> >-----Original Message-----
> >From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
> >Sent: Friday, March 23, 2012 6:43 AM
> >To: rave-dev@incubator.apache.org
> >Subject: Re: iframe height of opensocial gadgets
> >
> >Hi Jasha,
> >
> >On 23-3-2012 11:16, Jasha Joachimsthal wrote:
> >> On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl>
> >wrote:
> >>
> >>> My first question is that I noticed gadgets which have a 'height'
> >>> argument in the gadget moduleprefs, are not resized to that height. The
> >>> iframe created for those gadgets have a 'default' height of 250px. I
> >>> tried to search for the code where the iframe is created or the height
> >>> is set, but I was unable to find it. Can anybody confirm that the
> height
> >>> of the gadget iframe is not resized, based on the 'height' argument in
> >>> the ModulePrefs, or is the gadget module incorrect?
> >>>
> >>>
> >> The dynamic-height cannot detect how much height the iframe needs. You
> >> should be able to let the iframe content notify the container to resize
> the
> >> iframe with rpc relay calls. As an example the gadget definition in [1]
> >> registers the rpc and calls the adjustHeight. The content of the iframe
> is
> >> rendered with [2]. The iframe content does an rpc call to the
> adjustHeight.
> >> As you may see, we've injected the Shindig host there, but at least in
> the
> >> gadget it can be replaced with
> gadgets.rpc.getOrigin(window.location.href)
> >> (haven't checked for the iframe content).
> >>
> >> [1]
> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
> >> [2]
> >> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
> >teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
> >>
> >>
> >For most of our gadgets, we indeed use dynamic height, by letting the
> >gadget call gadgets.window.adjustHeight(). The rpc-call by which an
> >iframe can control the gadgets height is new to me, so thanks for this
> >example!
> >Unfortunately, we also want to use off-the-shelf gadgets from third
> >parties and they do not use these constructs. I guess providing a
> >'height' attribute in the ModulePrefs element is optional for a platform
> >to support, but because google at least supports it, most iframe-based
> >gadgets just provide a static height in their gadget definition.
> >As I mentioned, Rave (or Shindig?) currently generates iframes with a
> >default height of 250px, which is hardcoded in the html (not by using
> >CSS). Can you point me to the code where this iframe is generated? Maybe
> >I can provide a patch for supporting the 'height' attribute.
>
> Sounds like a bug.  I thought we had support for the height property of
> OpenSocial gadgets, so not sure why it isn't working.  If you want to look
> through rave_opensocial.js, find where the issue is and provide a patch,
> that would be great!  A jira ticket will need to be created for this issue.
>
> >
> >--
> >Dennis van der Laan, MSc
> >Centre for Information Technology
> >University of Groningen
>
>

RE: iframe height of opensocial gadgets

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Dennis van der Laan [mailto:d.g.van.der.laan@rug.nl]
>Sent: Friday, March 23, 2012 6:43 AM
>To: rave-dev@incubator.apache.org
>Subject: Re: iframe height of opensocial gadgets
>
>Hi Jasha,
>
>On 23-3-2012 11:16, Jasha Joachimsthal wrote:
>> On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl>
>wrote:
>>
>>> My first question is that I noticed gadgets which have a 'height'
>>> argument in the gadget moduleprefs, are not resized to that height. The
>>> iframe created for those gadgets have a 'default' height of 250px. I
>>> tried to search for the code where the iframe is created or the height
>>> is set, but I was unable to find it. Can anybody confirm that the height
>>> of the gadget iframe is not resized, based on the 'height' argument in
>>> the ModulePrefs, or is the gadget module incorrect?
>>>
>>>
>> The dynamic-height cannot detect how much height the iframe needs. You
>> should be able to let the iframe content notify the container to resize the
>> iframe with rpc relay calls. As an example the gadget definition in [1]
>> registers the rpc and calls the adjustHeight. The content of the iframe is
>> rendered with [2]. The iframe content does an rpc call to the adjustHeight.
>> As you may see, we've injected the Shindig host there, but at least in the
>> gadget it can be replaced with gadgets.rpc.getOrigin(window.location.href)
>> (haven't checked for the iframe content).
>>
>> [1]
>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
>> [2]
>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>>
>>
>For most of our gadgets, we indeed use dynamic height, by letting the
>gadget call gadgets.window.adjustHeight(). The rpc-call by which an
>iframe can control the gadgets height is new to me, so thanks for this
>example!
>Unfortunately, we also want to use off-the-shelf gadgets from third
>parties and they do not use these constructs. I guess providing a
>'height' attribute in the ModulePrefs element is optional for a platform
>to support, but because google at least supports it, most iframe-based
>gadgets just provide a static height in their gadget definition.
>As I mentioned, Rave (or Shindig?) currently generates iframes with a
>default height of 250px, which is hardcoded in the html (not by using
>CSS). Can you point me to the code where this iframe is generated? Maybe
>I can provide a patch for supporting the 'height' attribute.

Sounds like a bug.  I thought we had support for the height property of OpenSocial gadgets, so not sure why it isn't working.  If you want to look through rave_opensocial.js, find where the issue is and provide a patch, that would be great!  A jira ticket will need to be created for this issue.

>
>--
>Dennis van der Laan, MSc
>Centre for Information Technology
>University of Groningen


Re: iframe height of opensocial gadgets

Posted by Jasha Joachimsthal <j....@onehippo.com>.
On 23 March 2012 11:42, Dennis van der Laan <d....@rug.nl> wrote:

> Hi Jasha,
>
> On 23-3-2012 11:16, Jasha Joachimsthal wrote:
> > On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl>
> wrote:
> >
> >> My first question is that I noticed gadgets which have a 'height'
> >> argument in the gadget moduleprefs, are not resized to that height. The
> >> iframe created for those gadgets have a 'default' height of 250px. I
> >> tried to search for the code where the iframe is created or the height
> >> is set, but I was unable to find it. Can anybody confirm that the height
> >> of the gadget iframe is not resized, based on the 'height' argument in
> >> the ModulePrefs, or is the gadget module incorrect?
> >>
> >>
> > The dynamic-height cannot detect how much height the iframe needs. You
> > should be able to let the iframe content notify the container to resize
> the
> > iframe with rpc relay calls. As an example the gadget definition in [1]
> > registers the rpc and calls the adjustHeight. The content of the iframe
> is
> > rendered with [2]. The iframe content does an rpc call to the
> adjustHeight.
> > As you may see, we've injected the Shindig host there, but at least in
> the
> > gadget it can be replaced with
> gadgets.rpc.getOrigin(window.location.href)
> > (haven't checked for the iframe content).
> >
> > [1]
> >
> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
> > [2]
> >
> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
> >
> >
> For most of our gadgets, we indeed use dynamic height, by letting the
> gadget call gadgets.window.adjustHeight(). The rpc-call by which an
> iframe can control the gadgets height is new to me, so thanks for this
> example!
> Unfortunately, we also want to use off-the-shelf gadgets from third
> parties and they do not use these constructs. I guess providing a
> 'height' attribute in the ModulePrefs element is optional for a platform
> to support, but because google at least supports it, most iframe-based
> gadgets just provide a static height in their gadget definition.
> As I mentioned, Rave (or Shindig?) currently generates iframes with a
> default height of 250px, which is hardcoded in the html (not by using
> CSS). Can you point me to the code where this iframe is generated? Maybe
> I can provide a patch for supporting the 'height' attribute.
>
>
In rave_opensocial.js and rave_wookie.js (rave-portal-resources) there's a
MIN_HEIGHT variable set to 250 (px). This is later used to set its minimal
height in if it's not rendered in the canvas view.


> --
> Dennis van der Laan, MSc
> Centre for Information Technology
> University of Groningen
>
>

Re: iframe height of opensocial gadgets

Posted by Dennis van der Laan <d....@rug.nl>.
Hi Jasha,

On 23-3-2012 11:16, Jasha Joachimsthal wrote:
> On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl> wrote:
>
>> My first question is that I noticed gadgets which have a 'height'
>> argument in the gadget moduleprefs, are not resized to that height. The
>> iframe created for those gadgets have a 'default' height of 250px. I
>> tried to search for the code where the iframe is created or the height
>> is set, but I was unable to find it. Can anybody confirm that the height
>> of the gadget iframe is not resized, based on the 'height' argument in
>> the ModulePrefs, or is the gadget module incorrect?
>>
>>
> The dynamic-height cannot detect how much height the iframe needs. You
> should be able to let the iframe content notify the container to resize the
> iframe with rpc relay calls. As an example the gadget definition in [1]
> registers the rpc and calls the adjustHeight. The content of the iframe is
> rendered with [2]. The iframe content does an rpc call to the adjustHeight.
> As you may see, we've injected the Shindig host there, but at least in the
> gadget it can be replaced with gadgets.rpc.getOrigin(window.location.href)
> (haven't checked for the iframe content).
>
> [1]
> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
> [2]
> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>
>
For most of our gadgets, we indeed use dynamic height, by letting the
gadget call gadgets.window.adjustHeight(). The rpc-call by which an
iframe can control the gadgets height is new to me, so thanks for this
example!
Unfortunately, we also want to use off-the-shelf gadgets from third
parties and they do not use these constructs. I guess providing a
'height' attribute in the ModulePrefs element is optional for a platform
to support, but because google at least supports it, most iframe-based
gadgets just provide a static height in their gadget definition.
As I mentioned, Rave (or Shindig?) currently generates iframes with a
default height of 250px, which is hardcoded in the html (not by using
CSS). Can you point me to the code where this iframe is generated? Maybe
I can provide a patch for supporting the 'height' attribute.

-- 
Dennis van der Laan, MSc
Centre for Information Technology
University of Groningen


Re: iframe height of opensocial gadgets

Posted by Jasha Joachimsthal <j....@onehippo.com>.
Hi Dennis,



On 22 March 2012 22:28, Dennis van der Laan <d....@rug.nl> wrote:

>
> My first question is that I noticed gadgets which have a 'height'
> argument in the gadget moduleprefs, are not resized to that height. The
> iframe created for those gadgets have a 'default' height of 250px. I
> tried to search for the code where the iframe is created or the height
> is set, but I was unable to find it. Can anybody confirm that the height
> of the gadget iframe is not resized, based on the 'height' argument in
> the ModulePrefs, or is the gadget module incorrect?
>
>
The dynamic-height cannot detect how much height the iframe needs. You
should be able to let the iframe content notify the container to resize the
iframe with rpc relay calls. As an example the gadget definition in [1]
registers the rpc and calls the adjustHeight. The content of the iframe is
rendered with [2]. The iframe content does an rpc call to the adjustHeight.
As you may see, we've injected the Shindig host there, but at least in the
gadget it can be replaced with gadgets.rpc.getOrigin(window.location.href)
(haven't checked for the iframe content).

[1]
https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
[2]
https://github.com/OpenConext/OpenConext-teams/blob/master/coin-teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag



Jasha Joachimsthal

Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll free)

www.onehippo.com