Package com.google.gdata.data

Examples of com.google.gdata.data.BaseFeed


        if (set.size() < 1)
            throw new StorageException("can not find feed for given feed id -- "
                + feed.getId());
        ServerBaseFeed result = set.next();
        refreshPersistentObject(result);
        BaseFeed oldFeed = result.getFeed();
        result.setAccount(account);
        result.setFeed(feed.getFeed());
        try {
            this.container.delete(oldFeed);
            this.container.set(result);
View Full Code Here


    // Set the OAuth credentials which were obtained from the step above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
    } else {
      for (int i = 0; i < resultFeed.getEntries().size(); i++) {
        BaseEntry entry = (BaseEntry) resultFeed.getEntries().get(i);
        System.out.println("|\t" + (i + 1) + ": "
            + entry.getTitle().getPlainText());
      }
    }
    System.out.println("=====================================================");
View Full Code Here

    // Set the OAuth credentials which were obtained from the steps above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
    } else {
      for (int i = 0; i < resultFeed.getEntries().size(); i++) {
        BaseEntry entry = (BaseEntry) resultFeed.getEntries().get(i);
        System.out.println("|\t" + (i + 1) + ": "
            + entry.getTitle().getPlainText());
      }
    }
    System.out.println("=====================================================");
View Full Code Here

   * @return
   * @throws Exception
   */
  private static BaseFeed parseFeed(ApiClient actor, InputStream is,
      MapsService maps, boolean preview, PrintWriter pw) throws Exception {
    BaseFeed feed;
    feed = actor.parseFeed(is);
    if (preview) {
      pp(maps, feed, pw);
    }
    return feed;
View Full Code Here

        break;

      case batch:
        client.trimFormat("/%s");     // sleazy hack to remove trailing id
        client.addFormat("/batch");
        BaseFeed bf = parseFeed(client, is, maps, preview, pw);
        pp(maps, client.createFeed(bf, uid, mid), pw);
        break;

      // Clear out a feed.
      case clear:
        client.trimFormat("/%s");     // sleazy hack to remove trailing id
        bf = client.readFeed(uid, mid, fid);
        client.addFormat("/batch");
        BaseFeed batch = client.newFeed();
        count = 0;
        for (Object o : bf.getEntries()) {
          String entryId = ((BaseEntry) o).getSelfLink().getHref();
          if (count == 0 && fudge) {
            entryId += "-xx";
          }
          BaseEntry delete = client.newEntry();
          delete.setId(replaceUserId(uid, entryId));
          BatchUtils.setBatchOperationType(delete, BatchOperationType.DELETE);
          BatchUtils.setBatchId(delete, Integer.toString(++count));
          batch.getEntries().add(delete);
        }
        if (preview) {
          pp(maps, batch, pw);
        }
        BaseFeed response = maps.batch(client.makeUri(uid, mid, fid), batch);
        pp(maps, response, pw);
        break;

      // Test bulk insert latency.
      case bulk:
View Full Code Here

    /**
     * Test method for 'org.apache.lucene.gdata.data.GDataEntityBuilder.buildFeed(String, Reader)'
     */
    public void testBuildFeedStringReader() throws  ParseException, IOException {
        this.reader = new FileReader(incomingFeed);
        BaseFeed feed = GDataEntityBuilder.buildFeed(this.reader,this.config);
        assertNotNull(feed);
        assertEquals("feed title",feed.getTitle().getPlainText(), feedTitleFromXML);
       
      
        
    }
View Full Code Here

    // Set the OAuth credentials which were obtained from the step above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
    } else {
      for (int i = 0; i < resultFeed.getEntries().size(); i++) {
        BaseEntry entry = (BaseEntry) resultFeed.getEntries().get(i);
        System.out.println("|\t" + (i + 1) + ": "
            + entry.getTitle().getPlainText());
      }
    }
    System.out.println("=====================================================");
View Full Code Here

    // Set the OAuth credentials which were obtained from the steps above.
    googleService.setOAuthCredentials(oauthParameters, signer);

    // Make the request to Google
    BaseFeed resultFeed = googleService.getFeed(feedUrl, Feed.class);
    System.out.println("Response Data:");
    System.out.println("=====================================================");
    System.out.println("| TITLE: " + resultFeed.getTitle().getPlainText());
    if (resultFeed.getEntries().size() == 0) {
      System.out.println("|\tNo entries found.");
    } else {
      for (int i = 0; i < resultFeed.getEntries().size(); i++) {
        BaseEntry entry = (BaseEntry) resultFeed.getEntries().get(i);
        System.out.println("|\t" + (i + 1) + ": "
            + entry.getTitle().getPlainText());
      }
    }
    System.out.println("=====================================================");
View Full Code Here

TOP

Related Classes of com.google.gdata.data.BaseFeed

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.