Package com.google.gdata.data.spreadsheet

Examples of com.google.gdata.data.spreadsheet.WorksheetFeed


        SpreadsheetService service = new SpreadsheetService("MySpreadsheetIntegration-foo");
        URL url = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full?title=GSS-Dev-Schedule");
        SpreadsheetFeed feed = service.getFeed(url, SpreadsheetFeed.class);
        List<SpreadsheetEntry> spreadsheets = feed.getEntries();
        SpreadsheetEntry spreadsheet = spreadsheets.get(0);
        WorksheetFeed worksheetFeed = service.getFeed(spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class);
        List<WorksheetEntry> worksheets = worksheetFeed.getEntries();
        WorksheetEntry worksheet = worksheets.get(0);
        // fetch A1 only
        URL cellFeedUrl = new URI(worksheet.getCellFeedUrl().toString() + "?min-row=1&max-row=1&min-col=1&max-col=1")
            .toURL();
        CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class);
View Full Code Here


    return worksheetNumber;
  }
 
  public GSpreadResultSet retrieveData() throws Exception {
    URL worksheetUrl = new URL(this.getConfig().generateWorksheetFeedURL());
    WorksheetFeed feedw = this.getConfig().getFeed(worksheetUrl, WorksheetFeed.class);
    WorksheetEntry worksheetEntry = feedw.getEntries().get(this.getWorksheetNumber() - 1);     
    CellFeed feedc = this.getConfig().getFeed(worksheetEntry.getCellFeedUrl(), CellFeed.class);     
    List<CellEntry> entries = feedc.getEntries();     
    GSpreadResultSet grs = new GSpreadResultSet();
   
    /* store the data */
 
View Full Code Here

        SpreadsheetService spreadsheetService = GDataExtension.getSpreadsheetService(null);
        String visibility = "public";
        FeedURLFactory factory = FeedURLFactory.getDefault();
        String key = GDataExtension.getSpreadsheetID(docUrl);
        docUrl = factory.getWorksheetFeedUrl(key, visibility, "values");
        WorksheetFeed feed = spreadsheetService.getFeed(docUrl, WorksheetFeed.class);
        return feed.getEntries();
    }
View Full Code Here

    FeedURLFactory urlFactory = FeedURLFactory.getDefault();
    WorksheetQuery worksheetQuery =
      new WorksheetQuery(urlFactory.getWorksheetFeedUrl(ssKey, "private", "values"));
    worksheetQuery.setTitleQuery(kind);
    WorksheetFeed spreadsheetFeed = ss.query(worksheetQuery, WorksheetFeed.class);
    WorksheetEntry workSheet = spreadsheetFeed.getEntries().get(0);
    final int colCount = workSheet.getColCount();
    String[] columnTitle = new String[colCount];
    String[] dataType = new String[colCount];

    URL cellFeedUrl = workSheet.getCellFeedUrl();
View Full Code Here

      SpreadsheetFeed spreadsheetFeed = ss.query(spreadsheetQuery, SpreadsheetFeed.class);
      SpreadsheetEntry spreadsheetEntry = spreadsheetFeed.getEntries().get(0);

      // Modify a default worksheet
      URL worksheetFeedUrl = spreadsheetEntry.getWorksheetFeedUrl();
      WorksheetFeed worksheetFeed = ss.getFeed(worksheetFeedUrl, WorksheetFeed.class);
      WorksheetEntry defaultWorksheet = worksheetFeed.getEntries().get(0);
      defaultWorksheet.setTitle(new PlainTextConstruct(targetKinds.get(0)));
      defaultWorksheet.setRowCount(2);
      defaultWorksheet.setColCount(1);
      defaultWorksheet.update();
      logger.info("Worksheet:" + targetKinds.get(0) + "is created.");
View Full Code Here

      throw new RuntimeException("Cannot find spreadsheet:" + ssKey);
    }

    // Modify a worksheet's column size
    URL worksheetFeedUrl = spreadsheetEntry.getWorksheetFeedUrl();
    WorksheetFeed worksheetFeed = ss.getFeed(worksheetFeedUrl, WorksheetFeed.class);
    WorksheetEntry worksheetEntry = null;
    for (WorksheetEntry worksheet : worksheetFeed.getEntries()) {
      if (kind.equals(worksheet.getTitle().getPlainText())) {
        worksheetEntry = worksheet;
        break;
      }
    }
View Full Code Here

  throws EPAuthenticationException {
    List<WorksheetEntry> returnList = null;

    try {
      SpreadsheetService ssService = getSsService();
      WorksheetFeed wsFeed = ssService.getFeed(
          new URL(wsFeedUrl),
          WorksheetFeed.class);
      returnList = wsFeed.getEntries();
    } catch (com.google.gdata.util.AuthenticationException authEx) {
      throw new EPAuthenticationException(
          "WS list read access not available");
    } catch (com.google.gdata.util.ServiceException svcex) {
      System.err.println("ServiceException while retrieving " +
View Full Code Here

   * Gets the list of worksheets from Google Spreadsheets.
   * @param spreadsheet the spreadsheet to get a list of worksheets for
   * @return true if successful
   */
  private boolean retrieveWorksheetList(SpreadsheetEntry spreadsheet) {
    WorksheetFeed feed;

    try {
      feed = service.getFeed(
          spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class);
    } catch (IOException e) {
      SpreadsheetApiDemo.showErrorBox(e);
      return false;
    } catch (ServiceException e) {
      SpreadsheetApiDemo.showErrorBox(e);
      return false;
    }

    this.worksheetEntries = feed.getEntries();

    return true;
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.spreadsheet.WorksheetFeed

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.