API Documentation

Gdata/Docs.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Gdata
subpackage
Docs
version
$Id: Docs.php 20112 2010-01-07 02:39:32Z tjohns $
Classes
Zend_Gdata_Docs

Description

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.

Zend_Gdata_Docs

Extends from
Zend_Gdata
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
link
http://code.google.com/apis/documents/
package
Zend_Gdata
subpackage
Docs
Constants
DOCUMENTS_LIST_FEED_URI
DOCUMENTS_FOLDER_FEED_URI
DOCUMENTS_CATEGORY_SCHEMA
DOCUMENTS_CATEGORY_TERM
AUTH_SERVICE_NAME
Properties
$_defaultPostUri
$SUPPORTED_FILETYPES
Methods
__construct
lookupMimeType
getDocumentListFeed
getDocumentListEntry
getDoc
getDocument
getSpreadsheet
getPresentation
uploadFile
createFolder
insertDocument

Description

Service class for interacting with the Google Document List data API

Constants

DOCUMENTS_LIST_FEED_URI

 DOCUMENTS_LIST_FEED_URI = 'http://docs.google.com/feeds/documents/private/full'

Details

value
http://docs.google.com/feeds/documents/private/full

DOCUMENTS_FOLDER_FEED_URI

 DOCUMENTS_FOLDER_FEED_URI = 'http://docs.google.com/feeds/folders/private/full'

Details

value
http://docs.google.com/feeds/folders/private/full

DOCUMENTS_CATEGORY_SCHEMA

 DOCUMENTS_CATEGORY_SCHEMA = 'http://schemas.google.com/g/2005#kind'

Details

value
http://schemas.google.com/g/2005#kind

DOCUMENTS_CATEGORY_TERM

 DOCUMENTS_CATEGORY_TERM = 'http://schemas.google.com/docs/2007#folder'

Details

value
http://schemas.google.com/docs/2007#folder

AUTH_SERVICE_NAME

 AUTH_SERVICE_NAME = 'writely'

Details

value
writely

Properties

$SUPPORTED_FILETYPES

 $SUPPORTED_FILETYPES = 'array'

Details

visibility
private
default
array
final
false
static
true

$_defaultPostUri

 $_defaultPostUri = 'self'

Details

visibility
protected
default
self
final
false
static
false

Methods

__construct

__construct( Zend_Http_Client $client = null, string $applicationId = MyCompany-MyApp-1.0 ) :

Create Gdata_Docs object

Arguments
$client
Zend_Http_Client
(optional) The HTTP client to use when when communicating with the Google servers.
$applicationId
string
The identity of the app in the form of Company-AppName-Version
Details
visibility
public
final
false
static
false

createFolder

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

Creates a new folder in Google Docs

Arguments
$folderName
string
The folder name to create
$folderResourceId
stringnull
The parent folder to create it in ("folder%3Amy_parent_folder")
Output
Zend_Gdata_Entry
The folder entry created.
Details
visibility
public
final
false
static
false
todo
ZF-8732: This should return a *subclass* of Zend_Gdata_Entry, but the appropriate type doesn't exist yet.

getDoc

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

Arguments
$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
Details
visibility
public
final
false
static
false

getDocument

getDocument( string $id ) :

Retreive entry object for the desired word processing document.

Arguments
$id
string
The URL id for the document. Example: dcmg89gw_62hfjj8m
Details
visibility
public
final
false
static
false

getDocumentListEntry

getDocumentListEntry( mixed $location = null ) : Zend_Gdata_Docs_DocumentListEntry

Retreive entry object representing a single document.

Arguments
$location
mixed
The location for the entry, as a URL or Query
Details
visibility
public
final
false
static
false

getDocumentListFeed

getDocumentListFeed( mixed $location = null ) : Zend_Gdata_Docs_DocumentListFeed

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

Arguments
$location
mixed
The location for the feed, as a URL or Query
Details
visibility
public
final
false
static
false

getPresentation

getPresentation( string $id ) :

Retreive entry object for the desired presentation.

Arguments
$id
string
The URL id for the document. Example: dcmg89gw_21gtrjcn
Details
visibility
public
final
false
static
false

getSpreadsheet

getSpreadsheet( string $id ) :

Retreive entry object for the desired spreadsheet.

Arguments
$id
string
The URL id for the document. Example: pKq0CzjiF3YmGd0AIlHKqeg
Details
visibility
public
final
false
static
false

insertDocument

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.

Arguments
$data
mixed
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.
$uri
string
POST URI
$className
string
(optional) The class of entry to be returned. The default is a 'Zend_Gdata_Docs_DocumentListEntry'.
Output
Zend_Gdata_Docs_DocumentListEntry
The entry returned by the service after insertion.
Details
visibility
public
final
false
static
false

lookupMimeType

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.

Arguments
$fileExtension
string
Output
string
The mime type to be sent to the server to tell it how the multipart mime data should be interpreted.
Details
visibility
public
final
false
static
true

uploadFile

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.

Arguments
$fileLocation
string
The full or relative path of the file to be uploaded.
$title
string
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'.
$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 made. Example: 'http://docs.google.com/feeds/documents/private/full'.
Output
Zend_Gdata_Docs_DocumentListEntry
The entry for the newly created Google Document.
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.