Author: ts
Date: Thu Sep 27 22:15:41 2007
New Revision: 6307

Log:
- Started refactoring ezcWebavTransport.
- First extracted XML related functionality to a new property of the object:
  $xml.
- Created a new class ezcWebdavXmlTool in the tools section which takes over
  the calls and handling of ezcWebdavNamespaceRegistry as well as all other DOM
  related calls.

Added:
    trunk/Webdav/src/tools/xml.php   (with props)
Modified:
    trunk/Webdav/design/class_diagram.png
    trunk/Webdav/src/namespace_registry.php
    trunk/Webdav/src/transport.php
    trunk/Webdav/src/webdav_autoload.php

Modified: trunk/Webdav/design/class_diagram.png
==============================================================================
Binary files - no diff available.

Modified: trunk/Webdav/src/namespace_registry.php
==============================================================================
--- trunk/Webdav/src/namespace_registry.php [iso-8859-1] (original)
+++ trunk/Webdav/src/namespace_registry.php [iso-8859-1] Thu Sep 27 22:15:41 
2007
@@ -20,7 +20,6 @@
  */
 class ezcWebdavNamespaceRegistry implements ArrayAccess
 {
-
     /**
      * Counter to create new shortcuts.
      * 

Added: trunk/Webdav/src/tools/xml.php
==============================================================================
--- trunk/Webdav/src/tools/xml.php (added)
+++ trunk/Webdav/src/tools/xml.php [iso-8859-1] Thu Sep 27 22:15:41 2007
@@ -1,0 +1,150 @@
+<?php
+
+class ezcWebdavXmlTool
+{
+    /**
+     * The default namespace, where WebDAV XML elements reside in. 
+     */
+    const XML_DEFAULT_NAMESPACE = 'DAV:';
+
+    /**
+     * The XML version to create DOM documents in. 
+     */
+    const XML_VERSION = '1.0';
+
+    /**
+     * Encoding to use to create DOM documents. 
+     */
+    const XML_ENCODING = 'utf-8';
+
+    /**
+     * Properties.
+     * 
+     * @var array(string=>mixed)
+     */
+    protected $properties = array();
+
+    /**
+     * Creates a new XML tool.
+     * 
+     * @param ezcWebdavNamespaceRegistry $namespaceRegistry 
+     * @return void
+     */
+    public function __construct( ezcWebdavNamespaceRegistry $namespaceRegistry 
= null )
+    {
+        // Initialize properties
+        $this->properties['namespaceRegistry'] = null;
+
+        $this->namespaceRegistry = ( $namespaceRegistry === null ? new 
ezcWebdavNamespaceRegistry() : $namespaceRegistry );
+    }
+
+    /**
+     * Returns a DOMDocument from the given XML.
+     * Creates a new DOMDocument with the options set in the class constants
+     * and loads the optionally given $xml string with settings appropriate to
+     * work with it. Returns false if the loading fails.
+     *
+     * @see LIBXML_NOWARNING, LIBXML_NSCLEAN, LIBXML_NOBLANKS
+     *
+     * @param sting $xml 
+     * @return DOMDocument|false
+     *
+     * @todo This should throw an exception if loading of the XML fails!
+     */
+    public function createDomDocument( $content = null )
+    {
+        $dom = new DOMDocument( self::XML_VERSION, self::XML_ENCODING );
+        if ( $content !== null )
+        {
+            if ( $dom->loadXML(
+                    $content,
+                    LIBXML_NOWARNING | LIBXML_NSCLEAN | LIBXML_NOBLANKS
+                 ) === false )
+            {
+                return false;
+            }
+        }
+        return $dom;
+    }
+
+    /**
+     * Returns a new DOMElement in the given namespace.
+     *
+     * Retrieves the shortcut for the $namespace and creates a new DOMElement
+     * object with the correct global name for the given $localName.
+     * 
+     * @param DOMDocument $dom 
+     * @param string $localName 
+     * @param string $namespace 
+     * @return DOMElement
+     */
+    public function createDomElement( DOMDocument $dom, $localName, $namespace 
= self::XML_DEFAULT_NAMESPACE )
+    {
+        return $dom->createElementNS(
+            $namespace,
+            "{$this->namespaceRegistry[$namespace]}:{$localName}"
+        );
+    }
+
+    /**
+     * Property write access.
+     * 
+     * @param string $propertyName Name of the property.
+     * @param mixed $propertyValue  The value for the property.
+     *
+     * @throws ezcBasePropertyNotFoundException
+     *         If a the value for the property options is not an instance of
+     * @throws ezcBaseValueException
+     *         If a the value for a property is out of range.
+     * @ignore
+     */
+    public function __set( $propertyName, $propertyValue )
+    {
+        switch ( $propertyName )
+        {
+            case 'namespaceRegistry':
+                if ( ( $propertyValue instanceof ezcWebdavNamespaceRegistry ) 
=== false )
+                {
+                    throw new ezcBaseValueException( $propertyName, 
$propertyValue, 'ezcWebdavNamespaceRegistry' );
+                }
+                break;
+            default:
+                throw new ezcBasePropertyNotFoundException( $propertyName );
+        }
+        $this->properties[$propertyName] = $propertyValue;
+    }
+
+    /**
+     * Property read access.
+     * 
+     * @param string $propertyName Name of the property.
+     * @return mixed Value of the property or null.
+     *
+     * @throws ezcBasePropertyNotFoundException
+     *         If the the desired property is not found.
+     * @ignore
+     */
+    public function __get( $propertyName )
+    {
+        if ( $this->__isset( $propertyName ) === false )
+        {
+            throw new ezcBasePropertyNotFoundException( $propertyName );
+        }
+            
+        return $this->properties[$propertyName];
+    }
+
+    /**
+     * Property isset access.
+     *
+     * @param string $propertyName Name of the property.
+     * @return bool True is the property is set, otherwise false.
+     * @ignore
+     */
+    public function __isset( $propertyName )
+    {
+        return array_key_exists( $propertyName, $this->properties );
+    }
+}
+
+?>

Propchange: trunk/Webdav/src/tools/xml.php
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/Webdav/src/transport.php
==============================================================================
--- trunk/Webdav/src/transport.php [iso-8859-1] (original)
+++ trunk/Webdav/src/transport.php [iso-8859-1] Thu Sep 27 22:15:41 2007
@@ -19,21 +19,6 @@
 class ezcWebdavTransport
 {
     /**
-     * The default namespace, where WebDAV XML elements reside in. 
-     */
-    const XML_DEFAULT_NAMESPACE = 'DAV:';
-
-    /**
-     * The XML version to create DOM documents in. 
-     */
-    const XML_VERSION = '1.0';
-
-    /**
-     * Encoding to use to create DOM documents. 
-     */
-    const XML_ENCODING = 'utf-8';
-
-    /**
      * Regedx to parse the <getcontenttype /> XML elemens content.
      *
      * Example: 'text/html; charset=UTF-8'
@@ -116,13 +101,11 @@
      * 
      * @param ezcWebdavTransportOptions $options 
      * @return void
-     *
-     * @todo The namespace factory should be moved into options, too.
-     */
-    public function __construct( ezcWebdavTransportOptions $options = null )
-    {
-        $this->properties['options']           = ( $options === null ? new 
ezcWebdavTransportOptions() : $options );
-        $this->properties['namespaceRegistry'] = new 
ezcWebdavNamespaceRegistry();
+     */
+    public function __construct( ezcWebdavXmlTool $xml = null, 
ezcWebdavTransportOptions $options = null )
+    {
+        $this->properties['xml']     = ( $xml === null     ? new 
ezcWebdavXmlTool()          : $xml );
+        $this->properties['options'] = ( $options === null ? new 
ezcWebdavTransportOptions() : $options );
     }
 
     /**
@@ -206,53 +189,6 @@
             $body .= $data;
         }
         return $body;
-    }
-
-    /**
-     * Returns a DOMDocument from the given XML.
-     * Creates a new DOMDocument with the options set in the class constants
-     * and loads the optionally given $xml string with settings appropriate to
-     * work with it.
-     * 
-     *
-     * @see LIBXML_NOWARNING, LIBXML_NSCLEAN, LIBXML_NOBLANKS
-     *
-     * @param sting $xml 
-     * @return DOMDocument|false
-     */
-    protected function getDom( $xml = null )
-    {
-        $dom = new DOMDocument( self::XML_VERSION, self::XML_ENCODING );
-        if ( $xml !== null )
-        {
-            if ( $dom->loadXML(
-                    $xml,
-                    LIBXML_NOWARNING | LIBXML_NSCLEAN | LIBXML_NOBLANKS
-                 ) === false )
-            {
-                return false;
-            }
-        }
-        return $dom;
-    }
-
-    /**
-     * Returns a new DOMElement in the given namespace.
-     *
-     * Retrieves the shortcut for the $namespace and creates a new DOMElement
-     * object with the correct global name for the given $localName.
-     * 
-     * @param DOMDocument $dom 
-     * @param string $localName 
-     * @param string $namespace 
-     * @return DOMElement
-     */
-    protected function newDomElement( DOMDocument $dom, $localName, $namespace 
= self::XML_DEFAULT_NAMESPACE )
-    {
-        return $dom->createElementNS(
-            $namespace,
-            "{$this->namespaceRegistry[$namespace]}:{$localName}"
-        );
     }
 
     /**
@@ -328,7 +264,7 @@
             case ( is_string( $info->body ) ):
                 if ( $info->response->getHeader( 'Content-Type' ) === null )
                 {
-                    throw new ezcWebdavMissingHeaderException( 'ContentType' )
+                    throw new ezcWebdavMissingHeaderException( 'ContentType' );
                 }
                 $result = $info->body;
                 break;
@@ -519,7 +455,7 @@
             return $request;
         }
 
-        if ( ( $dom = $this->getDom( $body ) ) === false )
+        if ( ( $dom = $this->xml->createDomDocument( $body ) ) === false )
         {
             throw new ezcWebdavInvalidRequestBodyException(
                 'COPY',
@@ -567,7 +503,7 @@
             return $request;
         }
 
-        if ( ( $dom = $this->getDom( $body ) ) === false )
+        if ( ( $dom = $this->xml->createDomDocument( $body ) ) === false )
         {
             throw new ezcWebdavInvalidRequestBodyException(
                 'MOVE',
@@ -670,7 +606,7 @@
             return $request;
         }
 
-        if ( ( $dom = $this->getDom( $body ) ) === false )
+        if ( ( $dom = $this->xml->createDomDocument( $body ) ) === false )
         {
             throw new ezcWebdavInvalidRequestBodyException(
                 'LOCK',
@@ -686,9 +622,9 @@
             );
         }
 
-        $lockTypeElements  = $dom->documentElement->getElementsByTagnameNS( 
self::XML_DEFAULT_NAMESPACE, 'locktype' );
-        $lockScopeElements = $dom->documentElement->getElementsByTagnameNS( 
self::XML_DEFAULT_NAMESPACE, 'lockscope' );
-        $ownerElements     = $dom->documentElement->getElementsByTagnameNS( 
self::XML_DEFAULT_NAMESPACE, 'owner' );
+        $lockTypeElements  = $dom->documentElement->getElementsByTagnameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'locktype' );
+        $lockScopeElements = $dom->documentElement->getElementsByTagnameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'lockscope' );
+        $ownerElements     = $dom->documentElement->getElementsByTagnameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'owner' );
 
         if ( $lockTypeElements->length === 0 )
         {
@@ -806,7 +742,7 @@
             )
         );
 
-        if ( ( $dom = $this->getDom( $body ) ) === false )
+        if ( ( $dom = $this->xml->createDomDocument( $body ) ) === false )
         {
             throw new ezcWebdavInvalidRequestBodyException(
                 'PROPFIND',
@@ -885,7 +821,7 @@
             
             // DAV: namespace indicates live property!
             // Other RFCs allready intruded into this namespace, as 3253 does.
-            if ( $currentNode->namespaceURI === self::XML_DEFAULT_NAMESPACE )
+            if ( $currentNode->namespaceURI === 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE )
             {
                 $property = $this->extractLiveProperty( $currentNode );
                 // In case we don't know the property, we currently ignore it!
@@ -1046,7 +982,7 @@
     {
         $activeLock = new ezcWebdavLockDiscoveryPropertyActiveLock();
 
-        $activelockElement = $domElement->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'activelock' )->item( 0 );
+        $activelockElement = $domElement->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'activelock' )->item( 0 );
         for ( $i = 0; $i < $activelockElement->childNodes->length; ++$i )
         {
             if ( ( ( $currentElement = $activelockElement->childNodes->item( 
$i ) ) instanceof DOMElement ) === false )
@@ -1127,13 +1063,13 @@
         $links = array();
 
         $linkElements = $domElement->getElementsByTagNameNS(
-            self::XML_DEFAULT_NAMESPACE, 'link'
+            ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'link'
         );
         for ( $i = 0; $i < $linkElements->length; ++$i )
         {
             $links[] = new ezcWebdavSourcePropertyLink(
-                $linkElements->item( $i )->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'src' )->nodeValue,
-                $linkElements->item( $i )->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'dst' )->nodeValue
+                $linkElements->item( $i )->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'src' )->nodeValue,
+                $linkElements->item( $i )->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'dst' )->nodeValue
             );
         }
         return $links;
@@ -1153,13 +1089,13 @@
     {
         $lockEntries = array();
 
-        $lockEntryElements = $domElement->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'lockentry' );
+        $lockEntryElements = $domElement->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'lockentry' );
         for ( $i = 0; $i < $lockEntryElements->length; ++$i )
         {
             $lockEntries[] = new ezcWebdavSupportedLockPropertyLockentry(
-                ( $lockEntryElements->item( $i )->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'locktype' )->item( 0 )->localname === 'write'
+                ( $lockEntryElements->item( $i )->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'locktype' )->item( 0 )->localname === 
'write'
                     ? ezcWebdavLockRequest::TYPE_WRITE : 
ezcWebdavLockRequest::TYPE_READ ),
-                ( $lockEntryElements->item( $i )->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'lockscope' )->item( 0 )->localname === 'shared'
+                ( $lockEntryElements->item( $i )->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'lockscope' )->item( 0 )->localname 
=== 'shared'
                     ? ezcWebdavLockRequest::SCOPE_SHARED : 
ezcWebdavLockRequest::SCOPE_EXCLUSIVE )
             );
         }
@@ -1183,7 +1119,7 @@
     {
         $request = new ezcWebdavPropPatchRequest( $path );
 
-        if ( ( $dom = $this->getDom( $body ) ) === false )
+        if ( ( $dom = $this->xml->createDomDocument( $body ) ) === false )
         {
             throw new ezcWebdavInvalidRequestBodyException(
                 'PROPPATCH',
@@ -1199,8 +1135,8 @@
             );
         }
 
-        $setElements    = $dom->documentElement->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'set' );
-        $removeElements = $dom->documentElement->getElementsByTagNameNS( 
self::XML_DEFAULT_NAMESPACE, 'remove' );
+        $setElements    = $dom->documentElement->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'set' );
+        $removeElements = $dom->documentElement->getElementsByTagNameNS( 
ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'remove' );
         
         for ( $i = 0; $i < $setElements->length; ++$i )
         {
@@ -1232,10 +1168,10 @@
      */
     protected function processMultiStatusResponse( 
ezcWebdavMultiStatusResponse $response )
     {
-        $dom = $this->getDom();
+        $dom = $this->xml->createDomDocument();
 
         $multistatusElement = $dom->appendChild(
-            $this->newDomElement( $dom, 'multistatus' )
+            $this->xml->createDomElement( $dom, 'multistatus' )
         );
 
         foreach ( $response->responses as $subResponse )
@@ -1259,14 +1195,14 @@
      */
     protected function processPropFindResponse( ezcWebdavPropFindResponse 
$response )
     {
-        $dom = $this->getDom();
+        $dom = $this->xml->createDomDocument();
 
         $responseElement = $dom->appendChild(
-            $this->newDomElement( $dom, 'response' )
+            $this->xml->createDomElement( $dom, 'response' )
         );
 
         $responseElement->appendChild(
-            $this->newDomElement( $dom, 'href' )
+            $this->xml->createDomElement( $dom, 'href' )
         )->nodeValue = $this->options->pathFactory->generateUriFromPath( 
$response->node->path );
 
         foreach ( $response->responses as $propStat )
@@ -1334,17 +1270,17 @@
         $dom = null;
         if ( $xml === true )
         {
-            $dom = $this->getDom();
+            $dom = $this->xml->createDomDocument();
             $responseElement = $dom->appendChild(
-                $this->newDomElement( $dom, 'response' )
+                $this->xml->createDomElement( $dom, 'response' )
             );
             
             $responseElement->appendChild(
-                $this->newDomElement( $dom, 'href' )
+                $this->xml->createDomElement( $dom, 'href' )
             )->nodeValue = $this->options->pathFactory->generateUriFromPath( 
$response->requestUri );
             
             $responseElement->appendChild(
-                $this->newDomElement( $dom, 'status' )
+                $this->xml->createDomElement( $dom, 'status' )
             )->nodeValue = (string) $response;
 
         }
@@ -1455,19 +1391,19 @@
      */
     protected function processPropStatResponse( ezcWebdavPropStatResponse 
$response )
     {
-        $dom = $this->getDom();
+        $dom = $this->xml->createDomDocument();
 
         $propstatElement = $dom->appendChild(
-            $this->newDomElement( $dom, 'propstat' )
+            $this->xml->createDomElement( $dom, 'propstat' )
         );
         
         $this->serializePropertyStorage(
             $response->storage,
-            $propstatElement->appendChild( $this->newDomElement( $dom, 'prop' 
) )
+            $propstatElement->appendChild( $this->xml->createDomElement( $dom, 
'prop' ) )
         );
 
         $propstatElement->appendChild(
-            $this->newDomElement(
+            $this->xml->createDomElement(
                 $dom,
                 'status'
             )
@@ -1512,10 +1448,10 @@
      */
     protected function serializeDeadProperty( ezcWebdavDeadProperty $property, 
DOMElement $parentElement )
     {
-        if ( $property->content === null || ( $contentDom = $this->getDom( 
$property->content ) ) === false )
+        if ( $property->content === null || ( $contentDom = 
$this->xml->createDomDocument( $property->content ) ) === false )
         {
             return $parentElement->appendChild(
-                $this->newDomElement(
+                $this->xml->createDomElement(
                     $parentElement->ownerDocument,
                     $property->name,
                     $property->namespace
@@ -1576,7 +1512,7 @@
                 break;
             case 'ezcWebdavResourceTypeProperty':
                 $elementName  = 'resourcetype';
-                $elementValue = ( $property->type === 
ezcWebdavResourceTypeProperty::TYPE_COLLECTION ? array( $this->newDomElement( 
$parentElement->ownerDocument, 'collection' ) ) : null );
+                $elementValue = ( $property->type === 
ezcWebdavResourceTypeProperty::TYPE_COLLECTION ? array( 
$this->xml->createDomElement( $parentElement->ownerDocument, 'collection' ) ) : 
null );
                 break;
             case 'ezcWebdavSourceProperty':
                 $elementName  = 'source';
@@ -1589,7 +1525,7 @@
         }
 
         $propertyElement = $parentElement->appendChild( 
-            $this->newDomElement( $parentElement->ownerDocument, $elementName, 
$property->namespace )
+            $this->xml->createDomElement( $parentElement->ownerDocument, 
$elementName, $property->namespace )
         );
 
         if ( $elementValue instanceof DOMDocument )
@@ -1625,22 +1561,22 @@
         $activeLockElements = array();
         foreach ( $activeLocks as $activeLock )
         {
-            $activeLockElement = $this->newDomElement( $dom, 'activelock' );
+            $activeLockElement = $this->xml->createDomElement( $dom, 
'activelock' );
             
             $activeLockElement->appendChild(
-                $this->newDomElement( $dom, 'locktype' )
+                $this->xml->createDomElement( $dom, 'locktype' )
             )->appendChild(
-                $this->newDomElement( $dom, ( $activeLock->lockType === 
ezcWebdavLockRequest::TYPE_READ ? 'read' : 'write' ) )
+                $this->xml->createDomElement( $dom, ( $activeLock->lockType 
=== ezcWebdavLockRequest::TYPE_READ ? 'read' : 'write' ) )
             );
             
             $activeLockElement->appendChild(
-                $this->newDomElement( $dom, 'lockscope' )
+                $this->xml->createDomElement( $dom, 'lockscope' )
             )->appendChild(
-                $this->newDomElement( $dom, ( $activeLock->lockScope === 
ezcWebdavLockRequest::SCOPE_EXCLUSIVE ? 'exclusive' : 'shared' ) )
+                $this->xml->createDomElement( $dom, ( $activeLock->lockScope 
=== ezcWebdavLockRequest::SCOPE_EXCLUSIVE ? 'exclusive' : 'shared' ) )
             );
             
             $depthElement = $activeLockElement->appendChild(
-                $this->newDomElement( $dom, 'depth' )
+                $this->xml->createDomElement( $dom, 'depth' )
             );
             
             switch ( $activeLock->depth )
@@ -1659,20 +1595,20 @@
             if ( $activeLock->owner !== null )
             {
                 $activeLockElement->appendChild(
-                    $this->newDomElement( $dom, 'owner' )
+                    $this->xml->createDomElement( $dom, 'owner' )
                 )->nodeValue = $activeLock->owner;
             }
 
             $activeLockElement->appendChild(
-                $this->newDomElement( $dom, 'timeout' )
+                $this->xml->createDomElement( $dom, 'timeout' )
             )->$activeLock->timeout;
 
             foreach ( $activeLock->tokens as $token )
             {
                 $activeLockElement->appendChild(
-                    $this->newDomElement( $dom, 'locktoken' )
+                    $this->xml->createDomElement( $dom, 'locktoken' )
                 )->appendChild(
-                    $this->newDomElement( $dom, 'href' )
+                    $this->xml->createDomElement( $dom, 'href' )
                 )->nodeValue = $token;
             }
 
@@ -1695,12 +1631,12 @@
 
         foreach( $links as $link )
         {
-            $linkElement = $this->newDomElement( $dom, 'link' );
+            $linkElement = $this->xml->createDomElement( $dom, 'link' );
             $linkElement->appendChild(
-                $this->newDomElement( $dom, 'src' )
+                $this->xml->createDomElement( $dom, 'src' )
             )->nodeValue = $link->src;
             $linkElement->appendChild(
-                $this->newDomElement( $dom, 'dst' )
+                $this->xml->createDomElement( $dom, 'dst' )
             )->nodeValue = $link->dst;
             $linkContentElements[] = $linkElement;
         }
@@ -1721,16 +1657,16 @@
 
         foreach( $lockEntries as $lockEntry )
         {
-            $lockEntryElement = $this->newDomElement( $dom, 'lockentry' );
+            $lockEntryElement = $this->xml->createDomElement( $dom, 
'lockentry' );
             $lockEntryElement->appendChild(
-                $this->newDomElement( $dom, 'lockscope' )
+                $this->xml->createDomElement( $dom, 'lockscope' )
             )->appendChild(
-                $this->newDomElement( $dom, ( $lockEntry->lockScope === 
ezcWebdavLockRequest::SCOPE_EXCLUSIVE ? 'exclusive' : 'shared' ) )
+                $this->xml->createDomElement( $dom, ( $lockEntry->lockScope 
=== ezcWebdavLockRequest::SCOPE_EXCLUSIVE ? 'exclusive' : 'shared' ) )
             );
             $lockEntryElement->appendChild(
-                $this->newDomElement( $dom, 'locktype' )
+                $this->xml->createDomElement( $dom, 'locktype' )
             )->appendChild(
-                $this->newDomElement( $dom, ( $lockEntry->lockScope === 
ezcWebdavLockRequest::TYPE_READ ? 'read' : 'write' ) )
+                $this->xml->createDomElement( $dom, ( $lockEntry->lockScope 
=== ezcWebdavLockRequest::TYPE_READ ? 'read' : 'write' ) )
             );
             $lockEntryContentElements[] = $lockEntryElement;
         }
@@ -1780,10 +1716,10 @@
                     throw new ezcBaseValueException( $propertyName, 
$propertyValue, 'ezcWebdavTransportOptions' );
                 }
                 break;
-            case 'namepaceRegistry':
-                if ( ( $propertyValue instanceof ezcWebdavNamespaceRegistry ) 
=== false )
-                {
-                    throw new ezcBaseValueException( $propertyName, 
$propertyValue, 'ezcWebdavNamespaceRegistry' );
+            case 'xml':
+                if ( ( $propertyValue instanceof ezcWebdavXmlTool ) === false )
+                {
+                    throw new ezcBaseValueException( $propertyName, 
$propertyValue, 'ezcWebdavXmlTool' );
                 }
                 break;
             default:

Modified: trunk/Webdav/src/webdav_autoload.php
==============================================================================
--- trunk/Webdav/src/webdav_autoload.php [iso-8859-1] (original)
+++ trunk/Webdav/src/webdav_autoload.php [iso-8859-1] Thu Sep 27 22:15:41 2007
@@ -90,5 +90,6 @@
     'ezcWebdavTransport'                       => 'Webdav/transport.php',
     'ezcWebdavTransportOptions'                => 
'Webdav/options/transport.php',
     'ezcWebdavUnlockRequest'                   => 'Webdav/request/unlock.php',
+    'ezcWebdavXmlTool'                         => 'Webdav/tools/xml.php',
 );
 ?>


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to