Thinking ahead - Google drive integration with app script!
A bit of a background
What is google drive?
Google drive is a file storage and synchronisation service provided by Google launched in April 2012. It enables user cloud storage, file sharing and collaborative editing.
Google drive is a file storage and synchronisation service provided by Google launched in April 2012. It enables user cloud storage, file sharing and collaborative editing.
What is a google app script?
Google app script is a JavaScript cloud scripting language that lets you extend Google Apps and build web applications. Scripts are developed in Google Apps Script's browser-based script editor, and they are stored in and run from Google's servers.
Google app script is a JavaScript cloud scripting language that lets you extend Google Apps and build web applications. Scripts are developed in Google Apps Script's browser-based script editor, and they are stored in and run from Google's servers.
How to integrate?
Two essential integration flows.
- Having your application available to the users in google drive.
- Access files in Google drive from google app script.
The steps to integrate via an illustrated example are given below :
Step 1 : Create a roster in google spread sheet.
Step 2 : Open up Google drive and go to 'my drive'.
Step 3 : Open up the link in the mail pointing to the application developed.
Step 4 : Page redirected to a welcome screen for installation of the Google App for proceed confirmation.
Step 5 : Post installation refresh the drive contents and this app would be visible in the list of your installed apps.
Step 6 : Click on the application to start it.
Step 7 : After application completes the run, the contents created by the application should be visible in the google drive.
Step 8 : The created docs can be worked upon and saved.
Step 9 : Options in the application provide you with the information for next steps like for eg: publish, so that the application is visible to selected people in the google drive n/w.
Step 10 : A person with the persona of student would be able to view the published contents on their login and act on the same.
Step 11 : A time slot is given to users to act on the contents of the created docs and then the quiz is closed and any attempts to save the information further by people or group working on it would be restricted with a user friendly message.
Step 2 : Open up Google drive and go to 'my drive'.
Step 3 : Open up the link in the mail pointing to the application developed.
Step 4 : Page redirected to a welcome screen for installation of the Google App for proceed confirmation.
Step 5 : Post installation refresh the drive contents and this app would be visible in the list of your installed apps.
Step 6 : Click on the application to start it.
Step 7 : After application completes the run, the contents created by the application should be visible in the google drive.
Step 8 : The created docs can be worked upon and saved.
Step 9 : Options in the application provide you with the information for next steps like for eg: publish, so that the application is visible to selected people in the google drive n/w.
Step 10 : A person with the persona of student would be able to view the published contents on their login and act on the same.
Step 11 : A time slot is given to users to act on the contents of the created docs and then the quiz is closed and any attempts to save the information further by people or group working on it would be restricted with a user friendly message.
What are Key concepts : App script & google drive
- App script works on google drive and also provides ability to call external services via apis.
- Code can be written in a browser using the url script.google.com.
- The code script goes as part of the app and provides all the functions for it.
- The editor is equipped with basic editor functionality along with auto complete feature.
- Also google app script apps can be deployed as a web application.
- Works on exposing web end points for the business logic.
- Deploy and run the application as end user rater than developer the developed it.
- Restrict and control access to the app for a particular domain.
- Implement a method called doGet based on servlet programming and return the contents post processing.
What are salient features of Google drive sdk?
- Integrate with drive UI.
- Build web application by the above process.
- Install via OAuth 2 drive.install scope for eg: an email link or via Chrome app store.
What is the sdk app lifecycle :
- Click on the install invokes the web app and introduces a parameter called state.
- App script kicks off its execution of the business logic and uses drive app Api to read from google drive and write to it.
What are the steps to get the drive sdk integration working?
- Enable the drive sdk service from developer console in active services of developer console.
- Click on Drive sdk to get the complete set of settings - important ones are 'open url', 'register default mime types' & 'create with' to let users create documents.
What are the advantages?
- Linking of two application via google platform and no downloads.
- Enablement of app being mobile friendly by a single click.
What are nice points about latest drive services?
- New features - change ownership of file or folder and change default sharing of document to a particular domain.
- Powerful search functionality & simpler code for receiving files and folders.
What is being restricted as of now on google drive service?
No longer expose email addresses in order to prevent security lapses.
No longer expose email addresses in order to prevent security lapses.
PS: All excerpts are taken from Google I/O Sessions 2013 and bundled into an easily understandable structure.
No comments:
Post a Comment