Google Docs API - Zend gData - How to find the URI of a collection

By : achi
Source: Stackoverflow.com
Question!

I have an entry of type Zend_Gdata_App_Entry,

This entry is a collection/folder and i try to get the URI of this folder,

I know that the URI is an URL but the id of the entry is an URL also so what is the difference?

I would like to do this :

// Instantiate a FolderQuery object to retrieve the content of the folder.
FolderQuery contentQuery = new FolderQuery(folder.ResourceId);

URI = contentQuery.Uri

But not in .NET but using the Zend gdata framework in PHP

Thank you !

By : achi


Answers

In GData the self URI and the ID are relatively similar usually. So if you have one or the other it really doesn't matter much. The ResourceID is a little different since they are not URLs but are in the form folder:1234. They can be easily constructed if you have the number after the folder: prefix. If you look closely the ID of the document cis constructed from the resource ID. There are on practical differences for all these, they are mostly needed by the GData protocol.

Anyways, once you have the ID or the ressource ID of the folder you cold list its content by using the following URL:

https://docs.google.com/feeds/default/private/full/folder:1234/contents

Just make sure you replace folder:1234 with he actual Ressource ID of the folder.

Then you could use that URL in the method Zend_Gdata_Docs.getDocumentListFeed(String location) as the location attribute. That will get you a Document Feed containing all the elements inside the folder.

By : Nivco


Maybe this will help you. Creating subfolder and then upload file to a new folder:

$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$docs = new Zend_Gdata_Docs($client);

$parentFolder = 'folder:[folderid]';    

$newFolder = $docs-
By : shamania


This video can help you solving your question :)
By: admin