Package org.apache.shindig.gadgets.config

Examples of org.apache.shindig.gadgets.config.ConfigContributor


    ImmutableList.Builder<String> libsBuilder =
        ImmutableList.<String>builder().add(ConfigInjectionProcessor.CONFIG_FEATURE,
          "feature1", "feature2");
    if (extraContrib) {
      libsBuilder.add("feature3");
      ConfigContributor cc = control.createMock(ConfigContributor.class);
      Capture<Map<String, Object>> captureConfig = new Capture<Map<String, Object>>();
      cc.contribute(capture(captureConfig), eq(CONTAINER), eq(HOST));
      expectLastCall().andAnswer(new IAnswer<Void>() {
        @SuppressWarnings("unchecked")
        public Void answer() throws Throwable {
          Map<String, Object> config = (Map<String, Object>)getCurrentArguments()[0];
          String f3Value = (String)config.get("feature3");
View Full Code Here


    expect(request.getHost()).andReturn(HOST).anyTimes();
    expect(registry.getFeatures(requested)).andReturn(requested);

    JsResponseBuilder builder = prepareRequestReturnBuilder(RenderingContext.CONFIGURED_GADGET);

    ConfigContributor cc = control.createMock(ConfigContributor.class);
    Capture<Map<String, Object>> captureConfig = new Capture<Map<String, Object>>();
    cc.contribute(capture(captureConfig), eq(CONTAINER), eq(HOST));
    expectLastCall().andAnswer(new IAnswer<Void>() {
      @SuppressWarnings("unchecked")
      public Void answer() throws Throwable {
        Map<String, Object> config = (Map<String, Object>)getCurrentArguments()[0];
        String f3Value = (String)config.get("reqfeature1");
View Full Code Here

    ImmutableList.Builder<String> libsBuilder =
        ImmutableList.<String>builder().add(ConfigInjectionProcessor.CONFIG_FEATURE,
          "feature1", "feature2");
    if (extraContrib) {
      libsBuilder.add("feature3");
      ConfigContributor cc = control.createMock(ConfigContributor.class);
      Capture<Map<String, Object>> captureConfig = new Capture<Map<String, Object>>();
      cc.contribute(capture(captureConfig), eq(CONTAINER), eq(HOST));
      expectLastCall().andAnswer(new IAnswer<Void>() {
        @SuppressWarnings("unchecked")
        public Void answer() throws Throwable {
          Map<String, Object> config = (Map<String, Object>)getCurrentArguments()[0];
          String f3Value = (String)config.get("feature3");
View Full Code Here

    expect(request.getHost()).andReturn(HOST).anyTimes();
    expect(registry.getFeatures(requested)).andReturn(requested);

    JsResponseBuilder builder = prepareRequestReturnBuilder(RenderingContext.CONFIGURED_GADGET);

    ConfigContributor cc = control.createMock(ConfigContributor.class);
    Capture<Map<String, Object>> captureConfig = new Capture<Map<String, Object>>();
    cc.contribute(capture(captureConfig), eq(CONTAINER), eq(HOST));
    expectLastCall().andAnswer(new IAnswer<Void>() {
      @SuppressWarnings("unchecked")
      public Void answer() throws Throwable {
        Map<String, Object> config = (Map<String, Object>)getCurrentArguments()[0];
        String f3Value = (String)config.get("reqfeature1");
View Full Code Here

          Object conf = features.get(name);
          // Add from containerConfig
          if (conf != null) {
            config.put(name, conf);
          }
          ConfigContributor contributor = configContributors.get(name);
          if (contributor != null) {
            contributor.contribute(config, container, req.getHeader("Host"));
          }
        }
        jsData.append("gadgets.config.init(").append(JsonSerializer.serialize(config)).append(");\n");
      }
    }
View Full Code Here

        if (conf != null) {
          config.put(name, conf);
        }

        // See if this feature has configuration data
        ConfigContributor contributor = configContributors.get(name);
        if (contributor != null) {
          contributor.contribute(config, gadget);
        }
      }
    }

    return "gadgets.config.init(" + JsonSerializer.serialize(config) + ");\n";
View Full Code Here

        if (conf != null) {
          config.put(name, conf);
        }
       
        // See if this feature has configuration data
        ConfigContributor contributor = configContributors.get(name);
        if (contributor != null) {
          contributor.contribute(config, gadget);
        }
      }
    }

    return "gadgets.config.init(" + JsonSerializer.serialize(config) + ");\n";
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.config.ConfigContributor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.