Döcu Content

Google Spreadsheets API

Script Libray


System Requirements:

Download Domino Designer 8.5.3 Environment (DDE)


Download /Make available Google Spreadsheets API




In this tutorial, we are using a Java console program to list the name of a certain Spreadsheet document housed on Google Drive, using the Spreadsheets API. We will be reading publically available document(s), previously created... We will be programming via Domino Desginer Environement (DDE).


Information contained in the following is presented as is. This tutorial assumes you have basic Lotus Notes Configuration, Programming knowledge, and are familiar with Google APIs.

Döcu Content JavaAgent (Script Library)

Go to URLs provided, download JAR files, then create a Java Script Library with the jar files contained in the zip (gdata-src.java-1.47.1.zip). Reference the Script Library in your JavaAgent program, run code to list Spreadsheet info to console....

Take a look at the JAR file section below, view screenshots; you may need to remove deprecated JARs from your download. See 'Hint' in this document.

Related Info:



Döcu Content Design JARs

User configuration and design: the following library files are needed as Script files... Add Script as an Archive item. Besire to navigate to lib folder to include all JAR files from download...


You may run into an issue where your code cannot connect to Google, it could be becuase you Script Library contains one the deprecated JARs, 'google-collect-1.0-rc1.jar'... Delete it, save Script Library, save the program, and run it.

Copy and Paste Page Design code

More than likely, with the proper JAR files in place, the program compiles, run as Java program and view results in Console



* Created from copy: 2014.

* GoogleSpreadsheetsJavaAgent | ListGoogleDriveFilesJavaAgent.java

* List Spreadsheets in specific Google Drive Account



* @author Dököll Solutions, Inc.

* @version 2014.



//Google imports...


import com.google.gdata.client.spreadsheet.*;

import com.google.gdata.data.spreadsheet.*;

import com.google.gdata.util.*;

//java imports...


import java.io.IOException;

import java.net.*;

import java.util.*;

public class ListGoogleDriveFilesJavaAgent {

public static void main(String[] args)

throws AuthenticationException, MalformedURLException, IOException, ServiceException {

//TODO: see about connecting automatically...

//existing Google Drive login creds...

String USERNAME = "yourgoogleaccount@gmail.com";

String PASSWORD = "youraccountpassword";

SpreadsheetService service =

new SpreadsheetService("MySpreadsheetIntegration");

service.setUserCredentials(USERNAME, PASSWORD);

// TODO: for code to put here...



// Make a request to the API and get all spreadsheets.

SpreadsheetFeed feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);

List<SpreadsheetEntry> spreadsheets = feed.getEntries();

// Iterate through all of the spreadsheets returned

for (SpreadsheetEntry spreadsheet : spreadsheets) {

// Print the title of this spreadsheet to the screen


// Make a request to the API to fetch information about all

// worksheets in the spreadsheet.

List<WorksheetEntry> worksheets = spreadsheet.getWorksheets();

// Iterate through each worksheet in the spreadsheet.

for (WorksheetEntry worksheet : worksheets) {

// Get the worksheet's title, row count, and column count.

String title = worksheet.getTitle().getPlainText();

int rowCount = worksheet.getRowCount();

int colCount = worksheet.getColCount();

// Print the fetched information to the screen for this worksheet.

System.out.println("\t" + title + "- rows:" + rowCount + " cols: " + colCount);

}//for worksheet

}//for spreadsheet



Döcu Content Console View (Console)

Full page design: Here is what your results might look like when program runs...


Provided you have laready set up... Access publically available document housed on Google Infrastructure with the push of a button.

Questions, comments, please post a brief message on our Contact form on the main site.

Thank you for coming...