adding zend project folders into old campcaster.
This commit is contained in:
parent
56abfaf28e
commit
7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions
1211
library/Zend/Gdata/App.php
Normal file
1211
library/Zend/Gdata/App.php
Normal file
File diff suppressed because it is too large
Load diff
41
library/Zend/Gdata/App/AuthException.php
Normal file
41
library/Zend/Gdata/App/AuthException.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AuthException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata exceptions
|
||||
*
|
||||
* Class to represent exceptions that occur during Gdata operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_AuthException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
}
|
42
library/Zend/Gdata/App/BadMethodCallException.php
Normal file
42
library/Zend/Gdata/App/BadMethodCallException.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BadMethodCallException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata APP exceptions
|
||||
*
|
||||
* Class to represent exceptions that occur during Gdata APP operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_BadMethodCallException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
}
|
572
library/Zend/Gdata/App/Base.php
Normal file
572
library/Zend/Gdata/App/Base.php
Normal file
|
@ -0,0 +1,572 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Base.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Util
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Util.php';
|
||||
|
||||
/**
|
||||
* Abstract class for all XML elements
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_Base
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string The XML element name, including prefix if desired
|
||||
*/
|
||||
protected $_rootElement = null;
|
||||
|
||||
/**
|
||||
* @var string The XML namespace prefix
|
||||
*/
|
||||
protected $_rootNamespace = 'atom';
|
||||
|
||||
/**
|
||||
* @var string The XML namespace URI - takes precedence over lookup up the
|
||||
* corresponding URI for $_rootNamespace
|
||||
*/
|
||||
protected $_rootNamespaceURI = null;
|
||||
|
||||
/**
|
||||
* @var array Leftover elements which were not handled
|
||||
*/
|
||||
protected $_extensionElements = array();
|
||||
|
||||
/**
|
||||
* @var array Leftover attributes which were not handled
|
||||
*/
|
||||
protected $_extensionAttributes = array();
|
||||
|
||||
/**
|
||||
* @var string XML child text node content
|
||||
*/
|
||||
protected $_text = null;
|
||||
|
||||
/**
|
||||
* @var array Memoized results from calls to lookupNamespace() to avoid
|
||||
* expensive calls to getGreatestBoundedValue(). The key is in the
|
||||
* form 'prefix-majorVersion-minorVersion', and the value is the
|
||||
* output from getGreatestBoundedValue().
|
||||
*/
|
||||
protected static $_namespaceLookupCache = array();
|
||||
|
||||
/**
|
||||
* List of namespaces, as a three-dimensional array. The first dimension
|
||||
* represents the namespace prefix, the second dimension represents the
|
||||
* minimum major protocol version, and the third dimension is the minimum
|
||||
* minor protocol version. Null keys are NOT allowed.
|
||||
*
|
||||
* When looking up a namespace for a given prefix, the greatest version
|
||||
* number (both major and minor) which is less than the effective version
|
||||
* should be used.
|
||||
*
|
||||
* @see lookupNamespace()
|
||||
* @see registerNamespace()
|
||||
* @see registerAllNamespaces()
|
||||
* @var array
|
||||
*/
|
||||
protected $_namespaces = array(
|
||||
'atom' => array(
|
||||
1 => array(
|
||||
0 => 'http://www.w3.org/2005/Atom'
|
||||
)
|
||||
),
|
||||
'app' => array(
|
||||
1 => array(
|
||||
0 => 'http://purl.org/atom/app#'
|
||||
),
|
||||
2 => array(
|
||||
0 => 'http://www.w3.org/2007/app'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the child text node of this element
|
||||
* This represents any raw text contained within the XML element
|
||||
*
|
||||
* @return string Child text node
|
||||
*/
|
||||
public function getText($trim = true)
|
||||
{
|
||||
if ($trim) {
|
||||
return trim($this->_text);
|
||||
} else {
|
||||
return $this->_text;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the child text node of this element
|
||||
* This represents any raw text contained within the XML element
|
||||
*
|
||||
* @param string $value Child text node
|
||||
* @return Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
|
||||
*/
|
||||
public function setText($value)
|
||||
{
|
||||
$this->_text = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all elements not matched to data model classes
|
||||
* during the parsing of the XML
|
||||
*
|
||||
* @return array All elements not matched to data model classes during parsing
|
||||
*/
|
||||
public function getExtensionElements()
|
||||
{
|
||||
return $this->_extensionElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an array of all elements not matched to data model classes
|
||||
* during the parsing of the XML. This method can be used to add arbitrary
|
||||
* child XML elements to any data model class.
|
||||
*
|
||||
* @param array $value All extension elements
|
||||
* @return Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
|
||||
*/
|
||||
public function setExtensionElements($value)
|
||||
{
|
||||
$this->_extensionElements = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all extension attributes not transformed into data
|
||||
* model properties during parsing of the XML. Each element of the array
|
||||
* is a hashed array of the format:
|
||||
* array('namespaceUri' => string, 'name' => string, 'value' => string);
|
||||
*
|
||||
* @return array All extension attributes
|
||||
*/
|
||||
public function getExtensionAttributes()
|
||||
{
|
||||
return $this->_extensionAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an array of all extension attributes not transformed into data
|
||||
* model properties during parsing of the XML. Each element of the array
|
||||
* is a hashed array of the format:
|
||||
* array('namespaceUri' => string, 'name' => string, 'value' => string);
|
||||
* This can be used to add arbitrary attributes to any data model element
|
||||
*
|
||||
* @param array $value All extension attributes
|
||||
* @return Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
|
||||
*/
|
||||
public function setExtensionAttributes($value)
|
||||
{
|
||||
$this->_extensionAttributes = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
if ($doc === null) {
|
||||
$doc = new DOMDocument('1.0', 'utf-8');
|
||||
}
|
||||
if ($this->_rootNamespaceURI != null) {
|
||||
$element = $doc->createElementNS($this->_rootNamespaceURI, $this->_rootElement);
|
||||
} elseif ($this->_rootNamespace !== null) {
|
||||
if (strpos($this->_rootElement, ':') === false) {
|
||||
$elementName = $this->_rootNamespace . ':' . $this->_rootElement;
|
||||
} else {
|
||||
$elementName = $this->_rootElement;
|
||||
}
|
||||
$element = $doc->createElementNS($this->lookupNamespace($this->_rootNamespace), $elementName);
|
||||
} else {
|
||||
$element = $doc->createElement($this->_rootElement);
|
||||
}
|
||||
if ($this->_text != null) {
|
||||
$element->appendChild($element->ownerDocument->createTextNode($this->_text));
|
||||
}
|
||||
foreach ($this->_extensionElements as $extensionElement) {
|
||||
$element->appendChild($extensionElement->getDOM($element->ownerDocument));
|
||||
}
|
||||
foreach ($this->_extensionAttributes as $attribute) {
|
||||
$element->setAttribute($attribute['name'], $attribute['value']);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a child DOMNode, tries to determine how to map the data into
|
||||
* object instance members. If no mapping is defined, Extension_Element
|
||||
* objects are created and stored in an array.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode needed to be handled
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
if ($child->nodeType == XML_TEXT_NODE) {
|
||||
$this->_text = $child->nodeValue;
|
||||
} else {
|
||||
$extensionElement = new Zend_Gdata_App_Extension_Element();
|
||||
$extensionElement->transferFromDOM($child);
|
||||
$this->_extensionElements[] = $extensionElement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
$arrayIndex = ($attribute->namespaceURI != '')?(
|
||||
$attribute->namespaceURI . ':' . $attribute->name):
|
||||
$attribute->name;
|
||||
$this->_extensionAttributes[$arrayIndex] =
|
||||
array('namespaceUri' => $attribute->namespaceURI,
|
||||
'name' => $attribute->localName,
|
||||
'value' => $attribute->nodeValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfers each child and attribute into member variables.
|
||||
* This is called when XML is received over the wire and the data
|
||||
* model needs to be built to represent this XML.
|
||||
*
|
||||
* @param DOMNode $node The DOMNode that represents this object's data
|
||||
*/
|
||||
public function transferFromDOM($node)
|
||||
{
|
||||
foreach ($node->childNodes as $child) {
|
||||
$this->takeChildFromDOM($child);
|
||||
}
|
||||
foreach ($node->attributes as $attribute) {
|
||||
$this->takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the provided XML text and generates data model classes for
|
||||
* each know element by turning the XML text into a DOM tree and calling
|
||||
* transferFromDOM($element). The first data model element with the same
|
||||
* name as $this->_rootElement is used and the child elements are
|
||||
* recursively parsed.
|
||||
*
|
||||
* @param string $xml The XML text to parse
|
||||
*/
|
||||
public function transferFromXML($xml)
|
||||
{
|
||||
if ($xml) {
|
||||
// Load the feed as an XML DOMDocument object
|
||||
@ini_set('track_errors', 1);
|
||||
$doc = new DOMDocument();
|
||||
$success = @$doc->loadXML($xml);
|
||||
@ini_restore('track_errors');
|
||||
if (!$success) {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception("DOMDocument cannot parse XML: $php_errormsg");
|
||||
}
|
||||
$element = $doc->getElementsByTagName($this->_rootElement)->item(0);
|
||||
if (!$element) {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception('No root <' . $this->_rootElement . '> element');
|
||||
}
|
||||
$this->transferFromDOM($element);
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception('XML passed to transferFromXML cannot be null');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts this element and all children into XML text using getDOM()
|
||||
*
|
||||
* @return string XML content
|
||||
*/
|
||||
public function saveXML()
|
||||
{
|
||||
$element = $this->getDOM();
|
||||
return $element->ownerDocument->saveXML($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for saveXML() returns XML content for this element and all
|
||||
* children
|
||||
*
|
||||
* @return string XML content
|
||||
*/
|
||||
public function getXML()
|
||||
{
|
||||
return $this->saveXML();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for saveXML()
|
||||
*
|
||||
* Can be overridden by children to provide more complex representations
|
||||
* of entries.
|
||||
*
|
||||
* @return string Encoded string content
|
||||
*/
|
||||
public function encode()
|
||||
{
|
||||
return $this->saveXML();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full version of a namespace prefix
|
||||
*
|
||||
* Looks up a prefix (atom:, etc.) in the list of registered
|
||||
* namespaces and returns the full namespace URI if
|
||||
* available. Returns the prefix, unmodified, if it's not
|
||||
* registered.
|
||||
*
|
||||
* @param string $prefix The namespace prefix to lookup.
|
||||
* @param integer $majorVersion The major protocol version in effect.
|
||||
* Defaults to '1'.
|
||||
* @param integer $minorVersion The minor protocol version in effect.
|
||||
* Defaults to null (use latest).
|
||||
* @return string
|
||||
*/
|
||||
public function lookupNamespace($prefix,
|
||||
$majorVersion = 1,
|
||||
$minorVersion = null)
|
||||
{
|
||||
// Check for a memoized result
|
||||
$key = $prefix . ' ' .
|
||||
(is_null($majorVersion) ? 'NULL' : $majorVersion) .
|
||||
' '. (is_null($minorVersion) ? 'NULL' : $minorVersion);
|
||||
if (array_key_exists($key, self::$_namespaceLookupCache))
|
||||
return self::$_namespaceLookupCache[$key];
|
||||
// If no match, return the prefix by default
|
||||
$result = $prefix;
|
||||
|
||||
// Find tuple of keys that correspond to the namespace we should use
|
||||
if (isset($this->_namespaces[$prefix])) {
|
||||
// Major version search
|
||||
$nsData = $this->_namespaces[$prefix];
|
||||
$foundMajorV = Zend_Gdata_App_Util::findGreatestBoundedValue(
|
||||
$majorVersion, $nsData);
|
||||
// Minor version search
|
||||
$nsData = $nsData[$foundMajorV];
|
||||
$foundMinorV = Zend_Gdata_App_Util::findGreatestBoundedValue(
|
||||
$minorVersion, $nsData);
|
||||
// Extract NS
|
||||
$result = $nsData[$foundMinorV];
|
||||
}
|
||||
|
||||
// Memoize result
|
||||
self::$_namespaceLookupCache[$key] = $result;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a namespace and prefix to the registered list
|
||||
*
|
||||
* Takes a prefix and a full namespace URI and adds them to the
|
||||
* list of registered namespaces for use by
|
||||
* $this->lookupNamespace().
|
||||
*
|
||||
* WARNING: Currently, registering a namespace will NOT invalidate any
|
||||
* memoized data stored in $_namespaceLookupCache. Under normal
|
||||
* use, this behavior is acceptable. If you are adding
|
||||
* contradictory data to the namespace lookup table, you must
|
||||
* call flushNamespaceLookupCache().
|
||||
*
|
||||
* @param string $prefix The namespace prefix
|
||||
* @param string $namespaceUri The full namespace URI
|
||||
* @param integer $majorVersion The major protocol version in effect.
|
||||
* Defaults to '1'.
|
||||
* @param integer $minorVersion The minor protocol version in effect.
|
||||
* Defaults to null (use latest).
|
||||
* @return void
|
||||
*/
|
||||
public function registerNamespace($prefix,
|
||||
$namespaceUri,
|
||||
$majorVersion = 1,
|
||||
$minorVersion = 0)
|
||||
{
|
||||
$this->_namespaces[$prefix][$majorVersion][$minorVersion] =
|
||||
$namespaceUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush namespace lookup cache.
|
||||
*
|
||||
* Empties the namespace lookup cache. Call this function if you have
|
||||
* added data to the namespace lookup table that contradicts values that
|
||||
* may have been cached during a previous call to lookupNamespace().
|
||||
*/
|
||||
public static function flushNamespaceLookupCache()
|
||||
{
|
||||
self::$_namespaceLookupCache = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an array of namespaces to the registered list.
|
||||
*
|
||||
* Takes an array in the format of:
|
||||
* namespace prefix, namespace URI, major protocol version,
|
||||
* minor protocol version and adds them with calls to ->registerNamespace()
|
||||
*
|
||||
* @param array $namespaceArray An array of namespaces.
|
||||
* @return void
|
||||
*/
|
||||
public function registerAllNamespaces($namespaceArray)
|
||||
{
|
||||
foreach($namespaceArray as $namespace) {
|
||||
$this->registerNamespace(
|
||||
$namespace[0], $namespace[1], $namespace[2], $namespace[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Magic getter to allow access like $entry->foo to call $entry->getFoo()
|
||||
* Alternatively, if no getFoo() is defined, but a $_foo protected variable
|
||||
* is defined, this is returned.
|
||||
*
|
||||
* TODO Remove ability to bypass getFoo() methods??
|
||||
*
|
||||
* @param string $name The variable name sought
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
$method = 'get'.ucfirst($name);
|
||||
if (method_exists($this, $method)) {
|
||||
return call_user_func(array(&$this, $method));
|
||||
} else if (property_exists($this, "_${name}")) {
|
||||
return $this->{'_' . $name};
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic setter to allow acces like $entry->foo='bar' to call
|
||||
* $entry->setFoo('bar') automatically.
|
||||
*
|
||||
* Alternatively, if no setFoo() is defined, but a $_foo protected variable
|
||||
* is defined, this is returned.
|
||||
*
|
||||
* TODO Remove ability to bypass getFoo() methods??
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function __set($name, $val)
|
||||
{
|
||||
$method = 'set'.ucfirst($name);
|
||||
if (method_exists($this, $method)) {
|
||||
return call_user_func(array(&$this, $method), $val);
|
||||
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
|
||||
$this->{'_' . $name} = $val;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic __isset method
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function __isset($name)
|
||||
{
|
||||
$rc = new ReflectionClass(get_class($this));
|
||||
$privName = '_' . $name;
|
||||
if (!($rc->hasProperty($privName))) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
} else {
|
||||
if (isset($this->{$privName})) {
|
||||
if (is_array($this->{$privName})) {
|
||||
if (count($this->{$privName}) > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic __unset method
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function __unset($name)
|
||||
{
|
||||
if (isset($this->{'_' . $name})) {
|
||||
if (is_array($this->{'_' . $name})) {
|
||||
$this->{'_' . $name} = array();
|
||||
} else {
|
||||
$this->{'_' . $name} = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*
|
||||
* @return string The text representation of this object
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getText();
|
||||
}
|
||||
|
||||
}
|
179
library/Zend/Gdata/App/BaseMediaSource.php
Normal file
179
library/Zend/Gdata/App/BaseMediaSource.php
Normal file
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BaseMediaSource.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_MediaSource
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/MediaSource.php';
|
||||
|
||||
/**
|
||||
* Concrete class to use a file handle as an attachment within a MediaEntry.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSource
|
||||
{
|
||||
|
||||
/**
|
||||
* The content type for the attached file (example image/png)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentType = null;
|
||||
|
||||
/**
|
||||
* The slug header value representing the attached file title, or null if
|
||||
* no slug should be used. The slug header is only necessary in some cases,
|
||||
* usually when a multipart upload is not being performed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_slug = null;
|
||||
|
||||
/**
|
||||
* The content type for the attached file (example image/png)
|
||||
*
|
||||
* @return string The content type
|
||||
*/
|
||||
public function getContentType()
|
||||
{
|
||||
return $this->_contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content type for the file attached (example image/png)
|
||||
*
|
||||
* @param string $value The content type
|
||||
* @return Zend_Gdata_App_MediaFileSource Provides a fluent interface
|
||||
*/
|
||||
public function setContentType($value)
|
||||
{
|
||||
$this->_contentType = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Slug header value. Used by some services to determine the
|
||||
* title for the uploaded file. Returns null if no slug should be used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSlug(){
|
||||
return $this->_slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Slug header value. Used by some services to determine the
|
||||
* title for the uploaded file. A null value indicates no slug header.
|
||||
*
|
||||
* @var string The slug value
|
||||
* @return Zend_Gdata_App_MediaSource Provides a fluent interface
|
||||
*/
|
||||
public function setSlug($value){
|
||||
$this->_slug = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Magic getter to allow acces like $source->foo to call $source->getFoo()
|
||||
* Alternatively, if no getFoo() is defined, but a $_foo protected variable
|
||||
* is defined, this is returned.
|
||||
*
|
||||
* TODO Remove ability to bypass getFoo() methods??
|
||||
*
|
||||
* @param string $name The variable name sought
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
$method = 'get'.ucfirst($name);
|
||||
if (method_exists($this, $method)) {
|
||||
return call_user_func(array(&$this, $method));
|
||||
} else if (property_exists($this, "_${name}")) {
|
||||
return $this->{'_' . $name};
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic setter to allow acces like $source->foo='bar' to call
|
||||
* $source->setFoo('bar') automatically.
|
||||
*
|
||||
* Alternatively, if no setFoo() is defined, but a $_foo protected variable
|
||||
* is defined, this is returned.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function __set($name, $val)
|
||||
{
|
||||
$method = 'set'.ucfirst($name);
|
||||
if (method_exists($this, $method)) {
|
||||
return call_user_func(array(&$this, $method), $val);
|
||||
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
|
||||
$this->{'_' . $name} = $val;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic __isset method
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function __isset($name)
|
||||
{
|
||||
$rc = new ReflectionClass(get_class($this));
|
||||
$privName = '_' . $name;
|
||||
if (!($rc->hasProperty($privName))) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Property ' . $name . ' does not exist');
|
||||
} else {
|
||||
if (isset($this->{$privName})) {
|
||||
if (is_array($this->{$privName})) {
|
||||
if (count($this->{$privName}) > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
94
library/Zend/Gdata/App/CaptchaRequiredException.php
Normal file
94
library/Zend/Gdata/App/CaptchaRequiredException.php
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: CaptchaRequiredException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_CaptchaRequiredException
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/AuthException.php';
|
||||
|
||||
/**
|
||||
* Gdata exceptions
|
||||
*
|
||||
* Class to represent an exception that occurs during the use of ClientLogin.
|
||||
* This particular exception happens when a CAPTCHA challenge is issued. This
|
||||
* challenge is a visual puzzle presented to the user to prove that they are
|
||||
* not an automated system.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_CaptchaRequiredException extends Zend_Gdata_App_AuthException
|
||||
{
|
||||
/**
|
||||
* The Google Accounts URL prefix.
|
||||
*/
|
||||
const ACCOUNTS_URL = 'https://www.google.com/accounts/';
|
||||
|
||||
/**
|
||||
* The token identifier from the server.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $captchaToken;
|
||||
|
||||
/**
|
||||
* The URL of the CAPTCHA image.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $captchaUrl;
|
||||
|
||||
/**
|
||||
* Constructs the exception to handle a CAPTCHA required response.
|
||||
*
|
||||
* @param string $captchaToken The CAPTCHA token ID provided by the server.
|
||||
* @param string $captchaUrl The URL to the CAPTCHA challenge image.
|
||||
*/
|
||||
public function __construct($captchaToken, $captchaUrl) {
|
||||
$this->captchaToken = $captchaToken;
|
||||
$this->captchaUrl = Zend_Gdata_App_CaptchaRequiredException::ACCOUNTS_URL . $captchaUrl;
|
||||
parent::__construct('CAPTCHA challenge issued by server');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the token identifier as provided by the server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCaptchaToken() {
|
||||
return $this->captchaToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the URL CAPTCHA image as provided by the server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCaptchaUrl() {
|
||||
return $this->captchaUrl;
|
||||
}
|
||||
|
||||
}
|
389
library/Zend/Gdata/App/Entry.php
Normal file
389
library/Zend/Gdata/App/Entry.php
Normal file
|
@ -0,0 +1,389 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Entry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_FeedEntryParent
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/FeedEntryParent.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Content
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Content.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Edited
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Edited.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Published
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Published.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Source
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Source.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Summary
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Summary.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Control
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Control.php';
|
||||
|
||||
/**
|
||||
* Concrete class for working with Atom entries.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Entry extends Zend_Gdata_App_FeedEntryParent
|
||||
{
|
||||
|
||||
/**
|
||||
* Root XML element for Atom entries.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_rootElement = 'entry';
|
||||
|
||||
/**
|
||||
* Class name for each entry in this feed*
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_App_Entry';
|
||||
|
||||
/**
|
||||
* atom:content element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Content
|
||||
*/
|
||||
protected $_content = null;
|
||||
|
||||
/**
|
||||
* atom:published element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Published
|
||||
*/
|
||||
protected $_published = null;
|
||||
|
||||
/**
|
||||
* atom:source element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Source
|
||||
*/
|
||||
protected $_source = null;
|
||||
|
||||
/**
|
||||
* atom:summary element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Summary
|
||||
*/
|
||||
protected $_summary = null;
|
||||
|
||||
/**
|
||||
* app:control element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Control
|
||||
*/
|
||||
protected $_control = null;
|
||||
|
||||
/**
|
||||
* app:edited element
|
||||
*
|
||||
* @var Zend_Gdata_App_Extension_Edited
|
||||
*/
|
||||
protected $_edited = null;
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_content != null) {
|
||||
$element->appendChild($this->_content->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_published != null) {
|
||||
$element->appendChild($this->_published->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_source != null) {
|
||||
$element->appendChild($this->_source->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_summary != null) {
|
||||
$element->appendChild($this->_summary->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_control != null) {
|
||||
$element->appendChild($this->_control->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_edited != null) {
|
||||
$element->appendChild($this->_edited->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'content':
|
||||
$content = new Zend_Gdata_App_Extension_Content();
|
||||
$content->transferFromDOM($child);
|
||||
$this->_content = $content;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'published':
|
||||
$published = new Zend_Gdata_App_Extension_Published();
|
||||
$published->transferFromDOM($child);
|
||||
$this->_published = $published;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'source':
|
||||
$source = new Zend_Gdata_App_Extension_Source();
|
||||
$source->transferFromDOM($child);
|
||||
$this->_source = $source;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'summary':
|
||||
$summary = new Zend_Gdata_App_Extension_Summary();
|
||||
$summary->transferFromDOM($child);
|
||||
$this->_summary = $summary;
|
||||
break;
|
||||
case $this->lookupNamespace('app') . ':' . 'control':
|
||||
$control = new Zend_Gdata_App_Extension_Control();
|
||||
$control->transferFromDOM($child);
|
||||
$this->_control = $control;
|
||||
break;
|
||||
case $this->lookupNamespace('app') . ':' . 'edited':
|
||||
$edited = new Zend_Gdata_App_Extension_Edited();
|
||||
$edited->transferFromDOM($child);
|
||||
$this->_edited = $edited;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads changes in this entry to the server using Zend_Gdata_App
|
||||
*
|
||||
* @param string|null $uri The URI to send requests to, or null if $data
|
||||
* contains the URI.
|
||||
* @param string|null $className The name of the class that should we
|
||||
* deserializing the server response. If null, then
|
||||
* 'Zend_Gdata_App_Entry' will be used.
|
||||
* @param array $extraHeaders Extra headers to add to the request, as an
|
||||
* array of string-based key/value pairs.
|
||||
* @return Zend_Gdata_App_Entry The updated entry.
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
*/
|
||||
public function save($uri = null, $className = null, $extraHeaders = array())
|
||||
{
|
||||
return $this->getService()->updateEntry($this,
|
||||
$uri,
|
||||
$className,
|
||||
$extraHeaders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes this entry to the server using the referenced
|
||||
* Zend_Http_Client to do a HTTP DELETE to the edit link stored in this
|
||||
* entry's link collection.
|
||||
*
|
||||
* @return void
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$this->getService()->delete($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload the current entry. Returns a new copy of the entry as returned
|
||||
* by the server, or null if no changes exist. This does not
|
||||
* modify the current entry instance.
|
||||
*
|
||||
* @param string|null The URI to send requests to, or null if $data
|
||||
* contains the URI.
|
||||
* @param string|null The name of the class that should we deserializing
|
||||
* the server response. If null, then 'Zend_Gdata_App_Entry' will
|
||||
* be used.
|
||||
* @param array $extraHeaders Extra headers to add to the request, as an
|
||||
* array of string-based key/value pairs.
|
||||
* @return mixed A new instance of the current entry with updated data, or
|
||||
* null if the server reports that no changes have been made.
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
*/
|
||||
public function reload($uri = null, $className = null, $extraHeaders = array())
|
||||
{
|
||||
// Get URI
|
||||
$editLink = $this->getEditLink();
|
||||
if (($uri === null) && $editLink != null) {
|
||||
$uri = $editLink->getHref();
|
||||
}
|
||||
|
||||
// Set classname to current class, if not otherwise set
|
||||
if ($className === null) {
|
||||
$className = get_class($this);
|
||||
}
|
||||
|
||||
// Append ETag, if present (Gdata v2 and above, only) and doesn't
|
||||
// conflict with existing headers
|
||||
if ($this->_etag != null
|
||||
&& !array_key_exists('If-Match', $extraHeaders)
|
||||
&& !array_key_exists('If-None-Match', $extraHeaders)) {
|
||||
$extraHeaders['If-None-Match'] = $this->_etag;
|
||||
}
|
||||
|
||||
// If an HTTP 304 status (Not Modified)is returned, then we return
|
||||
// null.
|
||||
$result = null;
|
||||
try {
|
||||
$result = $this->service->importUrl($uri, $className, $extraHeaders);
|
||||
} catch (Zend_Gdata_App_HttpException $e) {
|
||||
if ($e->getResponse()->getStatus() != '304')
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the atom:content element
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Content
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
return $this->_content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the atom:content element
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Content $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setContent($value)
|
||||
{
|
||||
$this->_content = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the atom:published element
|
||||
* This represents the publishing date for an entry
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Published
|
||||
*/
|
||||
public function getPublished()
|
||||
{
|
||||
return $this->_published;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the atom:published element
|
||||
* This represents the publishing date for an entry
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Published $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setPublished($value)
|
||||
{
|
||||
$this->_published = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the atom:source element
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Source
|
||||
*/
|
||||
public function getSource()
|
||||
{
|
||||
return $this->_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the atom:source element
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Source $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setSource($value)
|
||||
{
|
||||
$this->_source = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the atom:summary element
|
||||
* This represents a textual summary of this entry's content
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Summary
|
||||
*/
|
||||
public function getSummary()
|
||||
{
|
||||
return $this->_summary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the atom:summary element
|
||||
* This represents a textual summary of this entry's content
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Summary $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setSummary($value)
|
||||
{
|
||||
$this->_summary = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the app:control element
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Control
|
||||
*/
|
||||
public function getControl()
|
||||
{
|
||||
return $this->_control;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the app:control element
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Control $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setControl($value)
|
||||
{
|
||||
$this->_control = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/Exception.php
Normal file
43
library/Zend/Gdata/App/Exception.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Zend_Exception
|
||||
*/
|
||||
require_once 'Zend/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata App exceptions
|
||||
*
|
||||
* Class to represent exceptions that occur during Gdata App operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Exception extends Zend_Exception
|
||||
{
|
||||
}
|
40
library/Zend/Gdata/App/Extension.php
Normal file
40
library/Zend/Gdata/App/Extension.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Extension.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Base
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Base.php';
|
||||
|
||||
/**
|
||||
* Gdata App extensions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_Extension extends Zend_Gdata_App_Base
|
||||
{
|
||||
}
|
43
library/Zend/Gdata/App/Extension/Author.php
Normal file
43
library/Zend/Gdata/App/Extension/Author.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Author.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Person.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:author element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Author extends Zend_Gdata_App_Extension_Person
|
||||
{
|
||||
|
||||
protected $_rootElement = 'author';
|
||||
|
||||
}
|
140
library/Zend/Gdata/App/Extension/Category.php
Normal file
140
library/Zend/Gdata/App/Extension/Category.php
Normal file
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Category.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:category element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Category extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'category';
|
||||
protected $_term = null;
|
||||
protected $_scheme = null;
|
||||
protected $_label = null;
|
||||
|
||||
public function __construct($term = null, $scheme = null, $label=null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_term = $term;
|
||||
$this->_scheme = $scheme;
|
||||
$this->_label = $label;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_term !== null) {
|
||||
$element->setAttribute('term', $this->_term);
|
||||
}
|
||||
if ($this->_scheme !== null) {
|
||||
$element->setAttribute('scheme', $this->_scheme);
|
||||
}
|
||||
if ($this->_label !== null) {
|
||||
$element->setAttribute('label', $this->_label);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'term':
|
||||
$this->_term = $attribute->nodeValue;
|
||||
break;
|
||||
case 'scheme':
|
||||
$this->_scheme = $attribute->nodeValue;
|
||||
break;
|
||||
case 'label':
|
||||
$this->_label = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTerm()
|
||||
{
|
||||
return $this->_term;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Extension_Category Provides a fluent interface
|
||||
*/
|
||||
public function setTerm($value)
|
||||
{
|
||||
$this->_term = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getScheme()
|
||||
{
|
||||
return $this->_scheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Extension_Category Provides a fluent interface
|
||||
*/
|
||||
public function setScheme($value)
|
||||
{
|
||||
$this->_scheme = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->_label;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Extension_Category Provides a fluent interface
|
||||
*/
|
||||
public function setLabel($value)
|
||||
{
|
||||
$this->_label = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
88
library/Zend/Gdata/App/Extension/Content.php
Normal file
88
library/Zend/Gdata/App/Extension/Content.php
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Content.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Text
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Text.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:content element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Content extends Zend_Gdata_App_Extension_Text
|
||||
{
|
||||
|
||||
protected $_rootElement = 'content';
|
||||
protected $_src = null;
|
||||
|
||||
public function __construct($text = null, $type = 'text', $src = null)
|
||||
{
|
||||
parent::__construct($text, $type);
|
||||
$this->_src = $src;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_src !== null) {
|
||||
$element->setAttribute('src', $this->_src);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'src':
|
||||
$this->_src = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSrc()
|
||||
{
|
||||
return $this->_src;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setSrc($value)
|
||||
{
|
||||
$this->_src = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/Extension/Contributor.php
Normal file
43
library/Zend/Gdata/App/Extension/Contributor.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Contributor.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Person.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:contributor element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Contributor extends Zend_Gdata_App_Extension_Person
|
||||
{
|
||||
|
||||
protected $_rootElement = 'contributor';
|
||||
|
||||
}
|
98
library/Zend/Gdata/App/Extension/Control.php
Normal file
98
library/Zend/Gdata/App/Extension/Control.php
Normal file
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Control.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Draft
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Draft.php';
|
||||
|
||||
/**
|
||||
* Represents the app:control element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Control extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'app';
|
||||
protected $_rootElement = 'control';
|
||||
protected $_draft = null;
|
||||
|
||||
public function __construct($draft = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_draft = $draft;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_draft != null) {
|
||||
$element->appendChild($this->_draft->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('app') . ':' . 'draft':
|
||||
$draft = new Zend_Gdata_App_Extension_Draft();
|
||||
$draft->transferFromDOM($child);
|
||||
$this->_draft = $draft;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Draft
|
||||
*/
|
||||
public function getDraft()
|
||||
{
|
||||
return $this->_draft;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Draft $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setDraft($value)
|
||||
{
|
||||
$this->_draft = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
50
library/Zend/Gdata/App/Extension/Draft.php
Normal file
50
library/Zend/Gdata/App/Extension/Draft.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Draft.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the app:draft element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Draft extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'app';
|
||||
protected $_rootElement = 'draft';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Edited.php
Normal file
49
library/Zend/Gdata/App/Extension/Edited.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Edited.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the app:edited element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Edited extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'edited';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/App/Extension/Element.php
Normal file
58
library/Zend/Gdata/App/Extension/Element.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Element.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Class that represents elements which were not handled by other parsing
|
||||
* code in the library.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Element extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
public function __construct($rootElement=null, $rootNamespace=null, $rootNamespaceURI=null, $text=null){
|
||||
parent::__construct();
|
||||
$this->_rootElement = $rootElement;
|
||||
$this->_rootNamespace = $rootNamespace;
|
||||
$this->_rootNamespaceURI = $rootNamespaceURI;
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
public function transferFromDOM($node)
|
||||
{
|
||||
parent::transferFromDOM($node);
|
||||
$this->_rootNamespace = null;
|
||||
$this->_rootNamespaceURI = $node->namespaceURI;
|
||||
$this->_rootElement = $node->localName;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Email.php
Normal file
49
library/Zend/Gdata/App/Extension/Email.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Email.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:email element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Email extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'email';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
115
library/Zend/Gdata/App/Extension/Generator.php
Normal file
115
library/Zend/Gdata/App/Extension/Generator.php
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Generator.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:generator element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Generator extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'generator';
|
||||
protected $_uri = null;
|
||||
protected $_version = null;
|
||||
|
||||
public function __construct($text = null, $uri = null, $version = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
$this->_uri = $uri;
|
||||
$this->_version = $version;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_uri !== null) {
|
||||
$element->setAttribute('uri', $this->_uri);
|
||||
}
|
||||
if ($this->_version !== null) {
|
||||
$element->setAttribute('version', $this->_version);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'uri':
|
||||
$this->_uri = $attribute->nodeValue;
|
||||
break;
|
||||
case 'version':
|
||||
$this->_version= $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Uri
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
return $this->_uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Uri $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setUri($value)
|
||||
{
|
||||
$this->_uri = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Version
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->_version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Version $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setVersion($value)
|
||||
{
|
||||
$this->_version = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Icon.php
Normal file
49
library/Zend/Gdata/App/Extension/Icon.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Icon.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:icon element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Icon extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'icon';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Id.php
Normal file
49
library/Zend/Gdata/App/Extension/Id.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Id.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:id element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Id extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'id';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
219
library/Zend/Gdata/App/Extension/Link.php
Normal file
219
library/Zend/Gdata/App/Extension/Link.php
Normal file
|
@ -0,0 +1,219 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Link.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Data model for representing an atom:link element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Link extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'link';
|
||||
protected $_href = null;
|
||||
protected $_rel = null;
|
||||
protected $_type = null;
|
||||
protected $_hrefLang = null;
|
||||
protected $_title = null;
|
||||
protected $_length = null;
|
||||
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_href = $href;
|
||||
$this->_rel = $rel;
|
||||
$this->_type = $type;
|
||||
$this->_hrefLang = $hrefLang;
|
||||
$this->_title = $title;
|
||||
$this->_length = $length;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_href !== null) {
|
||||
$element->setAttribute('href', $this->_href);
|
||||
}
|
||||
if ($this->_rel !== null) {
|
||||
$element->setAttribute('rel', $this->_rel);
|
||||
}
|
||||
if ($this->_type !== null) {
|
||||
$element->setAttribute('type', $this->_type);
|
||||
}
|
||||
if ($this->_hrefLang !== null) {
|
||||
$element->setAttribute('hreflang', $this->_hrefLang);
|
||||
}
|
||||
if ($this->_title !== null) {
|
||||
$element->setAttribute('title', $this->_title);
|
||||
}
|
||||
if ($this->_length !== null) {
|
||||
$element->setAttribute('length', $this->_length);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'href':
|
||||
$this->_href = $attribute->nodeValue;
|
||||
break;
|
||||
case 'rel':
|
||||
$this->_rel = $attribute->nodeValue;
|
||||
break;
|
||||
case 'type':
|
||||
$this->_type = $attribute->nodeValue;
|
||||
break;
|
||||
case 'hreflang':
|
||||
$this->_hrefLang = $attribute->nodeValue;
|
||||
break;
|
||||
case 'title':
|
||||
$this->_title = $attribute->nodeValue;
|
||||
break;
|
||||
case 'length':
|
||||
$this->_length = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHref()
|
||||
{
|
||||
return $this->_href;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setHref($value)
|
||||
{
|
||||
$this->_href = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRel()
|
||||
{
|
||||
return $this->_rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setRel($value)
|
||||
{
|
||||
$this->_rel = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setType($value)
|
||||
{
|
||||
$this->_type = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getHrefLang()
|
||||
{
|
||||
return $this->_hrefLang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setHrefLang($value)
|
||||
{
|
||||
$this->_hrefLang = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->_title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setTitle($value)
|
||||
{
|
||||
$this->_title = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLength()
|
||||
{
|
||||
return $this->_length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setLength($value)
|
||||
{
|
||||
$this->_length = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Logo.php
Normal file
49
library/Zend/Gdata/App/Extension/Logo.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Logo.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:logo element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Logo extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'logo';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
48
library/Zend/Gdata/App/Extension/Name.php
Normal file
48
library/Zend/Gdata/App/Extension/Name.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Name.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:name element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Name extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'name';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
}
|
163
library/Zend/Gdata/App/Extension/Person.php
Normal file
163
library/Zend/Gdata/App/Extension/Person.php
Normal file
|
@ -0,0 +1,163 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Person.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Name
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Name.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Email
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Email.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Uri
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Uri.php';
|
||||
|
||||
/**
|
||||
* Base class for people (currently used by atom:author, atom:contributor)
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_Extension_Person extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = null;
|
||||
protected $_name = null;
|
||||
protected $_email = null;
|
||||
protected $_uri = null;
|
||||
|
||||
public function __construct($name = null, $email = null, $uri = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_name = $name;
|
||||
$this->_email = $email;
|
||||
$this->_uri = $uri;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_name != null) {
|
||||
$element->appendChild($this->_name->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_email != null) {
|
||||
$element->appendChild($this->_email->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_uri != null) {
|
||||
$element->appendChild($this->_uri->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'name':
|
||||
$name = new Zend_Gdata_App_Extension_Name();
|
||||
$name->transferFromDOM($child);
|
||||
$this->_name = $name;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'email':
|
||||
$email = new Zend_Gdata_App_Extension_Email();
|
||||
$email->transferFromDOM($child);
|
||||
$this->_email = $email;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'uri':
|
||||
$uri = new Zend_Gdata_App_Extension_Uri();
|
||||
$uri->transferFromDOM($child);
|
||||
$this->_uri = $uri;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Name $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setName($value)
|
||||
{
|
||||
$this->_name = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Email
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Email $value
|
||||
* @return Zend_Gdata_App_Extension_Person Provides a fluent interface
|
||||
*/
|
||||
public function setEmail($value)
|
||||
{
|
||||
$this->_email = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Uri
|
||||
*/
|
||||
public function getUri()
|
||||
{
|
||||
return $this->_uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Uri $value
|
||||
* @return Zend_Gdata_App_Extension_Person Provides a fluent interface
|
||||
*/
|
||||
public function setUri($value)
|
||||
{
|
||||
$this->_uri = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Published.php
Normal file
49
library/Zend/Gdata/App/Extension/Published.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Published.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:published element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Published extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'published';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Rights.php
Normal file
49
library/Zend/Gdata/App/Extension/Rights.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Rights.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Text
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Text.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:rights element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Rights extends Zend_Gdata_App_Extension_Text
|
||||
{
|
||||
|
||||
protected $_rootElement = 'rights';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
46
library/Zend/Gdata/App/Extension/Source.php
Normal file
46
library/Zend/Gdata/App/Extension/Source.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Source.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_FeedSourceParent
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/FeedSourceParent.php';
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Source extends Zend_Gdata_App_FeedSourceParent
|
||||
{
|
||||
|
||||
protected $_rootElement = 'source';
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/Extension/Subtitle.php
Normal file
43
library/Zend/Gdata/App/Extension/Subtitle.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Subtitle.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Text
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Text.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:subtitle element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Subtitle extends Zend_Gdata_App_Extension_Text
|
||||
{
|
||||
|
||||
protected $_rootElement = 'subtitle';
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/Extension/Summary.php
Normal file
43
library/Zend/Gdata/App/Extension/Summary.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Summary.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Text
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Text.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:summary element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Summary extends Zend_Gdata_App_Extension_Text
|
||||
{
|
||||
|
||||
protected $_rootElement = 'summary';
|
||||
|
||||
}
|
90
library/Zend/Gdata/App/Extension/Text.php
Normal file
90
library/Zend/Gdata/App/Extension/Text.php
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Text.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Abstract class for data models that require only text and type-- such as:
|
||||
* title, summary, etc.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_Extension_Text extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = null;
|
||||
protected $_type = 'text';
|
||||
|
||||
public function __construct($text = null, $type = 'text')
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_type !== null) {
|
||||
$element->setAttribute('type', $this->_type);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'type':
|
||||
$this->_type = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @return Zend_Gdata_App_Extension_Type
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_App_Extension_Text Provides a fluent interface
|
||||
*/
|
||||
public function setType($value)
|
||||
{
|
||||
$this->_type = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/Extension/Title.php
Normal file
43
library/Zend/Gdata/App/Extension/Title.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Title.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Text
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Text.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:title element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Title extends Zend_Gdata_App_Extension_Text
|
||||
{
|
||||
|
||||
protected $_rootElement = 'title';
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Updated.php
Normal file
49
library/Zend/Gdata/App/Extension/Updated.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Updated.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:updated element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Updated extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'updated';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
49
library/Zend/Gdata/App/Extension/Uri.php
Normal file
49
library/Zend/Gdata/App/Extension/Uri.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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 uri
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Uri.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the atom:uri element
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Extension_Uri extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootElement = 'uri';
|
||||
|
||||
public function __construct($text = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->_text = $text;
|
||||
}
|
||||
|
||||
}
|
352
library/Zend/Gdata/App/Feed.php
Normal file
352
library/Zend/Gdata/App/Feed.php
Normal file
|
@ -0,0 +1,352 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Feed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_FeedSourceParent
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/FeedSourceParent.php';
|
||||
|
||||
/**
|
||||
* Atom feed class
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Feed extends Zend_Gdata_App_FeedSourceParent
|
||||
implements Iterator, ArrayAccess
|
||||
{
|
||||
|
||||
/**
|
||||
* The root xml element of this data element
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_rootElement = 'feed';
|
||||
|
||||
/**
|
||||
* Cache of feed entries.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_entry = array();
|
||||
|
||||
/**
|
||||
* Current location in $_entry array
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_entryIndex = 0;
|
||||
|
||||
/**
|
||||
* Make accessing some individual elements of the feed easier.
|
||||
*
|
||||
* Special accessors 'entry' and 'entries' are provided so that if
|
||||
* you wish to iterate over an Atom feed's entries, you can do so
|
||||
* using foreach ($feed->entries as $entry) or foreach
|
||||
* ($feed->entry as $entry).
|
||||
*
|
||||
* @param string $var The property to get.
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($var)
|
||||
{
|
||||
switch ($var) {
|
||||
case 'entries':
|
||||
return $this;
|
||||
default:
|
||||
return parent::__get($var);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the DOM model representing this object and all children
|
||||
*
|
||||
* @param DOMDocument $doc
|
||||
* @return DOMElement
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
foreach ($this->_entry as $entry) {
|
||||
$element->appendChild($entry->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates individual Entry objects of the appropriate type and
|
||||
* stores them in the $_entry array based upon DOM data.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode to process
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'entry':
|
||||
$newEntry = new $this->_entryClassName($child);
|
||||
$newEntry->setHttpClient($this->getHttpClient());
|
||||
$newEntry->setMajorProtocolVersion($this->getMajorProtocolVersion());
|
||||
$newEntry->setMinorProtocolVersion($this->getMinorProtocolVersion());
|
||||
$this->_entry[] = $newEntry;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of entries in this feed object.
|
||||
*
|
||||
* @return integer Entry count.
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->_entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the Iterator interface.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->_entryIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the Iterator interface.
|
||||
*
|
||||
* @return mixed The current row, or null if no rows.
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->_entry[$this->_entryIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the Iterator interface.
|
||||
*
|
||||
* @return mixed The current row number (starts at 0), or NULL if no rows
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return $this->_entryIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the Iterator interface.
|
||||
*
|
||||
* @return mixed The next row, or null if no more rows.
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
++$this->_entryIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the Iterator interface.
|
||||
*
|
||||
* @return boolean Whether the iteration is valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
return 0 <= $this->_entryIndex && $this->_entryIndex < $this->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the array of atom:entry elements contained within this
|
||||
* atom:feed representation
|
||||
*
|
||||
* @return array Zend_Gdata_App_Entry array
|
||||
*/
|
||||
public function getEntry()
|
||||
{
|
||||
return $this->_entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the array of atom:entry elements contained within this
|
||||
* atom:feed representation
|
||||
*
|
||||
* @param array $value The array of Zend_Gdata_App_Entry elements
|
||||
* @return Zend_Gdata_App_Feed Provides a fluent interface
|
||||
*/
|
||||
public function setEntry($value)
|
||||
{
|
||||
$this->_entry = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an entry representation to the array of entries
|
||||
* contained within this feed
|
||||
*
|
||||
* @param Zend_Gdata_App_Entry An individual entry to add.
|
||||
* @return Zend_Gdata_App_Feed Provides a fluent interface
|
||||
*/
|
||||
public function addEntry($value)
|
||||
{
|
||||
$this->_entry[] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the ArrayAccess interface
|
||||
*
|
||||
* @param int $key The index to set
|
||||
* @param Zend_Gdata_App_Entry $value The value to set
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
$this->_entry[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the ArrayAccess interface
|
||||
*
|
||||
* @param int $key The index to get
|
||||
* @param Zend_Gdata_App_Entry $value The value to set
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
{
|
||||
if (array_key_exists($key, $this->_entry)) {
|
||||
return $this->_entry[$key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the ArrayAccess interface
|
||||
*
|
||||
* @param int $key The index to set
|
||||
* @param Zend_Gdata_App_Entry $value The value to set
|
||||
*/
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
if (array_key_exists($key, $this->_entry)) {
|
||||
unset($this->_entry[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Required by the ArrayAccess interface
|
||||
*
|
||||
* @param int $key The index to check for existence
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return (array_key_exists($key, $this->_entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the next set of results from this feed.
|
||||
*
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
* @return mixed|null Returns the next set of results as a feed of the same
|
||||
* class as this feed, or null if no results exist.
|
||||
*/
|
||||
public function getNextFeed()
|
||||
{
|
||||
$nextLink = $this->getNextLink();
|
||||
if (!$nextLink) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_Exception('No link to next set ' .
|
||||
'of results found.');
|
||||
}
|
||||
$nextLinkHref = $nextLink->getHref();
|
||||
$service = new Zend_Gdata_App($this->getHttpClient());
|
||||
|
||||
return $service->getFeed($nextLinkHref, get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the previous set of results from this feed.
|
||||
*
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
* @return mixed|null Returns the previous set of results as a feed of
|
||||
* the same class as this feed, or null if no results exist.
|
||||
*/
|
||||
public function getPreviousFeed()
|
||||
{
|
||||
$previousLink = $this->getPreviousLink();
|
||||
if (!$previousLink) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_Exception('No link to previous set ' .
|
||||
'of results found.');
|
||||
}
|
||||
$previousLinkHref = $previousLink->getHref();
|
||||
$service = new Zend_Gdata_App($this->getHttpClient());
|
||||
|
||||
return $service->getFeed($previousLinkHref, get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the major protocol version that should be used. Values < 1 will
|
||||
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
|
||||
*
|
||||
* This value will be propogated to all child entries.
|
||||
*
|
||||
* @see _majorProtocolVersion
|
||||
* @param (int|NULL) $value The major protocol version to use.
|
||||
* @throws Zend_Gdata_App_InvalidArgumentException
|
||||
*/
|
||||
public function setMajorProtocolVersion($value)
|
||||
{
|
||||
parent::setMajorProtocolVersion($value);
|
||||
foreach ($this->entries as $entry) {
|
||||
$entry->setMajorProtocolVersion($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the minor protocol version that should be used. If set to NULL, no
|
||||
* minor protocol version will be sent to the server. Values < 0 will
|
||||
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
|
||||
*
|
||||
* This value will be propogated to all child entries.
|
||||
*
|
||||
* @see _minorProtocolVersion
|
||||
* @param (int|NULL) $value The minor protocol version to use.
|
||||
* @throws Zend_Gdata_App_InvalidArgumentException
|
||||
*/
|
||||
public function setMinorProtocolVersion($value)
|
||||
{
|
||||
parent::setMinorProtocolVersion($value);
|
||||
foreach ($this->entries as $entry) {
|
||||
$entry->setMinorProtocolVersion($value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
681
library/Zend/Gdata/App/FeedEntryParent.php
Normal file
681
library/Zend/Gdata/App/FeedEntryParent.php
Normal file
|
@ -0,0 +1,681 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FeedEntryParent.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Element
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Element.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Author
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Author.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Category
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Category.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Contributor
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Contributor.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Id
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Id.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Link
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Link.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Rights
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Rights.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Title
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Title.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Updated
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Updated.php';
|
||||
|
||||
/**
|
||||
* Zend_Version
|
||||
*/
|
||||
require_once 'Zend/Version.php';
|
||||
|
||||
/**
|
||||
* Abstract class for common functionality in entries and feeds
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_FeedEntryParent extends Zend_Gdata_App_Base
|
||||
{
|
||||
/**
|
||||
* Service instance used to make network requests.
|
||||
*
|
||||
* @see setService(), getService()
|
||||
*/
|
||||
protected $_service = null;
|
||||
|
||||
/**
|
||||
* The HTTP ETag associated with this entry. Used for optimistic
|
||||
* concurrency in protoco v2 or greater.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $_etag = NULL;
|
||||
|
||||
protected $_author = array();
|
||||
protected $_category = array();
|
||||
protected $_contributor = array();
|
||||
protected $_id = null;
|
||||
protected $_link = array();
|
||||
protected $_rights = null;
|
||||
protected $_title = null;
|
||||
protected $_updated = null;
|
||||
|
||||
/**
|
||||
* Indicates the major protocol version that should be used.
|
||||
* At present, recognized values are either 1 or 2. However, any integer
|
||||
* value >= 1 is considered valid.
|
||||
*
|
||||
* @see setMajorProtocolVersion()
|
||||
* @see getMajorProtocolVersion()
|
||||
*/
|
||||
protected $_majorProtocolVersion = 1;
|
||||
|
||||
/**
|
||||
* Indicates the minor protocol version that should be used. Can be set
|
||||
* to either an integer >= 0, or NULL if no minor version should be sent
|
||||
* to the server.
|
||||
*
|
||||
* @see setMinorProtocolVersion()
|
||||
* @see getMinorProtocolVersion()
|
||||
*/
|
||||
protected $_minorProtocolVersion = null;
|
||||
|
||||
/**
|
||||
* Constructs a Feed or Entry
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
if (!($element instanceof DOMElement)) {
|
||||
if ($element) {
|
||||
$this->transferFromXML($element);
|
||||
}
|
||||
} else {
|
||||
$this->transferFromDOM($element);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTTP client instance
|
||||
*
|
||||
* Sets the HTTP client object to use for retrieving the feed.
|
||||
*
|
||||
* @deprecated Deprecated as of Zend Framework 1.7. Use
|
||||
* setService() instead.
|
||||
* @param Zend_Http_Client $httpClient
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setHttpClient(Zend_Http_Client $httpClient)
|
||||
{
|
||||
if (!$this->_service) {
|
||||
$this->_service = new Zend_Gdata_App();
|
||||
}
|
||||
$this->_service->setHttpClient($httpClient);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP client object. If none is set, a new Zend_Http_Client
|
||||
* will be used.
|
||||
*
|
||||
* @deprecated Deprecated as of Zend Framework 1.7. Use
|
||||
* getService() instead.
|
||||
* @return Zend_Http_Client_Abstract
|
||||
*/
|
||||
public function getHttpClient()
|
||||
{
|
||||
if (!$this->_service) {
|
||||
$this->_service = new Zend_Gdata_App();
|
||||
}
|
||||
$client = $this->_service->getHttpClient();
|
||||
return $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the active service instance for this object. This will be used to
|
||||
* perform network requests, such as when calling save() and delete().
|
||||
*
|
||||
* @param Zend_Gdata_App $instance The new service instance.
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface.
|
||||
*/
|
||||
public function setService($instance)
|
||||
{
|
||||
$this->_service = $instance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active service instance for this object. This will be used to
|
||||
* perform network requests, such as when calling save() and delete().
|
||||
*
|
||||
* @return Zend_Gdata_App|null The current service instance, or null if
|
||||
* not set.
|
||||
*/
|
||||
public function getService()
|
||||
{
|
||||
return $this->_service;
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
foreach ($this->_author as $author) {
|
||||
$element->appendChild($author->getDOM($element->ownerDocument));
|
||||
}
|
||||
foreach ($this->_category as $category) {
|
||||
$element->appendChild($category->getDOM($element->ownerDocument));
|
||||
}
|
||||
foreach ($this->_contributor as $contributor) {
|
||||
$element->appendChild($contributor->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_id != null) {
|
||||
$element->appendChild($this->_id->getDOM($element->ownerDocument));
|
||||
}
|
||||
foreach ($this->_link as $link) {
|
||||
$element->appendChild($link->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_rights != null) {
|
||||
$element->appendChild($this->_rights->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_title != null) {
|
||||
$element->appendChild($this->_title->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_updated != null) {
|
||||
$element->appendChild($this->_updated->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'author':
|
||||
$author = new Zend_Gdata_App_Extension_Author();
|
||||
$author->transferFromDOM($child);
|
||||
$this->_author[] = $author;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'category':
|
||||
$category = new Zend_Gdata_App_Extension_Category();
|
||||
$category->transferFromDOM($child);
|
||||
$this->_category[] = $category;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'contributor':
|
||||
$contributor = new Zend_Gdata_App_Extension_Contributor();
|
||||
$contributor->transferFromDOM($child);
|
||||
$this->_contributor[] = $contributor;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'id':
|
||||
$id = new Zend_Gdata_App_Extension_Id();
|
||||
$id->transferFromDOM($child);
|
||||
$this->_id = $id;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'link':
|
||||
$link = new Zend_Gdata_App_Extension_Link();
|
||||
$link->transferFromDOM($child);
|
||||
$this->_link[] = $link;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'rights':
|
||||
$rights = new Zend_Gdata_App_Extension_Rights();
|
||||
$rights->transferFromDOM($child);
|
||||
$this->_rights = $rights;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'title':
|
||||
$title = new Zend_Gdata_App_Extension_Title();
|
||||
$title->transferFromDOM($child);
|
||||
$this->_title = $title;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'updated':
|
||||
$updated = new Zend_Gdata_App_Extension_Updated();
|
||||
$updated->transferFromDOM($child);
|
||||
$this->_updated = $updated;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Author
|
||||
*/
|
||||
public function getAuthor()
|
||||
{
|
||||
return $this->_author;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of the authors of this feed/entry. In an atom feed, each
|
||||
* author is represented by an atom:author element
|
||||
*
|
||||
* @param array $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setAuthor($value)
|
||||
{
|
||||
$this->_author = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array of categories that classify this feed/entry. Each
|
||||
* category is represented in an atom feed by an atom:category element.
|
||||
*
|
||||
* @return array Array of Zend_Gdata_App_Extension_Category
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
return $this->_category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the array of categories that classify this feed/entry. Each
|
||||
* category is represented in an atom feed by an atom:category element.
|
||||
*
|
||||
* @param array $value Array of Zend_Gdata_App_Extension_Category
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setCategory($value)
|
||||
{
|
||||
$this->_category = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the array of contributors to this feed/entry. Each contributor
|
||||
* is represented in an atom feed by an atom:contributor XML element
|
||||
*
|
||||
* @return array An array of Zend_Gdata_App_Extension_Contributor
|
||||
*/
|
||||
public function getContributor()
|
||||
{
|
||||
return $this->_contributor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the array of contributors to this feed/entry. Each contributor
|
||||
* is represented in an atom feed by an atom:contributor XML element
|
||||
*
|
||||
* @param array $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setContributor($value)
|
||||
{
|
||||
$this->_contributor = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Id
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Id $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setId($value)
|
||||
{
|
||||
$this->_id = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a particular 'rel' value, this method returns a matching
|
||||
* Zend_Gdata_App_Extension_Link element. If the 'rel' value
|
||||
* is not provided, the full array of Zend_Gdata_App_Extension_Link
|
||||
* elements is returned. In an atom feed, each link is represented
|
||||
* by an atom:link element. The 'rel' value passed to this function
|
||||
* is the atom:link/@rel attribute. Example rel values include 'self',
|
||||
* 'edit', and 'alternate'.
|
||||
*
|
||||
* @param string $rel The rel value of the link to be found. If null,
|
||||
* the array of Zend_Gdata_App_Extension_link elements is returned
|
||||
* @return mixed Either a single Zend_Gdata_App_Extension_link element,
|
||||
* an array of the same or null is returned depending on the rel value
|
||||
* supplied as the argument to this function
|
||||
*/
|
||||
public function getLink($rel = null)
|
||||
{
|
||||
if ($rel == null) {
|
||||
return $this->_link;
|
||||
} else {
|
||||
foreach ($this->_link as $link) {
|
||||
if ($link->rel == $rel) {
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Zend_Gdata_App_Extension_Link element which represents
|
||||
* the URL used to edit this resource. This link is in the atom feed/entry
|
||||
* as an atom:link with a rel attribute value of 'edit'.
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
|
||||
*/
|
||||
public function getEditLink()
|
||||
{
|
||||
return $this->getLink('edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Zend_Gdata_App_Extension_Link element which represents
|
||||
* the URL used to retrieve the next chunk of results when paging through
|
||||
* a feed. This link is in the atom feed as an atom:link with a
|
||||
* rel attribute value of 'next'.
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
|
||||
*/
|
||||
public function getNextLink()
|
||||
{
|
||||
return $this->getLink('next');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Zend_Gdata_App_Extension_Link element which represents
|
||||
* the URL used to retrieve the previous chunk of results when paging
|
||||
* through a feed. This link is in the atom feed as an atom:link with a
|
||||
* rel attribute value of 'previous'.
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
|
||||
*/
|
||||
public function getPreviousLink()
|
||||
{
|
||||
return $this->getLink('previous');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Link
|
||||
*/
|
||||
public function getLicenseLink()
|
||||
{
|
||||
return $this->getLink('license');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Zend_Gdata_App_Extension_Link element which represents
|
||||
* the URL used to retrieve the entry or feed represented by this object
|
||||
* This link is in the atom feed/entry as an atom:link with a
|
||||
* rel attribute value of 'self'.
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
|
||||
*/
|
||||
public function getSelfLink()
|
||||
{
|
||||
return $this->getLink('self');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Zend_Gdata_App_Extension_Link element which represents
|
||||
* the URL for an alternate view of the data represented by this feed or
|
||||
* entry. This alternate view is commonly a user-facing webpage, blog
|
||||
* post, etc. The MIME type for the data at the URL is available from the
|
||||
* returned Zend_Gdata_App_Extension_Link element.
|
||||
* This link is in the atom feed/entry as an atom:link with a
|
||||
* rel attribute value of 'self'.
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link The link, or null if not found
|
||||
*/
|
||||
public function getAlternateLink()
|
||||
{
|
||||
return $this->getLink('alternate');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $value The array of Zend_Gdata_App_Extension_Link elements
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setLink($value)
|
||||
{
|
||||
$this->_link = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_AppExtension_Rights
|
||||
*/
|
||||
public function getRights()
|
||||
{
|
||||
return $this->_rights;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Rights $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setRights($value)
|
||||
{
|
||||
$this->_rights = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title of this feed or entry. The title is an extremely
|
||||
* short textual representation of this resource and is found as
|
||||
* an atom:title element in a feed or entry
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Title
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->_title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the title of this feed or entry.
|
||||
* The title is an extremely short textual representation of this
|
||||
* resource and is found as an atom:title element in a feed or entry
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleValue()
|
||||
{
|
||||
if (($titleObj = $this->getTitle()) != null) {
|
||||
return $titleObj->getText();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title of this feed or entry. The title is an extremely
|
||||
* short textual representation of this resource and is found as
|
||||
* an atom:title element in a feed or entry
|
||||
*
|
||||
* @param Zend_Gdata_App_Extension_Title $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setTitle($value)
|
||||
{
|
||||
$this->_title = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_App_Extension_Updated
|
||||
*/
|
||||
public function getUpdated()
|
||||
{
|
||||
return $this->_updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Updated $value
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface
|
||||
*/
|
||||
public function setUpdated($value)
|
||||
{
|
||||
$this->_updated = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Etag for the current entry to $value. Setting $value to null
|
||||
* unsets the Etag.
|
||||
*
|
||||
* @param string|null $value
|
||||
* @return Zend_Gdata_App_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setEtag($value) {
|
||||
$this->_etag = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Etag for the current entry, or null if not set.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEtag() {
|
||||
return $this->_etag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the major protocol version that should be used. Values < 1
|
||||
* (excluding NULL) will cause a Zend_Gdata_App_InvalidArgumentException
|
||||
* to be thrown.
|
||||
*
|
||||
* @see _majorProtocolVersion
|
||||
* @param (int|NULL) $value The major protocol version to use.
|
||||
* @throws Zend_Gdata_App_InvalidArgumentException
|
||||
*/
|
||||
public function setMajorProtocolVersion($value)
|
||||
{
|
||||
if (!($value >= 1) && ($value !== null)) {
|
||||
require_once('Zend/Gdata/App/InvalidArgumentException.php');
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Major protocol version must be >= 1');
|
||||
}
|
||||
$this->_majorProtocolVersion = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the major protocol version that is in use.
|
||||
*
|
||||
* @see _majorProtocolVersion
|
||||
* @return (int|NULL) The major protocol version in use.
|
||||
*/
|
||||
public function getMajorProtocolVersion()
|
||||
{
|
||||
return $this->_majorProtocolVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the minor protocol version that should be used. If set to NULL, no
|
||||
* minor protocol version will be sent to the server. Values < 0 will
|
||||
* cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
|
||||
*
|
||||
* @see _minorProtocolVersion
|
||||
* @param (int|NULL) $value The minor protocol version to use.
|
||||
* @throws Zend_Gdata_App_InvalidArgumentException
|
||||
*/
|
||||
public function setMinorProtocolVersion($value)
|
||||
{
|
||||
if (!($value >= 0)) {
|
||||
require_once('Zend/Gdata/App/InvalidArgumentException.php');
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Minor protocol version must be >= 0 or null');
|
||||
}
|
||||
$this->_minorProtocolVersion = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the minor protocol version that is in use.
|
||||
*
|
||||
* @see _minorProtocolVersion
|
||||
* @return (int|NULL) The major protocol version in use, or NULL if no
|
||||
* minor version is specified.
|
||||
*/
|
||||
public function getMinorProtocolVersion()
|
||||
{
|
||||
return $this->_minorProtocolVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full version of a namespace prefix
|
||||
*
|
||||
* Looks up a prefix (atom:, etc.) in the list of registered
|
||||
* namespaces and returns the full namespace URI if
|
||||
* available. Returns the prefix, unmodified, if it's not
|
||||
* registered.
|
||||
*
|
||||
* The current entry or feed's version will be used when performing the
|
||||
* namespace lookup unless overridden using $majorVersion and
|
||||
* $minorVersion. If the entry/fee has a null version, then the latest
|
||||
* protocol version will be used by default.
|
||||
*
|
||||
* @param string $prefix The namespace prefix to lookup.
|
||||
* @param integer $majorVersion The major protocol version in effect.
|
||||
* Defaults to null (auto-select).
|
||||
* @param integer $minorVersion The minor protocol version in effect.
|
||||
* Defaults to null (auto-select).
|
||||
* @return string
|
||||
*/
|
||||
public function lookupNamespace($prefix,
|
||||
$majorVersion = null,
|
||||
$minorVersion = null)
|
||||
{
|
||||
// Auto-select current version
|
||||
if ($majorVersion === null) {
|
||||
$majorVersion = $this->getMajorProtocolVersion();
|
||||
}
|
||||
if ($minorVersion === null) {
|
||||
$minorVersion = $this->getMinorProtocolVersion();
|
||||
}
|
||||
|
||||
// Perform lookup
|
||||
return parent::lookupNamespace($prefix, $majorVersion, $minorVersion);
|
||||
}
|
||||
|
||||
}
|
267
library/Zend/Gdata/App/FeedSourceParent.php
Normal file
267
library/Zend/Gdata/App/FeedSourceParent.php
Normal file
|
@ -0,0 +1,267 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FeedSourceParent.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_FeedSourceParent
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/FeedEntryParent.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Generator
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Generator.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Icon
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Icon.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Logo
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Logo.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Subtitle
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Subtitle.php';
|
||||
|
||||
/**
|
||||
* Atom feed class
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Gdata_App_FeedSourceParent extends Zend_Gdata_App_FeedEntryParent
|
||||
{
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_App_Entry';
|
||||
|
||||
/**
|
||||
* Root XML element for Atom entries.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_rootElement = null;
|
||||
|
||||
protected $_generator = null;
|
||||
protected $_icon = null;
|
||||
protected $_logo = null;
|
||||
protected $_subtitle = null;
|
||||
|
||||
/**
|
||||
* Set the HTTP client instance
|
||||
*
|
||||
* Sets the HTTP client object to use for retrieving the feed.
|
||||
*
|
||||
* @deprecated Deprecated as of Zend Framework 1.7. Use
|
||||
* setService() instead.
|
||||
* @param Zend_Http_Client $httpClient
|
||||
* @return Zend_Gdata_App_FeedSourceParent Provides a fluent interface
|
||||
*/
|
||||
public function setHttpClient(Zend_Http_Client $httpClient)
|
||||
{
|
||||
parent::setHttpClient($httpClient);
|
||||
foreach ($this->_entry as $entry) {
|
||||
$entry->setHttpClient($httpClient);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the active service instance for this feed and all enclosed entries.
|
||||
* This will be used to perform network requests, such as when calling
|
||||
* save() and delete().
|
||||
*
|
||||
* @param Zend_Gdata_App $instance The new service instance.
|
||||
* @return Zend_Gdata_App_FeedEntryParent Provides a fluent interface.
|
||||
*/
|
||||
public function setService($instance)
|
||||
{
|
||||
parent::setService($instance);
|
||||
foreach ($this->_entry as $entry) {
|
||||
$entry->setService($instance);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make accessing some individual elements of the feed easier.
|
||||
*
|
||||
* Special accessors 'entry' and 'entries' are provided so that if
|
||||
* you wish to iterate over an Atom feed's entries, you can do so
|
||||
* using foreach ($feed->entries as $entry) or foreach
|
||||
* ($feed->entry as $entry).
|
||||
*
|
||||
* @param string $var The property to access.
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($var)
|
||||
{
|
||||
switch ($var) {
|
||||
default:
|
||||
return parent::__get($var);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_generator != null) {
|
||||
$element->appendChild($this->_generator->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_icon != null) {
|
||||
$element->appendChild($this->_icon->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_logo != null) {
|
||||
$element->appendChild($this->_logo->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_subtitle != null) {
|
||||
$element->appendChild($this->_subtitle->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates individual Entry objects of the appropriate type and
|
||||
* stores them in the $_entry array based upon DOM data.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode to process
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'generator':
|
||||
$generator = new Zend_Gdata_App_Extension_Generator();
|
||||
$generator->transferFromDOM($child);
|
||||
$this->_generator = $generator;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'icon':
|
||||
$icon = new Zend_Gdata_App_Extension_Icon();
|
||||
$icon->transferFromDOM($child);
|
||||
$this->_icon = $icon;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'logo':
|
||||
$logo = new Zend_Gdata_App_Extension_Logo();
|
||||
$logo->transferFromDOM($child);
|
||||
$this->_logo = $logo;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'subtitle':
|
||||
$subtitle = new Zend_Gdata_App_Extension_Subtitle();
|
||||
$subtitle->transferFromDOM($child);
|
||||
$this->_subtitle = $subtitle;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_AppExtension_Generator
|
||||
*/
|
||||
public function getGenerator()
|
||||
{
|
||||
return $this->_generator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Generator $value
|
||||
* @return Zend_Gdata_App_FeedSourceParent Provides a fluent interface
|
||||
*/
|
||||
public function setGenerator($value)
|
||||
{
|
||||
$this->_generator = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_AppExtension_Icon
|
||||
*/
|
||||
public function getIcon()
|
||||
{
|
||||
return $this->_icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Icon $value
|
||||
* @return Zend_Gdata_App_FeedSourceParent Provides a fluent interface
|
||||
*/
|
||||
public function setIcon($value)
|
||||
{
|
||||
$this->_icon = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_AppExtension_logo
|
||||
*/
|
||||
public function getlogo()
|
||||
{
|
||||
return $this->_logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_logo $value
|
||||
* @return Zend_Gdata_App_FeedSourceParent Provides a fluent interface
|
||||
*/
|
||||
public function setlogo($value)
|
||||
{
|
||||
$this->_logo = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Gdata_AppExtension_Subtitle
|
||||
*/
|
||||
public function getSubtitle()
|
||||
{
|
||||
return $this->_subtitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_App_Extension_Subtitle $value
|
||||
* @return Zend_Gdata_App_FeedSourceParent Provides a fluent interface
|
||||
*/
|
||||
public function setSubtitle($value)
|
||||
{
|
||||
$this->_subtitle = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
121
library/Zend/Gdata/App/HttpException.php
Normal file
121
library/Zend/Gdata/App/HttpException.php
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: HttpException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Zend_Http_Client_Exception
|
||||
*/
|
||||
require_once 'Zend/Http/Client/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata exceptions
|
||||
*
|
||||
* Class to represent exceptions that occur during Gdata operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_HttpException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
|
||||
protected $_httpClientException = null;
|
||||
protected $_response = null;
|
||||
|
||||
/**
|
||||
* Create a new Zend_Gdata_App_HttpException
|
||||
*
|
||||
* @param string $message Optionally set a message
|
||||
* @param Zend_Http_Client_Exception Optionally pass in a Zend_Http_Client_Exception
|
||||
* @param Zend_Http_Response Optionally pass in a Zend_Http_Response
|
||||
*/
|
||||
public function __construct($message = null, $e = null, $response = null)
|
||||
{
|
||||
$this->_httpClientException = $e;
|
||||
$this->_response = $response;
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Zend_Http_Client_Exception.
|
||||
*
|
||||
* @return Zend_Http_Client_Exception
|
||||
*/
|
||||
public function getHttpClientException()
|
||||
{
|
||||
return $this->_httpClientException;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Zend_Http_Client_Exception.
|
||||
*
|
||||
* @param Zend_Http_Client_Exception $value
|
||||
*/
|
||||
public function setHttpClientException($value)
|
||||
{
|
||||
$this->_httpClientException = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Zend_Http_Response.
|
||||
*
|
||||
* @param Zend_Http_Response $response
|
||||
*/
|
||||
public function setResponse($response)
|
||||
{
|
||||
$this->_response = $response;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Zend_Http_Response.
|
||||
*
|
||||
* @return Zend_Http_Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the body of the Zend_Http_Response
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRawResponseBody()
|
||||
{
|
||||
if ($this->getResponse()) {
|
||||
$response = $this->getResponse();
|
||||
return $response->getRawBody();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
43
library/Zend/Gdata/App/IOException.php
Normal file
43
library/Zend/Gdata/App/IOException.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: IOException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata App IO exceptions.
|
||||
*
|
||||
* Class to represent IO exceptions that occur during Gdata App operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_IOException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
}
|
42
library/Zend/Gdata/App/InvalidArgumentException.php
Normal file
42
library/Zend/Gdata/App/InvalidArgumentException.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InvalidArgumentException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata exceptions
|
||||
*
|
||||
* Class to represent exceptions that occur during Gdata operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_InvalidArgumentException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
}
|
119
library/Zend/Gdata/App/LoggingHttpClientAdapterSocket.php
Normal file
119
library/Zend/Gdata/App/LoggingHttpClientAdapterSocket.php
Normal file
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @version $Id: LoggingHttpClientAdapterSocket.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Http_Client_Adapter_Socket
|
||||
*/
|
||||
require_once 'Zend/Http/Client/Adapter/Socket.php';
|
||||
|
||||
/**
|
||||
* Overrides the traditional socket-based adapter class for Zend_Http_Client to
|
||||
* enable logging of requests. All requests are logged to a location specified
|
||||
* in the config as $config['logfile']. Requests and responses are logged after
|
||||
* they are sent and received/processed, thus an error could prevent logging.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_LoggingHttpClientAdapterSocket extends Zend_Http_Client_Adapter_Socket
|
||||
{
|
||||
|
||||
/**
|
||||
* The file handle for writing logs
|
||||
*
|
||||
* @var resource|null
|
||||
*/
|
||||
protected $log_handle = null;
|
||||
|
||||
/**
|
||||
* Log the given message to the log file. The log file is configured
|
||||
* as the config param 'logfile'. This method opens the file for
|
||||
* writing if necessary.
|
||||
*
|
||||
* @param string $message The message to log
|
||||
*/
|
||||
protected function log($message)
|
||||
{
|
||||
if ($this->log_handle == null) {
|
||||
$this->log_handle = fopen($this->config['logfile'], 'a');
|
||||
}
|
||||
fwrite($this->log_handle, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to the remote server
|
||||
*
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param boolean $secure
|
||||
* @param int $timeout
|
||||
*/
|
||||
public function connect($host, $port = 80, $secure = false)
|
||||
{
|
||||
$this->log("Connecting to: ${host}:${port}");
|
||||
return parent::connect($host, $port, $secure);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send request to the remote server
|
||||
*
|
||||
* @param string $method
|
||||
* @param Zend_Uri_Http $uri
|
||||
* @param string $http_ver
|
||||
* @param array $headers
|
||||
* @param string $body
|
||||
* @return string Request as string
|
||||
*/
|
||||
public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
|
||||
{
|
||||
$request = parent::write($method, $uri, $http_ver, $headers, $body);
|
||||
$this->log("\n\n" . $request);
|
||||
return $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read response from server
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$response = parent::read();
|
||||
$this->log("${response}\n\n");
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the connection to the server
|
||||
*
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
$this->log("Closing socket\n\n");
|
||||
parent::close();
|
||||
}
|
||||
|
||||
}
|
119
library/Zend/Gdata/App/MediaEntry.php
Normal file
119
library/Zend/Gdata/App/MediaEntry.php
Normal file
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MediaEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_MediaSource
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/MediaSource.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_MediaMimeStream
|
||||
*/
|
||||
require_once 'Zend/Gdata/MediaMimeStream.php';
|
||||
|
||||
/**
|
||||
* Concrete class for working with Atom entries containing multi-part data.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_MediaEntry extends Zend_Gdata_App_Entry
|
||||
{
|
||||
/**
|
||||
* The attached MediaSource/file
|
||||
*
|
||||
* @var Zend_Gdata_App_MediaSource
|
||||
*/
|
||||
protected $_mediaSource = null;
|
||||
|
||||
/**
|
||||
* Constructs a new MediaEntry, representing XML data and optional
|
||||
* file to upload
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null, $mediaSource = null)
|
||||
{
|
||||
parent::__construct($element);
|
||||
$this->_mediaSource = $mediaSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MIME multipart representation of this MediaEntry.
|
||||
*
|
||||
* @return string|Zend_Gdata_MediaMimeStream The MIME multipart
|
||||
* representation of this MediaEntry. If the entry consisted only
|
||||
* of XML, a string is returned.
|
||||
*/
|
||||
public function encode()
|
||||
{
|
||||
$xmlData = $this->saveXML();
|
||||
$mediaSource = $this->getMediaSource();
|
||||
if ($mediaSource === null) {
|
||||
// No attachment, just send XML for entry
|
||||
return $xmlData;
|
||||
} else {
|
||||
return new Zend_Gdata_MediaMimeStream($xmlData,
|
||||
$mediaSource->getFilename(), $mediaSource->getContentType());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MediaSource object representing the file attached to this
|
||||
* MediaEntry.
|
||||
*
|
||||
* @return Zend_Gdata_App_MediaSource The attached MediaSource/file
|
||||
*/
|
||||
public function getMediaSource()
|
||||
{
|
||||
return $this->_mediaSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the MediaSource object (file) for this MediaEntry
|
||||
*
|
||||
* @param Zend_Gdata_App_MediaSource $value The attached MediaSource/file
|
||||
* @return Zend_Gdata_App_MediaEntry Provides a fluent interface
|
||||
*/
|
||||
public function setMediaSource($value)
|
||||
{
|
||||
if ($value instanceof Zend_Gdata_App_MediaSource) {
|
||||
$this->_mediaSource = $value;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'You must specify the media data as a class that conforms to Zend_Gdata_App_MediaSource.');
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
146
library/Zend/Gdata/App/MediaFileSource.php
Normal file
146
library/Zend/Gdata/App/MediaFileSource.php
Normal file
|
@ -0,0 +1,146 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MediaFileSource.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_MediaData
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/BaseMediaSource.php';
|
||||
|
||||
/**
|
||||
* Concrete class to use a file handle as an attachment within a MediaEntry.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_MediaFileSource extends Zend_Gdata_App_BaseMediaSource
|
||||
{
|
||||
/**
|
||||
* The filename which is represented
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_filename = null;
|
||||
|
||||
/**
|
||||
* The content type for the file attached (example image/png)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_contentType = null;
|
||||
|
||||
/**
|
||||
* Create a new Zend_Gdata_App_MediaFileSource object.
|
||||
*
|
||||
* @param string $filename The name of the file to read from.
|
||||
*/
|
||||
public function __construct($filename)
|
||||
{
|
||||
$this->setFilename($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MIME multipart representation of this MediaEntry.
|
||||
*
|
||||
* @return string
|
||||
* @throws Zend_Gdata_App_IOException
|
||||
*/
|
||||
public function encode()
|
||||
{
|
||||
if ($this->getFilename() !== null &&
|
||||
is_readable($this->getFilename())) {
|
||||
|
||||
// Retrieves the file, using the include path
|
||||
$fileHandle = fopen($this->getFilename(), 'r', true);
|
||||
$result = fread($fileHandle, filesize($this->getFilename()));
|
||||
if ($result === false) {
|
||||
require_once 'Zend/Gdata/App/IOException.php';
|
||||
throw new Zend_Gdata_App_IOException("Error reading file - " .
|
||||
$this->getFilename() . '. Read failed.');
|
||||
}
|
||||
fclose($fileHandle);
|
||||
return $result;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/IOException.php';
|
||||
throw new Zend_Gdata_App_IOException("Error reading file - " .
|
||||
$this->getFilename() . '. File is not readable.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename associated with this reader.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the filename which is to be read.
|
||||
*
|
||||
* @param string $value The desired file handle.
|
||||
* @return Zend_Gdata_App_MediaFileSource Provides a fluent interface.
|
||||
*/
|
||||
public function setFilename($value)
|
||||
{
|
||||
$this->_filename = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The content type for the file attached (example image/png)
|
||||
*
|
||||
* @return string The content type
|
||||
*/
|
||||
public function getContentType()
|
||||
{
|
||||
return $this->_contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content type for the file attached (example image/png)
|
||||
*
|
||||
* @param string $value The content type
|
||||
* @return Zend_Gdata_App_MediaFileSource Provides a fluent interface
|
||||
*/
|
||||
public function setContentType($value)
|
||||
{
|
||||
$this->_contentType = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for getFilename().
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getFilename();
|
||||
}
|
||||
|
||||
}
|
73
library/Zend/Gdata/App/MediaSource.php
Normal file
73
library/Zend/Gdata/App/MediaSource.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MediaSource.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for defining data that can be encoded and sent over the network.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Gdata_App_MediaSource
|
||||
{
|
||||
/**
|
||||
* Return a byte stream representation of this object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function encode();
|
||||
|
||||
/**
|
||||
* Set the content type for the file attached (example image/png)
|
||||
*
|
||||
* @param string $value The content type
|
||||
* @return Zend_Gdata_App_MediaFileSource Provides a fluent interface
|
||||
*/
|
||||
public function setContentType($value);
|
||||
|
||||
/**
|
||||
* The content type for the file attached (example image/png)
|
||||
*
|
||||
* @return string The content type
|
||||
*/
|
||||
public function getContentType();
|
||||
|
||||
/**
|
||||
* Sets the Slug header value. Used by some services to determine the
|
||||
* title for the uploaded file. A null value indicates no slug header.
|
||||
*
|
||||
* @var string The slug value
|
||||
* @return Zend_Gdata_App_MediaSource Provides a fluent interface
|
||||
*/
|
||||
public function setSlug($value);
|
||||
|
||||
/**
|
||||
* Returns the Slug header value. Used by some services to determine the
|
||||
* title for the uploaded file. Returns null if no slug should be used.
|
||||
*
|
||||
* @return string The slug value
|
||||
*/
|
||||
public function getSlug();
|
||||
}
|
112
library/Zend/Gdata/App/Util.php
Normal file
112
library/Zend/Gdata/App/Util.php
Normal file
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Util.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Utility class for static functions needed by Zend_Gdata_App
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_Util
|
||||
{
|
||||
|
||||
/**
|
||||
* Convert timestamp into RFC 3339 date string.
|
||||
* 2005-04-19T15:30:00
|
||||
*
|
||||
* @param int $timestamp
|
||||
* @throws Zend_Gdata_App_InvalidArgumentException
|
||||
*/
|
||||
public static function formatTimestamp($timestamp)
|
||||
{
|
||||
$rfc3339 = '/^(\d{4})\-?(\d{2})\-?(\d{2})((T|t)(\d{2})\:?(\d{2})' .
|
||||
'\:?(\d{2})(\.\d{1,})?((Z|z)|([\+\-])(\d{2})\:?(\d{2})))?$/';
|
||||
|
||||
if (ctype_digit($timestamp)) {
|
||||
return gmdate('Y-m-d\TH:i:sP', $timestamp);
|
||||
} elseif (preg_match($rfc3339, $timestamp) > 0) {
|
||||
// timestamp is already properly formatted
|
||||
return $timestamp;
|
||||
} else {
|
||||
$ts = strtotime($timestamp);
|
||||
if ($ts === false) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException("Invalid timestamp: $timestamp.");
|
||||
}
|
||||
return date('Y-m-d\TH:i:s', $ts);
|
||||
}
|
||||
}
|
||||
|
||||
/** Find the greatest key that is less than or equal to a given upper
|
||||
* bound, and return the value associated with that key.
|
||||
*
|
||||
* @param integer|null $maximumKey The upper bound for keys. If null, the
|
||||
* maxiumum valued key will be found.
|
||||
* @param array $collection An two-dimensional array of key/value pairs
|
||||
* to search through.
|
||||
* @returns mixed The value corresponding to the located key.
|
||||
* @throws Zend_Gdata_App_Exception Thrown if $collection is empty.
|
||||
*/
|
||||
public static function findGreatestBoundedValue($maximumKey, $collection)
|
||||
{
|
||||
$found = false;
|
||||
$foundKey = $maximumKey;
|
||||
|
||||
// Sanity check: Make sure that the collection isn't empty
|
||||
if (sizeof($collection) == 0) {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception("Empty namespace collection encountered.");
|
||||
}
|
||||
|
||||
if ($maximumKey === null) {
|
||||
// If the key is null, then we return the maximum available
|
||||
$keys = array_keys($collection);
|
||||
sort($keys);
|
||||
$found = true;
|
||||
$foundKey = end($keys);
|
||||
} else {
|
||||
// Otherwise, we optimistically guess that the current version
|
||||
// will have a matching namespce. If that fails, we decrement the
|
||||
// version until we find a match.
|
||||
while (!$found && $foundKey >= 0) {
|
||||
if (array_key_exists($foundKey, $collection))
|
||||
$found = true;
|
||||
else
|
||||
$foundKey--;
|
||||
}
|
||||
}
|
||||
|
||||
// Guard: A namespace wasn't found. Either none were registered, or
|
||||
// the current protcol version is lower than the maximum namespace.
|
||||
if (!$found) {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception("Namespace compatible with current protocol not found.");
|
||||
}
|
||||
|
||||
return $foundKey;
|
||||
}
|
||||
|
||||
}
|
42
library/Zend/Gdata/App/VersionException.php
Normal file
42
library/Zend/Gdata/App/VersionException.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: VersionException.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_Exception
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
|
||||
/**
|
||||
* Gdata APP exceptions
|
||||
*
|
||||
* Class to represent version exceptions that occur during Gdata APP operations.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage App
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_App_VersionException extends Zend_Gdata_App_Exception
|
||||
{
|
||||
}
|
246
library/Zend/Gdata/AuthSub.php
Normal file
246
library/Zend/Gdata/AuthSub.php
Normal file
|
@ -0,0 +1,246 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AuthSub.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_HttpClient
|
||||
*/
|
||||
require_once 'Zend/Gdata/HttpClient.php';
|
||||
|
||||
/**
|
||||
* Zend_Version
|
||||
*/
|
||||
require_once 'Zend/Version.php';
|
||||
|
||||
/**
|
||||
* Wrapper around Zend_Http_Client to facilitate Google's "Account Authentication
|
||||
* Proxy for Web-Based Applications".
|
||||
*
|
||||
* @see http://code.google.com/apis/accounts/AuthForWebApps.html
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_AuthSub
|
||||
{
|
||||
|
||||
const AUTHSUB_REQUEST_URI = 'https://www.google.com/accounts/AuthSubRequest';
|
||||
|
||||
const AUTHSUB_SESSION_TOKEN_URI = 'https://www.google.com/accounts/AuthSubSessionToken';
|
||||
|
||||
const AUTHSUB_REVOKE_TOKEN_URI = 'https://www.google.com/accounts/AuthSubRevokeToken';
|
||||
|
||||
const AUTHSUB_TOKEN_INFO_URI = 'https://www.google.com/accounts/AuthSubTokenInfo';
|
||||
|
||||
/**
|
||||
* Creates a URI to request a single-use AuthSub token.
|
||||
*
|
||||
* @param string $next (required) URL identifying the service to be
|
||||
* accessed.
|
||||
* The resulting token will enable access to the specified service only.
|
||||
* Some services may limit scope further, such as read-only access.
|
||||
* @param string $scope (required) URL identifying the service to be
|
||||
* accessed. The resulting token will enable
|
||||
* access to the specified service only.
|
||||
* Some services may limit scope further, such
|
||||
* as read-only access.
|
||||
* @param int $secure (optional) Boolean flag indicating whether the
|
||||
* authentication transaction should issue a secure
|
||||
* token (1) or a non-secure token (0). Secure tokens
|
||||
* are available to registered applications only.
|
||||
* @param int $session (optional) Boolean flag indicating whether
|
||||
* the one-time-use token may be exchanged for
|
||||
* a session token (1) or not (0).
|
||||
* @param string $request_uri (optional) URI to which to direct the
|
||||
* authentication request.
|
||||
*/
|
||||
public static function getAuthSubTokenUri($next, $scope, $secure=0, $session=0,
|
||||
$request_uri = self::AUTHSUB_REQUEST_URI)
|
||||
{
|
||||
$querystring = '?next=' . urlencode($next)
|
||||
. '&scope=' . urldecode($scope)
|
||||
. '&secure=' . urlencode($secure)
|
||||
. '&session=' . urlencode($session);
|
||||
return $request_uri . $querystring;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Upgrades a single use token to a session token
|
||||
*
|
||||
* @param string $token The single use token which is to be upgraded
|
||||
* @param Zend_Http_Client $client (optional) HTTP client to use to
|
||||
* make the request
|
||||
* @param string $request_uri (optional) URI to which to direct
|
||||
* the session token upgrade
|
||||
* @return string The upgraded token value
|
||||
* @throws Zend_Gdata_App_AuthException
|
||||
* @throws Zend_Gdata_App_HttpException
|
||||
*/
|
||||
public static function getAuthSubSessionToken(
|
||||
$token, $client = null,
|
||||
$request_uri = self::AUTHSUB_SESSION_TOKEN_URI)
|
||||
{
|
||||
$client = self::getHttpClient($token, $client);
|
||||
|
||||
if ($client instanceof Zend_Gdata_HttpClient) {
|
||||
$filterResult = $client->filterHttpRequest('GET', $request_uri);
|
||||
$url = $filterResult['url'];
|
||||
$headers = $filterResult['headers'];
|
||||
$client->setHeaders($headers);
|
||||
$client->setUri($url);
|
||||
} else {
|
||||
$client->setUri($request_uri);
|
||||
}
|
||||
|
||||
try {
|
||||
$response = $client->request('GET');
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException($e->getMessage(), $e);
|
||||
}
|
||||
|
||||
// Parse Google's response
|
||||
if ($response->isSuccessful()) {
|
||||
$goog_resp = array();
|
||||
foreach (explode("\n", $response->getBody()) as $l) {
|
||||
$l = chop($l);
|
||||
if ($l) {
|
||||
list($key, $val) = explode('=', chop($l), 2);
|
||||
$goog_resp[$key] = $val;
|
||||
}
|
||||
}
|
||||
return $goog_resp['Token'];
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/AuthException.php';
|
||||
throw new Zend_Gdata_App_AuthException(
|
||||
'Token upgrade failed. Reason: ' . $response->getBody());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Revoke a token
|
||||
*
|
||||
* @param string $token The token to revoke
|
||||
* @param Zend_Http_Client $client (optional) HTTP client to use to make the request
|
||||
* @param string $request_uri (optional) URI to which to direct the revokation request
|
||||
* @return boolean Whether the revokation was successful
|
||||
* @throws Zend_Gdata_App_HttpException
|
||||
*/
|
||||
public static function AuthSubRevokeToken($token, $client = null,
|
||||
$request_uri = self::AUTHSUB_REVOKE_TOKEN_URI)
|
||||
{
|
||||
$client = self::getHttpClient($token, $client);
|
||||
|
||||
if ($client instanceof Zend_Gdata_HttpClient) {
|
||||
$filterResult = $client->filterHttpRequest('GET', $request_uri);
|
||||
$url = $filterResult['url'];
|
||||
$headers = $filterResult['headers'];
|
||||
$client->setHeaders($headers);
|
||||
$client->setUri($url);
|
||||
$client->resetParameters();
|
||||
} else {
|
||||
$client->setUri($request_uri);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
try {
|
||||
$response = $client->request('GET');
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException($e->getMessage(), $e);
|
||||
}
|
||||
ob_end_clean();
|
||||
// Parse Google's response
|
||||
if ($response->isSuccessful()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get token information
|
||||
*
|
||||
* @param string $token The token to retrieve information about
|
||||
* @param Zend_Http_Client $client (optional) HTTP client to use to
|
||||
* make the request
|
||||
* @param string $request_uri (optional) URI to which to direct
|
||||
* the information request
|
||||
*/
|
||||
public static function getAuthSubTokenInfo(
|
||||
$token, $client = null, $request_uri = self::AUTHSUB_TOKEN_INFO_URI)
|
||||
{
|
||||
$client = self::getHttpClient($token, $client);
|
||||
|
||||
if ($client instanceof Zend_Gdata_HttpClient) {
|
||||
$filterResult = $client->filterHttpRequest('GET', $request_uri);
|
||||
$url = $filterResult['url'];
|
||||
$headers = $filterResult['headers'];
|
||||
$client->setHeaders($headers);
|
||||
$client->setUri($url);
|
||||
} else {
|
||||
$client->setUri($request_uri);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
try {
|
||||
$response = $client->request('GET');
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException($e->getMessage(), $e);
|
||||
}
|
||||
ob_end_clean();
|
||||
return $response->getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a HTTP client object with AuthSub credentials attached
|
||||
* as the Authorization header
|
||||
*
|
||||
* @param string $token The token to retrieve information about
|
||||
* @param Zend_Gdata_HttpClient $client (optional) HTTP client to use to make the request
|
||||
*/
|
||||
public static function getHttpClient($token, $client = null)
|
||||
{
|
||||
if ($client == null) {
|
||||
$client = new Zend_Gdata_HttpClient();
|
||||
}
|
||||
if (!$client instanceof Zend_Http_Client) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException('Client is not an instance of Zend_Http_Client.');
|
||||
}
|
||||
$useragent = 'Zend_Framework_Gdata/' . Zend_Version::VERSION;
|
||||
$client->setConfig(array(
|
||||
'strictredirects' => true,
|
||||
'useragent' => $useragent
|
||||
)
|
||||
);
|
||||
$client->setAuthSubToken($token);
|
||||
return $client;
|
||||
}
|
||||
|
||||
}
|
204
library/Zend/Gdata/Books.php
Normal file
204
library/Zend/Gdata/Books.php
Normal file
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Books.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_CollectionEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/CollectionEntry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_CollectionFeed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/CollectionFeed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_VolumeEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/VolumeEntry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_VolumeFeed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/VolumeFeed.php';
|
||||
|
||||
/**
|
||||
* Service class for interacting with the Books service
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books extends Zend_Gdata
|
||||
{
|
||||
const VOLUME_FEED_URI = 'http://books.google.com/books/feeds/volumes';
|
||||
const MY_LIBRARY_FEED_URI = 'http://books.google.com/books/feeds/users/me/collections/library/volumes';
|
||||
const MY_ANNOTATION_FEED_URI = 'http://books.google.com/books/feeds/users/me/volumes';
|
||||
const AUTH_SERVICE_NAME = 'print';
|
||||
|
||||
/**
|
||||
* Namespaces used for Zend_Gdata_Books
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $namespaces = array(
|
||||
array('gbs', 'http://schemas.google.com/books/2008', 1, 0),
|
||||
array('dc', 'http://purl.org/dc/terms', 1, 0)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create Zend_Gdata_Books object
|
||||
*
|
||||
* @param Zend_Http_Client $client (optional) The HTTP client to use when
|
||||
* when communicating with the Google servers.
|
||||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version
|
||||
*/
|
||||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0')
|
||||
{
|
||||
$this->registerPackage('Zend_Gdata_Books');
|
||||
$this->registerPackage('Zend_Gdata_Books_Extension');
|
||||
parent::__construct($client, $applicationId);
|
||||
$this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a feed of volumes.
|
||||
*
|
||||
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
|
||||
* query or a Zend_Gdata_Query object from which a URL can be
|
||||
* determined.
|
||||
* @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the
|
||||
* specified URL.
|
||||
*/
|
||||
public function getVolumeFeed($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
$uri = self::VOLUME_FEED_URI;
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a specific volume entry.
|
||||
*
|
||||
* @param string|null $volumeId The volumeId of interest.
|
||||
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
|
||||
* query or a Zend_Gdata_Query object from which a URL can be
|
||||
* determined.
|
||||
* @return Zend_Gdata_Books_VolumeEntry The feed of volumes found at the
|
||||
* specified URL.
|
||||
*/
|
||||
public function getVolumeEntry($volumeId = null, $location = null)
|
||||
{
|
||||
if ($volumeId !== null) {
|
||||
$uri = self::VOLUME_FEED_URI . "/" . $volumeId;
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getEntry($uri, 'Zend_Gdata_Books_VolumeEntry');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a feed of volumes, by default the User library feed.
|
||||
*
|
||||
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
|
||||
* query.
|
||||
* @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the
|
||||
* specified URL.
|
||||
*/
|
||||
public function getUserLibraryFeed($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
$uri = self::MY_LIBRARY_FEED_URI;
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a feed of volumes, by default the User annotation feed
|
||||
*
|
||||
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
|
||||
* query.
|
||||
* @return Zend_Gdata_Books_VolumeFeed The feed of volumes found at the
|
||||
* specified URL.
|
||||
*/
|
||||
public function getUserAnnotationFeed($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
$uri = self::MY_ANNOTATION_FEED_URI;
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a Volume / Annotation
|
||||
*
|
||||
* @param Zend_Gdata_Books_VolumeEntry $entry
|
||||
* @param Zend_Gdata_Query|string|null $location (optional) The URL to
|
||||
* query
|
||||
* @return Zend_Gdata_Books_VolumeEntry The inserted volume entry.
|
||||
*/
|
||||
public function insertVolume($entry, $location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
$uri = self::MY_LIBRARY_FEED_URI;
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::insertEntry(
|
||||
$entry, $uri, 'Zend_Gdata_Books_VolumeEntry');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Volume
|
||||
*
|
||||
* @param Zend_Gdata_Books_VolumeEntry $entry
|
||||
* @return void
|
||||
*/
|
||||
public function deleteVolume($entry)
|
||||
{
|
||||
$entry->delete();
|
||||
}
|
||||
|
||||
}
|
56
library/Zend/Gdata/Books/CollectionEntry.php
Normal file
56
library/Zend/Gdata/Books/CollectionEntry.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: CollectionEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* Describes an entry in a feed of collections
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_CollectionEntry extends Zend_Gdata_Entry
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_CollectionEntry which
|
||||
* Describes an entry in a feed of collections
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
62
library/Zend/Gdata/Books/CollectionFeed.php
Normal file
62
library/Zend/Gdata/Books/CollectionFeed.php
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: CollectionFeed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Feed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Feed.php';
|
||||
|
||||
/**
|
||||
* Describes a Book Search collection feed
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_CollectionFeed extends Zend_Gdata_Feed
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_CollectionFeed which
|
||||
* Describes a Book Search collection feed
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Books_CollectionEntry';
|
||||
|
||||
}
|
||||
|
63
library/Zend/Gdata/Books/Extension/AnnotationLink.php
Normal file
63
library/Zend/Gdata/Books/Extension/AnnotationLink.php
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AnnotationLink.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_BooksLink
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
|
||||
|
||||
/**
|
||||
* Describes an annotation link
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_AnnotationLink extends
|
||||
Zend_Gdata_Books_Extension_BooksLink
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_AnnotationLink which
|
||||
* Describes an annotation link
|
||||
*
|
||||
* @param string|null $href Linked resource URI
|
||||
* @param string|null $rel Forward relationship
|
||||
* @param string|null $type Resource MIME type
|
||||
* @param string|null $hrefLang Resource language
|
||||
* @param string|null $title Human-readable resource title
|
||||
* @param string|null $length Resource length in octets
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
}
|
||||
|
||||
}
|
||||
|
59
library/Zend/Gdata/Books/Extension/BooksCategory.php
Normal file
59
library/Zend/Gdata/Books/Extension/BooksCategory.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BooksCategory.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Category
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Category.php';
|
||||
|
||||
/**
|
||||
* Describes a books category
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_BooksCategory extends
|
||||
Zend_Gdata_App_Extension_Category
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_BooksCategory which
|
||||
* Describes a books category
|
||||
*
|
||||
* @param string|null $term An identifier representing the category within
|
||||
* the categorization scheme.
|
||||
* @param string|null $scheme A string containing a URI identifying the
|
||||
* categorization scheme.
|
||||
* @param string|null $label A human-readable label for display in
|
||||
* end-user applications.
|
||||
*/
|
||||
public function __construct($term = null, $scheme = null, $label = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($term, $scheme, $label);
|
||||
}
|
||||
|
||||
}
|
61
library/Zend/Gdata/Books/Extension/BooksLink.php
Normal file
61
library/Zend/Gdata/Books/Extension/BooksLink.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BooksLink.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Link
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Link.php';
|
||||
|
||||
/**
|
||||
* Extends the base Link class with Books extensions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_BooksLink extends Zend_Gdata_App_Extension_Link
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_BooksLink which
|
||||
* Extends the base Link class with Books extensions
|
||||
*
|
||||
* @param string|null $href Linked resource URI
|
||||
* @param string|null $rel Forward relationship
|
||||
* @param string|null $type Resource MIME type
|
||||
* @param string|null $hrefLang Resource language
|
||||
* @param string|null $title Human-readable resource title
|
||||
* @param string|null $length Resource length in octets
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
122
library/Zend/Gdata/Books/Extension/Embeddability.php
Normal file
122
library/Zend/Gdata/Books/Extension/Embeddability.php
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Embeddability.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Describes an embeddability
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_Embeddability extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gbs';
|
||||
protected $_rootElement = 'embeddability';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_Embeddability which
|
||||
* Describes an embeddability.
|
||||
*
|
||||
* @param string|null $value A programmatic value representing the book's
|
||||
* embeddability.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build this object back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistance.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', $this->_value);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts XML attributes from the DOM and converts them to the
|
||||
* appropriate object members.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute to be handled.
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
$this->_value = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the programmatic value that describes the embeddability of a
|
||||
* volume in Google Book Search
|
||||
*
|
||||
* @return string|null The value
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the programmatic value that describes the embeddability of a
|
||||
* volume in Google Book Search
|
||||
*
|
||||
* @param string|null $value Programmatic value that describes the
|
||||
* embeddability of a volume in Google Book Search
|
||||
* @return Zend_Gdata_Books_Extension_Embeddability Provides a fluent
|
||||
* interface
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
59
library/Zend/Gdata/Books/Extension/InfoLink.php
Normal file
59
library/Zend/Gdata/Books/Extension/InfoLink.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InfoLink.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_BooksLink
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
|
||||
|
||||
/**
|
||||
* Describes an info link
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_InfoLink extends
|
||||
Zend_Gdata_Books_Extension_BooksLink
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_InfoLink which
|
||||
* Describes an info link
|
||||
*
|
||||
* @param string|null $href Linked resource URI
|
||||
* @param string|null $rel Forward relationship
|
||||
* @param string|null $type Resource MIME type
|
||||
* @param string|null $hrefLang Resource language
|
||||
* @param string|null $title Human-readable resource title
|
||||
* @param string|null $length Resource length in octets
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
}
|
||||
|
||||
}
|
60
library/Zend/Gdata/Books/Extension/PreviewLink.php
Normal file
60
library/Zend/Gdata/Books/Extension/PreviewLink.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: PreviewLink.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_BooksLink
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
|
||||
|
||||
/**
|
||||
* Describes a preview link
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_PreviewLink extends
|
||||
Zend_Gdata_Books_Extension_BooksLink
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_PreviewLink which
|
||||
* Describes a preview link
|
||||
*
|
||||
* @param string|null $href Linked resource URI
|
||||
* @param string|null $rel Forward relationship
|
||||
* @param string|null $type Resource MIME type
|
||||
* @param string|null $hrefLang Resource language
|
||||
* @param string|null $title Human-readable resource title
|
||||
* @param string|null $length Resource length in octets
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
}
|
||||
|
||||
}
|
152
library/Zend/Gdata/Books/Extension/Review.php
Normal file
152
library/Zend/Gdata/Books/Extension/Review.php
Normal file
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Review.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* User-provided review
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_Review extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gbs';
|
||||
protected $_rootElement = 'review';
|
||||
protected $_lang = null;
|
||||
protected $_type = null;
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_Review which
|
||||
* User-provided review
|
||||
*
|
||||
* @param string|null $lang Review language.
|
||||
* @param string|null $type Type of text construct (typically text, html,
|
||||
* or xhtml).
|
||||
* @param string|null $value Text content of the review.
|
||||
*/
|
||||
public function __construct($lang = null, $type = null, $value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_lang = $lang;
|
||||
$this->_type = $type;
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build this object back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistance.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc);
|
||||
if ($this->_lang !== null) {
|
||||
$element->setAttribute('lang', $this->_lang);
|
||||
}
|
||||
if ($this->_type !== null) {
|
||||
$element->setAttribute('type', $this->_type);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts XML attributes from the DOM and converts them to the
|
||||
* appropriate object members.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute to be handled.
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'lang':
|
||||
$this->_lang = $attribute->nodeValue;
|
||||
break;
|
||||
case 'type':
|
||||
$this->_type = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the language of link title
|
||||
*
|
||||
* @return string The lang
|
||||
*/
|
||||
public function getLang()
|
||||
{
|
||||
return $this->_lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of text construct (typically 'text', 'html' or 'xhtml')
|
||||
*
|
||||
* @return string The type
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the language of link title
|
||||
*
|
||||
* @param string $lang language of link title
|
||||
* @return Zend_Gdata_Books_Extension_Review Provides a fluent interface
|
||||
*/
|
||||
public function setLang($lang)
|
||||
{
|
||||
$this->_lang = $lang;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type of text construct (typically 'text', 'html' or 'xhtml')
|
||||
*
|
||||
* @param string $type type of text construct (typically 'text', 'html' or 'xhtml')
|
||||
* @return Zend_Gdata_Books_Extension_Review Provides a fluent interface
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->_type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
60
library/Zend/Gdata/Books/Extension/ThumbnailLink.php
Normal file
60
library/Zend/Gdata/Books/Extension/ThumbnailLink.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ThumbnailLink.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_BooksLink
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/BooksLink.php';
|
||||
|
||||
/**
|
||||
* Describes a thumbnail link
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_ThumbnailLink extends
|
||||
Zend_Gdata_Books_Extension_BooksLink
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_ThumbnailLink which
|
||||
* Describes a thumbnail link
|
||||
*
|
||||
* @param string|null $href Linked resource URI
|
||||
* @param string|null $rel Forward relationship
|
||||
* @param string|null $type Resource MIME type
|
||||
* @param string|null $hrefLang Resource language
|
||||
* @param string|null $title Human-readable resource title
|
||||
* @param string|null $length Resource length in octets
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
}
|
||||
|
||||
}
|
123
library/Zend/Gdata/Books/Extension/Viewability.php
Normal file
123
library/Zend/Gdata/Books/Extension/Viewability.php
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Viewability.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Describes a viewability
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_Extension_Viewability extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gbs';
|
||||
protected $_rootElement = 'viewability';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_Extension_Viewability which
|
||||
* Describes a viewability
|
||||
*
|
||||
* @param string|null $value A programmatic value representing the book's
|
||||
* viewability mode.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build this object back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistance.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', $this->_value);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts XML attributes from the DOM and converts them to the
|
||||
* appropriate object members.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute to be handled.
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
$this->_value = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the programmatic value that describes the viewability of a volume
|
||||
* in Google Book Search
|
||||
*
|
||||
* @return string The value
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the programmatic value that describes the viewability of a volume in
|
||||
* Google Book Search
|
||||
*
|
||||
* @param string $value programmatic value that describes the viewability
|
||||
* of a volume in Googl eBook Search
|
||||
* @return Zend_Gdata_Books_Extension_Viewability Provides a fluent
|
||||
* interface
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
687
library/Zend/Gdata/Books/VolumeEntry.php
Normal file
687
library/Zend/Gdata/Books/VolumeEntry.php
Normal file
|
@ -0,0 +1,687 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: VolumeEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_Comments
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension/Comments.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Creator
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Creator.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Date
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Date.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Description
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Description.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_Embeddability
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/Embeddability.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Format
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Format.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Identifier
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Identifier.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Language
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Language.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Publisher
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Publisher.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_Rating
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension/Rating.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_Review
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/Review.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Subject
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Subject.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_DublinCore_Extension_Title
|
||||
*/
|
||||
require_once 'Zend/Gdata/DublinCore/Extension/Title.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Books_Extension_Viewability
|
||||
*/
|
||||
require_once 'Zend/Gdata/Books/Extension/Viewability.php';
|
||||
|
||||
/**
|
||||
* Describes an entry in a feed of Book Search volumes
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_VolumeEntry extends Zend_Gdata_Entry
|
||||
{
|
||||
|
||||
const THUMBNAIL_LINK_REL = 'http://schemas.google.com/books/2008/thumbnail';
|
||||
const PREVIEW_LINK_REL = 'http://schemas.google.com/books/2008/preview';
|
||||
const INFO_LINK_REL = 'http://schemas.google.com/books/2008/info';
|
||||
const ANNOTATION_LINK_REL = 'http://schemas.google.com/books/2008/annotation';
|
||||
|
||||
protected $_comments = null;
|
||||
protected $_creators = array();
|
||||
protected $_dates = array();
|
||||
protected $_descriptions = array();
|
||||
protected $_embeddability = null;
|
||||
protected $_formats = array();
|
||||
protected $_identifiers = array();
|
||||
protected $_languages = array();
|
||||
protected $_publishers = array();
|
||||
protected $_rating = null;
|
||||
protected $_review = null;
|
||||
protected $_subjects = array();
|
||||
protected $_titles = array();
|
||||
protected $_viewability = null;
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_VolumeEntry which
|
||||
* Describes an entry in a feed of Book Search volumes
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build this object back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistance.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc);
|
||||
if ($this->_creators !== null) {
|
||||
foreach ($this->_creators as $creators) {
|
||||
$element->appendChild($creators->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_dates !== null) {
|
||||
foreach ($this->_dates as $dates) {
|
||||
$element->appendChild($dates->getDOM($element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_descriptions !== null) {
|
||||
foreach ($this->_descriptions as $descriptions) {
|
||||
$element->appendChild($descriptions->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_formats !== null) {
|
||||
foreach ($this->_formats as $formats) {
|
||||
$element->appendChild($formats->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_identifiers !== null) {
|
||||
foreach ($this->_identifiers as $identifiers) {
|
||||
$element->appendChild($identifiers->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_languages !== null) {
|
||||
foreach ($this->_languages as $languages) {
|
||||
$element->appendChild($languages->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_publishers !== null) {
|
||||
foreach ($this->_publishers as $publishers) {
|
||||
$element->appendChild($publishers->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_subjects !== null) {
|
||||
foreach ($this->_subjects as $subjects) {
|
||||
$element->appendChild($subjects->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_titles !== null) {
|
||||
foreach ($this->_titles as $titles) {
|
||||
$element->appendChild($titles->getDOM($element->ownerDocument));
|
||||
}
|
||||
}
|
||||
if ($this->_comments !== null) {
|
||||
$element->appendChild($this->_comments->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
if ($this->_embeddability !== null) {
|
||||
$element->appendChild($this->_embeddability->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
if ($this->_rating !== null) {
|
||||
$element->appendChild($this->_rating->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
if ($this->_review !== null) {
|
||||
$element->appendChild($this->_review->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
if ($this->_viewability !== null) {
|
||||
$element->appendChild($this->_viewability->getDOM(
|
||||
$element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates individual objects of the appropriate type and stores
|
||||
* them in this object based upon DOM data.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode to process.
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('dc') . ':' . 'creator':
|
||||
$creators = new Zend_Gdata_DublinCore_Extension_Creator();
|
||||
$creators->transferFromDOM($child);
|
||||
$this->_creators[] = $creators;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'date':
|
||||
$dates = new Zend_Gdata_DublinCore_Extension_Date();
|
||||
$dates->transferFromDOM($child);
|
||||
$this->_dates[] = $dates;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'description':
|
||||
$descriptions = new Zend_Gdata_DublinCore_Extension_Description();
|
||||
$descriptions->transferFromDOM($child);
|
||||
$this->_descriptions[] = $descriptions;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'format':
|
||||
$formats = new Zend_Gdata_DublinCore_Extension_Format();
|
||||
$formats->transferFromDOM($child);
|
||||
$this->_formats[] = $formats;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'identifier':
|
||||
$identifiers = new Zend_Gdata_DublinCore_Extension_Identifier();
|
||||
$identifiers->transferFromDOM($child);
|
||||
$this->_identifiers[] = $identifiers;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'language':
|
||||
$languages = new Zend_Gdata_DublinCore_Extension_Language();
|
||||
$languages->transferFromDOM($child);
|
||||
$this->_languages[] = $languages;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'publisher':
|
||||
$publishers = new Zend_Gdata_DublinCore_Extension_Publisher();
|
||||
$publishers->transferFromDOM($child);
|
||||
$this->_publishers[] = $publishers;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'subject':
|
||||
$subjects = new Zend_Gdata_DublinCore_Extension_Subject();
|
||||
$subjects->transferFromDOM($child);
|
||||
$this->_subjects[] = $subjects;
|
||||
break;
|
||||
case $this->lookupNamespace('dc') . ':' . 'title':
|
||||
$titles = new Zend_Gdata_DublinCore_Extension_Title();
|
||||
$titles->transferFromDOM($child);
|
||||
$this->_titles[] = $titles;
|
||||
break;
|
||||
case $this->lookupNamespace('gd') . ':' . 'comments':
|
||||
$comments = new Zend_Gdata_Extension_Comments();
|
||||
$comments->transferFromDOM($child);
|
||||
$this->_comments = $comments;
|
||||
break;
|
||||
case $this->lookupNamespace('gbs') . ':' . 'embeddability':
|
||||
$embeddability = new Zend_Gdata_Books_Extension_Embeddability();
|
||||
$embeddability->transferFromDOM($child);
|
||||
$this->_embeddability = $embeddability;
|
||||
break;
|
||||
case $this->lookupNamespace('gd') . ':' . 'rating':
|
||||
$rating = new Zend_Gdata_Extension_Rating();
|
||||
$rating->transferFromDOM($child);
|
||||
$this->_rating = $rating;
|
||||
break;
|
||||
case $this->lookupNamespace('gbs') . ':' . 'review':
|
||||
$review = new Zend_Gdata_Books_Extension_Review();
|
||||
$review->transferFromDOM($child);
|
||||
$this->_review = $review;
|
||||
break;
|
||||
case $this->lookupNamespace('gbs') . ':' . 'viewability':
|
||||
$viewability = new Zend_Gdata_Books_Extension_Viewability();
|
||||
$viewability->transferFromDOM($child);
|
||||
$this->_viewability = $viewability;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Comments class
|
||||
*
|
||||
* @return Zend_Gdata_Extension_Comments|null The comments
|
||||
*/
|
||||
public function getComments()
|
||||
{
|
||||
return $this->_comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the creators
|
||||
*
|
||||
* @return array The creators
|
||||
*/
|
||||
public function getCreators()
|
||||
{
|
||||
return $this->_creators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the dates
|
||||
*
|
||||
* @return array The dates
|
||||
*/
|
||||
public function getDates()
|
||||
{
|
||||
return $this->_dates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the descriptions
|
||||
*
|
||||
* @return array The descriptions
|
||||
*/
|
||||
public function getDescriptions()
|
||||
{
|
||||
return $this->_descriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the embeddability
|
||||
*
|
||||
* @return Zend_Gdata_Books_Extension_Embeddability|null The embeddability
|
||||
*/
|
||||
public function getEmbeddability()
|
||||
{
|
||||
return $this->_embeddability;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the formats
|
||||
*
|
||||
* @return array The formats
|
||||
*/
|
||||
public function getFormats()
|
||||
{
|
||||
return $this->_formats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the identifiers
|
||||
*
|
||||
* @return array The identifiers
|
||||
*/
|
||||
public function getIdentifiers()
|
||||
{
|
||||
return $this->_identifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the languages
|
||||
*
|
||||
* @return array The languages
|
||||
*/
|
||||
public function getLanguages()
|
||||
{
|
||||
return $this->_languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the publishers
|
||||
*
|
||||
* @return array The publishers
|
||||
*/
|
||||
public function getPublishers()
|
||||
{
|
||||
return $this->_publishers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rating
|
||||
*
|
||||
* @return Zend_Gdata_Extension_Rating|null The rating
|
||||
*/
|
||||
public function getRating()
|
||||
{
|
||||
return $this->_rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the review
|
||||
*
|
||||
* @return Zend_Gdata_Books_Extension_Review|null The review
|
||||
*/
|
||||
public function getReview()
|
||||
{
|
||||
return $this->_review;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the subjects
|
||||
*
|
||||
* @return array The subjects
|
||||
*/
|
||||
public function getSubjects()
|
||||
{
|
||||
return $this->_subjects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the titles
|
||||
*
|
||||
* @return array The titles
|
||||
*/
|
||||
public function getTitles()
|
||||
{
|
||||
return $this->_titles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the viewability
|
||||
*
|
||||
* @return Zend_Gdata_Books_Extension_Viewability|null The viewability
|
||||
*/
|
||||
public function getViewability()
|
||||
{
|
||||
return $this->_viewability;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Comments class
|
||||
*
|
||||
* @param Zend_Gdata_Extension_Comments|null $comments Comments class
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setComments($comments)
|
||||
{
|
||||
$this->_comments = $comments;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the creators
|
||||
*
|
||||
* @param array $creators Creators|null
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setCreators($creators)
|
||||
{
|
||||
$this->_creators = $creators;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the dates
|
||||
*
|
||||
* @param array $dates dates
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setDates($dates)
|
||||
{
|
||||
$this->_dates = $dates;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the descriptions
|
||||
*
|
||||
* @param array $descriptions descriptions
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setDescriptions($descriptions)
|
||||
{
|
||||
$this->_descriptions = $descriptions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the embeddability
|
||||
*
|
||||
* @param Zend_Gdata_Books_Extension_Embeddability|null $embeddability
|
||||
* embeddability
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setEmbeddability($embeddability)
|
||||
{
|
||||
$this->_embeddability = $embeddability;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the formats
|
||||
*
|
||||
* @param array $formats formats
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setFormats($formats)
|
||||
{
|
||||
$this->_formats = $formats;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the identifiers
|
||||
*
|
||||
* @param array $identifiers identifiers
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setIdentifiers($identifiers)
|
||||
{
|
||||
$this->_identifiers = $identifiers;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the languages
|
||||
*
|
||||
* @param array $languages languages
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setLanguages($languages)
|
||||
{
|
||||
$this->_languages = $languages;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the publishers
|
||||
*
|
||||
* @param array $publishers publishers
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setPublishers($publishers)
|
||||
{
|
||||
$this->_publishers = $publishers;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rating
|
||||
*
|
||||
* @param Zend_Gdata_Extension_Rating|null $rating rating
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setRating($rating)
|
||||
{
|
||||
$this->_rating = $rating;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the review
|
||||
*
|
||||
* @param Zend_Gdata_Books_Extension_Review|null $review review
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setReview($review)
|
||||
{
|
||||
$this->_review = $review;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the subjects
|
||||
*
|
||||
* @param array $subjects subjects
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setSubjects($subjects)
|
||||
{
|
||||
$this->_subjects = $subjects;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the titles
|
||||
*
|
||||
* @param array $titles titles
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setTitles($titles)
|
||||
{
|
||||
$this->_titles = $titles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the viewability
|
||||
*
|
||||
* @param Zend_Gdata_Books_Extension_Viewability|null $viewability
|
||||
* viewability
|
||||
* @return Zend_Gdata_Books_VolumeEntry Provides a fluent interface
|
||||
*/
|
||||
public function setViewability($viewability)
|
||||
{
|
||||
$this->_viewability = $viewability;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the volume ID based upon the atom:id value
|
||||
*
|
||||
* @return string The volume ID
|
||||
* @throws Zend_Gdata_App_Exception
|
||||
*/
|
||||
public function getVolumeId()
|
||||
{
|
||||
$fullId = $this->getId()->getText();
|
||||
$position = strrpos($fullId, '/');
|
||||
if ($position === false) {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception('Slash not found in atom:id');
|
||||
} else {
|
||||
return substr($fullId, strrpos($fullId,'/') + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the thumbnail link
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_link|null The thumbnail link
|
||||
*/
|
||||
public function getThumbnailLink()
|
||||
{
|
||||
return $this->getLink(self::THUMBNAIL_LINK_REL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the preview link
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link|null The preview link
|
||||
*/
|
||||
public function getPreviewLink()
|
||||
{
|
||||
return $this->getLink(self::PREVIEW_LINK_REL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the info link
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link|null The info link
|
||||
*/
|
||||
public function getInfoLink()
|
||||
{
|
||||
return $this->getLink(self::INFO_LINK_REL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the annotations link
|
||||
*
|
||||
* @return Zend_Gdata_App_Extension_Link|null The annotations link
|
||||
*/
|
||||
public function getAnnotationLink()
|
||||
{
|
||||
return $this->getLink(self::ANNOTATION_LINK_REL);
|
||||
}
|
||||
|
||||
}
|
62
library/Zend/Gdata/Books/VolumeFeed.php
Normal file
62
library/Zend/Gdata/Books/VolumeFeed.php
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: VolumeFeed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Feed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Feed.php';
|
||||
|
||||
/**
|
||||
* Describes a Book Search volume feed
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_VolumeFeed extends Zend_Gdata_Feed
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_Books_VolumeFeed which
|
||||
* Describes a Book Search volume feed
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Books::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Books_VolumeEntry';
|
||||
|
||||
}
|
||||
|
112
library/Zend/Gdata/Books/VolumeQuery.php
Normal file
112
library/Zend/Gdata/Books/VolumeQuery.php
Normal file
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: VolumeQuery.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_Books
|
||||
*/
|
||||
require_once('Zend/Gdata/Books.php');
|
||||
|
||||
/**
|
||||
* Zend_Gdata_Query
|
||||
*/
|
||||
require_once('Zend/Gdata/Query.php');
|
||||
|
||||
/**
|
||||
* Assists in constructing queries for Books volumes
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Books
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Books_VolumeQuery extends Zend_Gdata_Query
|
||||
{
|
||||
|
||||
/**
|
||||
* Create Gdata_Books_VolumeQuery object
|
||||
*
|
||||
* @param string|null $url If non-null, pre-initializes the instance to
|
||||
* use a given URL.
|
||||
*/
|
||||
public function __construct($url = null)
|
||||
{
|
||||
parent::__construct($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum level of viewability of volumes to return in the search results
|
||||
*
|
||||
* @param string|null $value The minimum viewability - 'full' or 'partial'
|
||||
* @return Zend_Gdata_Books_VolumeQuery Provides a fluent interface
|
||||
*/
|
||||
public function setMinViewability($value = null)
|
||||
{
|
||||
switch ($value) {
|
||||
case 'full_view':
|
||||
$this->_params['min-viewability'] = 'full';
|
||||
break;
|
||||
case 'partial_view':
|
||||
$this->_params['min-viewability'] = 'partial';
|
||||
break;
|
||||
case null:
|
||||
unset($this->_params['min-viewability']);
|
||||
break;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimum viewability of volumes to include in search results
|
||||
*
|
||||
* @return string|null min-viewability
|
||||
*/
|
||||
public function getMinViewability()
|
||||
{
|
||||
if (array_key_exists('min-viewability', $this->_params)) {
|
||||
return $this->_params['min-viewability'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the generated full query URL
|
||||
*
|
||||
* @return string The URL
|
||||
*/
|
||||
public function getQueryUrl()
|
||||
{
|
||||
if (isset($this->_url)) {
|
||||
$url = $this->_url;
|
||||
} else {
|
||||
$url = Zend_Gdata_Books::VOLUME_FEED_URI;
|
||||
}
|
||||
if ($this->getCategory() !== null) {
|
||||
$url .= '/-/' . $this->getCategory();
|
||||
}
|
||||
$url = $url . $this->getQueryString();
|
||||
return $url;
|
||||
}
|
||||
|
||||
}
|
169
library/Zend/Gdata/Calendar.php
Normal file
169
library/Zend/Gdata/Calendar.php
Normal file
|
@ -0,0 +1,169 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Calendar.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_EventFeed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/EventFeed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_EventEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/EventEntry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_ListFeed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/ListFeed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_ListEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/ListEntry.php';
|
||||
|
||||
/**
|
||||
* Service class for interacting with the Google Calendar data API
|
||||
* @link http://code.google.com/apis/gdata/calendar.html
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar extends Zend_Gdata
|
||||
{
|
||||
|
||||
const CALENDAR_FEED_URI = 'http://www.google.com/calendar/feeds';
|
||||
const CALENDAR_EVENT_FEED_URI = 'http://www.google.com/calendar/feeds/default/private/full';
|
||||
const AUTH_SERVICE_NAME = 'cl';
|
||||
|
||||
protected $_defaultPostUri = self::CALENDAR_EVENT_FEED_URI;
|
||||
|
||||
/**
|
||||
* Namespaces used for Zend_Gdata_Calendar
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $namespaces = array(
|
||||
array('gCal', 'http://schemas.google.com/gCal/2005', 1, 0)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create Gdata_Calendar object
|
||||
*
|
||||
* @param Zend_Http_Client $client (optional) The HTTP client to use when
|
||||
* when communicating with the Google servers.
|
||||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version
|
||||
*/
|
||||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0')
|
||||
{
|
||||
$this->registerPackage('Zend_Gdata_Calendar');
|
||||
$this->registerPackage('Zend_Gdata_Calendar_Extension');
|
||||
parent::__construct($client, $applicationId);
|
||||
$this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive feed object
|
||||
*
|
||||
* @param mixed $location The location for the feed, as a URL or Query
|
||||
* @return Zend_Gdata_Calendar_EventFeed
|
||||
*/
|
||||
public function getCalendarEventFeed($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
$uri = self::CALENDAR_EVENT_FEED_URI;
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getFeed($uri, 'Zend_Gdata_Calendar_EventFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entry object
|
||||
*
|
||||
* @return Zend_Gdata_Calendar_EventEntry
|
||||
*/
|
||||
public function getCalendarEventEntry($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Location must not be null');
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getEntry($uri, 'Zend_Gdata_Calendar_EventEntry');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve feed object
|
||||
*
|
||||
* @return Zend_Gdata_Calendar_ListFeed
|
||||
*/
|
||||
public function getCalendarListFeed()
|
||||
{
|
||||
$uri = self::CALENDAR_FEED_URI . '/default';
|
||||
return parent::getFeed($uri,'Zend_Gdata_Calendar_ListFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entryobject
|
||||
*
|
||||
* @return Zend_Gdata_Calendar_ListEntry
|
||||
*/
|
||||
public function getCalendarListEntry($location = null)
|
||||
{
|
||||
if ($location == null) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Location must not be null');
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getEntry($uri,'Zend_Gdata_Calendar_ListEntry');
|
||||
}
|
||||
|
||||
public function insertEvent($event, $uri=null)
|
||||
{
|
||||
if ($uri == null) {
|
||||
$uri = $this->_defaultPostUri;
|
||||
}
|
||||
$newEvent = $this->insertEntry($event, $uri, 'Zend_Gdata_Calendar_EventEntry');
|
||||
return $newEvent;
|
||||
}
|
||||
|
||||
}
|
164
library/Zend/Gdata/Calendar/EventEntry.php
Normal file
164
library/Zend/Gdata/Calendar/EventEntry.php
Normal file
|
@ -0,0 +1,164 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: EventEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Kind_EventEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Kind/EventEntry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_Extension_SendEventNotifications
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/SendEventNotifications.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_Extension_Timezone
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_Extension_Link
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Link.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Calendar_Extension_QuickAdd
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/QuickAdd.php';
|
||||
|
||||
/**
|
||||
* Data model class for a Google Calendar Event Entry
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_EventEntry extends Zend_Gdata_Kind_EventEntry
|
||||
{
|
||||
|
||||
protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
|
||||
protected $_sendEventNotifications = null;
|
||||
protected $_timezone = null;
|
||||
protected $_quickadd = null;
|
||||
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_sendEventNotifications != null) {
|
||||
$element->appendChild($this->_sendEventNotifications->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_timezone != null) {
|
||||
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_quickadd != null) {
|
||||
$element->appendChild($this->_quickadd->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications';
|
||||
$sendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
|
||||
$sendEventNotifications->transferFromDOM($child);
|
||||
$this->_sendEventNotifications = $sendEventNotifications;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
||||
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
||||
$timezone->transferFromDOM($child);
|
||||
$this->_timezone = $timezone;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'link';
|
||||
$link = new Zend_Gdata_Calendar_Extension_Link();
|
||||
$link->transferFromDOM($child);
|
||||
$this->_link[] = $link;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'quickadd';
|
||||
$quickadd = new Zend_Gdata_Calendar_Extension_QuickAdd();
|
||||
$quickadd->transferFromDOM($child);
|
||||
$this->_quickadd = $quickadd;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function getSendEventNotifications()
|
||||
{
|
||||
return $this->_sendEventNotifications;
|
||||
}
|
||||
|
||||
public function setSendEventNotifications($value)
|
||||
{
|
||||
$this->_sendEventNotifications = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->_timezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Timezone $value
|
||||
* @return Zend_Gdata_Extension_EventEntry Provides a fluent interface
|
||||
*/
|
||||
public function setTimezone($value)
|
||||
{
|
||||
$this->_timezone = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getQuickAdd()
|
||||
{
|
||||
return $this->_quickadd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_QuickAdd $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setQuickAdd($value)
|
||||
{
|
||||
$this->_quickadd = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
106
library/Zend/Gdata/Calendar/EventFeed.php
Normal file
106
library/Zend/Gdata/Calendar/EventFeed.php
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: EventFeed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Feed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Feed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_Timezone
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
|
||||
|
||||
/**
|
||||
* Data model for a Google Calendar feed of events
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
|
||||
{
|
||||
|
||||
protected $_timezone = null;
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
|
||||
|
||||
/**
|
||||
* The classname for the feed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_feedClassName = 'Zend_Gdata_Calendar_EventFeed';
|
||||
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_timezone != null) {
|
||||
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
||||
}
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
||||
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
||||
$timezone->transferFromDOM($child);
|
||||
$this->_timezone = $timezone;
|
||||
break;
|
||||
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->_timezone;
|
||||
}
|
||||
|
||||
public function setTimezone($value)
|
||||
{
|
||||
$this->_timezone = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
491
library/Zend/Gdata/Calendar/EventQuery.php
Normal file
491
library/Zend/Gdata/Calendar/EventQuery.php
Normal file
|
@ -0,0 +1,491 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: EventQuery.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_App_util
|
||||
*/
|
||||
require_once('Zend/Gdata/App/Util.php');
|
||||
|
||||
/**
|
||||
* Zend_Gdata_Query
|
||||
*/
|
||||
require_once('Zend/Gdata/Query.php');
|
||||
|
||||
/**
|
||||
* Assists in constructing queries for Google Calendar events
|
||||
*
|
||||
* @link http://code.google.com/apis/gdata/calendar/
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_EventQuery extends Zend_Gdata_Query
|
||||
{
|
||||
|
||||
const CALENDAR_FEED_URI = 'http://www.google.com/calendar/feeds';
|
||||
|
||||
/**
|
||||
* The default URI used for feeds.
|
||||
*/
|
||||
protected $_defaultFeedUri = self::CALENDAR_FEED_URI;
|
||||
|
||||
/**
|
||||
* The comment ID to retrieve. If null, no specific comment will be
|
||||
* retrieved unless already included in the query URI. The event ID
|
||||
* ($_event) must be set, otherwise this property is ignored.
|
||||
*/
|
||||
protected $_comments = null;
|
||||
|
||||
/**
|
||||
* The calendar address to be requested by queries. This may be an email
|
||||
* address if requesting the primary calendar for a user. Defaults to
|
||||
* "default" (the currently authenticated user). A null value should be
|
||||
* used when the calendar address has already been set as part of the
|
||||
* query URI.
|
||||
*/
|
||||
protected $_user = 'default';
|
||||
|
||||
/*
|
||||
* The visibility to be requested by queries. Defaults to "public". A
|
||||
* null value should be used when the calendar address has already been
|
||||
* set as part of the query URI.
|
||||
*/
|
||||
protected $_visibility = 'public';
|
||||
|
||||
/**
|
||||
* Projection to be requested by queries. Defaults to "full". A null value
|
||||
* should be used when the calendar address has already been set as part
|
||||
* of the query URI.
|
||||
*/
|
||||
protected $_projection = 'full';
|
||||
|
||||
/**
|
||||
* The event ID to retrieve. If null, no specific event will be retrieved
|
||||
* unless already included in the query URI.
|
||||
*/
|
||||
protected $_event = null;
|
||||
|
||||
/**
|
||||
* Create Gdata_Calendar_EventQuery object. If a URL is provided,
|
||||
* it becomes the base URL, and additional URL components may be
|
||||
* appended. For instance, if $url is 'http://www.google.com/calendar',
|
||||
* the default URL constructed will be
|
||||
* 'http://www.google.com/calendar/default/public/full'.
|
||||
*
|
||||
* If the URL already contains a calendar ID, projection, visibility,
|
||||
* event ID, or comment ID, you will need to set these fields to null
|
||||
* to prevent them from being inserted. See this class's properties for
|
||||
* more information.
|
||||
*
|
||||
* @param string $url The URL to use as the base path for requests
|
||||
*/
|
||||
public function __construct($url = null)
|
||||
{
|
||||
parent::__construct($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_comments
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setComments($value)
|
||||
{
|
||||
$this->_comments = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_event
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setEvent($value)
|
||||
{
|
||||
$this->_event = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_projection
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setProjection($value)
|
||||
{
|
||||
$this->_projection = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_user
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setUser($value)
|
||||
{
|
||||
$this->_user = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_visibility
|
||||
* @param bool $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setVisibility($value)
|
||||
{
|
||||
$this->_visibility = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_comments;
|
||||
* @return string comments
|
||||
*/
|
||||
public function getComments()
|
||||
{
|
||||
return $this->_comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_event;
|
||||
* @return string event
|
||||
*/
|
||||
public function getEvent()
|
||||
{
|
||||
return $this->_event;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_projection
|
||||
* @return string projection
|
||||
*/
|
||||
public function getProjection()
|
||||
{
|
||||
return $this->_projection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_user
|
||||
* @return string user
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $_visibility
|
||||
* @return string visibility
|
||||
*/
|
||||
public function getVisibility()
|
||||
{
|
||||
return $this->_visibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setStartMax($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['start-max'] = Zend_Gdata_App_Util::formatTimestamp($value);
|
||||
} else {
|
||||
unset($this->_params['start-max']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setStartMin($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['start-min'] = Zend_Gdata_App_Util::formatTimestamp($value);
|
||||
} else {
|
||||
unset($this->_params['start-min']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setOrderBy($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['orderby'] = $value;
|
||||
} else {
|
||||
unset($this->_params['orderby']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int start-max
|
||||
*/
|
||||
public function getStartMax()
|
||||
{
|
||||
if (array_key_exists('start-max', $this->_params)) {
|
||||
return $this->_params['start-max'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int start-min
|
||||
*/
|
||||
public function getStartMin()
|
||||
{
|
||||
if (array_key_exists('start-min', $this->_params)) {
|
||||
return $this->_params['start-min'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string orderby
|
||||
*/
|
||||
public function getOrderBy()
|
||||
{
|
||||
if (array_key_exists('orderby', $this->_params)) {
|
||||
return $this->_params['orderby'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string sortorder
|
||||
*/
|
||||
public function getSortOrder()
|
||||
{
|
||||
if (array_key_exists('sortorder', $this->_params)) {
|
||||
return $this->_params['sortorder'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string sortorder
|
||||
*/
|
||||
public function setSortOrder($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['sortorder'] = $value;
|
||||
} else {
|
||||
unset($this->_params['sortorder']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string recurrence-expansion-start
|
||||
*/
|
||||
public function getRecurrenceExpansionStart()
|
||||
{
|
||||
if (array_key_exists('recurrence-expansion-start', $this->_params)) {
|
||||
return $this->_params['recurrence-expansion-start'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string recurrence-expansion-start
|
||||
*/
|
||||
public function setRecurrenceExpansionStart($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['recurrence-expansion-start'] = Zend_Gdata_App_Util::formatTimestamp($value);
|
||||
} else {
|
||||
unset($this->_params['recurrence-expansion-start']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string recurrence-expansion-end
|
||||
*/
|
||||
public function getRecurrenceExpansionEnd()
|
||||
{
|
||||
if (array_key_exists('recurrence-expansion-end', $this->_params)) {
|
||||
return $this->_params['recurrence-expansion-end'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string recurrence-expansion-end
|
||||
*/
|
||||
public function setRecurrenceExpansionEnd($value)
|
||||
{
|
||||
if ($value != null) {
|
||||
$this->_params['recurrence-expansion-end'] = Zend_Gdata_App_Util::formatTimestamp($value);
|
||||
} else {
|
||||
unset($this->_params['recurrence-expansion-end']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value Also accepts bools.
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function getSingleEvents()
|
||||
{
|
||||
if (array_key_exists('singleevents', $this->_params)) {
|
||||
$value = $this->_params['singleevents'];
|
||||
switch ($value) {
|
||||
case 'true':
|
||||
return true;
|
||||
break;
|
||||
case 'false':
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'Invalid query param value for futureevents: ' .
|
||||
$value . ' It must be a boolean.');
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value Also accepts bools. If using a string, must be either "true" or "false".
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setSingleEvents($value)
|
||||
{
|
||||
if ($value !== null) {
|
||||
if (is_bool($value)) {
|
||||
$this->_params['singleevents'] = ($value?'true':'false');
|
||||
} elseif ($value == 'true' | $value == 'false') {
|
||||
$this->_params['singleevents'] = $value;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'Invalid query param value for futureevents: ' .
|
||||
$value . ' It must be a boolean.');
|
||||
}
|
||||
} else {
|
||||
unset($this->_params['singleevents']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string futureevents
|
||||
*/
|
||||
public function getFutureEvents()
|
||||
{
|
||||
if (array_key_exists('futureevents', $this->_params)) {
|
||||
$value = $this->_params['futureevents'];
|
||||
switch ($value) {
|
||||
case 'true':
|
||||
return true;
|
||||
break;
|
||||
case 'false':
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'Invalid query param value for futureevents: ' .
|
||||
$value . ' It must be a boolean.');
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value Also accepts bools. If using a string, must be either "true" or "false" or
|
||||
* an exception will be thrown on retrieval.
|
||||
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
|
||||
*/
|
||||
public function setFutureEvents($value)
|
||||
{
|
||||
if ($value !== null) {
|
||||
if (is_bool($value)) {
|
||||
$this->_params['futureevents'] = ($value?'true':'false');
|
||||
} elseif ($value == 'true' | $value == 'false') {
|
||||
$this->_params['futureevents'] = $value;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'Invalid query param value for futureevents: ' .
|
||||
$value . ' It must be a boolean.');
|
||||
}
|
||||
} else {
|
||||
unset($this->_params['futureevents']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string url
|
||||
*/
|
||||
public function getQueryUrl()
|
||||
{
|
||||
if (isset($this->_url)) {
|
||||
$uri = $this->_url;
|
||||
} else {
|
||||
$uri = $this->_defaultFeedUri;
|
||||
}
|
||||
if ($this->getUser() != null) {
|
||||
$uri .= '/' . $this->getUser();
|
||||
}
|
||||
if ($this->getVisibility() != null) {
|
||||
$uri .= '/' . $this->getVisibility();
|
||||
}
|
||||
if ($this->getProjection() != null) {
|
||||
$uri .= '/' . $this->getProjection();
|
||||
}
|
||||
if ($this->getEvent() != null) {
|
||||
$uri .= '/' . $this->getEvent();
|
||||
if ($this->getComments() != null) {
|
||||
$uri .= '/comments/' . $this->getComments();
|
||||
}
|
||||
}
|
||||
$uri .= $this->getQueryString();
|
||||
return $uri;
|
||||
}
|
||||
|
||||
}
|
125
library/Zend/Gdata/Calendar/Extension/AccessLevel.php
Normal file
125
library/Zend/Gdata/Calendar/Extension/AccessLevel.php
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AccessLevel.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:accessLevel element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_AccessLevel extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'accesslevel';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_AccessLevel object.
|
||||
* @param string $value (optional) The text content of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value != null) {
|
||||
$element->setAttribute('value', $this->_value);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
$this->_value = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return string The attribute being modified.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param string $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_Selected The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
}
|
125
library/Zend/Gdata/Calendar/Extension/Color.php
Normal file
125
library/Zend/Gdata/Calendar/Extension/Color.php
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Color.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:color element used by the Calendar data API
|
||||
* to define the color of a calendar in the UI.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_Color extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'color';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_Color object.
|
||||
* @param string $value (optional) The text content of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value != null) {
|
||||
$element->setAttribute('value', $this->_value);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
$this->_value = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return string The value associated with this attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param string $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_Color The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
}
|
134
library/Zend/Gdata/Calendar/Extension/Hidden.php
Normal file
134
library/Zend/Gdata/Calendar/Extension/Hidden.php
Normal file
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Hidden.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:hidden element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_Hidden extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'hidden';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_Hidden object.
|
||||
* @param bool $value (optional) The value of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', ($this->_value ? "true" : "false"));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
if ($attribute->nodeValue == "true") {
|
||||
$this->_value = true;
|
||||
}
|
||||
else if ($attribute->nodeValue == "false") {
|
||||
$this->_value = false;
|
||||
}
|
||||
else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return string The requested attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param bool $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_Hidden The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
}
|
||||
|
125
library/Zend/Gdata/Calendar/Extension/Link.php
Normal file
125
library/Zend/Gdata/Calendar/Extension/Link.php
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?php
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Link.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Link.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/WebContent.php';
|
||||
|
||||
|
||||
/**
|
||||
* Specialized Link class for use with Calendar. Enables use of gCal extension elements.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_Link extends Zend_Gdata_App_Extension_Link
|
||||
{
|
||||
|
||||
protected $_webContent = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_Link object.
|
||||
* @see Zend_Gdata_App_Extension_Link#__construct
|
||||
* @param Zend_Gdata_Calendar_Extension_Webcontent $webContent
|
||||
*/
|
||||
public function __construct($href = null, $rel = null, $type = null,
|
||||
$hrefLang = null, $title = null, $length = null, $webContent = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
|
||||
$this->_webContent = $webContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_webContent != null) {
|
||||
$element->appendChild($this->_webContent->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates individual Entry objects of the appropriate type and
|
||||
* stores them as members of this entry based upon DOM data.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode to process
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('gCal') . ':' . 'webContent':
|
||||
$webContent = new Zend_Gdata_Calendar_Extension_WebContent();
|
||||
$webContent->transferFromDOM($child);
|
||||
$this->_webContent = $webContent;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's WebContent attribute.
|
||||
*
|
||||
* @return Zend_Gdata_Calendar_Extension_Webcontent The WebContent value
|
||||
*/
|
||||
public function getWebContent()
|
||||
{
|
||||
return $this->_webContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's WebContent attribute.
|
||||
*
|
||||
* @param Zend_Gdata_Calendar_Extension_WebContent $value The desired value for this attribute.
|
||||
* @return Zend_Calendar_Extension_Link The element being modified. Provides a fluent interface.
|
||||
*/
|
||||
public function setWebContent($value)
|
||||
{
|
||||
$this->_webContent = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
132
library/Zend/Gdata/Calendar/Extension/QuickAdd.php
Normal file
132
library/Zend/Gdata/Calendar/Extension/QuickAdd.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: QuickAdd.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:quickAdd element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_QuickAdd extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'quickadd';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_QuickAdd object.
|
||||
* @param string $value (optional) The text content of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', ($this->_value ? "true" : "false"));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
if ($attribute->nodeValue == "true") {
|
||||
$this->_value = true;
|
||||
}
|
||||
else if ($attribute->nodeValue == "false") {
|
||||
$this->_value = false;
|
||||
}
|
||||
else {
|
||||
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return string The value associated with this attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param string $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_QuickAdd The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
}
|
133
library/Zend/Gdata/Calendar/Extension/Selected.php
Normal file
133
library/Zend/Gdata/Calendar/Extension/Selected.php
Normal file
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Selected.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:selected element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_Selected extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'selected';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_Selected object.
|
||||
* @param bool $value (optional) The value of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', ($this->_value ? "true" : "false"));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
if ($attribute->nodeValue == "true") {
|
||||
$this->_value = true;
|
||||
}
|
||||
else if ($attribute->nodeValue == "false") {
|
||||
$this->_value = false;
|
||||
}
|
||||
else {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return bool The value associated with this attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param bool $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_Selected The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
}
|
132
library/Zend/Gdata/Calendar/Extension/SendEventNotifications.php
Normal file
132
library/Zend/Gdata/Calendar/Extension/SendEventNotifications.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: SendEventNotifications.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Data model class to represent an entry's sendEventNotifications
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_SendEventNotifications extends Zend_Gdata_Extension
|
||||
{
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'sendEventNotifications';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Extension_SendEventNotifications object.
|
||||
* @param bool $value (optional) SendEventNotifications value as URI.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value !== null) {
|
||||
$element->setAttribute('value', ($this->_value ? "true" : "false"));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
if ($attribute->nodeValue == "true") {
|
||||
$this->_value = true;
|
||||
}
|
||||
else if ($attribute->nodeValue == "false") {
|
||||
$this->_value = false;
|
||||
}
|
||||
else {
|
||||
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's Value attribute.
|
||||
*
|
||||
* @return string The requested attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's Value attribute.
|
||||
*
|
||||
* @param string $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Extension_SendEventNotifications The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
124
library/Zend/Gdata/Calendar/Extension/Timezone.php
Normal file
124
library/Zend/Gdata/Calendar/Extension/Timezone.php
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Timezone.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:timezone element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_Timezone extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'timezone';
|
||||
protected $_value = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_Timezone object.
|
||||
* @param string $value (optional) The text content of the element.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_value != null) {
|
||||
$element->setAttribute('value', $this->_value);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'value':
|
||||
$this->_value = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's value attribute.
|
||||
*
|
||||
* @return string The value associated with this attribute.
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's value attribute.
|
||||
*
|
||||
* @param string $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_Timezone The element being modified.
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic toString method allows using this directly via echo
|
||||
* Works best in PHP >= 4.2.0
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
}
|
177
library/Zend/Gdata/Calendar/Extension/WebContent.php
Normal file
177
library/Zend/Gdata/Calendar/Extension/WebContent.php
Normal file
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: WebContent.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Represents the gCal:webContent element used by the Calendar data API
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_Extension_WebContent extends Zend_Gdata_App_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'gCal';
|
||||
protected $_rootElement = 'webContent';
|
||||
protected $_url = null;
|
||||
protected $_height = null;
|
||||
protected $_width = null;
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Calendar_Extension_WebContent object.
|
||||
* @param string $url (optional) The value for this element's URL attribute.
|
||||
* @param string $height (optional) The value for this element's height attribute.
|
||||
* @param string $width (optional) The value for this element's width attribute.
|
||||
*/
|
||||
public function __construct($url = null, $height = null, $width = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_url = $url;
|
||||
$this->_height = $height;
|
||||
$this->_width = $width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->url != null) {
|
||||
$element->setAttribute('url', $this->_url);
|
||||
}
|
||||
if ($this->height != null) {
|
||||
$element->setAttribute('height', $this->_height);
|
||||
}
|
||||
if ($this->width != null) {
|
||||
$element->setAttribute('width', $this->_width);
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'url':
|
||||
$this->_url = $attribute->nodeValue;
|
||||
break;
|
||||
case 'height':
|
||||
$this->_height = $attribute->nodeValue;
|
||||
break;
|
||||
case 'width':
|
||||
$this->_width = $attribute->nodeValue;
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's URL attribute.
|
||||
*
|
||||
* @return string The desired value for this attribute.
|
||||
*/
|
||||
public function getURL()
|
||||
{
|
||||
return $this->_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's URL attribute.
|
||||
*
|
||||
* @param bool $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
|
||||
*/
|
||||
public function setURL($value)
|
||||
{
|
||||
$this->_url = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's height attribute.
|
||||
*
|
||||
* @return int The desired value for this attribute.
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return $this->_height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's height attribute.
|
||||
*
|
||||
* @param int $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
|
||||
*/
|
||||
public function setHeight($value)
|
||||
{
|
||||
$this->_height = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for this element's height attribute.
|
||||
*
|
||||
* @return int The desired value for this attribute.
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->_width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for this element's height attribute.
|
||||
*
|
||||
* @param int $value The desired value for this attribute.
|
||||
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
|
||||
*/
|
||||
public function setWidth($value)
|
||||
{
|
||||
$this->_width = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
246
library/Zend/Gdata/Calendar/ListEntry.php
Normal file
246
library/Zend/Gdata/Calendar/ListEntry.php
Normal file
|
@ -0,0 +1,246 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ListEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Calendar_Extension_AccessLevel
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Calendar_Extension_Color
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Color.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Calendar_Extension_Hidden
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Calendar_Extension_Selected
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_EventStatus
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension/EventStatus.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_Visibility
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension/Visibility.php';
|
||||
|
||||
|
||||
/**
|
||||
* @see Zend_Extension_Where
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension/Where.php';
|
||||
|
||||
/**
|
||||
* Represents a Calendar entry in the Calendar data API meta feed of a user's
|
||||
* calendars.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
|
||||
{
|
||||
|
||||
protected $_color = null;
|
||||
protected $_accessLevel = null;
|
||||
protected $_hidden = null;
|
||||
protected $_selected = null;
|
||||
protected $_timezone = null;
|
||||
protected $_where = array();
|
||||
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_accessLevel != null) {
|
||||
$element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_color != null) {
|
||||
$element->appendChild($this->_color->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_hidden != null) {
|
||||
$element->appendChild($this->_hidden->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_selected != null) {
|
||||
$element->appendChild($this->_selected->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_timezone != null) {
|
||||
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
||||
}
|
||||
if ($this->_where != null) {
|
||||
foreach ($this->_where as $where) {
|
||||
$element->appendChild($where->getDOM($element->ownerDocument));
|
||||
}
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
|
||||
$accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
|
||||
$accessLevel->transferFromDOM($child);
|
||||
$this->_accessLevel = $accessLevel;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'color';
|
||||
$color = new Zend_Gdata_Calendar_Extension_Color();
|
||||
$color->transferFromDOM($child);
|
||||
$this->_color = $color;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'hidden';
|
||||
$hidden = new Zend_Gdata_Calendar_Extension_Hidden();
|
||||
$hidden->transferFromDOM($child);
|
||||
$this->_hidden = $hidden;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'selected';
|
||||
$selected = new Zend_Gdata_Calendar_Extension_Selected();
|
||||
$selected->transferFromDOM($child);
|
||||
$this->_selected = $selected;
|
||||
break;
|
||||
case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
||||
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
||||
$timezone->transferFromDOM($child);
|
||||
$this->_timezone = $timezone;
|
||||
break;
|
||||
case $this->lookupNamespace('gd') . ':' . 'where';
|
||||
$where = new Zend_Gdata_Extension_Where();
|
||||
$where->transferFromDOM($child);
|
||||
$this->_where[] = $where;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAccessLevel()
|
||||
{
|
||||
return $this->_accessLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_AccessLevel $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setAccessLevel($value)
|
||||
{
|
||||
$this->_accessLevel = $value;
|
||||
return $this;
|
||||
}
|
||||
public function getColor()
|
||||
{
|
||||
return $this->_color;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Color $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setColor($value)
|
||||
{
|
||||
$this->_color = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHidden()
|
||||
{
|
||||
return $this->_hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Hidden $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setHidden($value)
|
||||
{
|
||||
$this->_hidden = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSelected()
|
||||
{
|
||||
return $this->_selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Selected $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setSelected($value)
|
||||
{
|
||||
$this->_selected = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->_timezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Timezone $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setTimezone($value)
|
||||
{
|
||||
$this->_timezone = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWhere()
|
||||
{
|
||||
return $this->_where;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Extension_Where $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setWhere($value)
|
||||
{
|
||||
$this->_where = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
106
library/Zend/Gdata/Calendar/ListFeed.php
Normal file
106
library/Zend/Gdata/Calendar/ListFeed.php
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ListFeed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Feed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Feed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension_Timezone
|
||||
*/
|
||||
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
|
||||
|
||||
/**
|
||||
* Represents the meta-feed list of calendars
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Calendar
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Calendar_ListFeed extends Zend_Gdata_Feed
|
||||
{
|
||||
protected $_timezone = null;
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Calendar_ListEntry';
|
||||
|
||||
/**
|
||||
* The classname for the feed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_feedClassName = 'Zend_Gdata_Calendar_ListFeed';
|
||||
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_timezone != null) {
|
||||
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
||||
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
||||
$timezone->transferFromDOM($child);
|
||||
$this->_timezone = $timezone;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTimezone()
|
||||
{
|
||||
return $this->_timezone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Zend_Gdata_Calendar_Extension_Timezone $value
|
||||
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
||||
*/
|
||||
public function setTimezone($value)
|
||||
{
|
||||
$this->_timezone = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
182
library/Zend/Gdata/ClientLogin.php
Normal file
182
library/Zend/Gdata/ClientLogin.php
Normal file
|
@ -0,0 +1,182 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ClientLogin.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_HttpClient
|
||||
*/
|
||||
require_once 'Zend/Gdata/HttpClient.php';
|
||||
|
||||
/**
|
||||
* Zend_Version
|
||||
*/
|
||||
require_once 'Zend/Version.php';
|
||||
|
||||
/**
|
||||
* Class to facilitate Google's "Account Authentication
|
||||
* for Installed Applications" also known as "ClientLogin".
|
||||
* @see http://code.google.com/apis/accounts/AuthForInstalledApps.html
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_ClientLogin
|
||||
{
|
||||
|
||||
/**
|
||||
* The Google client login URI
|
||||
*
|
||||
*/
|
||||
const CLIENTLOGIN_URI = 'https://www.google.com/accounts/ClientLogin';
|
||||
|
||||
/**
|
||||
* The default 'source' parameter to send to Google
|
||||
*
|
||||
*/
|
||||
const DEFAULT_SOURCE = 'Zend-ZendFramework';
|
||||
|
||||
/**
|
||||
* Set Google authentication credentials.
|
||||
* Must be done before trying to do any Google Data operations that
|
||||
* require authentication.
|
||||
* For example, viewing private data, or posting or deleting entries.
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $password
|
||||
* @param string $service
|
||||
* @param Zend_Gdata_HttpClient $client
|
||||
* @param string $source
|
||||
* @param string $loginToken The token identifier as provided by the server.
|
||||
* @param string $loginCaptcha The user's response to the CAPTCHA challenge.
|
||||
* @param string $accountType An optional string to identify whether the
|
||||
* account to be authenticated is a google or a hosted account. Defaults to
|
||||
* 'HOSTED_OR_GOOGLE'. See: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Request
|
||||
* @throws Zend_Gdata_App_AuthException
|
||||
* @throws Zend_Gdata_App_HttpException
|
||||
* @throws Zend_Gdata_App_CaptchaRequiredException
|
||||
* @return Zend_Gdata_HttpClient
|
||||
*/
|
||||
public static function getHttpClient($email, $password, $service = 'xapi',
|
||||
$client = null,
|
||||
$source = self::DEFAULT_SOURCE,
|
||||
$loginToken = null,
|
||||
$loginCaptcha = null,
|
||||
$loginUri = self::CLIENTLOGIN_URI,
|
||||
$accountType = 'HOSTED_OR_GOOGLE')
|
||||
{
|
||||
if (! ($email && $password)) {
|
||||
require_once 'Zend/Gdata/App/AuthException.php';
|
||||
throw new Zend_Gdata_App_AuthException(
|
||||
'Please set your Google credentials before trying to ' .
|
||||
'authenticate');
|
||||
}
|
||||
|
||||
if ($client == null) {
|
||||
$client = new Zend_Gdata_HttpClient();
|
||||
}
|
||||
if (!$client instanceof Zend_Http_Client) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException(
|
||||
'Client is not an instance of Zend_Http_Client.');
|
||||
}
|
||||
|
||||
// Build the HTTP client for authentication
|
||||
$client->setUri($loginUri);
|
||||
$useragent = $source . ' Zend_Framework_Gdata/' . Zend_Version::VERSION;
|
||||
$client->setConfig(array(
|
||||
'maxredirects' => 0,
|
||||
'strictredirects' => true,
|
||||
'useragent' => $useragent
|
||||
)
|
||||
);
|
||||
$client->setParameterPost('accountType', $accountType);
|
||||
$client->setParameterPost('Email', (string) $email);
|
||||
$client->setParameterPost('Passwd', (string) $password);
|
||||
$client->setParameterPost('service', (string) $service);
|
||||
$client->setParameterPost('source', (string) $source);
|
||||
if ($loginToken || $loginCaptcha) {
|
||||
if($loginToken && $loginCaptcha) {
|
||||
$client->setParameterPost('logintoken', (string) $loginToken);
|
||||
$client->setParameterPost('logincaptcha',
|
||||
(string) $loginCaptcha);
|
||||
}
|
||||
else {
|
||||
require_once 'Zend/Gdata/App/AuthException.php';
|
||||
throw new Zend_Gdata_App_AuthException(
|
||||
'Please provide both a token ID and a user\'s response ' .
|
||||
'to the CAPTCHA challenge.');
|
||||
}
|
||||
}
|
||||
|
||||
// Send the authentication request
|
||||
// For some reason Google's server causes an SSL error. We use the
|
||||
// output buffer to supress an error from being shown. Ugly - but works!
|
||||
ob_start();
|
||||
try {
|
||||
$response = $client->request('POST');
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
require_once 'Zend/Gdata/App/HttpException.php';
|
||||
throw new Zend_Gdata_App_HttpException($e->getMessage(), $e);
|
||||
}
|
||||
ob_end_clean();
|
||||
|
||||
// Parse Google's response
|
||||
$goog_resp = array();
|
||||
foreach (explode("\n", $response->getBody()) as $l) {
|
||||
$l = chop($l);
|
||||
if ($l) {
|
||||
list($key, $val) = explode('=', chop($l), 2);
|
||||
$goog_resp[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if ($response->getStatus() == 200) {
|
||||
$client->setClientLoginToken($goog_resp['Auth']);
|
||||
$useragent = $source . ' Zend_Framework_Gdata/' . Zend_Version::VERSION;
|
||||
$client->setConfig(array(
|
||||
'strictredirects' => true,
|
||||
'useragent' => $useragent
|
||||
)
|
||||
);
|
||||
return $client;
|
||||
|
||||
} elseif ($response->getStatus() == 403) {
|
||||
// Check if the server asked for a CAPTCHA
|
||||
if (array_key_exists('Error', $goog_resp) &&
|
||||
$goog_resp['Error'] == 'CaptchaRequired') {
|
||||
require_once 'Zend/Gdata/App/CaptchaRequiredException.php';
|
||||
throw new Zend_Gdata_App_CaptchaRequiredException(
|
||||
$goog_resp['CaptchaToken'], $goog_resp['CaptchaUrl']);
|
||||
}
|
||||
else {
|
||||
require_once 'Zend/Gdata/App/AuthException.php';
|
||||
throw new Zend_Gdata_App_AuthException('Authentication with Google failed. Reason: ' .
|
||||
(isset($goog_resp['Error']) ? $goog_resp['Error'] : 'Unspecified.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
303
library/Zend/Gdata/Docs.php
Normal file
303
library/Zend/Gdata/Docs.php
Normal file
|
@ -0,0 +1,303 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Docs.php 20112 2010-01-07 02:39:32Z tjohns $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Docs_DocumentListFeed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Docs/DocumentListFeed.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Docs_DocumentListEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Docs/DocumentListEntry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Category
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Category.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_Extension_Title
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/Extension/Title.php';
|
||||
|
||||
/**
|
||||
* Service class for interacting with the Google Document List data API
|
||||
* @link http://code.google.com/apis/documents/
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Docs extends Zend_Gdata
|
||||
{
|
||||
|
||||
const DOCUMENTS_LIST_FEED_URI = 'http://docs.google.com/feeds/documents/private/full';
|
||||
const DOCUMENTS_FOLDER_FEED_URI = 'http://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';
|
||||
|
||||
protected $_defaultPostUri = self::DOCUMENTS_LIST_FEED_URI;
|
||||
|
||||
private static $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');
|
||||
|
||||
/**
|
||||
* Create Gdata_Docs object
|
||||
*
|
||||
* @param Zend_Http_Client $client (optional) The HTTP client to use when
|
||||
* when communicating with the Google servers.
|
||||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version
|
||||
*/
|
||||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0')
|
||||
{
|
||||
$this->registerPackage('Zend_Gdata_Docs');
|
||||
parent::__construct($client, $applicationId);
|
||||
$this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param string $fileExtension
|
||||
* @return string The mime type to be sent to the server to tell it how the
|
||||
* multipart mime data should be interpreted.
|
||||
*/
|
||||
public static function lookupMimeType($fileExtension) {
|
||||
return self::$SUPPORTED_FILETYPES[strtoupper($fileExtension)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive feed object containing entries for the user's documents.
|
||||
*
|
||||
* @param mixed $location The location for the feed, as a URL or Query
|
||||
* @return Zend_Gdata_Docs_DocumentListFeed
|
||||
*/
|
||||
public function getDocumentListFeed($location = null)
|
||||
{
|
||||
if ($location === null) {
|
||||
$uri = self::DOCUMENTS_LIST_FEED_URI;
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getFeed($uri, 'Zend_Gdata_Docs_DocumentListFeed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entry object representing a single document.
|
||||
*
|
||||
* @param mixed $location The location for the entry, as a URL or Query
|
||||
* @return Zend_Gdata_Docs_DocumentListEntry
|
||||
*/
|
||||
public function getDocumentListEntry($location = null)
|
||||
{
|
||||
if ($location === null) {
|
||||
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
|
||||
throw new Zend_Gdata_App_InvalidArgumentException(
|
||||
'Location must not be null');
|
||||
} else if ($location instanceof Zend_Gdata_Query) {
|
||||
$uri = $location->getQueryUrl();
|
||||
} else {
|
||||
$uri = $location;
|
||||
}
|
||||
return parent::getEntry($uri, '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.
|
||||
* @param string $docId The URL key for the document. Examples:
|
||||
* dcmg89gw_62hfjj8m, pKq0CzjiF3YmGd0AIlHKqeg
|
||||
* @param string $docType The type of the document as used in the Google
|
||||
* Document List URLs. Examples: document, spreadsheet, presentation
|
||||
* @return Zend_Gdata_Docs_DocumentListEntry
|
||||
*/
|
||||
public function getDoc($docId, $docType) {
|
||||
$location = 'http://docs.google.com/feeds/documents/private/full/' .
|
||||
$docType . '%3A' . $docId;
|
||||
return $this->getDocumentListEntry($location);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entry object for the desired word processing document.
|
||||
*
|
||||
* @param string $id The URL id for the document. Example:
|
||||
* dcmg89gw_62hfjj8m
|
||||
*/
|
||||
public function getDocument($id) {
|
||||
return $this->getDoc($id, 'document');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entry object for the desired spreadsheet.
|
||||
*
|
||||
* @param string $id The URL id for the document. Example:
|
||||
* pKq0CzjiF3YmGd0AIlHKqeg
|
||||
*/
|
||||
public function getSpreadsheet($id) {
|
||||
return $this->getDoc($id, 'spreadsheet');
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive entry object for the desired presentation.
|
||||
*
|
||||
* @param string $id The URL id for the document. Example:
|
||||
* dcmg89gw_21gtrjcn
|
||||
*/
|
||||
public function getPresentation($id) {
|
||||
return $this->getDoc($id, 'presentation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a local file to create a new Google Document entry.
|
||||
*
|
||||
* @param string $fileLocation The full or relative path of the file to
|
||||
* be uploaded.
|
||||
* @param string $title 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'.
|
||||
* @param string $mimeType 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.
|
||||
* @param string $uri (optional) The URL to which the upload should be
|
||||
* made.
|
||||
* Example: 'http://docs.google.com/feeds/documents/private/full'.
|
||||
* @return Zend_Gdata_Docs_DocumentListEntry The entry for the newly
|
||||
* created Google Document.
|
||||
*/
|
||||
public function uploadFile($fileLocation, $title=null, $mimeType=null,
|
||||
$uri=null)
|
||||
{
|
||||
// Set the URI to which the file will be uploaded.
|
||||
if ($uri === null) {
|
||||
$uri = $this->_defaultPostUri;
|
||||
}
|
||||
|
||||
// Create the media source which describes the file.
|
||||
$fs = $this->newMediaFileSource($fileLocation);
|
||||
if ($title !== null) {
|
||||
$slugHeader = $title;
|
||||
} else {
|
||||
$slugHeader = $fileLocation;
|
||||
}
|
||||
|
||||
// Set the slug header to tell the Google Documents server what the
|
||||
// title of the document should be and what the file extension was
|
||||
// for the original file.
|
||||
$fs->setSlug($slugHeader);
|
||||
|
||||
// Set the mime type of the data.
|
||||
if ($mimeType === null) {
|
||||
$filenameParts = explode('.', $fileLocation);
|
||||
$fileExtension = end($filenameParts);
|
||||
$mimeType = self::lookupMimeType($fileExtension);
|
||||
}
|
||||
|
||||
// Set the mime type for the upload request.
|
||||
$fs->setContentType($mimeType);
|
||||
|
||||
// Send the data to the server.
|
||||
return $this->insertDocument($fs, $uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new folder in Google Docs
|
||||
*
|
||||
* @param string $folderName The folder name to create
|
||||
* @param string|null $folderResourceId The parent folder to create it in
|
||||
* ("folder%3Amy_parent_folder")
|
||||
* @return 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.
|
||||
*/
|
||||
public function createFolder($folderName, $folderResourceId=null) {
|
||||
$category = new Zend_Gdata_App_Extension_Category(self::DOCUMENTS_CATEGORY_TERM,
|
||||
self::DOCUMENTS_CATEGORY_SCHEMA);
|
||||
$title = new Zend_Gdata_App_Extension_Title($folderName);
|
||||
$entry = new Zend_Gdata_Entry();
|
||||
|
||||
$entry->setCategory(array($category));
|
||||
$entry->setTitle($title);
|
||||
|
||||
$uri = self::DOCUMENTS_LIST_FEED_URI;
|
||||
if ($folderResourceId != null) {
|
||||
$uri = self::DOCUMENTS_FOLDER_FEED_URI . '/' . $folderResourceId;
|
||||
}
|
||||
|
||||
return $this->insertEntry($entry, $uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts an entry to a given URI and returns the response as an Entry.
|
||||
*
|
||||
* @param mixed $data 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.
|
||||
* @param string $uri POST URI
|
||||
* @param string $className (optional) The class of entry to be returned.
|
||||
* The default is a 'Zend_Gdata_Docs_DocumentListEntry'.
|
||||
* @return Zend_Gdata_Docs_DocumentListEntry The entry returned by the
|
||||
* service after insertion.
|
||||
*/
|
||||
public function insertDocument($data, $uri,
|
||||
$className='Zend_Gdata_Docs_DocumentListEntry')
|
||||
{
|
||||
return $this->insertEntry($data, $uri, $className);
|
||||
}
|
||||
|
||||
}
|
54
library/Zend/Gdata/Docs/DocumentListEntry.php
Normal file
54
library/Zend/Gdata/Docs/DocumentListEntry.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DocumentListEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_EntryAtom
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* Represents a Documents List entry in the Documents List data API meta feed
|
||||
* of a user's documents.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Docs_DocumentListEntry extends Zend_Gdata_Entry
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a new instance of an entry representing a document.
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Docs::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
}
|
68
library/Zend/Gdata/Docs/DocumentListFeed.php
Normal file
68
library/Zend/Gdata/Docs/DocumentListFeed.php
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DocumentListFeed.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Feed
|
||||
*/
|
||||
require_once 'Zend/Gdata/Feed.php';
|
||||
|
||||
|
||||
/**
|
||||
* Data model for a Google Documents List feed of documents
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Docs_DocumentListFeed extends Zend_Gdata_Feed
|
||||
{
|
||||
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Docs_DocumentListEntry';
|
||||
|
||||
/**
|
||||
* The classname for the feed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_feedClassName = 'Zend_Gdata_Docs_DocumentListFeed';
|
||||
|
||||
/**
|
||||
* Create a new instance of a feed for a list of documents.
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Docs::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
}
|
222
library/Zend/Gdata/Docs/Query.php
Normal file
222
library/Zend/Gdata/Docs/Query.php
Normal file
|
@ -0,0 +1,222 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Query.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Gdata_Query
|
||||
*/
|
||||
require_once('Zend/Gdata/Query.php');
|
||||
|
||||
/**
|
||||
* Assists in constructing queries for Google Document List documents
|
||||
*
|
||||
* @link http://code.google.com/apis/gdata/spreadsheets/
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Docs
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Docs_Query extends Zend_Gdata_Query
|
||||
{
|
||||
|
||||
/**
|
||||
* The base URL for retrieving a document list
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DOCUMENTS_LIST_FEED_URI = 'http://docs.google.com/feeds/documents';
|
||||
|
||||
/**
|
||||
* The generic base URL used by some inherited methods
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_defaultFeedUri = self::DOCUMENTS_LIST_FEED_URI;
|
||||
|
||||
/**
|
||||
* The visibility to be used when querying for the feed. A request for a
|
||||
* feed with private visbility requires the user to be authenricated.
|
||||
* Private is the only avilable visibility for the documents list.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_visibility = 'private';
|
||||
|
||||
/**
|
||||
* The projection determines how much detail should be given in the
|
||||
* result of the query. Full is the only valid projection for the
|
||||
* documents list.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_projection = 'full';
|
||||
|
||||
/**
|
||||
* Constructs a new instance of a Zend_Gdata_Docs_Query object.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the projection for this query. Common values for projection
|
||||
* include 'full'.
|
||||
*
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Docs_Query Provides a fluent interface
|
||||
*/
|
||||
public function setProjection($value)
|
||||
{
|
||||
$this->_projection = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the visibility for this query. Common values for visibility
|
||||
* include 'private'.
|
||||
*
|
||||
* @return Zend_Gdata_Docs_Query Provides a fluent interface
|
||||
*/
|
||||
public function setVisibility($value)
|
||||
{
|
||||
$this->_visibility = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projection for this query.
|
||||
*
|
||||
* @return string projection
|
||||
*/
|
||||
public function getProjection()
|
||||
{
|
||||
return $this->_projection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the visibility for this query.
|
||||
*
|
||||
* @return string visibility
|
||||
*/
|
||||
public function getVisibility()
|
||||
{
|
||||
return $this->_visibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the title attribute for this query. The title parameter is used
|
||||
* to restrict the results to documents whose titles either contain or
|
||||
* completely match the title.
|
||||
*
|
||||
* @param string $value
|
||||
* @return Zend_Gdata_Docs_Query Provides a fluent interface
|
||||
*/
|
||||
public function setTitle($value)
|
||||
{
|
||||
if ($value !== null) {
|
||||
$this->_params['title'] = $value;
|
||||
} else {
|
||||
unset($this->_params['title']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the title attribute for this query.
|
||||
*
|
||||
* @return string title
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
if (array_key_exists('title', $this->_params)) {
|
||||
return $this->_params['title'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the title-exact attribute for this query.
|
||||
* If title-exact is set to true, the title query parameter will be used
|
||||
* in an exact match. Only documents with a title identical to the
|
||||
* title parameter will be returned.
|
||||
*
|
||||
* @param boolean $value Use either true or false
|
||||
* @return Zend_Gdata_Docs_Query Provides a fluent interface
|
||||
*/
|
||||
public function setTitleExact($value)
|
||||
{
|
||||
if ($value) {
|
||||
$this->_params['title-exact'] = $value;
|
||||
} else {
|
||||
unset($this->_params['title-exact']);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the title-exact attribute for this query.
|
||||
*
|
||||
* @return string title-exact
|
||||
*/
|
||||
public function getTitleExact()
|
||||
{
|
||||
if (array_key_exists('title-exact', $this->_params)) {
|
||||
return $this->_params['title-exact'];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the full query URL for this query.
|
||||
*
|
||||
* @return string url
|
||||
*/
|
||||
public function getQueryUrl()
|
||||
{
|
||||
$uri = $this->_defaultFeedUri;
|
||||
|
||||
if ($this->_visibility !== null) {
|
||||
$uri .= '/' . $this->_visibility;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'A visibility must be provided for cell queries.');
|
||||
}
|
||||
|
||||
if ($this->_projection !== null) {
|
||||
$uri .= '/' . $this->_projection;
|
||||
} else {
|
||||
require_once 'Zend/Gdata/App/Exception.php';
|
||||
throw new Zend_Gdata_App_Exception(
|
||||
'A projection must be provided for cell queries.');
|
||||
}
|
||||
|
||||
$uri .= $this->getQueryString();
|
||||
return $uri;
|
||||
}
|
||||
|
||||
}
|
65
library/Zend/Gdata/DublinCore.php
Normal file
65
library/Zend/Gdata/DublinCore.php
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DublinCore.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* Service class for interacting with the services which use the
|
||||
* DublinCore extensions.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore extends Zend_Gdata
|
||||
{
|
||||
|
||||
/**
|
||||
* Namespaces used for Zend_Gdata_DublinCore
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $namespaces = array(
|
||||
array('dc', 'http://purl.org/dc/terms', 1, 0)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create Zend_Gdata_DublinCore object
|
||||
*
|
||||
* @param Zend_Http_Client $client (optional) The HTTP client to use when
|
||||
* when communicating with the Google servers.
|
||||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version
|
||||
*/
|
||||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0')
|
||||
{
|
||||
$this->registerPackage('Zend_Gdata_DublinCore');
|
||||
$this->registerPackage('Zend_Gdata_DublinCore_Extension');
|
||||
parent::__construct($client, $applicationId);
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Creator.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Creator.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Creator.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Entity primarily responsible for making the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Creator extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'creator';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Creator which
|
||||
* Entity primarily responsible for making the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
60
library/Zend/Gdata/DublinCore/Extension/Date.php
Normal file
60
library/Zend/Gdata/DublinCore/Extension/Date.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Date.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Point or period of time associated with an event in the lifecycle of the
|
||||
* resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Date extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'date';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Date which
|
||||
* Point or period of time associated with an event in the lifecycle of the
|
||||
* resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Description.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Description.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Description.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Account of the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Description extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'description';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Description which
|
||||
* Account of the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Format.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Format.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Format.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* File format, physical medium, or dimensions of the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Format extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'format';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Format which
|
||||
* File format, physical medium, or dimensions of the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Identifier.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Identifier.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Identifier.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* An unambiguous reference to the resource within a given context
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Identifier extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'identifier';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Identifier which
|
||||
* An unambiguous reference to the resource within a given context
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Language.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Language.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Language.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Language of the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Language extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'language';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Language which
|
||||
* Language of the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Publisher.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Publisher.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Publisher.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Entity responsible for making the resource available
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Publisher extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'publisher';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Publisher which
|
||||
* Entity responsible for making the resource available
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Rights.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Rights.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Rights.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Information about rights held in and over the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Rights extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'rights';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Rights which
|
||||
* Information about rights held in and over the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Subject.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Subject.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Subject.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Topic of the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Subject extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'subject';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Subject which
|
||||
* Topic of the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
58
library/Zend/Gdata/DublinCore/Extension/Title.php
Normal file
58
library/Zend/Gdata/DublinCore/Extension/Title.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Title.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* Name given to the resource
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage DublinCore
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_DublinCore_Extension_Title extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'dc';
|
||||
protected $_rootElement = 'title';
|
||||
|
||||
/**
|
||||
* Constructor for Zend_Gdata_DublinCore_Extension_Title which
|
||||
* Name given to the resource
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($value = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_DublinCore::$namespaces);
|
||||
parent::__construct();
|
||||
$this->_text = $value;
|
||||
}
|
||||
|
||||
}
|
132
library/Zend/Gdata/Entry.php
Normal file
132
library/Zend/Gdata/Entry.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Entry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_App_MediaEntry
|
||||
*/
|
||||
require_once 'Zend/Gdata/App/MediaEntry.php';
|
||||
|
||||
/**
|
||||
* Represents the Gdata flavor of an Atom entry
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Gdata
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Entry extends Zend_Gdata_App_MediaEntry
|
||||
{
|
||||
|
||||
protected $_entryClassName = 'Zend_Gdata_Entry';
|
||||
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
// ETags are special. We only support them in protocol >= 2.X.
|
||||
// This will be duplicated by the HTTP ETag header.
|
||||
if ($majorVersion >= 2) {
|
||||
if ($this->_etag != null) {
|
||||
$element->setAttributeNS($this->lookupNamespace('gd'),
|
||||
'gd:etag',
|
||||
$this->_etag);
|
||||
}
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('atom') . ':' . 'content':
|
||||
$content = new Zend_Gdata_App_Extension_Content();
|
||||
$content->transferFromDOM($child);
|
||||
$this->_content = $content;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'published':
|
||||
$published = new Zend_Gdata_App_Extension_Published();
|
||||
$published->transferFromDOM($child);
|
||||
$this->_published = $published;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'source':
|
||||
$source = new Zend_Gdata_App_Extension_Source();
|
||||
$source->transferFromDOM($child);
|
||||
$this->_source = $source;
|
||||
break;
|
||||
case $this->lookupNamespace('atom') . ':' . 'summary':
|
||||
$summary = new Zend_Gdata_App_Extension_Summary();
|
||||
$summary->transferFromDOM($child);
|
||||
$this->_summary = $summary;
|
||||
break;
|
||||
case $this->lookupNamespace('app') . ':' . 'control':
|
||||
$control = new Zend_Gdata_App_Extension_Control();
|
||||
$control->transferFromDOM($child);
|
||||
$this->_control = $control;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a DOMNode representing an attribute, tries to map the data into
|
||||
* instance members. If no mapping is defined, the name and value are
|
||||
* stored in an array.
|
||||
*
|
||||
* @param DOMNode $attribute The DOMNode attribute needed to be handled
|
||||
*/
|
||||
protected function takeAttributeFromDOM($attribute)
|
||||
{
|
||||
switch ($attribute->localName) {
|
||||
case 'etag':
|
||||
// ETags are special, since they can be conveyed by either the
|
||||
// HTTP ETag header or as an XML attribute.
|
||||
$etag = $attribute->nodeValue;
|
||||
if ($this->_etag === null) {
|
||||
$this->_etag = $etag;
|
||||
}
|
||||
elseif ($this->_etag != $etag) {
|
||||
require_once('Zend/Gdata/App/IOException.php');
|
||||
throw new Zend_Gdata_App_IOException("ETag mismatch");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
parent::takeAttributeFromDOM($attribute);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
65
library/Zend/Gdata/Exif.php
Normal file
65
library/Zend/Gdata/Exif.php
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exif.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata
|
||||
*/
|
||||
require_once 'Zend/Gdata.php';
|
||||
|
||||
/**
|
||||
* Service class for interacting with the services which use the EXIF extensions
|
||||
* @link http://code.google.com/apis/picasaweb/reference.html#exif_reference
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif extends Zend_Gdata
|
||||
{
|
||||
|
||||
/**
|
||||
* Namespaces used for Zend_Gdata_Exif
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $namespaces = array(
|
||||
array('exif', 'http://schemas.google.com/photos/exif/2007', 1, 0)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create Zend_Gdata_Exif object
|
||||
*
|
||||
* @param Zend_Http_Client $client (optional) The HTTP client to use when
|
||||
* when communicating with the Google servers.
|
||||
* @param string $applicationId The identity of the app in the form of Company-AppName-Version
|
||||
*/
|
||||
public function __construct($client = null, $applicationId = 'MyCompany-MyApp-1.0')
|
||||
{
|
||||
$this->registerPackage('Zend_Gdata_Exif');
|
||||
$this->registerPackage('Zend_Gdata_Exif_Extension');
|
||||
parent::__construct($client, $applicationId);
|
||||
}
|
||||
|
||||
}
|
145
library/Zend/Gdata/Exif/Entry.php
Normal file
145
library/Zend/Gdata/Exif/Entry.php
Normal file
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Entry.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Entry
|
||||
*/
|
||||
require_once 'Zend/Gdata/Entry.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif_Extension_Tags
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif/Extension/Tags.php';
|
||||
|
||||
/**
|
||||
* An Atom entry containing EXIF metadata.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif_Entry extends Zend_Gdata_Entry
|
||||
{
|
||||
/**
|
||||
* The classname for individual feed elements.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_entryClassName = 'Zend_Gdata_Exif_Entry';
|
||||
|
||||
/**
|
||||
* The tags that belong to the Exif group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_tags = null;
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param DOMElement $element (optional) DOMElement from which this
|
||||
* object should be constructed.
|
||||
*/
|
||||
public function __construct($element = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
||||
parent::__construct($element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOMElement which corresponds to this element and all
|
||||
* child properties. This is used to build an entry back into a DOM
|
||||
* and eventually XML text for sending to the server upon updates, or
|
||||
* for application storage/persistence.
|
||||
*
|
||||
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
||||
* @return DOMElement The DOMElement representing this element and all
|
||||
* child properties.
|
||||
*/
|
||||
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
||||
{
|
||||
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
||||
if ($this->_tags != null) {
|
||||
$element->appendChild($this->_tags->getDOM($element->ownerDocument));
|
||||
}
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates individual Entry objects of the appropriate type and
|
||||
* stores them as members of this entry based upon DOM data.
|
||||
*
|
||||
* @param DOMNode $child The DOMNode to process
|
||||
*/
|
||||
protected function takeChildFromDOM($child)
|
||||
{
|
||||
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
||||
switch ($absoluteNodeName) {
|
||||
case $this->lookupNamespace('exif') . ':' . 'tags':
|
||||
$tags = new Zend_Gdata_Exif_Extension_Tags();
|
||||
$tags->transferFromDOM($child);
|
||||
$this->_tags = $tags;
|
||||
break;
|
||||
default:
|
||||
parent::takeChildFromDOM($child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the tags for this entry.
|
||||
*
|
||||
* @see setTags
|
||||
* @return Zend_Gdata_Exif_Extension_Tags The requested object
|
||||
* or null if not set.
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return $this->_tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tags property for this entry. This property contains
|
||||
* various Exif data.
|
||||
*
|
||||
* This corresponds to the <exif:tags> property in the Google Data
|
||||
* protocol.
|
||||
*
|
||||
* @param Zend_Gdata_Exif_Extension_Tags $value The desired value
|
||||
* this element, or null to unset.
|
||||
* @return Zend_Gdata_Exif_Entry Provides a fluent interface
|
||||
*/
|
||||
public function setTags($value)
|
||||
{
|
||||
$this->_tags = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
61
library/Zend/Gdata/Exif/Extension/Distance.php
Normal file
61
library/Zend/Gdata/Exif/Extension/Distance.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Distance.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif.php';
|
||||
|
||||
/**
|
||||
* Represents the exif:distance element used by the Gdata Exif extensions.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif_Extension_Distance extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'exif';
|
||||
protected $_rootElement = 'distance';
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Exif_Extension_Distance object.
|
||||
*
|
||||
* @param string $text (optional) The value to use for this element.
|
||||
*/
|
||||
public function __construct($text = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
||||
parent::__construct();
|
||||
$this->setText($text);
|
||||
}
|
||||
|
||||
}
|
61
library/Zend/Gdata/Exif/Extension/Exposure.php
Normal file
61
library/Zend/Gdata/Exif/Extension/Exposure.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exposure.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif.php';
|
||||
|
||||
/**
|
||||
* Represents the exif:exposure element used by the Gdata Exif extensions.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif_Extension_Exposure extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'exif';
|
||||
protected $_rootElement = 'exposure';
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Exif_Extension_Exposure object.
|
||||
*
|
||||
* @param string $text (optional) The value to use for this element.
|
||||
*/
|
||||
public function __construct($text = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
||||
parent::__construct();
|
||||
$this->setText($text);
|
||||
}
|
||||
|
||||
}
|
61
library/Zend/Gdata/Exif/Extension/FStop.php
Normal file
61
library/Zend/Gdata/Exif/Extension/FStop.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: FStop.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif.php';
|
||||
|
||||
/**
|
||||
* Represents the exif:fStop element used by the Gdata Exif extensions.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif_Extension_FStop extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'exif';
|
||||
protected $_rootElement = 'fstop';
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Exif_Extension_FStop object.
|
||||
*
|
||||
* @param string $text (optional) The value to use for this element.
|
||||
*/
|
||||
public function __construct($text = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
||||
parent::__construct();
|
||||
$this->setText($text);
|
||||
}
|
||||
|
||||
}
|
61
library/Zend/Gdata/Exif/Extension/Flash.php
Normal file
61
library/Zend/Gdata/Exif/Extension/Flash.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Flash.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Extension
|
||||
*/
|
||||
require_once 'Zend/Gdata/Extension.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Gdata_Exif
|
||||
*/
|
||||
require_once 'Zend/Gdata/Exif.php';
|
||||
|
||||
/**
|
||||
* Represents the exif:flash element used by the Gdata Exif extensions.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Gdata
|
||||
* @subpackage Exif
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Gdata_Exif_Extension_Flash extends Zend_Gdata_Extension
|
||||
{
|
||||
|
||||
protected $_rootNamespace = 'exif';
|
||||
protected $_rootElement = 'flash';
|
||||
|
||||
/**
|
||||
* Constructs a new Zend_Gdata_Exif_Extension_Flash object.
|
||||
*
|
||||
* @param string $text (optional) The value to use for this element.
|
||||
*/
|
||||
public function __construct($text = null)
|
||||
{
|
||||
$this->registerAllNamespaces(Zend_Gdata_Exif::$namespaces);
|
||||
parent::__construct();
|
||||
$this->setText($text);
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue