You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Paul Lindner (JIRA)" <ji...@apache.org> on 2008/03/19 22:06:24 UTC

[jira] Resolved: (SHINDIG-137) Enable GadgetDataServlet to be configured with GadgetDataHandlers init param.

     [ https://issues.apache.org/jira/browse/SHINDIG-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner resolved SHINDIG-137.
----------------------------------

    Resolution: Fixed

This is great.  I plan to use this at hi5 as we move towards jsoncontainer.js

> Enable GadgetDataServlet to be configured with GadgetDataHandlers init param. 
> ------------------------------------------------------------------------------
>
>                 Key: SHINDIG-137
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-137
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial - Server
>            Reporter: Changshin Lee
>         Attachments: improve-data-servlet.patch
>
>
> Adding 
>   @Override
>   public void init(ServletConfig config) throws ServletException {
>     super.init(config);
>     String handlerNames = config.getInitParameter("handlers");
>     if (handlerNames == null) {
>       handlers.add(new OpenSocialDataHandler());
>       handlers.add(new StateFileDataHandler());
>     } else {
>       for (String handlerName : handlerNames.split(",")) {
>         try {
>           GadgetDataHandler handler = (GadgetDataHandler) (Class.forName(handlerName)).newInstance();
>           handlers.add(handler);
>         } catch (Exception ex) {
>           throw new ServletException(ex);
>         }
>       }
>     }
>   }
> to GadgetDataServlet enables you to configure GadgetDataHandlers with a web.xml init parameter like the following:
>     <!-- Serve social data -->
>     <servlet>
>         <servlet-name>socialdata</servlet-name>
>         <servlet-class>org.apache.shindig.social.GadgetDataServlet</servlet-class>
>         <init-param>
>             <param-name>handlers</param-name>
>             <param-value>agt.OpenSocialDataHandler</param-value>
>         </init-param>
>     </servlet>
> This improvement is the bottom line for letting your own Shindig instance have a  different way of data handling.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (SHINDIG-137) Enable GadgetDataServlet to be configured with GadgetDataHandlers init param.

Posted by Kevin Brown <et...@google.com>.
On Wed, Mar 19, 2008 at 3:42 PM, Paul Lindner <pl...@hi5.com> wrote:

> With that change in place I can pull gadgets.jar into an existing build
> and
> only serve up the socialdata servlet without having to create a custom
> CrossServletState.


I'm not advocating requiring a custom CrossServletState, I'm advocating
moving this logic into CrossServletState so that any other social servlets
won't have to duplicate the behavior, and to minimize the configuration
points throughout the stack. I'd prefer finer-grained control over custom
implementations of specific classes anyway, and I find the current approach
of having to implement a new CrossServletState when you only want to change
one piece to be undesirable (as I'm sure others have discovered as well).

Cassie mentioned using Guice for this, and it was something that was brought
up long long ago in Shindig's early days, but at the time we didn't feel
that there were enough customizable parts to justify it. Today that's
clearly not the case, and wiring up Guice would certainly be a lot better
than a half-baked reinvention of Spring.

We'd still have to have a single point of creation for the Guice module
because we need to support loading from web.xml, which necessitates the
static CrossServletState.get() in any case. We'd also have to add some class
wrappers for some of CrossServletState's functionality such as generating
iframe and js urls, but I feel that this is probably a good thing for the
overall qualify of the code base.


>
>
> On 3/19/08 2:12 PM, "Kevin Brown" <et...@google.com> wrote:
>
> > Since SocialDataServlet is already using CrossServletState, it would be
> > prudent to figure out a way to make these work cleanly together.
> Otherwise
> > it's a little weird to do half your changes in CrossServletState and the
> > other half by passing a list of class names. A simple solution might be
> to
> > just move the split / register logic to CrossServletState, but I suspect
> > that we might want a cleaner abstraction.
> >
> > On Wed, Mar 19, 2008 at 2:06 PM, Paul Lindner (JIRA) <ji...@apache.org>
> > wrote:
> >
> >>
> >>     [
> >>
> https://issues.apache.org/jira/browse/SHINDIG-137?page=com.atlassian.jira.plu
> >> gin.system.issuetabpanels:all-tabpanel]
> >>
> >> Paul Lindner resolved SHINDIG-137.
> >> ----------------------------------
> >>
> >>    Resolution: Fixed
> >>
> >> This is great.  I plan to use this at hi5 as we move towards
> >> jsoncontainer.js
> >>
> >>> Enable GadgetDataServlet to be configured with GadgetDataHandlers init
> >> param.
> >>>
> >>
>
> ----------------------------------------------------------------------------->>
> -
> >>>
> >>>                 Key: SHINDIG-137
> >>>                 URL: https://issues.apache.org/jira/browse/SHINDIG-137
> >>>             Project: Shindig
> >>>          Issue Type: Improvement
> >>>          Components: OpenSocial - Server
> >>>            Reporter: Changshin Lee
> >>>         Attachments: improve-data-servlet.patch
> >>>
> >>>
> >>> Adding
> >>>   @Override
> >>>   public void init(ServletConfig config) throws ServletException {
> >>>     super.init(config);
> >>>     String handlerNames = config.getInitParameter("handlers");
> >>>     if (handlerNames == null) {
> >>>       handlers.add(new OpenSocialDataHandler());
> >>>       handlers.add(new StateFileDataHandler());
> >>>     } else {
> >>>       for (String handlerName : handlerNames.split(",")) {
> >>>         try {
> >>>           GadgetDataHandler handler = (GadgetDataHandler) (
> Class.forName
> >> (handlerName)).newInstance();
> >>>           handlers.add(handler);
> >>>         } catch (Exception ex) {
> >>>           throw new ServletException(ex);
> >>>         }
> >>>       }
> >>>     }
> >>>   }
> >>> to GadgetDataServlet enables you to configure GadgetDataHandlers with
> a
> >> web.xml init parameter like the following:
> >>>     <!-- Serve social data -->
> >>>     <servlet>
> >>>         <servlet-name>socialdata</servlet-name>
> >>>         <servlet-class>org.apache.shindig.social.GadgetDataServlet
> >> </servlet-class>
> >>>         <init-param>
> >>>             <param-name>handlers</param-name>
> >>>             <param-value>agt.OpenSocialDataHandler</param-value>
> >>>         </init-param>
> >>>     </servlet>
> >>> This improvement is the bottom line for letting your own Shindig
> >> instance have a  different way of data handling.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> You can reply to this email to add a comment to the issue online.
> >>
> >>
> >
>
>


-- 
~Kevin

Re: [jira] Resolved: (SHINDIG-137) Enable GadgetDataServlet to be configured with GadgetDataHandlers init param.

Posted by Cassie <do...@apache.org>.
Sorry for my ignorance, I haven't looked really in depth at the
CrossServletState - but why aren't we using something like Guice [1]? Or any
other library that does relatively the same thing.

Thanks for the patch!

- Cassie

[1] http://code.google.com/p/google-guice/


On Wed, Mar 19, 2008 at 10:12 PM, Kevin Brown <et...@google.com> wrote:

> Since SocialDataServlet is already using CrossServletState, it would be
> prudent to figure out a way to make these work cleanly together. Otherwise
> it's a little weird to do half your changes in CrossServletState and the
> other half by passing a list of class names. A simple solution might be to
> just move the split / register logic to CrossServletState, but I suspect
> that we might want a cleaner abstraction.
>
> On Wed, Mar 19, 2008 at 2:06 PM, Paul Lindner (JIRA) <ji...@apache.org>
> wrote:
>
> >
> >     [
> >
> https://issues.apache.org/jira/browse/SHINDIG-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> >
> > Paul Lindner resolved SHINDIG-137.
> > ----------------------------------
> >
> >    Resolution: Fixed
> >
> > This is great.  I plan to use this at hi5 as we move towards
> > jsoncontainer.js
> >
> > > Enable GadgetDataServlet to be configured with GadgetDataHandlers init
> > param.
> > >
> >
> ------------------------------------------------------------------------------
> > >
> > >                 Key: SHINDIG-137
> > >                 URL: https://issues.apache.org/jira/browse/SHINDIG-137
> > >             Project: Shindig
> > >          Issue Type: Improvement
> > >          Components: OpenSocial - Server
> > >            Reporter: Changshin Lee
> > >         Attachments: improve-data-servlet.patch
> > >
> > >
> > > Adding
> > >   @Override
> > >   public void init(ServletConfig config) throws ServletException {
> > >     super.init(config);
> > >     String handlerNames = config.getInitParameter("handlers");
> > >     if (handlerNames == null) {
> > >       handlers.add(new OpenSocialDataHandler());
> > >       handlers.add(new StateFileDataHandler());
> > >     } else {
> > >       for (String handlerName : handlerNames.split(",")) {
> > >         try {
> > >           GadgetDataHandler handler = (GadgetDataHandler)
> (Class.forName
> > (handlerName)).newInstance();
> > >           handlers.add(handler);
> > >         } catch (Exception ex) {
> > >           throw new ServletException(ex);
> > >         }
> > >       }
> > >     }
> > >   }
> > > to GadgetDataServlet enables you to configure GadgetDataHandlers with
> a
> > web.xml init parameter like the following:
> > >     <!-- Serve social data -->
> > >     <servlet>
> > >         <servlet-name>socialdata</servlet-name>
> > >         <servlet-class>org.apache.shindig.social.GadgetDataServlet
> > </servlet-class>
> > >         <init-param>
> > >             <param-name>handlers</param-name>
> > >             <param-value>agt.OpenSocialDataHandler</param-value>
> > >         </init-param>
> > >     </servlet>
> > > This improvement is the bottom line for letting your own Shindig
> > instance have a  different way of data handling.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> >
> >
>
>
> --
> ~Kevin
>

Re: [jira] Resolved: (SHINDIG-137) Enable GadgetDataServlet to be configured with GadgetDataHandlers init param.

Posted by Paul Lindner <pl...@hi5.com>.
With that change in place I can pull gadgets.jar into an existing build and
only serve up the socialdata servlet without having to create a custom
CrossServletState. 


On 3/19/08 2:12 PM, "Kevin Brown" <et...@google.com> wrote:

> Since SocialDataServlet is already using CrossServletState, it would be
> prudent to figure out a way to make these work cleanly together. Otherwise
> it's a little weird to do half your changes in CrossServletState and the
> other half by passing a list of class names. A simple solution might be to
> just move the split / register logic to CrossServletState, but I suspect
> that we might want a cleaner abstraction.
> 
> On Wed, Mar 19, 2008 at 2:06 PM, Paul Lindner (JIRA) <ji...@apache.org>
> wrote:
> 
>> 
>>     [
>> https://issues.apache.org/jira/browse/SHINDIG-137?page=com.atlassian.jira.plu
>> gin.system.issuetabpanels:all-tabpanel]
>> 
>> Paul Lindner resolved SHINDIG-137.
>> ----------------------------------
>> 
>>    Resolution: Fixed
>> 
>> This is great.  I plan to use this at hi5 as we move towards
>> jsoncontainer.js
>> 
>>> Enable GadgetDataServlet to be configured with GadgetDataHandlers init
>> param.
>>> 
>> 
----------------------------------------------------------------------------->>
-
>>> 
>>>                 Key: SHINDIG-137
>>>                 URL: https://issues.apache.org/jira/browse/SHINDIG-137
>>>             Project: Shindig
>>>          Issue Type: Improvement
>>>          Components: OpenSocial - Server
>>>            Reporter: Changshin Lee
>>>         Attachments: improve-data-servlet.patch
>>> 
>>> 
>>> Adding
>>>   @Override
>>>   public void init(ServletConfig config) throws ServletException {
>>>     super.init(config);
>>>     String handlerNames = config.getInitParameter("handlers");
>>>     if (handlerNames == null) {
>>>       handlers.add(new OpenSocialDataHandler());
>>>       handlers.add(new StateFileDataHandler());
>>>     } else {
>>>       for (String handlerName : handlerNames.split(",")) {
>>>         try {
>>>           GadgetDataHandler handler = (GadgetDataHandler) (Class.forName
>> (handlerName)).newInstance();
>>>           handlers.add(handler);
>>>         } catch (Exception ex) {
>>>           throw new ServletException(ex);
>>>         }
>>>       }
>>>     }
>>>   }
>>> to GadgetDataServlet enables you to configure GadgetDataHandlers with a
>> web.xml init parameter like the following:
>>>     <!-- Serve social data -->
>>>     <servlet>
>>>         <servlet-name>socialdata</servlet-name>
>>>         <servlet-class>org.apache.shindig.social.GadgetDataServlet
>> </servlet-class>
>>>         <init-param>
>>>             <param-name>handlers</param-name>
>>>             <param-value>agt.OpenSocialDataHandler</param-value>
>>>         </init-param>
>>>     </servlet>
>>> This improvement is the bottom line for letting your own Shindig
>> instance have a  different way of data handling.
>> 
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>> 
>> 
> 


Re: [jira] Resolved: (SHINDIG-137) Enable GadgetDataServlet to be configured with GadgetDataHandlers init param.

Posted by Kevin Brown <et...@google.com>.
Since SocialDataServlet is already using CrossServletState, it would be
prudent to figure out a way to make these work cleanly together. Otherwise
it's a little weird to do half your changes in CrossServletState and the
other half by passing a list of class names. A simple solution might be to
just move the split / register logic to CrossServletState, but I suspect
that we might want a cleaner abstraction.

On Wed, Mar 19, 2008 at 2:06 PM, Paul Lindner (JIRA) <ji...@apache.org>
wrote:

>
>     [
> https://issues.apache.org/jira/browse/SHINDIG-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Paul Lindner resolved SHINDIG-137.
> ----------------------------------
>
>    Resolution: Fixed
>
> This is great.  I plan to use this at hi5 as we move towards
> jsoncontainer.js
>
> > Enable GadgetDataServlet to be configured with GadgetDataHandlers init
> param.
> >
> ------------------------------------------------------------------------------
> >
> >                 Key: SHINDIG-137
> >                 URL: https://issues.apache.org/jira/browse/SHINDIG-137
> >             Project: Shindig
> >          Issue Type: Improvement
> >          Components: OpenSocial - Server
> >            Reporter: Changshin Lee
> >         Attachments: improve-data-servlet.patch
> >
> >
> > Adding
> >   @Override
> >   public void init(ServletConfig config) throws ServletException {
> >     super.init(config);
> >     String handlerNames = config.getInitParameter("handlers");
> >     if (handlerNames == null) {
> >       handlers.add(new OpenSocialDataHandler());
> >       handlers.add(new StateFileDataHandler());
> >     } else {
> >       for (String handlerName : handlerNames.split(",")) {
> >         try {
> >           GadgetDataHandler handler = (GadgetDataHandler) (Class.forName
> (handlerName)).newInstance();
> >           handlers.add(handler);
> >         } catch (Exception ex) {
> >           throw new ServletException(ex);
> >         }
> >       }
> >     }
> >   }
> > to GadgetDataServlet enables you to configure GadgetDataHandlers with a
> web.xml init parameter like the following:
> >     <!-- Serve social data -->
> >     <servlet>
> >         <servlet-name>socialdata</servlet-name>
> >         <servlet-class>org.apache.shindig.social.GadgetDataServlet
> </servlet-class>
> >         <init-param>
> >             <param-name>handlers</param-name>
> >             <param-value>agt.OpenSocialDataHandler</param-value>
> >         </init-param>
> >     </servlet>
> > This improvement is the bottom line for letting your own Shindig
> instance have a  different way of data handling.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
~Kevin