Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Gdata_Docs Class Reference

Public Member Functions

 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata_Docs object.
 
 getDocumentListFeed ($location=null)
 Retreive feed object containing entries for the user's documents.
 
 getDocumentListEntry ($location=null)
 Retreive entry object representing a single document.
 
 getDoc ($docId, $docType)
 Retreive entry object representing a single document.
 
 getDocument ($id)
 Retreive entry object for the desired word processing document.
 
 getSpreadsheet ($id)
 Retreive entry object for the desired spreadsheet.
 
 getPresentation ($id)
 Retreive entry object for the desired presentation.
 
 uploadFile ($fileLocation, $title=null, $mimeType=null, $uri=null)
 Upload a local file to create a new Google Document entry.
 
 createFolder ($folderName, $folderResourceId=null)
 Creates a new folder in Google Docs.
 
 insertDocument ($data, $uri, $className='Zend_Gdata_Docs_DocumentListEntry')
 Inserts an entry to a given URI and returns the response as an Entry.
 
- Public Member Functions inherited from Zend_Gdata
 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata object.
 
 getFeed ($location, $className='Zend_Gdata_Feed')
 Retrieve feed as string or object.
 
 getEntry ($location, $className='Zend_Gdata_Entry')
 Retrieve entry as string or object.
 
 performHttpRequest ($method, $url, $headers=array(), $body=null, $contentType=null, $remainingRedirects=null)
 Performs a HTTP request using the specified method.
 
 isAuthenticated ()
 Determines whether service object is authenticated.
 
- Public Member Functions inherited from Zend_Gdata_App
 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 Create Gdata object.
 
 registerPackage ($name)
 Adds a Zend Framework package to the $_registeredPackages array.
 
 getFeed ($uri, $className='Zend_Gdata_App_Feed')
 Retrieve feed as string or object.
 
 getEntry ($uri, $className='Zend_Gdata_App_Entry')
 Retrieve entry as string or object.
 
 getHttpClient ()
 Get the Zend_Http_Client object used for communication.
 
 setHttpClient ($client, $applicationId= 'MyCompany-MyApp-1.0')
 Set the Zend_Http_Client object used for communication.
 
 setMajorProtocolVersion ($value)
 Set the major protocol version that should be used.
 
 getMajorProtocolVersion ()
 Get the major protocol version that is in use.
 
 setMinorProtocolVersion ($value)
 Set the minor protocol version that should be used.
 
 getMinorProtocolVersion ()
 Get the minor protocol version that is in use.
 
 prepareRequest ($method, $url=null, $headers=array(), $data=null, $contentTypeOverride=null)
 Provides pre-processing for HTTP requests to APP services.
 
 performHttpRequest ($method, $url, $headers=null, $body=null, $contentType=null, $remainingRedirects=null)
 Performs a HTTP request using the specified method.
 
 importUrl ($url, $className='Zend_Gdata_App_Feed', $extraHeaders=array())
 Imports the specified URL (non-statically).
 
 get ($uri, $extraHeaders=array())
 GET a URI using client object.
 
 post ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 POST data with client object.
 
 put ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 PUT data with client object.
 
 delete ($data, $remainingRedirects=null)
 DELETE entry with client object.
 
 insertEntry ($data, $uri, $className='Zend_Gdata_App_Entry', $extraHeaders=array())
 Inserts an entry to a given URI and returns the response as a fully formed Entry.
 
 updateEntry ($data, $uri=null, $className=null, $extraHeaders=array())
 Update an entry.
 
 __call ($method, $args)
 Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions.
 
 retrieveAllEntriesForFeed ($feed)
 Retrieve all entries for a feed, iterating through pages as necessary.
 
 enableRequestDebugLogging ($logfile)
 This method enables logging of requests by changing the Zend_Http_Client_Adapter used for performing the requests.
 
 getNextFeed ($feed, $className=null)
 Retrieve next set of results based on a given feed.
 
 getPreviousFeed ($feed, $className=null)
 Retrieve previous set of results based on a given feed.
 
 generateIfMatchHeaderData ($data, $allowWeek)
 Returns the data for an If-Match header based on the current Etag property.
 
 usingObjectMapping ()
 Determine whether service object is using XML to object mapping.
 
 useObjectMapping ($value)
 Enable/disable the use of XML to object mapping.
 

Static Public Member Functions

static lookupMimeType ($fileExtension)
 Looks up the mime type based on the file name extension.
 
- Static Public Member Functions inherited from Zend_Gdata
static import ($uri, $client=null, $className='Zend_Gdata_Feed', $useObjectMapping=true)
 Imports a feed located at $uri.
 
- Static Public Member Functions inherited from Zend_Gdata_App
static setStaticHttpClient (Zend_Http_Client $httpClient)
 Set the static HTTP client instance.
 
static getStaticHttpClient ()
 Gets the HTTP client object.
 
static setHttpMethodOverride ($override=true)
 Toggle using POST instead of PUT and DELETE HTTP methods.
 
static getHttpMethodOverride ()
 Get the HTTP override state.
 
static setGzipEnabled ($enabled=false)
 Toggle requesting gzip encoded responses.
 
static getGzipEnabled ()
 Get the HTTP override state.
 
static getVerboseExceptionMessages ()
 Get whether to use verbose exception messages.
 
static setVerboseExceptionMessages ($verbose)
 Set whether to use verbose exception messages.
 
static setMaxRedirects ($maxRedirects)
 Set the maximum number of redirects to follow during HTTP operations.
 
static getMaxRedirects ()
 Get the maximum number of redirects to follow during HTTP operations.
 
static import ($uri, $client=null, $className='Zend_Gdata_App_Feed', $useObjectMapping=true)
 Imports a feed located at $uri.
 
static importString ($string, $className='Zend_Gdata_App_Feed', $majorProtocolVersion=null, $minorProtocolVersion=null)
 Imports a feed represented by $string.
 
static importFile ($filename, $className='Zend_Gdata_App_Feed', $useIncludePath=false)
 Imports a feed from a file located at $filename.
 

Public Attributes

const DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full'
 
const DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full'
 
const DOCUMENTS_CATEGORY_SCHEMA = 'http://schemas.google.com/g/2005#kind'
 
const DOCUMENTS_CATEGORY_TERM = 'http://schemas.google.com/docs/2007#folder'
 
const AUTH_SERVICE_NAME = 'writely'
 
- Public Attributes inherited from Zend_Gdata
const AUTH_SERVICE_NAME = 'xapi'
 
- Public Attributes inherited from Zend_Gdata_App
const DEFAULT_MAJOR_PROTOCOL_VERSION = 1
 Default major protocol version.
 
const DEFAULT_MINOR_PROTOCOL_VERSION = null
 Default minor protocol version.
 

Protected Attributes

 $_defaultPostUri = self::DOCUMENTS_LIST_FEED_URI
 
- Protected Attributes inherited from Zend_Gdata
 $_defaultPostUri = null
 
 $_registeredPackages
 
 $_httpClient
 
- Protected Attributes inherited from Zend_Gdata_App
 $_httpClient
 
 $_defaultPostUri = null
 
 $_registeredPackages
 
 $_majorProtocolVersion
 Indicates the major protocol version that should be used.
 
 $_minorProtocolVersion
 Indicates the minor protocol version that should be used.
 
 $_useObjectMapping = true
 

Additional Inherited Members

- Static Public Attributes inherited from Zend_Gdata
static $namespaces
 
- Static Protected Attributes inherited from Zend_Gdata
static $_staticHttpClient = null
 

Constructor & Destructor Documentation

__construct (   $client = null,
  $applicationId = 'MyCompany-MyApp-1.0' 
)

Create Gdata_Docs object.

Parameters
Zend_Http_Client$client(optional) The HTTP client to use when when communicating with the Google servers.
string$applicationIdThe identity of the app in the form of Company-AppName-Version

Member Function Documentation

createFolder (   $folderName,
  $folderResourceId = null 
)

Creates a new folder in Google Docs.

Parameters
string$folderNameThe folder name to create
string | null$folderResourceIdThe parent folder to create it in ("folder%3Amy_parent_folder")
Returns
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 (   $docId,
  $docType 
)

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
string$docIdThe URL key for the document. Examples: dcmg89gw_62hfjj8m, pKq0CzjiF3YmGd0AIlHKqeg
string$docTypeThe type of the document as used in the Google Document List URLs. Examples: document, spreadsheet, presentation
Returns
Zend_Gdata_Docs_DocumentListEntry
getDocument (   $id)

Retreive entry object for the desired word processing document.

Parameters
string$idThe URL id for the document. Example: dcmg89gw_62hfjj8m
getDocumentListEntry (   $location = null)

Retreive entry object representing a single document.

Parameters
mixed$locationThe location for the entry, as a URL or Query
Returns
Zend_Gdata_Docs_DocumentListEntry
getDocumentListFeed (   $location = null)

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

Parameters
mixed$locationThe location for the feed, as a URL or Query
Returns
Zend_Gdata_Docs_DocumentListFeed
getPresentation (   $id)

Retreive entry object for the desired presentation.

Parameters
string$idThe URL id for the document. Example: dcmg89gw_21gtrjcn
getSpreadsheet (   $id)

Retreive entry object for the desired spreadsheet.

Parameters
string$idThe URL id for the document. Example: pKq0CzjiF3YmGd0AIlHKqeg
insertDocument (   $data,
  $uri,
  $className = 'Zend_Gdata_Docs_DocumentListEntry' 
)

Inserts an entry to a given URI and returns the response as an Entry.

Parameters
mixed$dataThe 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.
string$uriPOST URI
string$className(optional) The class of entry to be returned. The default is a 'Zend_Gdata_Docs_DocumentListEntry'.
Returns
Zend_Gdata_Docs_DocumentListEntry The entry returned by the service after insertion.
static lookupMimeType (   $fileExtension)
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
string$fileExtension
Returns
string The mime type to be sent to the server to tell it how the multipart mime data should be interpreted.
uploadFile (   $fileLocation,
  $title = null,
  $mimeType = null,
  $uri = null 
)

Upload a local file to create a new Google Document entry.

Parameters
string$fileLocationThe full or relative path of the file to be uploaded.
string$titleThe 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'.
string$mimeTypeDescribes 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.
string$uri(optional) The URL to which the upload should be made. Example: 'https://docs.google.com/feeds/documents/private/full'.
Returns
Zend_Gdata_Docs_DocumentListEntry The entry for the newly created Google Document.

Member Data Documentation

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