Gdata/Docs.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Gdata
- Subpackage
- Docs
- Version
- $Id$
\Zend_Gdata_Docs
- Parent(s)
- \Zend_Gdata < \Zend_Gdata_App
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Link
- http://code.google.com/apis/documents/
Constants
Properties
$SUPPORTED_FILETYPES = array('TXT' => 'text/plain', 'CSV' => 'text/csv', 'TSV' => 'text/tab-separated-values', 'TAB' => 'text/tab-separated-values', 'HTML' => 'text/html', 'HTM' => 'text/html', 'DOC' => 'application/msword', 'ODS' => 'application/vnd.oasis.opendocument.spreadsheet', 'ODT' => 'application/vnd.oasis.opendocument.text', 'RTF' => 'application/rtf', 'SXW' => 'application/vnd.sun.xml.writer', 'XLS' => 'application/vnd.ms-excel', 'XLSX' => 'application/vnd.ms-excel', 'PPT' => 'application/vnd.ms-powerpoint', 'PPS' => 'application/vnd.ms-powerpoint')
array('TXT' => 'text/plain', 'CSV' => 'text/csv', 'TSV' => 'text/tab-separated-values', 'TAB' => 'text/tab-separated-values', 'HTML' => 'text/html', 'HTM' => 'text/html', 'DOC' => 'application/msword', 'ODS' => 'application/vnd.oasis.opendocument.spreadsheet', 'ODT' => 'application/vnd.oasis.opendocument.text', 'RTF' => 'application/rtf', 'SXW' => 'application/vnd.sun.xml.writer', 'XLS' => 'application/vnd.ms-excel', 'XLSX' => 'application/vnd.ms-excel', 'PPT' => 'application/vnd.ms-powerpoint', 'PPS' => 'application/vnd.ms-powerpoint')
Details- Type
- n/a
Methods
__construct(\Zend_Http_Client $client = null, string $applicationId = 'MyCompany-MyApp-1.0') : void
Create Gdata_Docs object
Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | (optional) The HTTP client to use when
|
$applicationId | string | The identity of the app in the form of Company-AppName-Version |
createFolder(string $folderName, string | null $folderResourceId = null) : \Zend_Gdata_Entry
Creates a new folder in Google Docs
Name | Type | Description |
---|---|---|
$folderName | string | The folder name to create |
$folderResourceId | string | null | The parent folder to create it in
|
Type | Description |
---|---|
\Zend_Gdata_Entry | The folder entry created. |
- Todo
- ZF-8732: This should return a *subclass* of Zend_Gdata_Entry, but the appropriate type doesn't exist yet.
getDoc(string $docId, string $docType) : \Zend_Gdata_Docs_DocumentListEntry
Retreive entry object representing a single document.
Name | Type | Description |
---|---|---|
$docId | string | The URL key for the document. Examples: dcmg89gw_62hfjj8m, pKq0CzjiF3YmGd0AIlHKqeg |
$docType | string | The type of the document as used in the Google Document List URLs. Examples: document, spreadsheet, presentation |
Type | Description |
---|---|
\Zend_Gdata_Docs_DocumentListEntry |
getDocument(string $id) : void
Retreive entry object for the desired word processing document.
Name | Type | Description |
---|---|---|
$id | string | The URL id for the document. Example: dcmg89gw_62hfjj8m |
getDocumentListEntry(mixed $location = null) : \Zend_Gdata_Docs_DocumentListEntry
Retreive entry object representing a single document.
Name | Type | Description |
---|---|---|
$location | mixed | The location for the entry, as a URL or Query |
Type | Description |
---|---|
\Zend_Gdata_Docs_DocumentListEntry |
getDocumentListFeed(mixed $location = null) : \Zend_Gdata_Docs_DocumentListFeed
Retreive feed object containing entries for the user's documents.
Name | Type | Description |
---|---|---|
$location | mixed | The location for the feed, as a URL or Query |
Type | Description |
---|---|
\Zend_Gdata_Docs_DocumentListFeed |
getPresentation(string $id) : void
Retreive entry object for the desired presentation.
Name | Type | Description |
---|---|---|
$id | string | The URL id for the document. Example: dcmg89gw_21gtrjcn |
getSpreadsheet(string $id) : void
Retreive entry object for the desired spreadsheet.
Name | Type | Description |
---|---|---|
$id | string | The URL id for the document. Example: pKq0CzjiF3YmGd0AIlHKqeg |
insertDocument(mixed $data, string $uri, string $className = 'Zend_Gdata_Docs_DocumentListEntry') : \Zend_Gdata_Docs_DocumentListEntry
Inserts an entry to a given URI and returns the response as an Entry.
Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_Docs_DocumentListEntry or media
|
$uri | string | POST URI |
$className | string | (optional) The class of entry to be returned.
|
Type | Description |
---|---|
\Zend_Gdata_Docs_DocumentListEntry | The entry returned by the service after insertion. |
lookupMimeType(string $fileExtension) : string
Looks up the mime type based on the file name extension. For example, calling this method with 'csv' would return 'text/comma-separated-values'. The Mime type is sent as a header in the upload HTTP POST request.
Name | Type | Description |
---|---|---|
$fileExtension | string |
Type | Description |
---|---|
string | The mime type to be sent to the server to tell it how the multipart mime data should be interpreted. |
uploadFile(string $fileLocation, string $title = null, string $mimeType = null, string $uri = null) : \Zend_Gdata_Docs_DocumentListEntry
Upload a local file to create a new Google Document entry.
Name | Type | Description |
---|---|---|
$fileLocation | string | The full or relative path of the file to be uploaded. |
$title | string | The name that this document should have on the
|
$mimeType | string | Describes the type of data which is being sent to the server. This must be one of the accepted mime types which are enumerated in SUPPORTED_FILETYPES. |
$uri | string | (optional) The URL to which the upload should be
|
Type | Description |
---|---|
\Zend_Gdata_Docs_DocumentListEntry | The entry for the newly created Google Document. |