WorksheetFeed worksheetFeed = s.getFeed(spreadsheet.getWorksheetFeedUrl(), WorksheetFeed.class); List<WorksheetEntry> worksheets = worksheetFeed.getEntries(); WorksheetEntry worksheet = worksheets.get(0); URL cellFeedUrl= worksheet.getCellFeedUrl (); CellFeed cellFeed= s.getFeed (cellFeedUrl, CellFeed.class); CellEntry cellEntry= new CellEntry (1, 1, "aa"); cellFeed.insert (cellEntry);
/** Constructs a new worksheet feed from an existing feed instance. */ public WorksheetFeed(BaseFeed sourceFeed) { super(WorksheetEntry.class, sourceFeed); getCategories().add(WorksheetEntry.CATEGORY); }
worksheetFeed.insert(newWorksheet); List <WorksheetEntry> worksheetEntrys = worksheetFeed.getEntries (); WorksheetEntry sheet1 = worksheetEntrys.get(0); WorksheetEntry sheet2 = worksheetEntrys.get(1);
/** * 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); }
/** * 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); }
worksheetFeedUrl, WorksheetFeed.class); List <WorksheetEntry> worksheetEntrys= worksheetFeed.getEntries (); WorksheetEntry worksheetEntry= worksheetEntrys.get (0);
/** Constructs an empty feed. */ public WorksheetFeed() { super(WorksheetEntry.class); getCategories().add(WorksheetEntry.CATEGORY); }
public SpDatabase()throws AuthenticationException, MalformedURLException, IOException, ServiceException { service = new SpreadsheetService("Test"); FeedURLFactory factory = FeedURLFactory.getDefault(); String key = "1arJFUxSghwdv0QpnJJ3lBu36X4I3d_uB4xx_xNGLKHU"; URL spreadSheetUrl = factory.getWorksheetFeedUrl(key, "public", "full"); WorksheetFeed feed = service.getFeed(spreadSheetUrl, WorksheetFeed.class); worksheet = feed.getEntries().get(0); URL cellFeedURL = worksheet.getCellFeedUrl(); CellFeed cellFeed = service.getFeed(cellFeedURL, CellFeed.class); }
/** Constructs a new worksheet feed from an existing feed instance. */ public WorksheetFeed(BaseFeed sourceFeed) { super(WorksheetEntry.class, sourceFeed); getCategories().add(WorksheetEntry.CATEGORY); }
URL WORKSHEET_FEED_URL = new URL("https://spreadsheets.google.com/feeds/worksheets/" + fileId + "/private/full"); WorksheetFeed feed = service.getFeed(WORKSHEET_FEED_URL, WorksheetFeed.class); worksheets = feed.getEntries();
/** Constructs an empty feed. */ public WorksheetFeed() { super(WorksheetEntry.class); getCategories().add(WorksheetEntry.CATEGORY); }
public static void main(String... args) throws MalformedURLException, ServiceException, IOException { SpreadsheetService service = new SpreadsheetService("Test"); FeedURLFactory fact = FeedURLFactory.getDefault(); String key = "0AvNWoDP9TASIdERsbFRnNXdsN2x4MXMxUmlyY0g3VUE"; URL spreadSheetUrl = fact.getWorksheetFeedUrl(key, "public", "basic"); WorksheetFeed feed = service.getFeed(spreadSheetUrl, WorksheetFeed.class); WorksheetEntry entry = feed.getEntries().get(0); URL cellFeedURL = entry.getCellFeedUrl(); CellFeed cellFeed = service.getFeed(cellFeedURL, CellFeed.class); }
SpreadsheetService service = new SpreadsheetService("google-spreadsheet"); FeedURLFactory urlFactory = FeedURLFactory.getDefault(); WorksheetFeed worksheetFeed = service.getFeed(urlFactory.getWorksheetFeedUrl("1V4jT4vSqmY4YNY1VJhariLRLbxfFWf5z8bSTpDcSBPE", "public", "full"), WorksheetFeed.class); List<WorksheetEntry> worksheets = worksheetFeed.getEntries(); WorksheetEntry worksheet = worksheets.get(0); System.out.println(worksheet.getTitle().getPlainText());
List<WorksheetEntry> worksheets = worksheetFeed.getEntries(); for (WorksheetEntry entry : worksheets) { if (entry.getTitle().getPlainText().equals(worksheetTitle)) {
import java.net.URL; import java.lang.*; import java.util.List; import com.google.gdata.client.spreadsheet.FeedURLFactory; import com.google.gdata.client.spreadsheet.ListQuery; import com.google.gdata.client.spreadsheet.SpreadsheetService; import com.google.gdata.data.spreadsheet.CustomElementCollection; import com.google.gdata.data.spreadsheet.ListEntry; import com.google.gdata.data.spreadsheet.ListFeed; import com.google.gdata.data.spreadsheet.WorksheetEntry; import com.google.gdata.data.spreadsheet.WorksheetFeed; public class SpreadsheetsDemo { public static void main(String[] args) throws Exception{ String application = "SpreadsheetsDemo"; String key = "0AvNWoDP9TASIdERsbFRnNXdsN2x4MXMxUmlyY0g3VUE"; SpreadsheetService service = new SpreadsheetService(application); URL url = FeedURLFactory.getDefault().getWorksheetFeedUrl(key, "public", "basic"); WorksheetFeed feed = service.getFeed(url, WorksheetFeed.class); List<WorksheetEntry> worksheetList = feed.getEntries(); WorksheetEntry worksheetEntry = worksheetList.get(0); CellQuery cellQuery = new CellQuery(worksheetEntry.CellFeedLink); CellFeed cellFeed = service.Query(cellQuery); foreach (CellEntry cell in cellFeed.Entries) { //Iterate through the columns and rows } } }
/** * Gets all worksheet entries that are part of this spreadsheet. * * You must be online for this to work. * * @return the list of worksheet entries */ public List<WorksheetEntry> getWorksheets() throws IOException, ServiceException { WorksheetFeed feed = state.service.getFeed(getWorksheetFeedUrl(), WorksheetFeed.class); return feed.getEntries(); }
/** * Gets all worksheet entries that are part of this spreadsheet. * * You must be online for this to work. * * @return the list of worksheet entries */ public List<WorksheetEntry> getWorksheets() throws IOException, ServiceException { WorksheetFeed feed = state.service.getFeed(getWorksheetFeedUrl(), WorksheetFeed.class); return feed.getEntries(); }
/** * Gets all worksheet entries that are part of this spreadsheet. * * You must be online for this to work. * * @return the list of worksheet entries */ public List<WorksheetEntry> getWorksheets() throws IOException, ServiceException { WorksheetFeed feed = state.service.getFeed(getWorksheetFeedUrl(), WorksheetFeed.class); return feed.getEntries(); }
/** * Gets all worksheet entries that are part of this spreadsheet. * * You must be online for this to work. * * @return the list of worksheet entries */ public List<WorksheetEntry> getWorksheets() throws IOException, ServiceException { WorksheetFeed feed = state.service.getFeed(getWorksheetFeedUrl(), WorksheetFeed.class); return feed.getEntries(); }
/** * Gets all worksheet entries that are part of this spreadsheet. * * You must be online for this to work. * * @return the list of worksheet entries */ public List<WorksheetEntry> getWorksheets() throws IOException, ServiceException { WorksheetFeed feed = state.service.getFeed(getWorksheetFeedUrl(), WorksheetFeed.class); return feed.getEntries(); }