eZ Publish  [4.2]
eZWebDAVContentServer Class Reference

Provides access to eZ Publish kernel using WebDAV. More...

+ Inheritance diagram for eZWebDAVContentServer:
+ Collaboration diagram for eZWebDAVContentServer:

List of all members.

Public Member Functions

 availableSites ()
 createFolder ($parentNode, $target)
 currentSiteFromPath ($path)
 eZWebDAVContentServer ()
 fetchNodeByTranslation ($nodePathString)
 fetchParentNodeByTranslation ($nodePathString)
 fileBasename ($name)
 headers ()
 processClientRequest ()
 processURL ($url)
 setCurrentSite ($site)
 splitFirstPathElement ($path, &$element)
 splitLastPathElement ($path, &$element)
 userHasSiteAccess ($site)
 userHasVirtualAccess ($site, $virtual )
 virtualFileInfoList ()
 virtualFileList ()
 virtualFolderInfoList ()
 virtualFolderList ()
 virtualInfoList ()
 virtualList ()
 fetchVirtualSiteContent ($site, $depth, $properties)
 fetchSiteListContent ($depth, $properties)
 fetchContentList (&$node, $target, $depth, $properties)
 isObjectFolder ($object, &$class)
 fetchNodeInfo (&$node)

Static Public Member Functions

static virtualContentFolderName ()
static virtualInfoFileName ()
static virtualMediaFolderName ()

Public Attributes

 $FolderClasses
 Contains an array with classes that are considered folder.
const WEBDAV_AUTH_FAILED = "Invalid username or password!"
const WEBDAV_AUTH_REALM = "eZ Publish WebDAV interface"
const WEBDAV_DISABLED = "WebDAV functionality is disabled!"
const WEBDAV_INI_FILE = "webdav.ini"
const WEBDAV_INVALID_SITE = "Invalid site name specified!"

Private Member Functions

 internalNodePath ($virtualFolder, $collection)
 outputSendDataToClient ($output, $headers_only=false)
 options ($target)
 getCollectionContent ($collection, $depth=false, $properties=false)
 get ($target)
 head ($target)
 put ($target, $tempFile)
 mkcol ($target)
 delete ($target)
 move ($source, $destination)
 getVirtualFolderCollection ($currentSite, $collection, $fullPath, $depth, $properties)
 getContentTreeCollection ($currentSite, $virtualFolder, $collection, $fullPath, $depth, $properties)
 getVirtualFolderData ($result, $currentSite, $target, $fullPath)
 getContentNodeData ($result, $currentSite, $virtualFolder, $target, $fullPath)
 putVirtualFolderData ($currentSite, $target, $tempFile, $fullPath)
 putContentData ($currentSite, $virtualFolder, $target, $tempFile, $fullPath)
 mkcolVirtualFolder ($currentSite, $target, $fullPath)
 mkcolContent ($currentSite, $virtualFolder, $target, $fullPath)
 deleteVirtualFolder ($currentSite, $target, $fullPath)
 deleteContent ($currentSite, $virtualFolder, $target, $fullPath)
 moveVirtualFolder ($sourceSite, $destinationSite, $source, $destination, $fullSource, $fullDestination)
 moveContent ($sourceSite, $destinationSite, $sourceVFolder, $destinationVFolder, $source, $destination, $fullSource, $fullDestination)

Detailed Description

Provides access to eZ Publish kernel using WebDAV.

Definition at line 40 of file ezwebdavcontentserver.php.


Member Function Documentation

eZWebDAVContentServer::availableSites ( )

Gets and returns a list of the available sites (from site.ini).

Definition at line 1563 of file ezwebdavcontentserver.php.

Referenced by currentSiteFromPath(), and fetchSiteListContent().

eZWebDAVContentServer::createFolder ( parentNode,
target 
)

Creates a new folder under the given target node.

Definition at line 1526 of file ezwebdavcontentserver.php.

Referenced by mkcolContent().

eZWebDAVContentServer::currentSiteFromPath ( path)

Detects a possible/valid site-name in start of a path.

Returns:
The name of the site that was detected or false if not site could be detected

Definition at line 900 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::delete ( target)

Removes the object from the node tree and leaves it in the trash.

Reimplemented from eZWebDAVServer.

Definition at line 538 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::deleteContent ( currentSite,
virtualFolder,
target,
fullPath 
) [private]

Handles deletion on the content tree level. It will try to find the node of the target $target and then try to remove it (ie. move to trash) if the user is allowed.

Definition at line 604 of file ezwebdavcontentserver.php.

Referenced by deleteVirtualFolder().

eZWebDAVContentServer::deleteVirtualFolder ( currentSite,
target,
fullPath 
) [private]

Handles deletion on the virtual folder level. It will check if the target is below a content folder in which it calls deleteContent().

Definition at line 563 of file ezwebdavcontentserver.php.

Referenced by delete().

eZWebDAVContentServer::eZWebDAVContentServer ( )

Initializes the eZWebDAVServer

Definition at line 51 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::fetchContentList ( &$  node,
target,
depth,
properties 
)

Gets and returns the content of an actual node. List of other nodes belonging to the target node (one level below it) will be returned.

Definition at line 1350 of file ezwebdavcontentserver.php.

Referenced by getContentTreeCollection().

eZWebDAVContentServer::fetchNodeByTranslation ( nodePathString)

Attempts to fetch a possible/existing node by translating the inputted string/path to a node-number.

Definition at line 1059 of file ezwebdavcontentserver.php.

Referenced by deleteContent(), getContentNodeData(), getContentTreeCollection(), mkcolContent(), moveContent(), and putContentData().

eZWebDAVContentServer::fetchNodeInfo ( &$  node)

Gathers information about a given node (specified as parameter).

Definition at line 1401 of file ezwebdavcontentserver.php.

Referenced by fetchContentList().

eZWebDAVContentServer::fetchParentNodeByTranslation ( nodePathString)

Attempts to fetch a possible node by translating the inputted string/path to a node-number. The last section of the path is removed before the actual translation: hence, the PARENT node is returned.

Definition at line 1114 of file ezwebdavcontentserver.php.

Referenced by mkcolContent(), moveContent(), and putContentData().

eZWebDAVContentServer::fetchSiteListContent ( depth,
properties 
)

Builds a content-list of available sites and returns it.

Definition at line 1295 of file ezwebdavcontentserver.php.

Referenced by getCollectionContent().

eZWebDAVContentServer::fetchVirtualSiteContent ( site,
depth,
properties 
)

Functions related to creation collections

Builds and returns the content of the virtual start fodler for a site. The virtual startfolder is an intermediate step between the site-list and actual content. This directory contains the "content" folder which leads to the site's actual content.

Definition at line 1227 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderCollection().

eZWebDAVContentServer::fileBasename ( name)
Returns:
The string $name without the final suffix (.jpg, .gif etc.)

Definition at line 1098 of file ezwebdavcontentserver.php.

Referenced by fetchNodeByTranslation(), fetchParentNodeByTranslation(), and moveContent().

eZWebDAVContentServer::get ( target)

Tries to figure out the filepath of the object being shown, if not we will pass the virtual url as the filepath.

Reimplemented from eZWebDAVServer.

Definition at line 198 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::getCollectionContent ( collection,
depth = false,
properties = false 
)

Produces the collection content. Builds either the virtual start folder with the virtual content folder in it (and additional files). OR: if we're browsing within the content folder: it gets the content of the target/given folder.

Reimplemented from eZWebDAVServer.

Definition at line 108 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::getContentNodeData ( result,
currentSite,
virtualFolder,
target,
fullPath 
) [private]

Handles data retrival on the content tree level.

Definition at line 276 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderData().

eZWebDAVContentServer::getContentTreeCollection ( currentSite,
virtualFolder,
collection,
fullPath,
depth,
properties 
) [private]

Handles collections on the content tree level. Depending on the virtual folder we will generate a node path url and fetch the nodes for that path.

Definition at line 171 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderCollection().

eZWebDAVContentServer::getVirtualFolderCollection ( currentSite,
collection,
fullPath,
depth,
properties 
) [private]

Handles collections on the virtual folder level, if no virtual folder elements are accessed it lists the virtual folders.

Definition at line 135 of file ezwebdavcontentserver.php.

Referenced by getCollectionContent().

eZWebDAVContentServer::getVirtualFolderData ( result,
currentSite,
target,
fullPath 
) [private]

Handles data retrival on the virtual folder level.

Definition at line 226 of file ezwebdavcontentserver.php.

Referenced by get().

eZWebDAVContentServer::head ( target)
Note:
Not implemented yet

Reimplemented from eZWebDAVServer.

Definition at line 313 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::headers ( )

This is called before each each request is processed and can be used to output some common headers.

Reimplemented from eZWebDAVServer.

Definition at line 954 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::internalNodePath ( virtualFolder,
collection 
) [private]
Returns:
A path that corresponds to the internal path of nodes.

Definition at line 1038 of file ezwebdavcontentserver.php.

Referenced by deleteContent(), getContentNodeData(), getContentTreeCollection(), mkcolContent(), moveContent(), and putContentData().

eZWebDAVContentServer::isObjectFolder ( object,
&$  class 
)
Returns:
true if the object $object should always be considered a folder.

Definition at line 1381 of file ezwebdavcontentserver.php.

Referenced by fetchNodeInfo().

eZWebDAVContentServer::mkcol ( target)

Tries to create a collection at $target. In our case this is a content-class of a given type (most likely a folder).

Reimplemented from eZWebDAVServer.

Definition at line 443 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::mkcolContent ( currentSite,
virtualFolder,
target,
fullPath 
) [private]

Handles collection creation on the content tree level. It will try to find the parent node of the wanted placement and create a new collection (folder etc.) as a child.

Definition at line 508 of file ezwebdavcontentserver.php.

Referenced by mkcolVirtualFolder().

eZWebDAVContentServer::mkcolVirtualFolder ( currentSite,
target,
fullPath 
) [private]

Handles collection creation on the virtual folder level. It will check if the target is below a content folder in which it calls mkcolContent().

Definition at line 468 of file ezwebdavcontentserver.php.

Referenced by mkcol().

eZWebDAVContentServer::move ( source,
destination 
)

Moves the object $source to destination $destination.

Reimplemented from eZWebDAVServer.

Definition at line 631 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::moveContent ( sourceSite,
destinationSite,
sourceVFolder,
destinationVFolder,
source,
destination,
fullSource,
fullDestination 
) [private]

Handles moving on the content tree level. It will try to find the node of the target $source and then try to move it to $destination.

Definition at line 735 of file ezwebdavcontentserver.php.

Referenced by moveVirtualFolder().

eZWebDAVContentServer::moveVirtualFolder ( sourceSite,
destinationSite,
source,
destination,
fullSource,
fullDestination 
) [private]

Handles moving on the virtual folder level. It will check if the target is below a content folder in which it calls moveContent().

Definition at line 675 of file ezwebdavcontentserver.php.

Referenced by move().

eZWebDAVContentServer::options ( target)

Restricts the allowed methods to only the subset that this server supports.

Reimplemented from eZWebDAVServer.

Definition at line 92 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::outputSendDataToClient ( output,
headers_only = false 
)

Fetch the file from eZCluster if needed before send.

Reimplemented from eZWebDAVServer.

Definition at line 75 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::processClientRequest ( )

Makes sure $this->User is reinitialized with the current user, then calls the $super->processClientRequest().

Reimplemented from eZWebDAVServer.

Definition at line 62 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::processURL ( url)

Removes the www-dir and indexfile from the URL.

Reimplemented from eZWebDAVServer.

Definition at line 934 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::put ( target,
tempFile 
)

Tries to create/update an object at location $target with the file $tempFile.

Reimplemented from eZWebDAVServer.

Definition at line 321 of file ezwebdavcontentserver.php.

eZWebDAVContentServer::putContentData ( currentSite,
virtualFolder,
target,
tempFile,
fullPath 
) [private]

Handles data storage on the content tree level. It will try to find the parent node of the wanted placement and create a new object with data from $tempFile.

Definition at line 386 of file ezwebdavcontentserver.php.

Referenced by putVirtualFolderData().

eZWebDAVContentServer::putVirtualFolderData ( currentSite,
target,
tempFile,
fullPath 
) [private]

Handles data storage on the content tree level. It will check if the target is below a content folder in which it calls putContentData().

Definition at line 345 of file ezwebdavcontentserver.php.

Referenced by put().

eZWebDAVContentServer::setCurrentSite ( site)

Sets/changes the current site(access) to a $site.

Definition at line 830 of file ezwebdavcontentserver.php.

Referenced by deleteVirtualFolder(), getVirtualFolderCollection(), getVirtualFolderData(), mkcolVirtualFolder(), moveVirtualFolder(), and putVirtualFolderData().

eZWebDAVContentServer::splitFirstPathElement ( path,
&$  element 
)

Takes the first path element from $path and removes it from the path, the extracted part will be placed in $name.

Returns:
A string containing the rest of the path, the path will not contain a starting slash.
Parameters:
$pathA string defining a path of elements delimited by a slash, if the path starts with a slash it will be removed.
[out]$elementThe name of the first path element without any slashes.
      $path = '/path/to/item/';
      $newPath = eZWebDAVContentServer::splitFirstPathElement( $path, $root );
      print( $root ); // prints 'path', $newPath is now 'to/item/'
      $newPath = eZWebDAVContentServer::splitFirstPathElement( $newPath, $second );
      print( $second ); // prints 'to', $newPath is now 'item/'
      $newPath = eZWebDAVContentServer::splitFirstPathElement( $newPath, $third );
      print( $third ); // prints 'item', $newPath is now ''

Definition at line 978 of file ezwebdavcontentserver.php.

Referenced by delete(), deleteVirtualFolder(), get(), getCollectionContent(), getVirtualFolderCollection(), getVirtualFolderData(), mkcol(), mkcolVirtualFolder(), move(), moveVirtualFolder(), put(), and putVirtualFolderData().

eZWebDAVContentServer::splitLastPathElement ( path,
&$  element 
)

Takes the last path element from $path and removes it from the path, the extracted part will be placed in $name.

Returns:
A string containing the rest of the path, the path will not contain the ending slash.
Parameters:
$pathA string defining a path of elements delimited by a slash, if the path ends with a slash it will be removed.
[out]$elementThe name of the first path element without any slashes.
      $path = '/path/to/item/';
      $newPath = eZWebDAVContentServer::splitLastPathElement( $path, $root );
      print( $root ); // prints 'item', $newPath is now '/path/to'
      $newPath = eZWebDAVContentServer::splitLastPathElement( $newPath, $second );
      print( $second ); // prints 'to', $newPath is now '/path'
      $newPath = eZWebDAVContentServer::splitLastPathElement( $newPath, $third );
      print( $third ); // prints 'path', $newPath is now ''

Definition at line 1015 of file ezwebdavcontentserver.php.

Referenced by fetchParentNodeByTranslation(), and moveContent().

eZWebDAVContentServer::userHasSiteAccess ( site)

Checks if the current user has access rights to site $site.

Returns:
true if the user proper access.

Definition at line 847 of file ezwebdavcontentserver.php.

Referenced by delete(), get(), getCollectionContent(), mkcol(), move(), and put().

eZWebDAVContentServer::userHasVirtualAccess ( site,
virtual 
)

Checks if the current user has access rights to virtual element virtual on site $site.

Returns:
true if the user proper access.

Definition at line 890 of file ezwebdavcontentserver.php.

Referenced by deleteVirtualFolder(), getVirtualFolderCollection(), getVirtualFolderData(), mkcolVirtualFolder(), moveVirtualFolder(), and putVirtualFolderData().

static eZWebDAVContentServer::virtualContentFolderName ( ) [static]
eZWebDAVContentServer::virtualFileInfoList ( )
Returns:
An array containing the names of all files in the virtual root.

Definition at line 1191 of file ezwebdavcontentserver.php.

Referenced by virtualInfoList().

eZWebDAVContentServer::virtualFileList ( )
Returns:
An array containing the names of all files in the virtual root.

Definition at line 1183 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderData(), and virtualList().

eZWebDAVContentServer::virtualFolderInfoList ( )
Returns:
An array containing the names of all folders in the virtual root.

Definition at line 1174 of file ezwebdavcontentserver.php.

Referenced by virtualInfoList().

eZWebDAVContentServer::virtualFolderList ( )
Returns:
An array containing the names of all folders in the virtual root.

Definition at line 1166 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderCollection(), getVirtualFolderData(), putVirtualFolderData(), and virtualList().

static eZWebDAVContentServer::virtualInfoFileName ( ) [static]
eZWebDAVContentServer::virtualInfoList ( )
Returns:
An array containing the names of all elements in the virtual root.

Definition at line 1209 of file ezwebdavcontentserver.php.

Referenced by fetchVirtualSiteContent().

eZWebDAVContentServer::virtualList ( )
Returns:
An array containing the names of all elements in the virtual root.

Definition at line 1200 of file ezwebdavcontentserver.php.

Referenced by deleteVirtualFolder(), mkcolVirtualFolder(), and moveVirtualFolder().


Member Data Documentation

eZWebDAVContentServer::$FolderClasses

Contains an array with classes that are considered folder.

Definition at line 1594 of file ezwebdavcontentserver.php.

const eZWebDAVContentServer::WEBDAV_AUTH_FAILED = "Invalid username or password!"

Definition at line 44 of file ezwebdavcontentserver.php.

const eZWebDAVContentServer::WEBDAV_AUTH_REALM = "eZ Publish WebDAV interface"

Definition at line 43 of file ezwebdavcontentserver.php.

const eZWebDAVContentServer::WEBDAV_DISABLED = "WebDAV functionality is disabled!"

Definition at line 46 of file ezwebdavcontentserver.php.

const eZWebDAVContentServer::WEBDAV_INVALID_SITE = "Invalid site name specified!"

Definition at line 45 of file ezwebdavcontentserver.php.


The documentation for this class was generated from the following file: