SlideShare a Scribd company logo
Overview of Google
Spreadsheet API for Java


                   Nazarii Kostiv
Agenda
●   Overview
●   Authorization;
●   Work with worksheet;
●   List-based feeds;
●   Cell-based feeds;
●   Questions.
What we need to start
●   jdk 1.5 or greater;
●   gdata-java-client jars;
●   java mail API 1.4 or greater;
●   javaBeans Activation Framework.
Overview

    Creating
  spreadsheet                      Set spreadsheet
                    Authorizing
    service                        URL and name




 Get row or cell                   Get spreadsheet
                   Get worksheet
                                         feed
Authorization
SpreadsheetService service =
    new SpreadsheetService("service name"); - create spreadsheet
service

service.setUserCredentials("username", "password"); - send user
credentials
Getting spreadsheet feed
String SPREADSHEET_URL = "https://spreadsheets.google.
com/feeds/spreadsheets/private/full";
URL sheetListUrl =
    new URL(SPREADSHEET_URL);- set spreadsheer URL;

SpreadsheetQuery query = new SpreadsheetQuery(sheetListUrl);
query.setTitleQuery("Spreadsheet name"); - set spreadsheet name;

SpreadsheetFeed feed =
    service.getFeed(query, SpreadsheetFeed.class); - get spreadsheet
feed with entries.
Worksheet
List<SpreadsheetEntry> spreadsheetEntries = feed.getEntries();
SpreadsheetEntry spreadsheet = spreadsheetEntries.get(0); - get
spreadsheet



List<WorksheetEntry> worksheets =
    spreadsheetEntry.getWorksheets();
WorksheetEntry worksheet = worksheets.get(0); - get worksheet;
Worksheet info
List<WorksheetEntry> worksheets = SpreadsheetDemoUtil.
getWorksheets();
       for (WorksheetEntry worksheet : worksheets) {
            System.out.println("Worksheet name: "
                   + worksheet.getTitle().getPlainText() + ", Cols: "
                   + worksheet.getColCount() + ", Rows: "
                   + worksheet.getRowCount());
       }

Worksheet name: Worksheet 1, Cols: 20, Rows: 93
Worksheet name: Worksheet 2, Cols: 20, Rows: 50
Worksheet name: New worksheet, Cols: 20, Rows: 100
Working with worksheet
WorksheetEntry worksheet = new WorksheetEntry();
URL worksheetFeedUrl =
    spreadsheetEntry.getWorksheetFeedUrl();
insertedWorksheet = service.insert(
    worksheetFeedUrl, worksheet); - add new worksheet;
worksheetETag = insertedWorksheet.getEtag();

worksheet.setColCount(30);
worksheet.update(); - update worksheet;
Working with worksheet
 title = worksheet.getTitle().getPlainText();
 eTag = worksheet.getEtag();
 if (title.equals("New worksheet")
            && eTag.equals(worksheetETag)) {
            try {
                 worksheet.delete();
            } catch .... - delete worksheet;
List-based feeds
URL listFeedUrl = worksheetEntry.getListFeedUrl();
ListFeed feed =
    service.getFeed(listFeedUrl, ListFeed.class); - get list-based feed
with list of rows

for (ListEntry entry : feed.getEntries()) {
     System.out.println(entry.getTitle().getPlainText());
}
List based working
URL listFeedUrl = new URI(null, null,
                   worksheet.getListFeedUrl().toString(),
                   "sq=width>25 and height<175", null).toURL();
listFeed = service.getFeed(listFeedUrl, ListFeed.class);
for (ListEntry row : listFeed.getEntries()) {
             System.out.println(row.get...);
}
Add row
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);
ListEntry row = new ListEntry();
        row.getCustomElements().setValueLocal("Component", "New
component");
        row.getCustomElements().setValueLocal("width", "25");
        row.getCustomElements().setValueLocal("height", "19");

row = service.insert(listFeedUrl, row); - insert new row
Delete row
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class);

for (ListEntry row : listFeed.getEntries()) {
             if (...) {
                   row.delete();
             }
Cell-based feeds
URL cellFeedUrl = worksheetEntry.getCellFeedUrl();
CellFeed feed =
    service.getFeed(celFeedUrl, CellFeed.class); - get cell-based feed
with list of cells

for (CellEntry cell : feed.getEntries()) {
  System.out.println(entry.getTitle().getPlainText());
}
Cell based working
URL cellFeedUrl = new URI(null, null,
                   worksheet.getCellFeedUrl().toString(),
                   "?min-row=2&min-col=4&max-col=4",
null).toURL();

CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class);

for (CellEntry cell : cellFeed.getEntries()) {
             System.out.println(cell.getTitle().getPlainText();
}
Cell based working
URL cellFeedUrl = mainWorksheet.getCellFeedUrl();
        CellQuery cellQuery = new CellQuery(cellFeedUrl);

        cellQuery.setMinimumCol(2);
        cellQuery.setMaximumCol(4);
        cellQuery.setMinimumRow(4);
        cellQuery.setMaximumRow(4);
        CellFeed cellFeed = null;
        try {
              cellFeed = service.query(cellQuery, CellFeed.class);
         } catch(...)
Cell data manipulation
if (cell.getTitle().getPlainText().equals("A1")){
     cell.changeInputValueLocal("123"); - set value to cell
     cell.update();
}

.....
        cell.changeInputValueLocal("=SUM(A1:B1)"); - set cell formula
Questions?
Links
●   https://developers.google.com/google-apps/spreadsheets/
●   https://developers.google.com/google-apps/documents-list/
●   https://developers.google.com/apps-script/guide
Nazarii Kostiv
Email: nazar.kostiv@gmail.com

More Related Content

What's hot

Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
Tushar Acharya
 
Get database properties using power shell in sql server 2008 techrepublic
Get database properties using power shell in sql server 2008   techrepublicGet database properties using power shell in sql server 2008   techrepublic
Get database properties using power shell in sql server 2008 techrepublicKaing Menglieng
 
Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
MongoDB
 
Indexing and Query Optimisation
Indexing and Query OptimisationIndexing and Query Optimisation
Indexing and Query OptimisationMongoDB
 
Appengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 btAppengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 btShinichi Ogawa
 
How to Use JSON in MySQL Wrong
How to Use JSON in MySQL WrongHow to Use JSON in MySQL Wrong
How to Use JSON in MySQL Wrong
Karwin Software Solutions LLC
 
ESNext for humans - LvivJS 16 August 2014
ESNext for humans - LvivJS 16 August 2014ESNext for humans - LvivJS 16 August 2014
ESNext for humans - LvivJS 16 August 2014
Jan Jongboom
 
Swing database(mysql)
Swing database(mysql)Swing database(mysql)
Swing database(mysql)
vishal choudhary
 
Sql-Injection
Sql-InjectionSql-Injection
Building Smart Async Functions For Mobile
Building Smart Async Functions For MobileBuilding Smart Async Functions For Mobile
Building Smart Async Functions For MobileGlan Thomas
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
Jeff Smith
 
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...djkucera
 
Hitchhiker's guide to the win8
Hitchhiker's guide to the win8Hitchhiker's guide to the win8
Hitchhiker's guide to the win8Jua Alice Kim
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentation
mrmean
 
知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips
ikeyat
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint Content
Vladimir Medina
 

What's hot (19)

Lu solr32 34-20110912
Lu solr32 34-20110912Lu solr32 34-20110912
Lu solr32 34-20110912
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
 
Get database properties using power shell in sql server 2008 techrepublic
Get database properties using power shell in sql server 2008   techrepublicGet database properties using power shell in sql server 2008   techrepublic
Get database properties using power shell in sql server 2008 techrepublic
 
Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
 
Indexing and Query Optimisation
Indexing and Query OptimisationIndexing and Query Optimisation
Indexing and Query Optimisation
 
What's Parse
What's ParseWhat's Parse
What's Parse
 
Appengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 btAppengine ja-night-sapporo#1 bt
Appengine ja-night-sapporo#1 bt
 
How to Use JSON in MySQL Wrong
How to Use JSON in MySQL WrongHow to Use JSON in MySQL Wrong
How to Use JSON in MySQL Wrong
 
ESNext for humans - LvivJS 16 August 2014
ESNext for humans - LvivJS 16 August 2014ESNext for humans - LvivJS 16 August 2014
ESNext for humans - LvivJS 16 August 2014
 
Swing database(mysql)
Swing database(mysql)Swing database(mysql)
Swing database(mysql)
 
Sql-Injection
Sql-InjectionSql-Injection
Sql-Injection
 
Building Smart Async Functions For Mobile
Building Smart Async Functions For MobileBuilding Smart Async Functions For Mobile
Building Smart Async Functions For Mobile
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
 
Python database access
Python database accessPython database access
Python database access
 
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
Oracle OpenWorld 2010 - Consolidating Microsoft SQL Server Databases into an ...
 
Hitchhiker's guide to the win8
Hitchhiker's guide to the win8Hitchhiker's guide to the win8
Hitchhiker's guide to the win8
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentation
 
知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint Content
 

Viewers also liked

ArcGIS Server Javascript API
ArcGIS Server Javascript APIArcGIS Server Javascript API
ArcGIS Server Javascript API
ewug
 
Jan. 2009 CBN
Jan. 2009 CBNJan. 2009 CBN
Jan. 2009 CBN
John Wong
 
Social Path Routing Optimization 1.1
Social Path Routing Optimization 1.1Social Path Routing Optimization 1.1
Social Path Routing Optimization 1.1
Joel Hoffmann
 
Iirs - Overview of GIS
Iirs - Overview of GISIirs - Overview of GIS
Iirs - Overview of GIS
Tushar Dholakia
 
Validating a smartphone-based pedestrian navigation system prototype - An inf...
Validating a smartphone-based pedestrian navigation system prototype - An inf...Validating a smartphone-based pedestrian navigation system prototype - An inf...
Validating a smartphone-based pedestrian navigation system prototype - An inf...Beniamino Murgante
 
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
Maurizio Pollino
 
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
Jamal Toutouh, PhD
 
Vehicle Tracking System (VTS)
Vehicle Tracking System (VTS)Vehicle Tracking System (VTS)
Vehicle Tracking System (VTS)
Pentode Technologies Pvt. Ltd.
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture
AppDynamics
 
Internet-enabled GIS Using Free and Open Source Tools
Internet-enabled GIS Using Free and Open Source ToolsInternet-enabled GIS Using Free and Open Source Tools
Internet-enabled GIS Using Free and Open Source Tools
John Reiser
 
Cisco Network Icon Library
Cisco Network Icon LibraryCisco Network Icon Library
Cisco Network Icon Library
mike_adolphs
 

Viewers also liked (11)

ArcGIS Server Javascript API
ArcGIS Server Javascript APIArcGIS Server Javascript API
ArcGIS Server Javascript API
 
Jan. 2009 CBN
Jan. 2009 CBNJan. 2009 CBN
Jan. 2009 CBN
 
Social Path Routing Optimization 1.1
Social Path Routing Optimization 1.1Social Path Routing Optimization 1.1
Social Path Routing Optimization 1.1
 
Iirs - Overview of GIS
Iirs - Overview of GISIirs - Overview of GIS
Iirs - Overview of GIS
 
Validating a smartphone-based pedestrian navigation system prototype - An inf...
Validating a smartphone-based pedestrian navigation system prototype - An inf...Validating a smartphone-based pedestrian navigation system prototype - An inf...
Validating a smartphone-based pedestrian navigation system prototype - An inf...
 
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
An Open Source GIS System for Earthquake Early Warning and Post-Event Emergen...
 
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
A Multiobjective Evolutionary Algorithm for Infrastructure Location in Vehicu...
 
Vehicle Tracking System (VTS)
Vehicle Tracking System (VTS)Vehicle Tracking System (VTS)
Vehicle Tracking System (VTS)
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture
 
Internet-enabled GIS Using Free and Open Source Tools
Internet-enabled GIS Using Free and Open Source ToolsInternet-enabled GIS Using Free and Open Source Tools
Internet-enabled GIS Using Free and Open Source Tools
 
Cisco Network Icon Library
Cisco Network Icon LibraryCisco Network Icon Library
Cisco Network Icon Library
 

Similar to Overview of Google spreadsheet API for Java by Nazar Kostiv

Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
Rob Windsor
 
Requery overview
Requery overviewRequery overview
Requery overview
Sunghyouk Bae
 
SERVIET
SERVIETSERVIET
SERVIET
sathish sak
 
Web api's
Web api'sWeb api's
Web api's
umesh patil
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
Sunil OS
 
Apache Click
Apache ClickApache Click
Apache Click
오석 한
 
Hibernate Query Language
Hibernate Query LanguageHibernate Query Language
Hibernate Query Language
InnovationM
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
David Rajah Selvaraj
 
Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache Filter
Wayan Wira
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 DatasourceKaz Watanabe
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
Nick Lee
 
SQLite with UWP
SQLite with UWPSQLite with UWP
SQLite with UWP
Cheah Eng Soon
 
AJAX.ppt
AJAX.pptAJAX.ppt
AJAX.ppt
karan419841
 
Testdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTestdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTruls Jørgensen
 
WP_Query, pre_get_posts, and eliminating query_posts()
WP_Query, pre_get_posts, and eliminating query_posts()WP_Query, pre_get_posts, and eliminating query_posts()
WP_Query, pre_get_posts, and eliminating query_posts()
Erick Hitter
 
Tutorial on developing a Solr search component plugin
Tutorial on developing a Solr search component pluginTutorial on developing a Solr search component plugin
Tutorial on developing a Solr search component plugin
searchbox-com
 

Similar to Overview of Google spreadsheet API for Java by Nazar Kostiv (20)

Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
Servlets intro
Servlets introServlets intro
Servlets intro
 
Requery overview
Requery overviewRequery overview
Requery overview
 
SERVIET
SERVIETSERVIET
SERVIET
 
Web api's
Web api'sWeb api's
Web api's
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
Apache Click
Apache ClickApache Click
Apache Click
 
Servlets
ServletsServlets
Servlets
 
Hibernate Query Language
Hibernate Query LanguageHibernate Query Language
Hibernate Query Language
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
 
Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache Filter
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
SQLite with UWP
SQLite with UWPSQLite with UWP
SQLite with UWP
 
AJAX.ppt
AJAX.pptAJAX.ppt
AJAX.ppt
 
Testdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinnerTestdrevet javautvikling på objektorienterte skinner
Testdrevet javautvikling på objektorienterte skinner
 
WP_Query, pre_get_posts, and eliminating query_posts()
WP_Query, pre_get_posts, and eliminating query_posts()WP_Query, pre_get_posts, and eliminating query_posts()
WP_Query, pre_get_posts, and eliminating query_posts()
 
Tutorial on developing a Solr search component plugin
Tutorial on developing a Solr search component pluginTutorial on developing a Solr search component plugin
Tutorial on developing a Solr search component plugin
 

More from IT Booze

Erlang - concurrency-oriented programming by Serhiy Yvtyshenko
Erlang - concurrency-oriented programming by Serhiy YvtyshenkoErlang - concurrency-oriented programming by Serhiy Yvtyshenko
Erlang - concurrency-oriented programming by Serhiy YvtyshenkoIT Booze
 
Cloud Providers: Amazon, Rackspace, Azure by Andriy Tsok
Cloud Providers: Amazon, Rackspace, Azure by Andriy TsokCloud Providers: Amazon, Rackspace, Azure by Andriy Tsok
Cloud Providers: Amazon, Rackspace, Azure by Andriy TsokIT Booze
 
Let's teach your child programming with Greenfoot by Oleg Pashkevych
Let's teach your child programming with Greenfoot by Oleg Pashkevych Let's teach your child programming with Greenfoot by Oleg Pashkevych
Let's teach your child programming with Greenfoot by Oleg Pashkevych
IT Booze
 
Microsoft Dynamics CRM Overview by Anatoly Kvasnikov
Microsoft Dynamics CRM Overview by Anatoly KvasnikovMicrosoft Dynamics CRM Overview by Anatoly Kvasnikov
Microsoft Dynamics CRM Overview by Anatoly Kvasnikov
IT Booze
 
Windows Phone and mobile application development
Windows Phone and mobile application developmentWindows Phone and mobile application development
Windows Phone and mobile application development
IT Booze
 
Windows 8 and Metro design applications
Windows 8 and Metro design applicationsWindows 8 and Metro design applications
Windows 8 and Metro design applications
IT Booze
 
Introduction to mercurial
Introduction to mercurialIntroduction to mercurial
Introduction to mercurialIT Booze
 

More from IT Booze (9)

Erlang - concurrency-oriented programming by Serhiy Yvtyshenko
Erlang - concurrency-oriented programming by Serhiy YvtyshenkoErlang - concurrency-oriented programming by Serhiy Yvtyshenko
Erlang - concurrency-oriented programming by Serhiy Yvtyshenko
 
Cloud Providers: Amazon, Rackspace, Azure by Andriy Tsok
Cloud Providers: Amazon, Rackspace, Azure by Andriy TsokCloud Providers: Amazon, Rackspace, Azure by Andriy Tsok
Cloud Providers: Amazon, Rackspace, Azure by Andriy Tsok
 
Let's teach your child programming with Greenfoot by Oleg Pashkevych
Let's teach your child programming with Greenfoot by Oleg Pashkevych Let's teach your child programming with Greenfoot by Oleg Pashkevych
Let's teach your child programming with Greenfoot by Oleg Pashkevych
 
Microsoft Dynamics CRM Overview by Anatoly Kvasnikov
Microsoft Dynamics CRM Overview by Anatoly KvasnikovMicrosoft Dynamics CRM Overview by Anatoly Kvasnikov
Microsoft Dynamics CRM Overview by Anatoly Kvasnikov
 
Windows Phone and mobile application development
Windows Phone and mobile application developmentWindows Phone and mobile application development
Windows Phone and mobile application development
 
Windows 8 and Metro design applications
Windows 8 and Metro design applicationsWindows 8 and Metro design applications
Windows 8 and Metro design applications
 
Savana
SavanaSavana
Savana
 
Introduction to mercurial
Introduction to mercurialIntroduction to mercurial
Introduction to mercurial
 
Git
GitGit
Git
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Overview of Google spreadsheet API for Java by Nazar Kostiv

  • 1. Overview of Google Spreadsheet API for Java Nazarii Kostiv
  • 2. Agenda ● Overview ● Authorization; ● Work with worksheet; ● List-based feeds; ● Cell-based feeds; ● Questions.
  • 3. What we need to start ● jdk 1.5 or greater; ● gdata-java-client jars; ● java mail API 1.4 or greater; ● javaBeans Activation Framework.
  • 4. Overview Creating spreadsheet Set spreadsheet Authorizing service URL and name Get row or cell Get spreadsheet Get worksheet feed
  • 5. Authorization SpreadsheetService service = new SpreadsheetService("service name"); - create spreadsheet service service.setUserCredentials("username", "password"); - send user credentials
  • 6. Getting spreadsheet feed String SPREADSHEET_URL = "https://spreadsheets.google. com/feeds/spreadsheets/private/full"; URL sheetListUrl = new URL(SPREADSHEET_URL);- set spreadsheer URL; SpreadsheetQuery query = new SpreadsheetQuery(sheetListUrl); query.setTitleQuery("Spreadsheet name"); - set spreadsheet name; SpreadsheetFeed feed = service.getFeed(query, SpreadsheetFeed.class); - get spreadsheet feed with entries.
  • 7. Worksheet List<SpreadsheetEntry> spreadsheetEntries = feed.getEntries(); SpreadsheetEntry spreadsheet = spreadsheetEntries.get(0); - get spreadsheet List<WorksheetEntry> worksheets = spreadsheetEntry.getWorksheets(); WorksheetEntry worksheet = worksheets.get(0); - get worksheet;
  • 8. Worksheet info List<WorksheetEntry> worksheets = SpreadsheetDemoUtil. getWorksheets(); for (WorksheetEntry worksheet : worksheets) { System.out.println("Worksheet name: " + worksheet.getTitle().getPlainText() + ", Cols: " + worksheet.getColCount() + ", Rows: " + worksheet.getRowCount()); } Worksheet name: Worksheet 1, Cols: 20, Rows: 93 Worksheet name: Worksheet 2, Cols: 20, Rows: 50 Worksheet name: New worksheet, Cols: 20, Rows: 100
  • 9. Working with worksheet WorksheetEntry worksheet = new WorksheetEntry(); URL worksheetFeedUrl = spreadsheetEntry.getWorksheetFeedUrl(); insertedWorksheet = service.insert( worksheetFeedUrl, worksheet); - add new worksheet; worksheetETag = insertedWorksheet.getEtag(); worksheet.setColCount(30); worksheet.update(); - update worksheet;
  • 10. Working with worksheet title = worksheet.getTitle().getPlainText(); eTag = worksheet.getEtag(); if (title.equals("New worksheet") && eTag.equals(worksheetETag)) { try { worksheet.delete(); } catch .... - delete worksheet;
  • 11. List-based feeds URL listFeedUrl = worksheetEntry.getListFeedUrl(); ListFeed feed = service.getFeed(listFeedUrl, ListFeed.class); - get list-based feed with list of rows for (ListEntry entry : feed.getEntries()) { System.out.println(entry.getTitle().getPlainText()); }
  • 12. List based working URL listFeedUrl = new URI(null, null, worksheet.getListFeedUrl().toString(), "sq=width>25 and height<175", null).toURL(); listFeed = service.getFeed(listFeedUrl, ListFeed.class); for (ListEntry row : listFeed.getEntries()) { System.out.println(row.get...); }
  • 13. Add row ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class); ListEntry row = new ListEntry(); row.getCustomElements().setValueLocal("Component", "New component"); row.getCustomElements().setValueLocal("width", "25"); row.getCustomElements().setValueLocal("height", "19"); row = service.insert(listFeedUrl, row); - insert new row
  • 14. Delete row ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class); for (ListEntry row : listFeed.getEntries()) { if (...) { row.delete(); }
  • 15. Cell-based feeds URL cellFeedUrl = worksheetEntry.getCellFeedUrl(); CellFeed feed = service.getFeed(celFeedUrl, CellFeed.class); - get cell-based feed with list of cells for (CellEntry cell : feed.getEntries()) { System.out.println(entry.getTitle().getPlainText()); }
  • 16. Cell based working URL cellFeedUrl = new URI(null, null, worksheet.getCellFeedUrl().toString(), "?min-row=2&min-col=4&max-col=4", null).toURL(); CellFeed cellFeed = service.getFeed(cellFeedUrl, CellFeed.class); for (CellEntry cell : cellFeed.getEntries()) { System.out.println(cell.getTitle().getPlainText(); }
  • 17. Cell based working URL cellFeedUrl = mainWorksheet.getCellFeedUrl(); CellQuery cellQuery = new CellQuery(cellFeedUrl); cellQuery.setMinimumCol(2); cellQuery.setMaximumCol(4); cellQuery.setMinimumRow(4); cellQuery.setMaximumRow(4); CellFeed cellFeed = null; try { cellFeed = service.query(cellQuery, CellFeed.class); } catch(...)
  • 18. Cell data manipulation if (cell.getTitle().getPlainText().equals("A1")){ cell.changeInputValueLocal("123"); - set value to cell cell.update(); } ..... cell.changeInputValueLocal("=SUM(A1:B1)"); - set cell formula
  • 20. Links ● https://developers.google.com/google-apps/spreadsheets/ ● https://developers.google.com/google-apps/documents-list/ ● https://developers.google.com/apps-script/guide