phpDocumentor WebDav
Classes
[ class tree: WebDav ] [ index: WebDav ] [ all elements ]

Class: WebDavHelper

Source Location: /modules/webdav/classes/WebDavHelper.class

Class WebDavHelper

Method Summary
array   checkConfiguration()   Check this module's configuration.
boolean   checkDavHeaders()   Check that OPTIONS responses includes the DAV headers.
boolean   checkLocks()   Check if there are no active locks at the specified path, or the request matches the token of the active lock.
boolean   checkRequestMethod()   Check that Gallery handles WebDAV request methods.
array   copyMoveRequestHelper()   COPY / MOVE request helper.
GalleryStatus   delete()   DELETE handler.
array   deleteHelper()   DELETE helper.
void   getDescendentsLocks()   Get active locks at specified path or any descendant path.
array   getLocks()   Get active WebDAV locks at specified path.
array('href'   getMountLink()   Returns a browser-specifc mount link for the given item.
array   getParentItemIdByPath()   Returns the id of item that corresponds to the parent of the given path.
WebDavServer   &getWebDavServer()   Get singleton WebDAV server library instance.
GalleryStatus   lock()   LOCK handler.
array   lockRequestHelper()   LOCK request helper.
void   lockResponseHelper()   LOCK response helper.
array   mirrorEntity()   Take two entities of possibly different classes and make the second entity as close a copy of the first entity as possible. Copy the id but not the entity type because the entity type must always match the class name.
GalleryStatus   mkcol()   MKCOL handler.
GalleryStatus   mkcolHelper()   MKCOL helper.
array   mkcolValidateHelper()   Validate MKCOL requests.
GalleryStatus   move()   MOVE handler.
array   moveValidateHelper()   Validate MOVE requests.
void   options()   OPTIONS handler.
GalleryStatus   propfind()   PROPFIND handler.
array   propfindRequestHelper()   PROPFIND request helper.
void   propfindResponseHelper()   PROPFIND response helper.
GalleryStatus   proppatch()   PROPPATCH handler.
array   proppatchRequestHelper()   PROPPATCH request helper.
void   proppatchResponseHelper()   PROPPATCH response helper.
array   putRequestHelper()   PUT request helper.
void   putResponseHelper()   PUT response helper.
GalleryStatus   unlock()   UNLOCK handler.
array   unlockRequestHelper()   UNLOCK request helper.
GalleryStatus   _propfindFiles()   PROPFIND recursive function.
GalleryStatus   _setItemProps()   Set item properties

[ Top ]
Methods
checkConfiguration  [line 60]

  array checkConfiguration( )

Check this module's configuration.


API Tags:
Return:  GalleryStatus a status code int WebDAV status code


[ Top ]
checkDavHeaders  [line 230]

  boolean checkDavHeaders( string $url  )

Check that OPTIONS responses includes the DAV headers.

Parameters:
string   $url: 

API Tags:
Return:  true if OPTIONS responses include the DAV headers


[ Top ]
checkLocks  [line 508]

  boolean checkLocks( string $path  )

Check if there are no active locks at the specified path, or the request matches the token of the active lock.

Parameters:
string   $path: 

API Tags:
Return:  no active locks or the request matches the active lock


[ Top ]
checkRequestMethod  [line 205]

  boolean checkRequestMethod( string $requestMethod  )

Check that Gallery handles WebDAV request methods.

Parameters:
string   $requestMethod: 

API Tags:
Return:  true if Gallery handles the request method


[ Top ]
copyMoveRequestHelper  [line 1266]

  array copyMoveRequestHelper( )

COPY / MOVE request helper.

Wrapper around HTTP_WebDAV_Server::copymove_request_helper which prepates data-structures from COPY / MOVE requests.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options int maximum depth of descendant paths boolean overwrite items at destination path string destination path
See:  HTTP_WebDAV_Server::copymove_request_helper


[ Top ]
delete  [line 1163]

  GalleryStatus delete( )

DELETE handler.


API Tags:
Return:  a status code


[ Top ]
deleteHelper  [line 1110]

  array deleteHelper( array $itemIds  )

DELETE helper.

For an array of item ids, delete the items if not the root album and the user has permission.

Copied from ItemDeleteController::handleRequest for consistancy. Maybe eventually should go in ItemDeleteController::requestHelper or a GalleryCoreApi method.

Parameters:
array   $itemIds:  ids of items to delete

API Tags:
Return:  GalleryStatus a status code int number of items deleted
See:  ItemDeleteController::handleRequest


[ Top ]
getDescendentsLocks  [line 498]

  void getDescendentsLocks( $path  )

Get active locks at specified path or any descendant path.

Parameters:
   $path: 

API Tags:
See:  WebDavHelper::getLocks


[ Top ]
getLocks  [line 420]

  array getLocks( string $path, [boolean $getDescendentsLocks = false]  )

Get active WebDAV locks at specified path.

Parameters:
string   $path: 
boolean   $getDescendentsLocks:  (optional) also get locks at any descendant path

API Tags:
Return:  GalleryStatus a status code array active WebDAV locks (scope, type, depth, owner, expires, token, path)


[ Top ]
getMountLink  [line 260]

  array('href' getMountLink( int $itemId  )

Returns a browser-specifc mount link for the given item.

Parameters:
int   $itemId: 

API Tags:
Return:  => string the davmount URL, 'script' (optional) => string JavaScript to be used as onclick, 'attrs' => array() string additional link tag attributes)


[ Top ]
getParentItemIdByPath  [line 310]

  array getParentItemIdByPath( $path, string $path,  )

Returns the id of item that corresponds to the parent of the given path.

The item at the given path doesn't have to exist, but its parent is expected to exist.

Parameters:
string   $path,:  e.g. /foo/bar
   $path: 

API Tags:
Return:  GalleryStatus a status code, int the id of the parent item


[ Top ]
getWebDavServer  [line 386]

  WebDavServer &getWebDavServer( )

Get singleton WebDAV server library instance.

If it didn't need path and baseUrl, we could eliminate and call library methods staticly.


API Tags:
Return:  instance


[ Top ]
lock  [line 1736]

  GalleryStatus lock( )

LOCK handler.

WebDAV locks persist between requests.


API Tags:
Return:  a status code

Information Tags:
Todo:  Make corresponding Gallery locks persist between requests

[ Top ]
lockRequestHelper  [line 1673]

  array lockRequestHelper( )

LOCK request helper.

Wrapper around HTTP_WebDAV_Server::lock_request_helper which prepares data-structures from LOCK reqeusts.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options string token of WebDAV lock to refresh or null string scope of WebDAV lock (exclusive or shared) string type of WebDAV lock (read or write) int maximum depth of descendant paths string owner of WebDAV lock int timeout of WebDAV lock string token of WebDAV lock to create
See:  HTTP_WebDAV_Server::lock_request_helper

Information Tags:
Todo:  Simplify function signature

[ Top ]
lockResponseHelper  [line 1715]

  void lockResponseHelper( array $webDavOptions, array $locks, mixed $status, string $scope, string $type, int $depth, string $owner, int $expires, string $token, int $timeout  )

LOCK response helper.

Wrapper around HTTP_WebDAV_Server::lock_response_helper which formates LOCK responses.

Parameters:
array   $webDavOptions:  WebDAV library options
array   $locks:  for response (path)
mixed   $status:  HTTP response status
string   $scope:  of WebDAV lock (exclusive or shared)
string   $type:  of WebDAV lock (read or write)
int   $depth:  maximum depth of descendant paths
string   $owner:  of WebDAV lock
int   $timeout:  of WebDAV lock
int   $expires:  timestamp of WebDAV lock expiration
string   $token:  of WebDAV lock

API Tags:
See:  HTTP_WebDAV_Server::lock_response_helper

Information Tags:
Todo:  Simplify function signature

[ Top ]
mirrorEntity  [line 339]

  array mirrorEntity( GalleryEntity $sourceEntity, GalleryEntity $mirrorEntity  )

Take two entities of possibly different classes and make the second entity as close a copy of the first entity as possible. Copy the id but not the entity type because the entity type must always match the class name.

Parameters:
GalleryEntity   $sourceEntity:  entity to copy from
GalleryEntity   $mirrorEntity:  entity to copy to

API Tags:
Return:  GalleryStatus a status code GalleryEntity the mirror entity


[ Top ]
mkcol  [line 1016]

  GalleryStatus mkcol( )

MKCOL handler.


API Tags:
Return:  a status code


[ Top ]
mkcolHelper  [line 988]

  GalleryStatus mkcolHelper( int $parentId, string $pathComponent, string $title, string $summary, string $description, array $keywords  )

MKCOL helper.

Acquire locks, create album and set permissions.

Copied from ItemAddAlbumController::handleRequest for consistancy. Maybe eventually should go in ItemAddAlbumController::requestHelper or a GalleryCoreApi method.

Parameters:
int   $parentId:  id of parent album
string   $pathComponent:  path component of new album
string   $title:  title of new album
string   $summary:  summary of new album
string   $description:  description of new album
array   $keywords:  keywords of new album

API Tags:
Return:  a status code
See:  ItemAddAlbumController::handleRequest


[ Top ]
mkcolValidateHelper  [line 950]

  array mkcolValidateHelper( int $parentId, string $pathComponent  )

Validate MKCOL requests.

Copied from ItemAddAlbumController::handleRequest for consistancy. Maybe eventually should go in ItemAddAlbumController::validateRequest or a GalleryCoreApi method.

Parameters:
int   $parentId:  id of parent album
string   $pathComponent:  path component of new album

API Tags:
Return:  GalleryStatus a status code array error strings
See:  ItemAddAlbumController::handleRequest


[ Top ]
move  [line 1412]

  GalleryStatus move( )

MOVE handler.

Rename an item, change its parent, or both.


API Tags:
Return:  a status code


[ Top ]
moveValidateHelper  [line 1321]

  array moveValidateHelper( array $items, GalleryAlbumItem $newParent  )

Validate MOVE requests.

Copied from ItemMoveController::handleRequest for consistancy. Maybe eventually should go in ItemMoveController::validateRequest or a GalleryCoreApi method.

Parameters:
array   $items:  items to move
GalleryAlbumItem   $newParent: 

API Tags:
Return:  GalleryStatus a status code array error strings
See:  ItemMoveController::handleRequest


[ Top ]
options  [line 526]

  void options( )

OPTIONS handler.


API Tags:
See:  HTTP_WebDAV_Server::options


[ Top ]
propfind  [line 577]

  GalleryStatus propfind( )

PROPFIND handler.


API Tags:
Return:  status code


[ Top ]
propfindRequestHelper  [line 546]

  array propfindRequestHelper( )

PROPFIND request helper.

Wrapper around HTTP_WebDAV_Server::propfind_request_helper which prepares data-structures from PROPFIND requests.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options int maximum depth of descendant paths
See:  HTTP_WebDAV_Server::propfind_request_helper


[ Top ]
propfindResponseHelper  [line 567]

  void propfindResponseHelper( array $webDavOptions, array $files, array $namespaces  )

PROPFIND response helper.

Wrapper around HTTP_WebDAV_Server::propfind_response_helper which formats PROPFIND responses.

Parameters:
array   $webDavOptions:  WebDAV library options
array   $files:  files for WebDAV response (path, props)
array   $namespaces:  namespaces for WebDAV response (URI => prefix)

API Tags:
See:  HTTP_WebDAV_Server::propfind_response_helper


[ Top ]
proppatch  [line 818]

  GalleryStatus proppatch( )

PROPPATCH handler.


API Tags:
Return:  a status code


[ Top ]
proppatchRequestHelper  [line 780]

  array proppatchRequestHelper( )

PROPPATCH request helper.

Wrapper around HTTP_WebDAV_Server::proppatch_request_helper which prepares data-structures from PROPPATCH requests.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options array properties to set (ns => namespace, name => name, val => value)
See:  HTTP_WebDAV_Server::proppatch_request_helper


[ Top ]
proppatchResponseHelper  [line 806]

  void proppatchResponseHelper( array $webDavOptions, string $path, array $props, $namespaces, array $namespace  )

PROPPATCH response helper.

Wrapper around HTTP_WebDAV_Server::proppatch_response_helper which formats PROPPATCH responses.

Parameters:
array   $webDavOptions:  WebDAV library options
string   $path: 
array   $props:  properties set (ns => namespace,
array   $namespace:  namespaces for WebDAV response (URI => prefix)
   $namespaces: 

API Tags:
See:  HTTP_WebDAV_Server::proppatch_response_helper


[ Top ]
putRequestHelper  [line 1225]

  array putRequestHelper( )

PUT request helper.

Wrapper around HTTP_WebDAV_Server::put_request_helper which prepares data-structures from PUT requests.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options resource request body file handle string request content type
See:  HTTP_WebDAV_Server::put_request_helper


[ Top ]
putResponseHelper  [line 1247]

  void putResponseHelper( array $webDavOptions, resource $stream  )

PUT response helper.

Wrapper around HTTP_WebDAV_Server::put_response_helper which formats PUT responses.

Parameters:
array   $webDavOptions:  WebDAV library options
resource   $stream:  destination file handle

API Tags:
See:  HTTP_WebDAV_Server::put_response_helper


[ Top ]
unlock  [line 1929]

  GalleryStatus unlock( )

UNLOCK handler.


API Tags:
Return:  a status code


[ Top ]
unlockRequestHelper  [line 1914]

  array unlockRequestHelper( )

UNLOCK request helper.

Wrapper around HTTP_WebDAV_Server::unlock_request_helper wich prepares data-structures from UNLOCK requests.


API Tags:
Return:  GalleryStatus a status code array WebDAV library options string token of WebDAV lock to clear
See:  HTTP_WebDAV_Server::unlock_request_helper


[ Top ]
_propfindFiles  [line 640]

  GalleryStatus _propfindFiles( GalleryItem $item, string $path, int $depth, &$files, array $files  )

PROPFIND recursive function.

Builds file arrays (path, props) from items until depth is exhausted.

Could be done iteratively, but waiting for MPTT for the ultimate solution - http://codex.gallery2.org/index.php/Gallery2:Modified_Preorder_Tree_Traversal

Parameters:
GalleryItem   $item: 
string   $path: 
int   $depth:  maximum depth of descendant paths
array   $files:  files for WebDAV response (path, props)
   &$files: 

API Tags:
Return:  a status code
Access:  private


[ Top ]
_setItemProps  [line 896]

  GalleryStatus _setItemProps( mixed &$item, mixed &$props  )

Set item properties


API Tags:
Return:  a status code


[ Top ]

Documentation generated on Fri, 08 Oct 2010 06:09:51 -0700 by phpDocumentor 1.3.0RC6