google-app-engine


Delete and Rename events in google drive


I am working on a feature for our webapp where we create google drive files from our server
Drive service = getServiceForLoginUser();
com.google.api.services.drive.model.File fileMetadata = new com.google.api.services.drive.model.File();
fileMetadata.setTitle(getDefaultName());
fileMetadata.setMimeType(APPLICATION_VND_GOOGLE_APPS_DRIVE_SDK);
com.google.api.services.drive.model.File.Thumbnail thumbnail = buildThumbnail(driveType);
fileMetadata.setThumbnail(thumbnail);
com.google.api.services.drive.model.File googleFile = service.files().insert(fileMetadata)
.setFields("id")
.execute();
I have configured Drive UI Integration to trigger New and Open URL flows from google drive.I have also published a chrome app with following manifest.
"name" : "classflowtest",
"version" : "3.5",
"manifest_version" : 2,
"icons": {
"128": "icon_128.png"
},
"description" : "description_text",
"container" : "GOOGLE_DRIVE",
"api_console_project_id" : "146081768739",
"gdrive_mime_types": {
"http://drive.google.com/intents/opendrivedoc": [
{
"type": ["image/png", "image/jpeg", "image/gif", "html","application/vnd.google.drive.ext-type.png",
"application/vnd.google.drive.ext-type.jpg","application/vnd.google.drive.ext-type.gif","application/vnd.google.drive.ext-type.html"],
"href": "https://mywebappurl",
"title" : "Open",
"disposition" : "window"
}
]
},
"app" : {
"launch" : {
"web_url" : "mywebappurl"
}
}
So now I can trigger New and Open flows in drive successfully. In New flow I create first a resource in our db and then I create a file in google drive from my application server. So every entry I create in google drive has a representation in our db as well. My issue is now if I rename or delete the file in google drive how do I get those events so that I can make the necessary changes in our DB ?
Check the Changes: list if it can help you. It will lists all the changes in your drive. But is is difficult to filter the results. To get the deleted files, you must specify the includeRemoved parameter to true. So it is easier to get the files if you know its fileID before you rename or delete it.
I found in this SO question that someone use Apps Activity API to solve this problem.
For more information, check this thread.

Related Links

Why am I not seeing my error logs?
Google icon not shown for generation of Entity Endpoint Class
Can't see Drive SDK in Google App Engine console
How to push from google pubsub to a servlet running on google app engine?
Will objectify re-save an unchanged item to datastore
GAE: Serve CSS file dynamically with correct mime type
is possible to share VM or groups of VM with several services in App Engine?
GAE push queue with max_concurrent_requests
How to write to local files on Google app engine managed VM
api for deleting image from google cloud storage buckets
Error: OAuth 2.0 client IDs of GAE app is not working in capedwarf
How do I use Google Datastore MultiQueryBuilder to load all Entities of a Kind?
AppEngine console add custom domain bug?
Google App Engine vs Firebase
Google Cloud SQL DeadlineExceededError when we try commit changes
Upload image to google bucket using jQuery-File-Upload

Categories

HOME
beautifulsoup
ggplot2
redux-form
pda
themes
sh
apiblueprint
spring-data-mongodb
xbee
babeljs
azure-container-service
trac
bing-maps
accessibility
g++
jquery-ui-sortable
heap
stellar.js
favicon
selenium-ide
scrolltop
android-intent
null-pointer
sencha-touch
babel
exit
qliksense
data.stackexchange.com
appirater
nstimer
underscore.js
spotipy
tpm
gitlab-api
powershell-ise
paragraph
clickjacking
mailkit
openwhisk
slacktextviewcontroller
imx6
projects-and-solutions
loading
diacritics
ogc
azure-arm
microsoft-metro
servermanager
lampp
globalize
launchctl
colorbar
dt
pocketsphinx-android
testrail
rocks
omxplayer
webjars
envi
tooleap
avspeechsynthesizer
nss
hadoop-partitioning
halcon
invoke-sqlcmd
crouton-os
sapi
boomerang
avisynth
dllimport
rate-limiting
omnifaces
kubuntu
mmwormhole
document-repository
nodelist
viewer
grails-domain-class
wxformbuilder
radiant
extjs2
git-repo
gwt-openlayers
ie8-compatibility-mode
pclzip
mysql-error-2013
apache-abdera
cakephp-1.2
luabind
mysql-error-1205
django-paypal
delimited-text
blender-2.49
data-mapping
wcf-proxy

Resources

Encrypt Message