Yeah I took a look at the spec as well and couldn't find anything that 
covers this case.  This document from Google shows how iGoogle handles 
this case though...
http://code.google.com/apis/gadgets/docs/ui.html

We may way to consider doing what they do, which is displaying nothing.

-Ryan

Email: [email protected]
Phone: 978-899-3041
developerWorks Profile



From:   Paul Lindner <[email protected]>
To:     [email protected], 
Cc:     Stanton Sievers/Westford/IBM@Lotus
Date:   03/10/2011 02:14 PM
Subject:        Re: NPE in DefaultIframeUriManager when no default view is 
provided by the gadget



The spec doesn't really cover this case..

If there's a view-less content section then it might make sense to add a
view=default attribute.

For cases where we're requesting a view that the gadget does not define 
then
we should return some minimal default empty view for the gadget so things
don't blow up.


On Thu, Mar 10, 2011 at 9:51 AM, Stanton Sievers 
<[email protected]>wrote:

> Hi,
>
> I've run into a NullPointerException in
> org.apache.shindig.gadgets.uri.DefaultIframeUriManager.makeRenderingUri 
in
> the case where the gadget spec document neither defines a Content 
section
> with no "view" attribute nor a Content section with a "view" attribute
> containing "default".  An example gadget is posted below.
>
> The NPE is thrown because the gadget.getCurrentView() call in
> makeRenderingUri() returns null.  The value returned by
> gadget.getCurrentView() is the same as the value returned by
> org.apache.shindig.gadgets.process.Processor.getView(GadgetContext,
> GadgetSpec).  Looking through the code, it seems that if the "view" 
param
> defined in the request is not found for the gadget or not defined at 
all,
> then we try to fall back to the "default" view.  However, if that 
doesn't
> exist either, then we get this NPE.
>
> I'm wondering what the expected behavior here should be?  I'd rather we
> pick a random view for the rendering url then throw a NPE.
>
> Thanks,
> -Stanton
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Module>
>  <ModulePrefs title="BadViews"
>               author="[email protected]">
>  </ModulePrefs>
>  <Content type="html" view="profile">
>  </Content>
>  <Content type="html" view="canvas">
>  </Content>
> </Module>
>
>
>


-- 
Paul Lindner -- [email protected] -- linkedin.com/in/plindner



Reply via email to