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: Gadgets Server - Java
            Reporter: Changshin Lee


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.

Reply via email to