/** Constructs a feed using state from an existing one. */ public ListFeed(BaseFeed sourceFeed) { super(ListEntry.class, sourceFeed); getCategories().add(ListEntry.CATEGORY); }
public ListEntry getListEntry(final GSRow row) throws IOException, ServiceException { this.worksheetEntry = this.worksheetEntry.getSelf(); this.listFeed = this.listFeed.getSelf(); int i = this.getRowIndex(row); return this.listFeed.getEntries().get(i); }
/** * 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 GSRow loadGoogleColumnIds(final int rowIndex, final int lastColumnIndex) throws Exception { final StringBuilder uri = new StringBuilder(this.worksheetEntry.getListFeedUrl().toString()); uri.append("?start-index=" + Integer.toString(rowIndex - GSConstants.HEADER_ROW_INDEX)); uri.append("&max-results=1"); final URL listFeedUrl = new URL(uri.toString()); final ListFeed listFeed = this.model.getWorksheetListFeed(listFeedUrl); final List<ListEntry> listEntries = listFeed.getEntries(); if (listEntries.size() == 1) { final ListEntry temporaryRow = listEntries.get(0); this.extractGoogleIdsFromRow(temporaryRow, lastColumnIndex); return new GSRow(this, temporaryRow); } else { throw new IllegalStateException("Failed to retrieve temporary row"); } }
/** * 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); }
browserFeed = service.getFeed(browserSheetURL, ListFeed.class); for (ListEntry row : browserFeed.getEntries()) { browserConfLForSingleSheet .add(getBrowserConfFromRow(row));
@Override public void removeRow(final SpreadsheetRow row) { LOGGER.debug("*** Removing Row"); this.checkThatWorksheetExists(); try { final int rowIndex = new ArrayList<GSRow>(this.rows).indexOf(row); this.listFeed = this.listFeed.getSelf(); this.listFeed.getEntries().get(rowIndex).delete(); this.worksheetEntry = this.worksheetEntry.getSelf(); this.rows.remove(row); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }
/** Constructs an empty feed. */ public ListFeed() { super(ListEntry.class); getCategories().add(ListEntry.CATEGORY); }
/*** * Get the primary data from the Mapping sheet in Google sheet, This would * be fed to MappedValue for refinement */ @Override public Map<String, IMappingData> getPrimaryData() { if (mappingBucket.isEmpty()) { URL listFeedURL; try { listFeedURL = getWorkSheet( GoogleSheetConstant.GOOGLE_MAP_SHEET_NAME) .getListFeedUrl(); ListFeed listFeed = service .getFeed(listFeedURL, ListFeed.class); for (ListEntry row : listFeed.getEntries()) { mappingBucket.put( row.getCustomElements().getValue("methodname"), getMap(row)); } } catch (IOException e) { LOGGER.error(e); } catch (ServiceException e) { LOGGER.error(e); } } return mappingBucket; }
@Override public List<SpreadsheetRow> getRows() { LOGGER.debug("*** Reading Rows"); this.checkThatWorksheetExists(); if (this.rows == null) { try { this.rows = new LinkedHashSet<GSRow>(); this.listFeed = this.listFeed.getSelf(); for (final ListEntry listEntry : this.listFeed.getEntries()) { final GSRow row = new GSRow(this, listEntry); this.rows.add(row); } } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException(e.getMessage()); } } return new ArrayList<SpreadsheetRow>(this.rows); }
/** Constructs an empty feed. */ public ListFeed() { super(ListEntry.class); getCategories().add(ListEntry.CATEGORY); }
Map<String, String> keyValuePair = new HashMap<String, String>(); DataPerEnvironment testEnvHolder = null; for (ListEntry row : rows.getEntries()) { LOGGER.debug("Row is: " + row.getCustomElements().getValue("key") + "value: " + row.getCustomElements().getValue("value"));
/** Constructs a feed using state from an existing one. */ public ListFeed(BaseFeed sourceFeed) { super(ListEntry.class, sourceFeed); getCategories().add(ListEntry.CATEGORY); }