Author: ts Date: Fri Sep 7 12:48:18 2007 New Revision: 6015 Log: - Started adding property classes. # Attention: Work in progress!
Added: experimental/Webdav/src/interfaces/property.php (with props) experimental/Webdav/src/properties/ experimental/Webdav/src/properties/creationdate.php (with props) experimental/Webdav/src/properties/displayname.php (with props) experimental/Webdav/src/properties/getcontentlanguage.php (with props) experimental/Webdav/src/properties/getcontentlength.php (with props) experimental/Webdav/src/properties/getcontenttype.php (with props) experimental/Webdav/src/properties/getetag.php (with props) experimental/Webdav/src/properties/getlastmodified.php (with props) experimental/Webdav/src/properties/lockdiscovery.php (with props) experimental/Webdav/src/properties/lockdiscovery_activelock.php (with props) experimental/Webdav/src/properties/resourcetype.php (with props) experimental/Webdav/src/properties/source.php (with props) experimental/Webdav/src/properties/source_link.php (with props) experimental/Webdav/src/properties/supportedlock.php (with props) experimental/Webdav/src/properties/supportedlock_lockentry.php (with props) Modified: experimental/Webdav/src/interfaces/xml_base.php Added: experimental/Webdav/src/interfaces/property.php ============================================================================== --- experimental/Webdav/src/interfaces/property.php (added) +++ experimental/Webdav/src/interfaces/property.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,70 @@ +<?php + +abstract class ezcWebdavProperty +{ + /** + * Container to hold the properties + * + * @var array(string=>mixed) + */ + protected $properties; + + /** + * Property get access. + * Simply returns a given property. + * + * @throws ezcBasePropertyNotFoundException + * If a the value for the property propertys is not an instance of + * @param string $propertyName The name of the property to get. + * @return mixed The property value. + * + * @ignore + * + * @throws ezcBasePropertyNotFoundException + * if the given property does not exist. + * @throws ezcBasePropertyPermissionException + * if the property to be set is a write-only property. + */ + public function __get( $propertyName ) + { + if ( $this->__isset( $propertyName ) === true ) + { + return $this->properties[$propertyName]; + } + throw new ezcBasePropertyNotFoundException( $propertyName ); + } + + /** + * Sets a property. + * This method is called when an property is to be set. + * + * @param string $propertyName The name of the property to set. + * @param mixed $propertyValue The property value. + * @ignore + * + * @throws ezcBasePropertyNotFoundException + * if the given property does not exist. + * @throws ezcBaseValueException + * if the value to be assigned to a property is invalid. + * @throws ezcBasePropertyPermissionException + * if the property to be set is a read-only property. + */ + abstract public function __set( $propertyName, $propertyValue ); + + /** + * Returns if a property exists. + * Returns true if the property exists in the [EMAIL PROTECTED] $properties} array + * (even if it is null) and false otherwise. + * + * @param string $propertyName Option name to check for. + * @return void + * @ignore + */ + public function __isset( $propertyName ) + { + return array_key_exists( $propertyName, $this->properties ); + } + +} + +?> Propchange: experimental/Webdav/src/interfaces/property.php ------------------------------------------------------------------------------ svn:eol-style = native Modified: experimental/Webdav/src/interfaces/xml_base.php ============================================================================== --- experimental/Webdav/src/interfaces/xml_base.php [iso-8859-1] (original) +++ experimental/Webdav/src/interfaces/xml_base.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,4 +1,12 @@ <?php +/** + * File containing the ezcWebdavXmlBase class. + * + * @package Base + * @version //autogen// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ /** * Base class for all XML based objects in this component. @@ -20,6 +28,9 @@ */ abstract class ezcWebdavXmlBase { + + protected $miscNodes = array(); + /** * Returns an array of DOMNode objects that were not recognized. * This method returns an array of DOMNode objects, which could not be @@ -29,7 +40,7 @@ */ public function getMiscNodes() { - // To be implemented... + return $this->miscNodes; } /** @@ -42,11 +53,18 @@ * @return void * * @throws ezcBaseValueException - * if the array contains elements that are no DOMNodes. + * if an element in the submitted array is not a DOMNode. */ public function setMiscNodes( array $nodes ) { - // To be implemented... + foreach ( $nodes as $id => $node ) + { + if ( ( $node instanceof DOMNode ) ) + { + throw new ezcBaseValueException( "nodes[$id]", get_class( $node ), 'DOMNode' ); + } + } + $this->miscNodes = $nodes; } } Added: experimental/Webdav/src/properties/creationdate.php ============================================================================== --- experimental/Webdav/src/properties/creationdate.php (added) +++ experimental/Webdav/src/properties/creationdate.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,23 @@ +<?php +/** + * File containing the ezcWebdavCreationdateProperty class. + * + * @package Webdav + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <creationdate>. + * + * @property DateTime $date + * The creation date. + * + * @version //autogentag// + * @package Webdav + */ +class ezcWebdavCreationdateProperty extends ezcWebdavProperty +{ +} + +?> Propchange: experimental/Webdav/src/properties/creationdate.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/displayname.php ============================================================================== --- experimental/Webdav/src/properties/displayname.php (added) +++ experimental/Webdav/src/properties/displayname.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the displayname property class. + * + * @package Webdav + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <displayname>. + * + * @property int $displayname + * The display name. + * + * @version //autogentag// + * @package Webdav + */ +class ezcWebdavDisplaynameProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/displayname.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/getcontentlanguage.php ============================================================================== --- experimental/Webdav/src/properties/getcontentlanguage.php (added) +++ experimental/Webdav/src/properties/getcontentlanguage.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the getcontentlanguage property class. + * + * @package Webdav + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <getcontentlanguage>. + * + * @property array(string) $languages + * The languages. + * + * @version //autogentag// + * @package Webdav + */ +class ezcWebdavGetcontentlanguageProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/getcontentlanguage.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/getcontentlength.php ============================================================================== --- experimental/Webdav/src/properties/getcontentlength.php (added) +++ experimental/Webdav/src/properties/getcontentlength.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the getcontentlength property class. + * + * @package Webdav + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <getcontentlength>. + * + * @property int $lengths + * The lengths. + * + * @version //autogentag// + * @package Webdav + */ +class ezcWebdavGetcontentlengthProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/getcontentlength.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/getcontenttype.php ============================================================================== --- experimental/Webdav/src/properties/getcontenttype.php (added) +++ experimental/Webdav/src/properties/getcontenttype.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,26 @@ +<?php +/** + * File containing the getcontenttype property class. + * + * @package Webdav + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <getcontenttype>. + * + * @property string $mime + * The MIME type. + * @property string $charset + * The character set, if provided, else null. + * + * @version //autogentag// + * @package Webdav + */ +class ezcWebdavGetcontenttypeProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/getcontenttype.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/getetag.php ============================================================================== --- experimental/Webdav/src/properties/getetag.php (added) +++ experimental/Webdav/src/properties/getetag.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the geteetag property class. + * + * @package Webdav + * @version //autogenetag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <geteetag>. + * + * @property string $etag + * The ETag. + * + * @version //autogenetag// + * @package Webdav + */ +class ezcWebdavGeteetagProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/getetag.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/getlastmodified.php ============================================================================== --- experimental/Webdav/src/properties/getlastmodified.php (added) +++ experimental/Webdav/src/properties/getlastmodified.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the getlastmodified property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <getlastmodified>. + * + * @property DateTime $date + * The last modification date. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavGetlastmodifiedProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/getlastmodified.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/lockdiscovery.php ============================================================================== --- experimental/Webdav/src/properties/lockdiscovery.php (added) +++ experimental/Webdav/src/properties/lockdiscovery.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the lockdiscovery property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <lockdiscovery>. + * + * @property array(ezcWebdavLockdiscoveryPropertyActivelock) $activelock + * Lock information according to <activelock> elements. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavLockdiscoveryProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/lockdiscovery.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/lockdiscovery_activelock.php ============================================================================== --- experimental/Webdav/src/properties/lockdiscovery_activelock.php (added) +++ experimental/Webdav/src/properties/lockdiscovery_activelock.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,37 @@ +<?php +/** + * File containing the lockdiscovery property activelock class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Objects of this class are used in the ezcWebdavLockdiscoveryProperty class. + * + * @property int $depth + * Constant indicating 0, 1 or infinity. + * @property string $owner + * Owner of this lock (free form string). Null if not provided. + * @property DateTime|null $timeout + * Timeout date or null for inifinite. Null if not provided. + * @property array(string) $tokens + * Tokens submitted in <locktocken> (URIs). Null if not provided. + * These are originally covered in additional <href> elements, which + * is left out here. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavLockdiscoveryPropertyActivelock extends ezcWebdavSupportedlockPropertyLockentry +{ + const DEPTH_ZERO = 0; + const DEPTH_ONE = 1; + const DEPTH_INFINITY = -1; + + // To be implemented. +} + + +?> Propchange: experimental/Webdav/src/properties/lockdiscovery_activelock.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/resourcetype.php ============================================================================== --- experimental/Webdav/src/properties/resourcetype.php (added) +++ experimental/Webdav/src/properties/resourcetype.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,26 @@ +<?php +/** + * File containing the resourcetype property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <resourcetype>. + * + * @property string $type + * The resource type (free form, might be an empty string). + * + * @todo Should we use null if the property is empty? + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavResourcetypeProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/resourcetype.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/source.php ============================================================================== --- experimental/Webdav/src/properties/source.php (added) +++ experimental/Webdav/src/properties/source.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the source property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <source>. + * + * @property array(ezcWebdavSourcePropertyLink) $link + * Lock information according to <link> elements. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavSourceProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/source.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/source_link.php ============================================================================== --- experimental/Webdav/src/properties/source_link.php (added) +++ experimental/Webdav/src/properties/source_link.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,26 @@ +<?php +/** + * File containing the source property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <source>. + * + * @property string $src + * Source of the link (URI). + * @property string $dst + * Destination of the link (URI). + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavSourcePropertyLink extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/source_link.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/supportedlock.php ============================================================================== --- experimental/Webdav/src/properties/supportedlock.php (added) +++ experimental/Webdav/src/properties/supportedlock.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,24 @@ +<?php +/** + * File containing the supportedlock property class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * An object of this class represents the Webdav property <supportedlock>. + * + * @property array(ezcWebdavSupportedlockPropertyLockentry) $lockentry + * Lock information according to <lockentry> elements. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavSupportedlockProperty extends ezcWebdavProperty +{ + // To be implemented. +} + +?> Propchange: experimental/Webdav/src/properties/supportedlock.php ------------------------------------------------------------------------------ svn:eol-style = native Added: experimental/Webdav/src/properties/supportedlock_lockentry.php ============================================================================== --- experimental/Webdav/src/properties/supportedlock_lockentry.php (added) +++ experimental/Webdav/src/properties/supportedlock_lockentry.php [iso-8859-1] Fri Sep 7 12:48:18 2007 @@ -1,0 +1,33 @@ +<?php +/** + * File containing the supportedlock property lockentry class. + * + * @package Webdav + * @version //autogenlastmodified// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Objects of this class are used in the ezcWebdavSupportedlockProperty class. + * + * @property int $locktype + * Constant indicating read or write lock. + * @property int $lockscope + * Constant indicating exclusive or shared lock. + * + * @version //autogenlastmodified// + * @package Webdav + */ +class ezcWebdavSupportedlockPropertyLockentry extends ezcWebdavProperty +{ + const TYPE_READ = 1; + const TYPE_WRITE = 2; + + const SCOPE_EXCLUSIVE = 1; + const SCOPE_SHARED = 2; + + // To be implemented. +} + + +?> Propchange: experimental/Webdav/src/properties/supportedlock_lockentry.php ------------------------------------------------------------------------------ svn:eol-style = native -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components