Gdata/Docs.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
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

Package: Zend_Gdata\Docs
Service class for interacting with the Google Document List data API
As the Google data API protocol is based upon the Atom Publishing Protocol (APP), Gdata functionality extends the appropriate Zend_Gdata_App classes
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

>VConstant  DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full'
>VConstant  DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full'
>VConstant  DOCUMENTS_CATEGORY_SCHEMA = 'http://schemas.google.com/g/2005#kind'
>VConstant  DOCUMENTS_CATEGORY_TERM = 'http://schemas.google.com/docs/2007#folder'
>VConstant  AUTH_SERVICE_NAME = 'writely'

Properties

>VPropertyprivate$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')
static
Default valuearray('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
>VPropertyprotected$_defaultPostUri = self::DOCUMENTS_LIST_FEED_URI
Default valueself::DOCUMENTS_LIST_FEED_URIDetails
Type
n/a

Methods

methodpublic__construct(\Zend_Http_Client $client = null, string $applicationId = 'MyCompany-MyApp-1.0') : void

Create Gdata_Docs object

Parameters
NameTypeDescription
$client\Zend_Http_Client

(optional) The HTTP client to use when

     when communicating with the Google servers.
$applicationIdstring

The identity of the app in the form of Company-AppName-Version

methodpubliccreateFolder(string $folderName, string | null $folderResourceId = null) : \Zend_Gdata_Entry

Creates a new folder in Google Docs

Parameters
NameTypeDescription
$folderNamestring

The folder name to create

$folderResourceIdstring | null

The parent folder to create it in

   ("folder%3Amy_parent_folder")
Returns
TypeDescription
\Zend_Gdata_EntryThe folder entry created.
Details
Todo
ZF-8732: This should return a *subclass* of Zend_Gdata_Entry, but the appropriate type doesn't exist yet.  
methodpublicgetDoc(string $docId, string $docType) : \Zend_Gdata_Docs_DocumentListEntry

Retreive entry object representing a single document.

This method builds the URL where this item is stored using the type and the id of the document.
Parameters
NameTypeDescription
$docIdstring

The URL key for the document. Examples: dcmg89gw_62hfjj8m, pKq0CzjiF3YmGd0AIlHKqeg

$docTypestring

The type of the document as used in the Google Document List URLs. Examples: document, spreadsheet, presentation

Returns
TypeDescription
\Zend_Gdata_Docs_DocumentListEntry
methodpublicgetDocument(string $id) : void

Retreive entry object for the desired word processing document.

Parameters
NameTypeDescription
$idstring

The URL id for the document. Example: dcmg89gw_62hfjj8m

methodpublicgetDocumentListEntry(mixed $location = null) : \Zend_Gdata_Docs_DocumentListEntry

Retreive entry object representing a single document.

Parameters
NameTypeDescription
$locationmixed

The location for the entry, as a URL or Query

Returns
TypeDescription
\Zend_Gdata_Docs_DocumentListEntry
methodpublicgetDocumentListFeed(mixed $location = null) : \Zend_Gdata_Docs_DocumentListFeed

Retreive feed object containing entries for the user's documents.

Parameters
NameTypeDescription
$locationmixed

The location for the feed, as a URL or Query

Returns
TypeDescription
\Zend_Gdata_Docs_DocumentListFeed
methodpublicgetPresentation(string $id) : void

Retreive entry object for the desired presentation.

Parameters
NameTypeDescription
$idstring

The URL id for the document. Example: dcmg89gw_21gtrjcn

methodpublicgetSpreadsheet(string $id) : void

Retreive entry object for the desired spreadsheet.

Parameters
NameTypeDescription
$idstring

The URL id for the document. Example: pKq0CzjiF3YmGd0AIlHKqeg

methodpublicinsertDocument(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.

Parameters
NameTypeDescription
$datamixed

The Zend_Gdata_Docs_DocumentListEntry or media

    source to post. If it is a DocumentListEntry, the mediaSource
    should already have been set. If $data is a mediaSource, it
    should have the correct slug header and mime type.
$uristring

POST URI

$classNamestring

(optional) The class of entry to be returned.

    The default is a 'Zend_Gdata_Docs_DocumentListEntry'.
Returns
TypeDescription
\Zend_Gdata_Docs_DocumentListEntryThe entry returned by the service after insertion.
methodpubliclookupMimeType(string $fileExtension) : string
static

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.

Parameters
NameTypeDescription
$fileExtensionstring
Returns
TypeDescription
stringThe mime type to be sent to the server to tell it how the multipart mime data should be interpreted.
methodpublicuploadFile(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.

Parameters
NameTypeDescription
$fileLocationstring

The full or relative path of the file to be uploaded.

$titlestring

The name that this document should have on the

    server. If set, the title is used as the slug header in the
    POST request. If no title is provided, the location of the
    file will be used as the slug header in the request. If no
    mimeType is provided, this method attempts to determine the
    mime type based on the slugHeader by looking for .doc,
    .csv, .txt, etc. at the end of the file name.
    Example value: 'test.doc'.
$mimeTypestring

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.

$uristring

(optional) The URL to which the upload should be

    made.
    Example: 'https://docs.google.com/feeds/documents/private/full'.
Returns
TypeDescription
\Zend_Gdata_Docs_DocumentListEntryThe entry for the newly created Google Document.
Documentation was generated by phpDocumentor 2.2.0 .