eZ Publish  [trunk]
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 18 of file ezwebdavcontentserver.php.


Member Function Documentation

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

Definition at line 1540 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 1503 of file ezwebdavcontentserver.php.

Referenced by mkcolContent().

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 877 of file ezwebdavcontentserver.php.

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

Reimplemented from eZWebDAVServer.

Definition at line 516 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 582 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 541 of file ezwebdavcontentserver.php.

Referenced by delete().

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 1327 of file ezwebdavcontentserver.php.

Referenced by getContentTreeCollection().

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

Definition at line 1036 of file ezwebdavcontentserver.php.

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

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

Definition at line 1378 of file ezwebdavcontentserver.php.

Referenced by fetchContentList().

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 1091 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 1272 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 1204 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderCollection().

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

Definition at line 1075 of file ezwebdavcontentserver.php.

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

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 176 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 86 of file ezwebdavcontentserver.php.

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

Handles data retrival on the content tree level.

Definition at line 254 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 149 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 113 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 204 of file ezwebdavcontentserver.php.

Referenced by get().

Note:
Not implemented yet

Reimplemented from eZWebDAVServer.

Definition at line 291 of file ezwebdavcontentserver.php.

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

Reimplemented from eZWebDAVServer.

Definition at line 931 of file ezwebdavcontentserver.php.

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

Definition at line 1015 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 1358 of file ezwebdavcontentserver.php.

Referenced by fetchNodeInfo().

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 421 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 486 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 446 of file ezwebdavcontentserver.php.

Referenced by mkcol().

eZWebDAVContentServer::move ( source,
destination 
)

Moves the object $source to destination $destination.

Reimplemented from eZWebDAVServer.

Definition at line 609 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 713 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 653 of file ezwebdavcontentserver.php.

Referenced by move().

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

Reimplemented from eZWebDAVServer.

Definition at line 70 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 53 of file ezwebdavcontentserver.php.

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

Reimplemented from eZWebDAVServer.

Definition at line 40 of file ezwebdavcontentserver.php.

Removes the www-dir and indexfile from the URL.

Reimplemented from eZWebDAVServer.

Definition at line 911 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 299 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 364 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 323 of file ezwebdavcontentserver.php.

Referenced by put().

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 955 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 992 of file ezwebdavcontentserver.php.

Referenced by fetchParentNodeByTranslation(), and moveContent().

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

Returns:
true if the user proper access.

Definition at line 824 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 867 of file ezwebdavcontentserver.php.

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

Returns:
An array containing the names of all files in the virtual root.

Definition at line 1168 of file ezwebdavcontentserver.php.

Referenced by virtualInfoList().

Returns:
An array containing the names of all files in the virtual root.

Definition at line 1160 of file ezwebdavcontentserver.php.

Referenced by getVirtualFolderData(), and virtualList().

Returns:
An array containing the names of all folders in the virtual root.

Definition at line 1151 of file ezwebdavcontentserver.php.

Referenced by virtualInfoList().

Returns:
An array containing the names of all folders in the virtual root.

Definition at line 1143 of file ezwebdavcontentserver.php.

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

Returns:
An array containing the names of all elements in the virtual root.

Definition at line 1186 of file ezwebdavcontentserver.php.

Referenced by fetchVirtualSiteContent().

Returns:
An array containing the names of all elements in the virtual root.

Definition at line 1177 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 1571 of file ezwebdavcontentserver.php.

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

Definition at line 22 of file ezwebdavcontentserver.php.

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

Definition at line 21 of file ezwebdavcontentserver.php.

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

Definition at line 24 of file ezwebdavcontentserver.php.

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

Definition at line 23 of file ezwebdavcontentserver.php.


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