Path

ez components / documentation / api reference / 2007.2alpha1 / webdav


eZ Components 2007.2alpha1

Webdav: ezcWebdavSimpleBackend

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcWebdavSimpleBackend

This backend provides the generic handling of requests and dispatches the requuired actions to some basic manipulation methods, which you are required to implement. [source]

Implemented Interfaces

This backend does not provide support for extended Webdav features, like compression, or locking handled by the backend, therefore the getFeatures() method is final. If you want to develop a backend which is capable of manual handling those features directly extend from ezcWebdavBackend.

Parents

ezcWebdavBackend
   |
   --ezcWebdavSimpleBackend

Inherited Constants

From ezcWebdavBackend:
ezcWebdavBackend::COMPRESSION_BZIP2    Backend has native support for bzip2 compression.
ezcWebdavBackend::COMPRESSION_GZIP    Backend has native support for gzip compression.
ezcWebdavBackend::CUSTOM_LOCK    Backend performs locking itself - no handling by server is required.
ezcWebdavBackend::MULTIPART    Backend has native support for multipart requests.
ezcWebdavBackend::PARTIAL    Backend has native support for partial requests.

Method Summary

public ezcWebdavResponse copy( $request )
Required method to serve COPY requests.
protected abstract void createCollection( $path )
Create a new collection.
protected abstract void createResource( $path, [$content = null] )
Create a new resource.
public ezcWebdavResponse delete( $request )
Required method to serve DELETE requests.
protected ezcWebdavResponse fetchAllProperties( $request )
Fetch all available properties for a node.
protected ezcWebdavResponse fetchProperties( $request )
Fetch properties by name as defined in propfind prop request.
protected ezcWebdavResponse fetchPropertyNames( $request )
Fetch names of all available properties for a node.
public ezcWebdavResponse get( $request )
Required method to serve GET requests.
public abstract ezcWebdavPropertyStorage getAllProperties( $resource )
Manually get a property on a resource.
protected abstract array getCollectionMembers( $path )
Get members of collection.
public int getFeatures( )
Return bitmap of additional features supported by the backend referenced by constants from the basic ezcWebdavBackend class.
protected array getNodes( $source, $depth )
Get all children nodes.
public abstract ezcWebdavProperty getProperty( $resource, $propertyName, [$namespace = 'DAV:'] )
Manually get a property on a resource.
protected abstract string getResourceContents( $path )
Get contents of a resource.
public ezcWebdavResponse head( $request )
Required method to serve HEAD requests.
protected abstract bool isCollection( $path )
Check if node is a collection.
public ezcWebdavResponse makeCollection( $request )
Required method to serve MKCOL (make collection) requests.
public ezcWebdavResponse move( $request )
Required method to serve MOVE requests.
protected abstract bool nodeExists( $path )
Check if node exists.
protected abstract array(ezcWebdavErrorResponse) performCopy( $fromPath, $toPath, [$depth = ezcWebdavRequest::DEPTH_INFINITY] )
Copy resources recursively from one path to another.
protected abstract ezcWebdavErrorResponse performDelete( $path )
Delete everything below this path.
public ezcWebdavResponse propFind( $request )
Required method to serve PROPFIND requests.
public ezcWebdavResponse propPatch( $request )
Required method to serve PROPPATCH requests.
public ezcWebdavResponse put( $request )
Required method to serve PUT requests.
public abstract bool removeProperty( $resource, $property )
Manually remove a property from a resource.
public abstract bool resetProperties( $resource, $properties )
Reset property storage for a resource.
public abstract bool setProperty( $resource, $property )
Manually set a property on a resource to request it later.
protected abstract void setResourceContents( $path, $content )
Set contents of a resource.

Inherited Methods

From ezcWebdavBackend :
public abstract ezcWebdavResponse ezcWebdavBackend::get()
Required method to serve GET requests.
public int ezcWebdavBackend::getFeatures()
Return bitmap of additional features supported by the backend referenced by constants from the basic ezcWebdavBackend class.
public abstract ezcWebdavResponse ezcWebdavBackend::head()
Required method to serve HEAD requests.
public ezcWebdavResponse ezcWebdavBackend::options()
Required method to serve OPTIONS requests.
public ezcWebdavResponse ezcWebdavBackend::performRequest()
Performs the given request.
public abstract ezcWebdavResponse ezcWebdavBackend::propFind()
Required method to serve PROPFIND requests.
public abstract ezcWebdavResponse ezcWebdavBackend::propPatch()
Required method to serve PROPPATCH requests.

Methods

copy

Required method to serve COPY requests.
The method receives a ezcWebdavCopyRequest objects containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavCopyRequest  

createCollection

void createCollection( string $path )
Create a new collection.
Creates a new collection at the given path.

Parameters

Name Type Description
$path string  

createResource

void createResource( string $path, [string $content = null] )
Create a new resource.
Creates a new resource at the given path, optionally with the given content.

Parameters

Name Type Description
$path string  
$content string  

delete

Required method to serve DELETE requests.
The method receives a ezcWebdavDeleteRequest objects containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavDeleteRequest  

fetchAllProperties

ezcWebdavResponse fetchAllProperties( ezcWebdavPropFindRequest $request )
Fetch all available properties for a node.
Fetch properties in one node, and if the node is a collection, also return children, depending on the set depth header.

Parameters

Name Type Description
$request ezcWebdavPropFindRequest  

fetchProperties

ezcWebdavResponse fetchProperties( ezcWebdavPropFindRequest $request )
Fetch properties by name as defined in propfind prop request.
Fetch properties as defined by the passed propfind request by their names for the given node.

Parameters

Name Type Description
$request ezcWebdavPropFindRequest  

fetchPropertyNames

ezcWebdavResponse fetchPropertyNames( ezcWebdavPropFindRequest $request )
Fetch names of all available properties for a node.
Fetch names of properties in one node, and if the node is a collection, also return children, depending on the set depth header.

Parameters

Name Type Description
$request ezcWebdavPropFindRequest  

get

Required method to serve GET requests.
The method receives a ezcWebdavGetRequest object containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavGetRequest  

Redefinition of

Method Description
ezcWebdavBackend::get() Required method to serve GET requests.

getAllProperties

ezcWebdavPropertyStorage getAllProperties( string $resource )
Manually get a property on a resource.
Get all properties for the given resource as a ezcWebdavBasicPropertyStorage

Parameters

Name Type Description
$resource string  

getCollectionMembers

array getCollectionMembers( string $path )
Get members of collection.
Returns an array with the members of the collection given by the path of the collection.
The returned array holds elements which are either ezcWebdavCollection, or ezcWebdavResource.

Parameters

Name Type Description
$path string  

getFeatures

int getFeatures( )
Return bitmap of additional features supported by the backend referenced by constants from the basic ezcWebdavBackend class.

Redefinition of

Method Description
ezcWebdavBackend::getFeatures() Return bitmap of additional features supported by the backend referenced by constants from the basic ezcWebdavBackend class.

getNodes

array getNodes( string $source, int $depth )
Get all children nodes.
Get all nodes from given $source path up to the given depth. Reuses the method getCollectionMembers, but you may want to overwrite this implementation by somethings which fits better with your backend.

Parameters

Name Type Description
$source string  
$depth int  

getProperty

ezcWebdavProperty getProperty( string $resource, string $propertyName, [string $namespace = 'DAV:'] )
Manually get a property on a resource.
Get the property with the given name from the given resource. You may optionally define a namespace to receive the property from.

Parameters

Name Type Description
$resource string  
$propertyName string  
$namespace string  

getResourceContents

string getResourceContents( string $path )
Get contents of a resource.

Parameters

Name Type Description
$path string  

head

Required method to serve HEAD requests.
The method receives a ezcWebdavHeadRequest object containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavGetRequest  

Redefinition of

Method Description
ezcWebdavBackend::head() Required method to serve HEAD requests.

isCollection

bool isCollection( string $path )
Check if node is a collection.
Check if the node behind the given path is a collection.

Parameters

Name Type Description
$path string  

makeCollection

Required method to serve MKCOL (make collection) requests.
The method receives a ezcWebdavMakeCollectionRequest objects containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavMakeCollectionRequest  

move

Required method to serve MOVE requests.
The method receives a ezcWebdavMoveRequest objects containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavMoveRequest  

nodeExists

bool nodeExists( string $path )
Check if node exists.
Check if a node exists with the given path.

Parameters

Name Type Description
$path string  

performCopy

array(ezcWebdavErrorResponse) performCopy( string $fromPath, string $toPath, [int $depth = ezcWebdavRequest::DEPTH_INFINITY] )
Copy resources recursively from one path to another.
Returns an array with ezcWebdavErrorResponses for all subtree, where the copy operation failed. Errors subsequent nodes in a subtree should be ommitted.
If an empty array is return, the operation has been completed successfully.

Parameters

Name Type Description
$fromPath string  
$toPath string  
$depth int  

performDelete

ezcWebdavErrorResponse performDelete( string $path )
Delete everything below this path.
Returns an error response if the deletion failed, and null on success.

Parameters

Name Type Description
$path string  

propFind

Required method to serve PROPFIND requests.
The method receives a ezcWebdavPropFindRequest object containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.
The ezcWebdavPropFindRequest object contains a definition to find one or more properties of a given file or collection.

Parameters

Name Type Description
$request ezcWebdavPropFindRequest  

Redefinition of

Method Description
ezcWebdavBackend::propFind() Required method to serve PROPFIND requests.

propPatch

Required method to serve PROPPATCH requests.
The method receives a ezcWebdavPropPatchRequest object containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavPropPatchRequest  

Redefinition of

Method Description
ezcWebdavBackend::propPatch() Required method to serve PROPPATCH requests.

put

Required method to serve PUT requests.
The method receives a ezcWebdavPutRequest objects containing all relevant information obout the clients request and should either return an error by returning an ezcWebdavErrorResponse object, or any other ezcWebdavResponse objects.

Parameters

Name Type Description
$request ezcWebdavPutRequest  

removeProperty

bool removeProperty( string $resource, ezcWebdavProperty $property )
Manually remove a property from a resource.

Parameters

Name Type Description
$resource string  
$property ezcWebdavProperty  

resetProperties

bool resetProperties( string $resource, ezcWebdavPropertyStorage $properties )
Reset property storage for a resource.

Parameters

Name Type Description
$resource string  
$properties ezcWebdavPropertyStorage  

setProperty

bool setProperty( string $resource, ezcWebdavProperty $property )
Manually set a property on a resource to request it later.

Parameters

Name Type Description
$resource string  
$property ezcWebdavProperty  

setResourceContents

void setResourceContents( string $path, string $content )
Set contents of a resource.
Change the contents of the given resource to the given content.

Parameters

Name Type Description
$path string  
$content string  

Last updated: Mon, 12 Nov 2007