Examples of Gadget


Examples of com.gadglet.data.Gadget

               
               
                try
                {
                  query.setUnique(true); //solve the one gadget issue
                  Gadget g  = (Gadget) query.execute(gadgetName);
                 
                if (g!=null ) // ignore  g.isVisible() as the igoogle call doesn't include credentials
                {
                  // XML file exists on server
                 
                  if(g.getGadgetFileName() != null && !g.getGadgetFileName().isEmpty())
                    continueRequest = true;
                  else
                  {
                    // XML in DataStore
                    PrintWriter out = response.getWriter();
                    response.setContentType("text/xml; charset=UTF-8");
                    out.print(g.getXmlSource());
                    continueRequest = false;
                  }
                   
                }
               
View Full Code Here

Examples of com.google.wave.api.Gadget

    String gadgetUrl = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
    List<Element> elementsIn = Lists.newArrayListWithCapacity(1);
    Map<String,String> properties = Maps.newHashMap();
    properties.put("url", gadgetUrl);
    properties.put("author", ALEX.getAddress());
    elementsIn.add(new Gadget(properties));

    OperationRequest operation =
      operationRequest(OperationType.DOCUMENT_MODIFY, rootBlipId,
            Parameter.of(ParamsProperty.MODIFY_ACTION,
                new DocumentModifyAction(ModifyHow.INSERT, NO_VALUES, NO_ANNOTATION_KEY,
                    elementsIn, NO_BUNDLED_ANNOTATIONS, false)),
            Parameter.of(ParamsProperty.INDEX, CONTENT_START_TEXT));

    service.execute(operation, helper.getContext(), ALEX);
   
    Gadget gadget = null;
    List<ElementInfo> elementsOut = getApiView().getElements();
    int size = 0;
    for (ElementInfo elementOut : elementsOut) {
      if (!elementOut.element.isGadget()) {
        continue;
      } else {
        size++;
        gadget = (Gadget)elementOut.element;
      }
    }
    assertEquals(1, size);
    assertEquals(gadgetUrl, gadget.getUrl());
    assertEquals(ALEX.getAddress(), gadget.getAuthor());
  }
View Full Code Here

Examples of com.google.wave.api.Gadget

    newProperties.put(propertyName, updatedPropertyValue);
    String newPropertyName = "newPropertyName";
    String newPropertyValue = "newPropertyValue";
    newProperties.put(newPropertyName, newPropertyValue);
    newProperties.put(propertyNameToDelete, null);
    updatedElementsIn.add(new Gadget(newProperties));

    OperationRequest updateOperation =
        operationRequest(OperationType.DOCUMENT_MODIFY, rootBlipId,
            Parameter.of(ParamsProperty.MODIFY_ACTION,
                new DocumentModifyAction(ModifyHow.UPDATE_ELEMENT,
                NO_VALUES, NO_ANNOTATION_KEY, updatedElementsIn, NO_BUNDLED_ANNOTATIONS, false)),
            Parameter.of(ParamsProperty.MODIFY_QUERY, new DocumentModifyQuery(ElementType.GADGET,
                ImmutableMap.of("url", gadgetUrl), 1)));

    service.execute(updateOperation, helper.getContext(), ALEX);

    Gadget gadget = null;
    List<ElementInfo> elementsOut = getApiView().getElements();
    for (ElementInfo elementOut : elementsOut) {
      if (elementOut.element.isGadget()) {
        gadget = (Gadget) elementOut.element;
      }
    }
    assertEquals(gadgetUrl, gadget.getUrl());
    assertEquals(ALEX.getAddress(), gadget.getAuthor());
    assertEquals(updatedPropertyValue, gadget.getProperty(propertyName));
    assertNotNull(gadget.getProperty(newPropertyName));
    assertEquals(newPropertyValue, gadget.getProperty(newPropertyName));
    assertNull(gadget.getProperty(propertyNameToDelete));
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    String expected = attr + "=\"" + rewritten + "\"";
    testMarkup(markUp, expected);
  }

  private void testMarkup(String markup, String expected, List<String> msgs) throws GadgetException{
    Gadget gadget = makeGadget();
    for (GadgetHtmlParser parser : parsers) {
      MutableContent mc = new MutableContent(parser, markup);
      rewriter.rewrite(gadget, mc);

      String actual = mc.getContent();
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

      }
    }
  }

  private Gadget makeGadget() throws GadgetException {
    Gadget gadget = EasyMock.createNiceMock(Gadget.class);
    GadgetContext context = EasyMock.createNiceMock(GadgetContext.class);

    expect(context.getUrl()).andReturn(Uri.parse("http://example.com/gadget.xml")).anyTimes();
    expect(context.getContainer()).andReturn("cajaContainer").anyTimes();
    expect(context.getDebug()).andReturn(false).anyTimes();

    expect(gadget.getContext()).andReturn(context).anyTimes();
    expect(gadget.getAllFeatures()).andReturn(ImmutableList.of("caja")).anyTimes();
    expect(gadget.requiresCaja()).andReturn(true).anyTimes();

    replay(context, gadget);
    return gadget;
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

         "'gadgets.features':{views:" +
           "{aliased: {aliases: ['some-alias', 'alias']}}" +
         "}}}");

    containerConfig = new JsonContainerConfig(config, Expressions.forTesting());
    Gadget gadget = mock(Gadget.class);
    processor = mock(Processor.class);
    Capture<GadgetContext> context = new Capture<GadgetContext>();
    expect(processor.process(EasyMock.capture(context))).andReturn(gadget).anyTimes();
    ldService = new HashLockedDomainService(containerConfig, false, mock(LockedDomainPrefixGenerator.class));
    handler = new MakeRequestHandler(containerConfig, pipeline, rewriterRegistry, feedProcessorProvider, gadgetAdminStore, processor, ldService);
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    Map<String, String> prefs = Maps.newHashMap();
    prefs.put(prefKey, prefVal);
    List<String> features = Lists.newArrayList();

    // Make the gadget.
    Gadget gadget = mockGadget(
        SPEC_URI.toString(),
        false,  // not type=url
        false,  // isDebug
        false,  // ignoreCache
        false,  // sanitize
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    Map<String, String> prefs = Maps.newHashMap();
    prefs.put(prefKey, prefVal);
    List<String> features = Lists.newArrayList();

    // Make the gadget.
    Gadget gadget = mockGadget(
        SPEC_URI.toString(),
        false,  // not type=url
        false,  // isDebug
        false,  // ignoreCache
        false,  // sanitize
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    Map<String, String> prefs = Maps.newHashMap();
    prefs.put(prefKey, prefVal);
    List<String> features = Lists.newArrayList();

    // Make the gadget.
    Gadget gadget = mockGadget(
        SPEC_URI.toString(),
        false,  // not type=url
        false,  // isDebug
        false,  // ignoreCache
        false,  // sanitize
View Full Code Here

Examples of org.apache.shindig.gadgets.Gadget

    Map<String, String> prefs = Maps.newHashMap();
    prefs.put(prefKey, prefVal);
    List<String> features = Lists.newArrayList("rpc", "setprefs");

    // Make the gadget.
    Gadget gadget = mockGadget(
        gadgetSite,
        true,   // type=url
        true,   // isDebug
        true,   // ignoreCache
        true,   // sanitize
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.