SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Google Drive and the
Google Drive SDK
Building Drive apps
Abdelhalim Lagrid
Google Developer Group, Algiers
1
Introduction :
One of Cloud google’s products : lunched in 2012 ..known by Google
Drive API .
What is Google Drive?
Yea, some marketing :)
2222
Access Anywhere
Google Drive is everywhere you are -- on the
web, in your home, at the office, and on the go.
So wherever you are, your stuff is just...there.
Ready to go, ready to share.
Install it on:
PC, Mac, Android, iOS
Store your files in a safe place
Things happen. Your phone goes for a swim.
Your laptop takes an infinite snooze.
No matter what happens to your devices, your
files are safely stored in Google Drive.
Powerful search
Google Drive can search keywords
in your files -- even the text in
pictures -- to help you quickly find
what you're looking for.
View anything
When a coworker shares a file with
you, you may not have the supported
software on your computer. With
Google Drive you can open and view
over 35 file types directly in the
browser.
Access to a world of apps!
Google Drive works with the apps
that make you more efficient.
Choose from a growing set of
productivity applications, integrated
right into your Drive.
Google Drive SDK
Why integrate with Google Drive?
Drive SDK opportunity
Extensive Reach Effortless Integration
Put your app in front of millions of
users with billions of files
Get the best of Google Drive's sharing
capabilities, storage capacity and user
identity management so you can focus
on your app
++
Drive SDK features
Drive
• Create, Read, List, Manage files through the API
• Search, sharing and revisions
Drive Web UI
• Open files and docs with your app directly from Drive
Integrating with Google Drive
Getting Started
Steps for integrating your app w/ Drive
Prerequisites:
• Create a project in the Google APIs Console
• Enable the Drive API
• Create OAuth 2.0 credentials
Integration steps:
• Auth with OAuth 2.0 [& OpenID Connect]
• Write code for opening / saving / managing files
OAuth 2.0
Introduction
A cool tool...
OAuth 2.0 Playground
Integrating with Google Drive
Handling Authorization for Web apps
Python
Authorization
Using OAuth 2.0 - Redirecting users to the Grant screen
decorator = OAuth2Decorator(client_id=settings.CLIENT_ID,
client_secret=settings.CLIENT_SECRET,
scope=settings.SCOPE,
user_agent='we-cloud')
class Documents(webapp.RequestHandler):
@decorator.oauth_required
def get(self):
user = users.get_current_user()
if user:
service = build('drive', 'v2', http=decorator.http())
Integrating with Google Drive
Interacting with Drive files
Python
Instantiating the Drive service Object
# Here is the Drive service
service = build('drive', 'v2', http=decorator.http())
Python
Creating Folders
folder = {
'title': self.request.get('project[name]'),
'mimeType': 'application/vnd.google-apps.folder'
}
created_folder = service.files().insert(body=folder).execute()
projectcollectionid = created_folder['id']
Python
Creating Files
mimetype = 'application/vnd.google-apps.' + self.request.get('doc[type]')
document = {
'title': self.request.get('doc[name]'),
'mimeType': mimetype
}
if projectcollectionid:
document['parents'] = [{'id': projectcollectionid}]
created_document = service.files().insert(body=document).execute()
resourceid = created_document['id']
Python
Sharing Files
#Share the file with other members
new_permission = {
'value': email,
'type': 'user',
'role': 'writer'
}
service.permissions().insert(fileId=fileid, body=new_permission).execute()
Python
Searching for files
def retrieve_all_files(service,query):
result = []
page_token = None
param = {}
param['q'] = "fullText contains '"+ query + "'"
param['fields'] = "items(id,parents/id)"
while True:
try:
if page_token:
param['pageToken'] = page_token
files = service.files().list(**param).execute()
result.extend(files['items'])
page_token = files.get('nextPageToken')
if not page_token:
break
except errors.HttpError, error:
Integrating with Google Drive
Adding the Drive Web-UI Integration
UI Integration - "Create"
UI Integration - "Open with"
Distribution - Chrome Web Store
Steps for adding Drive UI integration
Prerequisites:
• Create a Chrome Web Store listing (Painful !)
• Install the application from the CWS
• Enable and configure the Drive SDK in the Google APIs Console
Integration steps:
• Support OAuth 2.0 server-side flow
• Read action and file ID from URL parameter
JSON
Passing context on open & create
What happens when somebody launches your app from Drive?
{
"action" : "create",
"parentId" : "0ADK06pfg"
}
{
"action" : "open",
"ids" : ["0Bz0bd"]
}
URL
https://www.yourapp.com/drive?code=<authorization code>&state=<JSON>
Create actions
Open actions
Integrating with Google Drive
The Google Picker
UI Integration - Embedded file picker
JS
Embedding the picker
google.setOnLoadCallback(createPicker);
google.load('picker', '1');
var view = new google.picker.View(google.picker.ViewId.DOCS);
view.setMimeTypes("image/png,image/jpeg,image/jpg");
function createPicker() {
picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
.setAppId(YOUR_APP_ID)
.addView(view)
.setCallback(pickerCallback)
.build();
picker.setVisible(true);
JS
Handling picker selections
// A simple callback implementation.
function pickerCallback(data) {
if (data.action == google.picker.Action.PICKED) {
var fileId = data.docs[0].id;
alert('The user selected: ' + fileId);
}
}
Other features
• Resumable upload & download
• Indexable text
• Search!
• Conversions to native Google Documents
• Export of native Google Documents in many formats
• OCR
• Revisions
• List installed apps
• Copy files, Trash files, Touch files
• User Permissions
• Shortcuts
o Auto-generated MIME type
o Contentless
Other Features / tips & tricks
<Thank You!>
http://developers.google.com/drive
h.lagrid@gmail.com
google drive

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignIntroduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignGreg Quinlivan
 
Google drive
Google driveGoogle drive
Google driveTeddmosby
 
Lapin rs 2012 gd työpaja english
Lapin rs 2012 gd työpaja englishLapin rs 2012 gd työpaja english
Lapin rs 2012 gd työpaja englishJuha Paananen
 
Google docs m
Google docs m Google docs m
Google docs m u2903478
 
Extending Google Apps/Spreadsheet using Google Apps Script
Extending Google Apps/Spreadsheet using Google Apps ScriptExtending Google Apps/Spreadsheet using Google Apps Script
Extending Google Apps/Spreadsheet using Google Apps ScriptDipali Vyas
 
jQuery 1.9 and 2.0 - Present and Future
jQuery 1.9 and 2.0 - Present and FuturejQuery 1.9 and 2.0 - Present and Future
jQuery 1.9 and 2.0 - Present and FutureRichard Worth
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.jsVioletta Villani
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Hendrik Ebbers
 
Get More Out Of Google Docs
Get More Out Of Google DocsGet More Out Of Google Docs
Get More Out Of Google Docsbuggeen
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerRob Dodson
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeSession Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeRick Van Rousselt
 
Introduction Dojo Toolkit & IBM Lotus Domino
Introduction Dojo Toolkit & IBM Lotus DominoIntroduction Dojo Toolkit & IBM Lotus Domino
Introduction Dojo Toolkit & IBM Lotus DominoRolf Kremer
 
Intro to jQuery @ Startup Institute
Intro to jQuery @ Startup InstituteIntro to jQuery @ Startup Institute
Intro to jQuery @ Startup InstituteRafael Gonzaque
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13MongoDB
 

Was ist angesagt? (16)

Introduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignIntroduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe Assign
 
Google drive
Google drive Google drive
Google drive
 
Google drive
Google driveGoogle drive
Google drive
 
Lapin rs 2012 gd työpaja english
Lapin rs 2012 gd työpaja englishLapin rs 2012 gd työpaja english
Lapin rs 2012 gd työpaja english
 
Google docs m
Google docs m Google docs m
Google docs m
 
Extending Google Apps/Spreadsheet using Google Apps Script
Extending Google Apps/Spreadsheet using Google Apps ScriptExtending Google Apps/Spreadsheet using Google Apps Script
Extending Google Apps/Spreadsheet using Google Apps Script
 
Mdst 3559-02-10-jquery
Mdst 3559-02-10-jqueryMdst 3559-02-10-jquery
Mdst 3559-02-10-jquery
 
jQuery 1.9 and 2.0 - Present and Future
jQuery 1.9 and 2.0 - Present and FuturejQuery 1.9 and 2.0 - Present and Future
jQuery 1.9 and 2.0 - Present and Future
 
Level up apps and websites with vue.js
Level up  apps and websites with vue.jsLevel up  apps and websites with vue.js
Level up apps and websites with vue.js
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
Get More Out Of Google Docs
Get More Out Of Google DocsGet More Out Of Google Docs
Get More Out Of Google Docs
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeSession Slides from DEVintersection Europe
Session Slides from DEVintersection Europe
 
Introduction Dojo Toolkit & IBM Lotus Domino
Introduction Dojo Toolkit & IBM Lotus DominoIntroduction Dojo Toolkit & IBM Lotus Domino
Introduction Dojo Toolkit & IBM Lotus Domino
 
Intro to jQuery @ Startup Institute
Intro to jQuery @ Startup InstituteIntro to jQuery @ Startup Institute
Intro to jQuery @ Startup Institute
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13
 

Ähnlich wie google drive

google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdkfirenze-gtug
 
Ict google drive report
Ict google drive reportIct google drive report
Ict google drive reportSEANROMMEL
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptArun Nagarajan
 
Cloud computing
Cloud computingCloud computing
Cloud computingJo Esc
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive APIJomar Tigcal
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackwesley chun
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to presentwesley chun
 
Build with ALL of Google Cloud
Build with ALL of Google CloudBuild with ALL of Google Cloud
Build with ALL of Google Cloudwesley chun
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewwesley chun
 
CloudOps evening presentation from Google
CloudOps evening presentation from GoogleCloudOps evening presentation from Google
CloudOps evening presentation from GoogleAlistair Croll
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloudwesley chun
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...e-Legion
 
Google Cloud for Data Crunchers - Strata Conf 2011
Google Cloud for Data Crunchers - Strata Conf 2011Google Cloud for Data Crunchers - Strata Conf 2011
Google Cloud for Data Crunchers - Strata Conf 2011Patrick Chanezon
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIswesley chun
 
Cloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google CloudCloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google Cloudwesley chun
 
Google Enterprise Cloud Platform - Resources & $2000 credit!
Google Enterprise Cloud Platform - Resources & $2000 credit!Google Enterprise Cloud Platform - Resources & $2000 credit!
Google Enterprise Cloud Platform - Resources & $2000 credit!BigDataCloud
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIswesley chun
 

Ähnlich wie google drive (20)

google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
 
Ict google drive report
Ict google drive reportIct google drive report
Ict google drive report
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps Script
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive API
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hack
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
 
Build with ALL of Google Cloud
Build with ALL of Google CloudBuild with ALL of Google Cloud
Build with ALL of Google Cloud
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
CloudOps evening presentation from Google
CloudOps evening presentation from GoogleCloudOps evening presentation from Google
CloudOps evening presentation from Google
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
Google Cloud for Data Crunchers - Strata Conf 2011
Google Cloud for Data Crunchers - Strata Conf 2011Google Cloud for Data Crunchers - Strata Conf 2011
Google Cloud for Data Crunchers - Strata Conf 2011
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Cloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google CloudCloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google Cloud
 
Google Enterprise Cloud Platform - Resources & $2000 credit!
Google Enterprise Cloud Platform - Resources & $2000 credit!Google Enterprise Cloud Platform - Resources & $2000 credit!
Google Enterprise Cloud Platform - Resources & $2000 credit!
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 

Kürzlich hochgeladen

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 

Kürzlich hochgeladen (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

google drive

  • 1.
  • 2. Google Drive and the Google Drive SDK Building Drive apps Abdelhalim Lagrid Google Developer Group, Algiers 1
  • 3. Introduction : One of Cloud google’s products : lunched in 2012 ..known by Google Drive API .
  • 4. What is Google Drive? Yea, some marketing :) 2222
  • 5. Access Anywhere Google Drive is everywhere you are -- on the web, in your home, at the office, and on the go. So wherever you are, your stuff is just...there. Ready to go, ready to share. Install it on: PC, Mac, Android, iOS
  • 6. Store your files in a safe place Things happen. Your phone goes for a swim. Your laptop takes an infinite snooze. No matter what happens to your devices, your files are safely stored in Google Drive.
  • 7. Powerful search Google Drive can search keywords in your files -- even the text in pictures -- to help you quickly find what you're looking for.
  • 8. View anything When a coworker shares a file with you, you may not have the supported software on your computer. With Google Drive you can open and view over 35 file types directly in the browser.
  • 9. Access to a world of apps! Google Drive works with the apps that make you more efficient. Choose from a growing set of productivity applications, integrated right into your Drive.
  • 10. Google Drive SDK Why integrate with Google Drive?
  • 11. Drive SDK opportunity Extensive Reach Effortless Integration Put your app in front of millions of users with billions of files Get the best of Google Drive's sharing capabilities, storage capacity and user identity management so you can focus on your app ++
  • 12. Drive SDK features Drive • Create, Read, List, Manage files through the API • Search, sharing and revisions Drive Web UI • Open files and docs with your app directly from Drive
  • 13. Integrating with Google Drive Getting Started
  • 14. Steps for integrating your app w/ Drive Prerequisites: • Create a project in the Google APIs Console • Enable the Drive API • Create OAuth 2.0 credentials Integration steps: • Auth with OAuth 2.0 [& OpenID Connect] • Write code for opening / saving / managing files
  • 16. A cool tool... OAuth 2.0 Playground
  • 17. Integrating with Google Drive Handling Authorization for Web apps
  • 18. Python Authorization Using OAuth 2.0 - Redirecting users to the Grant screen decorator = OAuth2Decorator(client_id=settings.CLIENT_ID, client_secret=settings.CLIENT_SECRET, scope=settings.SCOPE, user_agent='we-cloud') class Documents(webapp.RequestHandler): @decorator.oauth_required def get(self): user = users.get_current_user() if user: service = build('drive', 'v2', http=decorator.http())
  • 19. Integrating with Google Drive Interacting with Drive files
  • 20. Python Instantiating the Drive service Object # Here is the Drive service service = build('drive', 'v2', http=decorator.http())
  • 21. Python Creating Folders folder = { 'title': self.request.get('project[name]'), 'mimeType': 'application/vnd.google-apps.folder' } created_folder = service.files().insert(body=folder).execute() projectcollectionid = created_folder['id']
  • 22. Python Creating Files mimetype = 'application/vnd.google-apps.' + self.request.get('doc[type]') document = { 'title': self.request.get('doc[name]'), 'mimeType': mimetype } if projectcollectionid: document['parents'] = [{'id': projectcollectionid}] created_document = service.files().insert(body=document).execute() resourceid = created_document['id']
  • 23. Python Sharing Files #Share the file with other members new_permission = { 'value': email, 'type': 'user', 'role': 'writer' } service.permissions().insert(fileId=fileid, body=new_permission).execute()
  • 24. Python Searching for files def retrieve_all_files(service,query): result = [] page_token = None param = {} param['q'] = "fullText contains '"+ query + "'" param['fields'] = "items(id,parents/id)" while True: try: if page_token: param['pageToken'] = page_token files = service.files().list(**param).execute() result.extend(files['items']) page_token = files.get('nextPageToken') if not page_token: break except errors.HttpError, error:
  • 25. Integrating with Google Drive Adding the Drive Web-UI Integration
  • 26. UI Integration - "Create"
  • 27. UI Integration - "Open with"
  • 29. Steps for adding Drive UI integration Prerequisites: • Create a Chrome Web Store listing (Painful !) • Install the application from the CWS • Enable and configure the Drive SDK in the Google APIs Console Integration steps: • Support OAuth 2.0 server-side flow • Read action and file ID from URL parameter
  • 30. JSON Passing context on open & create What happens when somebody launches your app from Drive? { "action" : "create", "parentId" : "0ADK06pfg" } { "action" : "open", "ids" : ["0Bz0bd"] } URL https://www.yourapp.com/drive?code=<authorization code>&state=<JSON> Create actions Open actions
  • 31. Integrating with Google Drive The Google Picker
  • 32. UI Integration - Embedded file picker
  • 33. JS Embedding the picker google.setOnLoadCallback(createPicker); google.load('picker', '1'); var view = new google.picker.View(google.picker.ViewId.DOCS); view.setMimeTypes("image/png,image/jpeg,image/jpg"); function createPicker() { picker = new google.picker.PickerBuilder() .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) .setAppId(YOUR_APP_ID) .addView(view) .setCallback(pickerCallback) .build(); picker.setVisible(true);
  • 34. JS Handling picker selections // A simple callback implementation. function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { var fileId = data.docs[0].id; alert('The user selected: ' + fileId); } }
  • 36. • Resumable upload & download • Indexable text • Search! • Conversions to native Google Documents • Export of native Google Documents in many formats • OCR • Revisions • List installed apps • Copy files, Trash files, Touch files • User Permissions • Shortcuts o Auto-generated MIME type o Contentless Other Features / tips & tricks