eZPublish  4.5
eZWebDAVContentServer Class Reference

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

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

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)
 
- Public Member Functions inherited from eZWebDAVServer
 copy ($source, $destination)
 
 delete ($target)
 
 eZWebDAVServer ()
 
 flushXMLBody ()
 
 get ($target)
 
 getCollectionContent ($collection, $depth=false, $properties=false)
 
 head ($target)
 
 mkcol ($target)
 
 move ($source, $destination)
 
 options ($target)
 
 processClientRequest ()
 
 put ($target, $tempFile)
 
 setServerRoot ($rootDir)
 
 setupXMLOutputCharset ()
 
 setXMLOutputCharset ($charset)
 
 xmlBody ()
 
 XMLOutputCharset ()
 

Static Public Member Functions

static virtualContentFolderName ()
 
static virtualInfoFileName ()
 
static virtualMediaFolderName ()
 
- Static Public Member Functions inherited from eZWebDAVServer
static appendLogEntry ($logString, $label=false)
 
 dataCharset ()
 
static isLoggingEnabled ()
 
 recode ($string, $fromCharset, $toCharset, $stop=false)
 
static rootDirectory ()
 
static tempDirectory ()
 
 userAgentPattern ()
 
 userAgentSettings ()
 

Public Attributes

 $FolderClasses
 Contains an array with classes that are considered folder. More...
 
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!"
 
- Public Attributes inherited from eZWebDAVServer
 $ServerRootDir = ""
 
 $XMLBodyRead = false
 
 $XMLOutputCharset = 'utf-8'
 
const CTIME_FORMAT = "Y-m-d\\TH:i:s\\Z"
 
const FAILED_BAD_GATEWAY = 36
 
const FAILED_CONFLICT = 33
 
const FAILED_EXISTS = 32
 
const FAILED_FORBIDDEN = 30
 
const FAILED_LOCKED = 35
 
const FAILED_NOT_FOUND = 31
 
const FAILED_PRECONDITION = 34
 
const FAILED_STORAGE_FULL = 37
 
const FAILED_UNSUPPORTED = 38
 
const MTIME_FORMAT = "D, d M Y H:i:s"
 
const OK = 10
 
const OK_CREATED = 12
 
const OK_OVERWRITE = 13
 
const OK_SILENT = 11
 
const TEMP_FILE_PREFIX = "eZWebDAVUpload_"
 

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)
 

Additional Inherited Members

- Protected Member Functions inherited from eZWebDAVServer
 handle ($status)
 
 headers ()
 
 outputCollectionContent ($collection, $requestedProperties)
 
 outputOptions ($options)
 
 outputSendDataToClient ($output, $headers_only=false)
 
 processURL ($url)
 
 storeUploadedFile ($target)
 

Detailed Description

Provides access to eZ Publish kernel using WebDAV.

Member Function Documentation

eZWebDAVContentServer::availableSites ( )

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

Referenced by currentSiteFromPath(), and fetchSiteListContent().

eZWebDAVContentServer::createFolder (   $parentNode,
  $target 
)

Creates a new folder under the given target node.

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
eZWebDAVContentServer::delete (   $target)

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

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.

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().

Referenced by delete().

eZWebDAVContentServer::eZWebDAVContentServer ( )

Initializes the eZWebDAVServer

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.

Referenced by getContentTreeCollection().

eZWebDAVContentServer::fetchNodeByTranslation (   $nodePathString)

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

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

eZWebDAVContentServer::fetchNodeInfo ( $node)

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

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.

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

eZWebDAVContentServer::fetchSiteListContent (   $depth,
  $properties 
)

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

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.

Referenced by getVirtualFolderCollection().

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

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.

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.

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

Handles data retrival on the content tree level.

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.

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.

Referenced by getCollectionContent().

eZWebDAVContentServer::getVirtualFolderData (   $result,
  $currentSite,
  $target,
  $fullPath 
)
private

Handles data retrival on the virtual folder level.

Referenced by get().

eZWebDAVContentServer::head (   $target)
Note
Not implemented yet
eZWebDAVContentServer::headers ( )
eZWebDAVContentServer::internalNodePath (   $virtualFolder,
  $collection 
)
private
Returns
A path that corresponds to the internal path of nodes.

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.

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).

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.

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().

Referenced by mkcol().

eZWebDAVContentServer::move (   $source,
  $destination 
)

Moves the object $source to destination $destination.

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.

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().

Referenced by move().

eZWebDAVContentServer::options (   $target)

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

eZWebDAVContentServer::outputSendDataToClient (   $output,
  $headers_only = false 
)

Fetch the file from eZCluster if needed before send.

eZWebDAVContentServer::processClientRequest ( )

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

eZWebDAVContentServer::processURL (   $url)

Removes the www-dir and indexfile from the URL.

eZWebDAVContentServer::put (   $target,
  $tempFile 
)

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

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.

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().

Referenced by put().

eZWebDAVContentServer::setCurrentSite (   $site)
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/';
print( $root ); // prints 'path', $newPath is now 'to/item/'
print( $second ); // prints 'to', $newPath is now 'item/'
$newPath = eZWebDAVContentServer::splitFirstPathElement( $newPath, $third );
print( $third ); // prints 'item', $newPath is now ''

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/';
print( $root ); // prints 'item', $newPath is now '/path/to'
print( $second ); // prints 'to', $newPath is now '/path'
$newPath = eZWebDAVContentServer::splitLastPathElement( $newPath, $third );
print( $third ); // prints 'path', $newPath is now ''

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.

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.

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.

Referenced by virtualInfoList().

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

Referenced by getVirtualFolderData(), and virtualList().

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

Referenced by virtualInfoList().

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

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.

Referenced by fetchVirtualSiteContent().

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

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

Member Data Documentation

eZWebDAVContentServer::$FolderClasses

Contains an array with classes that are considered folder.

const eZWebDAVContentServer::WEBDAV_AUTH_FAILED = "Invalid username or password!"
const eZWebDAVContentServer::WEBDAV_AUTH_REALM = "eZ Publish WebDAV interface"
const eZWebDAVContentServer::WEBDAV_DISABLED = "WebDAV functionality is disabled!"
const eZWebDAVContentServer::WEBDAV_INI_FILE = "webdav.ini"
const eZWebDAVContentServer::WEBDAV_INVALID_SITE = "Invalid site name specified!"

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