You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Jasha Joachimsthal <j....@onehippo.com> on 2011/08/23 14:35:35 UTC

Widget type attribute

The type attribute for a Widget object is now a String. Shouldn't we change
this into an enum to be sure that its value only contains known values?

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

RE: Widget type attribute

Posted by "Carlucci, Tony" <ac...@mitre.org>.
-----Original Message-----
From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com] 
Sent: Tuesday, August 23, 2011 8:36 AM
To: rave-dev@incubator.apache.org
Subject: Widget type attribute

> The type attribute for a Widget object is now a String. Shouldn't we change
> this into an enum to be sure that its value only contains known values?

+1

Tony

---
Anthony Carlucci | SW App Dev Eng, Sr. | R501 / KW App Development & Maint
e: acarlucci@mitre.org | v: 781.271.2432 | f: 781.271.3299
The MITRE Corporation | 202 Burlington Rd | Bedford, MA 01730-1420


RE: Widget type attribute

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>Sent: Tuesday, August 23, 2011 11:39 AM
>To: rave-dev@incubator.apache.org
>Subject: Re: Widget type attribute
>
>On 23 August 2011 16:55, Franklin, Matthew B. <mf...@mitre.org> wrote:
>
>> >-----Original Message-----
>> >From: Carlucci, Tony [mailto:acarlucci@mitre.org]
>> >Sent: Tuesday, August 23, 2011 10:36 AM
>> >To: rave-dev@incubator.apache.org
>> >Subject: RE: Widget type attribute
>> >
>> >-----Original Message-----
>> >From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>> >Sent: Tuesday, August 23, 2011 8:36 AM
>> >To: rave-dev@incubator.apache.org
>> >Subject: Widget type attribute
>> >
>> >> The type attribute for a Widget object is now a String. Shouldn't we
>> change
>> >> this into an enum to be sure that its value only contains known values?
>> >
>> >+1
>>
>> I disagree.  If we change it to an enum, then we lose the ability to add
>> providers easily.  Currently, to add a provider, you only need to create
>>  beans that implement the correct interfaces and add javascript to handle
>> the client-side rendering pieces.  So long as the beans are in the
>> application context at runtime and the script is included in the JSP, the
>> new provider will be automatically enabled.  By constraining widget types to
>> an enum, the enum will need to have all potential widget types, which may
>> not be the case.  If I am Joe Widget Writer with my own proprietary widget
>> type, I don't want to modify core rave code to make my provider work.
>>
>
>Good point. Enum is too strict for that.  I'm working on the "Add widget"
>form and it would be nice if there is a way to be sure that the type of
>widget to be added is known. What about looking up the possible values in a
>WidgetType table (bean)?

We can work on the provider SPIs so that everything is a little more explicit, but for now you could just auto-wire in the RenderService and get the collection of supported widgets.  That way you can be sure that there is a currently configured provider for the widget you are adding.  

>You can add your proprietary WidgetType. We can also build a feature that
>certain (supported) widget types are made unavailable by Mike Website
>Administrator (if he only wants W3C widgets but no OpenSocial gadgets).
>

I think we will want to support the ability to turn on or off widget providers, but I would wait on that until we decide how we really want to manage widget providers...

>Jasha

Re: Widget type attribute

Posted by Jasha Joachimsthal <j....@onehippo.com>.
On 23 August 2011 16:55, Franklin, Matthew B. <mf...@mitre.org> wrote:

> >-----Original Message-----
> >From: Carlucci, Tony [mailto:acarlucci@mitre.org]
> >Sent: Tuesday, August 23, 2011 10:36 AM
> >To: rave-dev@incubator.apache.org
> >Subject: RE: Widget type attribute
> >
> >-----Original Message-----
> >From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
> >Sent: Tuesday, August 23, 2011 8:36 AM
> >To: rave-dev@incubator.apache.org
> >Subject: Widget type attribute
> >
> >> The type attribute for a Widget object is now a String. Shouldn't we
> change
> >> this into an enum to be sure that its value only contains known values?
> >
> >+1
>
> I disagree.  If we change it to an enum, then we lose the ability to add
> providers easily.  Currently, to add a provider, you only need to create
>  beans that implement the correct interfaces and add javascript to handle
> the client-side rendering pieces.  So long as the beans are in the
> application context at runtime and the script is included in the JSP, the
> new provider will be automatically enabled.  By constraining widget types to
> an enum, the enum will need to have all potential widget types, which may
> not be the case.  If I am Joe Widget Writer with my own proprietary widget
> type, I don't want to modify core rave code to make my provider work.
>

Good point. Enum is too strict for that.  I'm working on the "Add widget"
form and it would be nice if there is a way to be sure that the type of
widget to be added is known. What about looking up the possible values in a
WidgetType table (bean)?
You can add your proprietary WidgetType. We can also build a feature that
certain (supported) widget types are made unavailable by Mike Website
Administrator (if he only wants W3C widgets but no OpenSocial gadgets).

Jasha

RE: Widget type attribute

Posted by "Franklin, Matthew B." <mf...@mitre.org>.
>-----Original Message-----
>From: Carlucci, Tony [mailto:acarlucci@mitre.org]
>Sent: Tuesday, August 23, 2011 10:36 AM
>To: rave-dev@incubator.apache.org
>Subject: RE: Widget type attribute
>
>-----Original Message-----
>From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com]
>Sent: Tuesday, August 23, 2011 8:36 AM
>To: rave-dev@incubator.apache.org
>Subject: Widget type attribute
>
>> The type attribute for a Widget object is now a String. Shouldn't we change
>> this into an enum to be sure that its value only contains known values?
>
>+1

I disagree.  If we change it to an enum, then we lose the ability to add providers easily.  Currently, to add a provider, you only need to create  beans that implement the correct interfaces and add javascript to handle the client-side rendering pieces.  So long as the beans are in the application context at runtime and the script is included in the JSP, the new provider will be automatically enabled.  By constraining widget types to an enum, the enum will need to have all potential widget types, which may not be the case.  If I am Joe Widget Writer with my own proprietary widget type, I don't want to modify core rave code to make my provider work.  


>
>Tony
>
>---
>Anthony Carlucci | SW App Dev Eng, Sr. | R501 / KW App Development &
>Maint
>e: acarlucci@mitre.org | v: 781.271.2432 | f: 781.271.3299
>The MITRE Corporation | 202 Burlington Rd | Bedford, MA 01730-1420
>