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
link | http://code.google.com/apis/documents/ |
---|---|
category | Zend |
package | Zend_Gdata |
subpackage | Docs |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Gdata |
__call(string $method, array $args)
string
The method name being called
array
The arguments passed to the call
\Zend_Gdata_App_Exception |
---|
__construct(\Zend_Http_Client $client= null
, string $applicationId= 'MyCompany-MyApp-1.0'
)
inherited_from | \Zend_Gdata::__construct() |
---|
\Zend_Http_Client
(optional) The HTTP client to use when when communicating with the Google servers.
string
The identity of the app in the form of Company-AppName-Version
__construct(\Zend_Http_Client $client= null
, string $applicationId= 'MyCompany-MyApp-1.0'
)
\Zend_Http_Client
string
createFolder(string $folderName, string|null $folderResourceId = null
) : \Zend_Gdata_Entry
todo | ZF-8732: This should return a *subclass* of Zend_Gdata_Entry, but the appropriate type doesn't exist yet. |
---|
string
The folder name to create
string
null
The parent folder to create it in ("folder%3Amy_parent_folder")
\Zend_Gdata_Entry
The folder entry created.delete(mixed $data, $remainingRedirects = null
) : void
mixed
The Zend_Gdata_App_Entry or URL to delete
\Zend_Gdata_App_Exception |
|
---|---|
\Zend_Gdata_App_HttpException |
|
\Zend_Gdata_App_InvalidArgumentException |
enableRequestDebugLogging(string $logfile)
NOTE: This will not work if you have customized the adapter already to use a proxy server or other interface.
string
The logfile to use when logging the requests
generateIfMatchHeaderData($data, $allowWeek) : string | null
string
null
$dataget(string $uri, array $extraHeaders = array()
) : \Zend_Http_Response
string
GET URI
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_HttpException |
---|
\Zend_Http_Response
getDoc(string $docId, string $docType) : \Zend_Gdata_Docs_DocumentListEntry
This method builds the URL where this item is stored using the type and the id of the document.
string
The URL key for the document. Examples: dcmg89gw_62hfjj8m, pKq0CzjiF3YmGd0AIlHKqeg
string
The type of the document as used in the Google Document List URLs. Examples: document, spreadsheet, presentation
\Zend_Gdata_Docs_DocumentListEntry
getDocument(string $id) : \Zend_Gdata_Docs_DocumentListEntry
string
The URL id for the document. Example: dcmg89gw_62hfjj8m
\Zend_Gdata_Docs_DocumentListEntry
getDocumentListEntry(mixed $location = null
) : \Zend_Gdata_Docs_DocumentListEntry
mixed
The location for the entry, as a URL or Query
\Zend_Gdata_App_InvalidArgumentException |
---|
\Zend_Gdata_Docs_DocumentListEntry
getDocumentListFeed(mixed $location = null
) : \Zend_Gdata_Docs_DocumentListFeed
mixed
The location for the feed, as a URL or Query
\Zend_Gdata_Docs_DocumentListFeed
getEntry(string $uri, string $className = 'Zend_Gdata_App_Entry'
) : string | \Zend_Gdata_App_Entry
string
string
The class which is used as the return type
string
\Zend_Gdata_App_Entry
Returns string only if the object
mapping has been disabled explicitly
by passing false to the
useObjectMapping() function.getFeed(string $uri, string $className = 'Zend_Gdata_App_Feed'
) : string | \Zend_Gdata_App_Feed
string
The uri from which to retrieve the feed
string
The class which is used as the return type
string
\Zend_Gdata_App_Feed
Returns string only if the object
mapping has been disabled explicitly
by passing false to the
useObjectMapping() function.getGzipEnabled() : boolean
boolean
getHttpClient() : \Zend_Http_Client
\Zend_Http_Client
getHttpMethodOverride() : boolean
boolean
getMajorProtocolVersion() : integer
getMaxRedirects() : integer
integer
Maximum number of redirects to followgetMinorProtocolVersion() : \(int | \NULL)
getNextFeed(\Zend_Gdata_App_Feed $feed, string $className = null
) : \Zend_Gdata_App_Feed | null
\Zend_Gdata_App_Feed
The feed from which to retreive the next set of results.
string
(optional) The class of feed to be returned. If null, the next feed (if found) will be the same class as the feed that was given as the first argument.
\Zend_Gdata_App_Feed
null
Returns a
Zend_Gdata_App_Feed or null if no next set of results
exists.getPresentation(string $id) : \Zend_Gdata_Docs_DocumentListEntry
string
The URL id for the document. Example: dcmg89gw_21gtrjcn
\Zend_Gdata_Docs_DocumentListEntry
getPreviousFeed(\Zend_Gdata_App_Feed $feed, string $className = null
) : \Zend_Gdata_App_Feed | null
\Zend_Gdata_App_Feed
The feed from which to retreive the previous set of results.
string
(optional) The class of feed to be returned. If null, the previous feed (if found) will be the same class as the feed that was given as the first argument.
\Zend_Gdata_App_Feed
null
Returns a
Zend_Gdata_App_Feed or null if no previous set of results
exists.getSpreadsheet(string $id) : \Zend_Gdata_Docs_DocumentListEntry
string
The URL id for the document. Example: pKq0CzjiF3YmGd0AIlHKqeg
\Zend_Gdata_Docs_DocumentListEntry
getStaticHttpClient() : \Zend_Http_Client
\Zend_Http_Client
getVerboseExceptionMessages() : boolean
In the case of HTTP errors, use the body of the HTTP response in the exception message.
boolean
import(string $uri, \Zend_Http_Client $client= null
, string $className= 'Zend_Gdata_App_Feed'
, boolean $useObjectMapping= true
) : string | \Zend_Gdata_App_Feed
string
\Zend_Http_Client
The client used for communication
string
The class which is used as the return type
boolean
Enable/disable the use of XML to object mapping.
\Zend_Gdata_App_Exception |
---|
string
\Zend_Gdata_App_Feed
Returns string only if the fourth
parameter ($useObjectMapping) is set
to false.importFile(string $filename, string $className= 'Zend_Gdata_App_Feed'
, string $useIncludePath= false
) : \Zend_Gdata_App_Feed
string
string
The class which is used as the return type
string
Whether the include_path should be searched
\Zend_Gdata_App_Exception |
---|
\Zend_Gdata_App_Feed
importString(string $string, string $className= 'Zend_Gdata_App_Feed'
, $majorProtocolVersion= null
, $minorProtocolVersion= null
) : \Zend_Gdata_App_Feed
string
string
The class which is used as the return type
\Zend_Gdata_App_Exception |
---|
\Zend_Gdata_App_Feed
importUrl(string $url, string $className= 'Zend_Gdata_App_Feed'
, array $extraHeaders= array()
) : string | \Zend_Gdata_App_Feed
string
The URL to import
string
The class which is used as the return type
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_Exception |
---|
string
\Zend_Gdata_App_Feed
Returns string only if the object
mapping has been disabled explicitly
by passing false to the
useObjectMapping() function.insertDocument(mixed $data, string $uri, string $className = 'Zend_Gdata_Docs_DocumentListEntry'
) : \Zend_Gdata_Docs_DocumentListEntry
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.
string
POST URI
string
(optional) The class of entry to be returned. The default is a 'Zend_Gdata_Docs_DocumentListEntry'.
\Zend_Gdata_Docs_DocumentListEntry
The entry returned by the
service after insertion.insertEntry(mixed $data, string $uri, string $className= 'Zend_Gdata_App_Entry'
, array $extraHeaders= array()
) : \Zend_Gdata_App_Entry
mixed
The Zend_Gdata_App_Entry or XML to post
string
POST URI
string
The class of entry to be returned.
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_Entry
The entry returned by the service after
insertion.isAuthenticated() : boolean
boolean
True if service object is authenticated, false otherwise.lookupMimeType(string $fileExtension) : string
string
string
The mime type to be sent to the server to tell it how the
multipart mime data should be interpreted.performHttpRequest(string $method, string $url, array $headers= null
, string $body= null
, string $contentType= null
, integer $remainingRedirects= null
) : \Zend_Http_Response
string
The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'
string
The URL to which this request is being performed
array
An associative array of HTTP headers for this request
string
The body of the HTTP request
string
The value for the content type of the request body
integer
Number of redirects to follow if request s results in one
\Zend_Http_Response
The response objectpost(mixed $data, string $uri= null
, $remainingRedirects= null
, string $contentType= null
, array $extraHeaders= null
) : \Zend_Http_Response
mixed
The Zend_Gdata_App_Entry or XML to post
string
POST URI
string
Content-type of the data
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_Exception |
|
---|---|
\Zend_Gdata_App_HttpException |
|
\Zend_Gdata_App_InvalidArgumentException |
\Zend_Http_Response
prepareRequest(string $method, string $url= null
, array $headers= array()
, mixed $data= null
, string $contentTypeOverride= null
) : array
string
The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'
string
The URL to which this request is being performed, or null if found in $data
array
An associative array of HTTP headers for this request
mixed
The Zend_Gdata_App_Entry or XML for the body of the request
string
The override value for the content type of the request body
array
An associative array containing the determined
'method', 'url', 'data', 'headers', 'contentType'put(mixed $data, string $uri= null
, $remainingRedirects= null
, string $contentType= null
, array $extraHeaders= null
) : \Zend_Http_Response
mixed
The Zend_Gdata_App_Entry or XML to post
string
PUT URI
string
Content-type of the data
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_Exception |
|
---|---|
\Zend_Gdata_App_HttpException |
|
\Zend_Gdata_App_InvalidArgumentException |
\Zend_Http_Response
registerPackage(string $name) : void
This array is searched when using the magic __call method below to instantiante new objects.
string
The name of the package (eg Zend_Gdata_App)
retrieveAllEntriesForFeed(object $feed) : mixed
Be aware that calling this function on a large dataset will take a significant amount of time to complete. In some cases this may cause execution to timeout without proper precautions in place.
object
The feed to iterate through.
mixed
A new feed of the same type as the one originally
passed in, containing all relevent entries.setGzipEnabled(boolean $enabled = false
) : void
boolean
Whether or not to enable gzipped responses
setHttpClient(\Zend_Http_Client $client, $applicationId = 'MyCompany-MyApp-1.0'
) : \Zend_Gdata_App
\Zend_Http_Client
The client to use for communication
\Zend_Gdata_App_HttpException |
---|
\Zend_Gdata_App
Provides a fluent interfacesetHttpMethodOverride(boolean $override = true
) : void
Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.
boolean
Whether to override PUT and DELETE with POST.
setMajorProtocolVersion(integer $value)
setMaxRedirects(integer $maxRedirects) : void
integer
Maximum number of redirects to follow
setMinorProtocolVersion(\(int|\NULL) $value)
setStaticHttpClient(\Zend_Http_Client $httpClient) : void
Sets the static HTTP client object to use for retrieving the feed.
\Zend_Http_Client
setVerboseExceptionMessages(boolean $verbose)
In the case of HTTP errors, use the body of the HTTP response in the exception message.
boolean
Whether to use verbose exception messages
updateEntry(mixed $data, $uri= null
, $className= null
, array $extraHeaders= array()
) : \Zend_Gdata_App_Entry
mixed
Zend_Gdata_App_Entry or XML (w/ID and link rel='edit')
array
Extra headers to add to the request, as an array of string-based key/value pairs.
\Zend_Gdata_App_Exception |
---|
\Zend_Gdata_App_Entry
The entry returned from the serveruploadFile(string $fileLocation, string $title= null
, string $mimeType= null
, string $uri= null
) : \Zend_Gdata_Docs_DocumentListEntry
string
The full or relative path of the file to be uploaded.
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'.
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.
string
(optional) The URL to which the upload should be made. Example: 'https://docs.google.com/feeds/documents/private/full'.
\Zend_Gdata_Docs_DocumentListEntry
The entry for the newly
created Google Document.useObjectMapping(boolean $value) : void
boolean
Pass in true to use the XML to object mapping. Pass in false or null to disable it.
usingObjectMapping() : boolean
boolean
True if service object is using XML to object mapping,
false otherwise.$namespaces : array
array(array('gd', 'http://schemas.google.com/g/2005', 1, 0), array('openSearch', 'http://a9.com/-/spec/opensearchrss/1.0/', 1, 0), array('openSearch', 'http://a9.com/-/spec/opensearch/1.1/', 2, 0), array('rss', 'http://blogs.law.harvard.edu/tech/rss', 1, 0))
$SUPPORTED_FILETYPES : array
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', 'DOCX' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', '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')
$_defaultPostUri : string
self::DOCUMENTS_LIST_FEED_URI
inherited_from | \Zend_Gdata::_defaultPostUri |
---|
$_defaultPostUri : string
null
$_gzipEnabled : boolean
false
$_httpClient : \Zend_Http_Client
$_httpMethodOverride : boolean
false
$_majorProtocolVersion
$_maxRedirects : integer
5
$_minorProtocolVersion
$_registeredPackages : array
array('Zend_Gdata_App_Extension', 'Zend_Gdata_App')
$_staticHttpClient : \Zend_Http_Client
null
$_useObjectMapping : boolean
true
$_verboseExceptionMessages : boolean
true
AUTH_SERVICE_NAME = 'writely'
inherited_from | \Zend_Gdata::AUTH_SERVICE_NAME |
---|
AUTH_SERVICE_NAME = 'xapi' : string
DOCUMENTS_CATEGORY_SCHEMA = 'http://schemas.google.com/g/2005#kind'
DOCUMENTS_CATEGORY_TERM = 'http://schemas.google.com/docs/2007#folder'
DOCUMENTS_FOLDER_FEED_URI = 'https://docs.google.com/feeds/folders/private/full'
DOCUMENTS_LIST_FEED_URI = 'https://docs.google.com/feeds/documents/private/full'