/** Constructs an empty feed. */ public SpreadsheetFeed() { super(SpreadsheetEntry.class); getCategories().add(SpreadsheetEntry.CATEGORY); }
/** * Declare the extensions of the feeds for the Google Spreadsheets service. */ private void declareExtensions() { new CellFeed().declareExtensions(extProfile); new ListFeed().declareExtensions(extProfile); new RecordFeed().declareExtensions(extProfile); new SpreadsheetFeed().declareExtensions(extProfile); new TableFeed().declareExtensions(extProfile); new WorksheetFeed().declareExtensions(extProfile); }
private void loadFirstSpreadsheet(final SpreadsheetFeed feed) throws Exception { final List<SpreadsheetEntry> spreadsheets = feed.getEntries(); if (CollectionUtils.isEmpty(spreadsheets)) { throw new IllegalArgumentException("Could not find spreadsheet with name '" + this.spreadsheetName + "'"); } else if (spreadsheets.size() > 1) { LOGGER.warn("Found multiple spreadsheets - selecting the first one from the list"); } this.spreadsheetEntry = spreadsheets.get(0); this.loadWorksheets(); }
/** * Declare the extensions of the feeds for the Google Spreadsheets service. */ private void declareExtensions() { new CellFeed().declareExtensions(extProfile); new ListFeed().declareExtensions(extProfile); new RecordFeed().declareExtensions(extProfile); new SpreadsheetFeed().declareExtensions(extProfile); new TableFeed().declareExtensions(extProfile); new WorksheetFeed().declareExtensions(extProfile); }
private SpreadsheetEntry connect() { service = new SpreadsheetService("Omlete"); try { service.setOAuth2Credentials(authorize()); URL spreadSheetFeedUrl = new URL( "https://spreadsheets.google.com/feeds/spreadsheets/private/full"); SpreadsheetFeed feed = service.getFeed(spreadSheetFeedUrl, SpreadsheetFeed.class); List<com.google.gdata.data.spreadsheet.SpreadsheetEntry> spreadsheets = feed .getEntries(); for (SpreadsheetEntry sheet : spreadsheets) { LOGGER.debug("Sheet title plain text: " + sheet.getTitle().getPlainText()); if (sheet.getTitle().getPlainText().equalsIgnoreCase(sheetName)) { return sheet; } } } catch (AuthenticationException e) { LOGGER.error(e); } catch (MalformedURLException e) { LOGGER.error(e); } catch (IOException e) { LOGGER.error(e); } catch (ServiceException e) { LOGGER.error(e); } return null; }
public SpreadsheetFeed(BaseFeed sourceFeed) { super(SpreadsheetEntry.class, sourceFeed); getCategories().add(SpreadsheetEntry.CATEGORY); }
/** Constructs an empty feed. */ public SpreadsheetFeed() { super(SpreadsheetEntry.class); getCategories().add(SpreadsheetEntry.CATEGORY); }
public SpreadsheetFeed(BaseFeed sourceFeed) { super(SpreadsheetEntry.class, sourceFeed); getCategories().add(SpreadsheetEntry.CATEGORY); }