00001 <?php 00002 // 00003 // Definition of eZContentUploadHandler class 00004 // 00005 // Created on: <18-Mar-2005 18:14:02 amos> 00006 // 00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00008 // SOFTWARE NAME: eZ publish 00009 // SOFTWARE RELEASE: 3.9.x 00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 00011 // SOFTWARE LICENSE: GNU General Public License v2.0 00012 // NOTICE: > 00013 // This program is free software; you can redistribute it and/or 00014 // modify it under the terms of version 2.0 of the GNU General 00015 // Public License as published by the Free Software Foundation. 00016 // 00017 // This program is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 // GNU General Public License for more details. 00021 // 00022 // You should have received a copy of version 2.0 of the GNU General 00023 // Public License along with this program; if not, write to the Free 00024 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00025 // MA 02110-1301, USA. 00026 // 00027 // 00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00029 // 00030 00031 /*! \file ezcontentuploadhandler.php 00032 */ 00033 00034 /*! 00035 \class eZContentUploadHandler ezcontentuploadhandler.php 00036 \brief Interface for all content upload handlers 00037 00038 This defines the interface for upload handlers for content objects. The handler 00039 will be used if upload.ini is configured for a specific MIME type. 00040 The uploading system is general and will be used both by Web uploads as well 00041 as WebDAV PUT requests. 00042 00043 The handler must inherit this class and implement the following methods: 00044 - handleFile() - This takes care of creating content objects from the uploaded file. 00045 00046 Also the constructor must pass a proper name and identifier to the eZContentUploadHandler. 00047 00048 */ 00049 00050 class eZContentUploadHandler 00051 { 00052 /*! 00053 Initialises the handler with the name. 00054 */ 00055 function eZContentUploadHandler( $name, $identifier ) 00056 { 00057 $this->Name = $name; 00058 $this->Identifier = $identifier; 00059 } 00060 00061 /*! 00062 \pure 00063 Handles the file \a $filePath and creates one ore more content objects. 00064 00065 \param $upload The eZContentUpload object that instantiated the request, public methods on this can be used. 00066 \param $filePath Path to file which should be stored, do not remove or move this file. 00067 \param $mimeInfo Contains MIME-Type information on the file. 00068 \param $result Result data, will be filled with information which the client can examine, contains: 00069 - errors - An array with errors, each element is an array with \c 'description' containing the text 00070 \param $location The node ID which the new object will be placed or the string \c 'auto' for automatic placement of type. 00071 \param $existingNode Pass a contentobjecttreenode object to let the uploading be done to an existing object, 00072 if not it will create one from scratch. 00073 00074 \return \c false if something failed or \c true if succesful. 00075 \note might be transaction unsafe. 00076 */ 00077 function handleFile( &$upload, &$result, 00078 $filePath, $originalFilename, $mimeInfo, 00079 $location, $existingNode ) 00080 { 00081 return false; 00082 } 00083 00084 /// \privatesection 00085 /// The name of the handler, can be displayed to the end user. 00086 var $Name; 00087 /// The identifier of the handler. 00088 var $Identifier; 00089 } 00090 00091 ?>
1.6.3