PaperFileManager Class Reference

Class defining operations for paper file management. More...

List of all members.

Public Member Functions

 copyAndRenameFile ($sourceFileId, $sourceRevision, $destType, $destFileId=null)
 copyPublicFile ($url, $mimeType, $fileId=null, $overwrite=true)
 copySubmissionFile ($url, $mimeType, $fileId=null, $overwrite=true)
 copySuppFile ($url, $mimeType, $fileId=null, $overwrite=true)
 copyToDirectorFile ($fileId, $revision=null, $destFileId=null)
 copyToLayoutFile ($fileId, $revision=null)
 copyToReviewFile ($fileId, $revision=null, $destFileId=null)
 deleteFile ($fileId, $revision=null)
 deletePaperTree ()
 downloadFile ($fileId, $revision=null, $inline=false)
generateDummyFile (&$paper)
 generateFilename (&$paperFile, $type, $originalName)
getFile ($fileId, $revision=null)
 handleCopy ($url, $mimeType, $type, $fileId=null, $overwrite=false)
 handleUpload ($fileName, $type, $fileId=null, $overwrite=false)
 handleWrite ($fileName, &$contents, $mimeType, $type, $fileId=null, $overwrite=false)
 PaperFileManager ($paperId)
 readFile ($fileId, $revision=null, $output=false)
 removePriorRevisions ($fileId, $revision)
 typeToPath ($type)
 uploadDirectorDecisionFile ($fileName, $fileId=null)
 uploadLayoutFile ($fileName, $fileId=null, $overwrite=true)
 uploadPublicFile ($fileName, $fileId=null, $overwrite=true)
 uploadReviewFile ($fileName, $fileId=null)
 uploadSubmissionFile ($fileName, $fileId=null, $overwrite=false)
 uploadSubmissionNoteFile ($fileName, $fileId=null, $overwrite=true)
 uploadSuppFile ($fileName, $fileId=null, $overwrite=true)
 viewFile ($fileId, $revision=null)
 writePublicFile ($fileName, &$contents, $mimeType, $fileId=null, $overwrite=true)
 writeSubmissionFile ($fileName, &$contents, $mimeType, $fileId=null, $overwrite=true)
 writeSuppFile ($fileName, &$contents, $mimeType, $fileId=null, $overwrite=true)

Public Attributes

 $filesDir
 $paper
 $paperId


Detailed Description

Class defining operations for paper file management.

Paper directory structure: [paper id]/note [paper id]/public [paper id]/submission [paper id]/submission/original [paper id]/submission/review [paper id]/submission/director [paper id]/submission/layout [paper id]/supp

Definition at line 38 of file PaperFileManager.inc.php.


Member Function Documentation

PaperFileManager.copyAndRenameFile ( sourceFileId,
sourceRevision,
destType,
destFileId = null 
)

Copies an existing PaperFile and renames it.

Parameters:
$sourceFileId int
$sourceRevision int
$destType string
$destFileId int (optional)

Definition at line 358 of file PaperFileManager.inc.php.

References typeToPath().

Referenced by copyToDirectorFile(), copyToLayoutFile(), and copyToReviewFile().

PaperFileManager.copyPublicFile ( url,
mimeType,
fileId = null,
overwrite = true 
)

Copy a public file.

Parameters:
$url string The source URL/filename
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 181 of file PaperFileManager.inc.php.

References handleCopy().

PaperFileManager.copySubmissionFile ( url,
mimeType,
fileId = null,
overwrite = true 
)

Copy a submission file.

Parameters:
$url string The source URL/filename
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 94 of file PaperFileManager.inc.php.

References handleCopy().

PaperFileManager.copySuppFile ( url,
mimeType,
fileId = null,
overwrite = true 
)

Copy a supplemental file.

Parameters:
$url string The source URL/filename
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 204 of file PaperFileManager.inc.php.

References handleCopy().

PaperFileManager.copyToDirectorFile ( fileId,
revision = null,
destFileId = null 
)

Copies an existing file to create a director decision file.

Parameters:
$fileId int the file id of the review file.
$revision int the revision of the review file.
$destFileId int file ID to copy to
Returns:
int the file id of the new file.

Definition at line 320 of file PaperFileManager.inc.php.

References copyAndRenameFile().

PaperFileManager.copyToLayoutFile ( fileId,
revision = null 
)

Copies an existing file to create a layout file.

Parameters:
$fileId int the file id of the layout file.
$revision int the revision of the layout file.
Returns:
int the file id of the new file.

Definition at line 330 of file PaperFileManager.inc.php.

References copyAndRenameFile().

PaperFileManager.copyToReviewFile ( fileId,
revision = null,
destFileId = null 
)

Copies an existing file to create a review file.

Parameters:
$originalFileId int the file id of the original file.
$originalRevision int the revision of the original file.
$destFileId int the file id of the current review file
Returns:
int the file id of the new file.

Definition at line 309 of file PaperFileManager.inc.php.

References copyAndRenameFile().

PaperFileManager.deleteFile ( fileId,
revision = null 
)

Delete a file by ID. If no revision is specified, all revisions of the file are deleted.

Parameters:
$fileId int
$revision int (optional)
Returns:
int number of files removed

Definition at line 244 of file PaperFileManager.inc.php.

Referenced by removePriorRevisions().

PaperFileManager.deletePaperTree (  ) 

Delete the entire tree of files belonging to a paper.

Definition at line 270 of file PaperFileManager.inc.php.

PaperFileManager.downloadFile ( fileId,
revision = null,
inline = false 
)

Download a file.

Parameters:
$fileId int the file id of the file to download
$revision int the revision of the file to download
$inline print file as inline instead of attachment, optional
Returns:
boolean

Definition at line 281 of file PaperFileManager.inc.php.

References getFile().

Referenced by viewFile().

& PaperFileManager.generateDummyFile ( &$  paper  ) 

PRIVATE routine to generate a dummy file. Used in handleUpload.

Parameters:
$paper object
Returns:
object paperFile

Definition at line 418 of file PaperFileManager.inc.php.

References $paper.

Referenced by handleCopy(), handleUpload(), and handleWrite().

PaperFileManager.generateFilename ( &$  paperFile,
type,
originalName 
)

PRIVATE routine to generate a filename for a paper file. Sets the filename field in the paperFile to the generated value.

Parameters:
$paperFile The paper to generate a filename for
$type The type of the paper (e.g. as supplied to handleUpload)
$originalName The name of the original file

Definition at line 457 of file PaperFileManager.inc.php.

Referenced by handleCopy(), handleUpload(), and handleWrite().

& PaperFileManager.getFile ( fileId,
revision = null 
)

Retrieve file information by file ID.

Returns:
PaperFile

Definition at line 212 of file PaperFileManager.inc.php.

Referenced by downloadFile(), and readFile().

PaperFileManager.handleCopy ( url,
mimeType,
type,
fileId = null,
overwrite = false 
)

PRIVATE routine to copy a paper file and add it to the database.

Parameters:
$url original filename/url of the file
$mimeType string the mime type of the file
$type string identifying type
$fileId int ID of an existing file to update
$overwrite boolean overwrite all previous revisions of the file (revision number is still incremented)
Returns:
int the file ID (false if upload failed)

Definition at line 579 of file PaperFileManager.inc.php.

References generateDummyFile(), generateFilename(), removePriorRevisions(), and typeToPath().

Referenced by copyPublicFile(), copySubmissionFile(), and copySuppFile().

PaperFileManager.handleUpload ( fileName,
type,
fileId = null,
overwrite = false 
)

PRIVATE routine to upload the file and add it to the database.

Parameters:
$fileName string index into the $_FILES array
$type string identifying type
$fileId int ID of an existing file to update
$overwrite boolean overwrite all previous revisions of the file (revision number is still incremented)
Returns:
int the file ID (false if upload failed)

Definition at line 472 of file PaperFileManager.inc.php.

References generateDummyFile(), generateFilename(), removePriorRevisions(), and typeToPath().

Referenced by uploadDirectorDecisionFile(), uploadLayoutFile(), uploadPublicFile(), uploadReviewFile(), uploadSubmissionFile(), uploadSubmissionNoteFile(), and uploadSuppFile().

PaperFileManager.handleWrite ( fileName,
&$  contents,
mimeType,
type,
fileId = null,
overwrite = false 
)

PRIVATE routine to write a paper file and add it to the database.

Parameters:
$fileName original filename of the file
$contents string contents of the file to write
$mimeType string the mime type of the file
$type string identifying type
$fileId int ID of an existing file to update
$overwrite boolean overwrite all previous revisions of the file (revision number is still incremented)
Returns:
int the file ID (false if upload failed)

Definition at line 527 of file PaperFileManager.inc.php.

References generateDummyFile(), generateFilename(), removePriorRevisions(), and typeToPath().

Referenced by writePublicFile(), writeSubmissionFile(), and writeSuppFile().

PaperFileManager.PaperFileManager ( paperId  ) 

Constructor. Create a manager for handling paper file uploads.

Parameters:
$paperId int

Definition at line 54 of file PaperFileManager.inc.php.

References $paperId.

PaperFileManager.readFile ( fileId,
revision = null,
output = false 
)

Read a file's contents.

Parameters:
$output boolean output the file's contents instead of returning a string
Returns:
boolean

Definition at line 223 of file PaperFileManager.inc.php.

References getFile().

PaperFileManager.removePriorRevisions ( fileId,
revision 
)

PRIVATE routine to remove all prior revisions of a file.

Definition at line 440 of file PaperFileManager.inc.php.

References deleteFile().

Referenced by handleCopy(), handleUpload(), and handleWrite().

PaperFileManager.typeToPath ( type  ) 

Return type path associated with a type code.

Parameters:
$type string
Returns:
string

Definition at line 339 of file PaperFileManager.inc.php.

Referenced by copyAndRenameFile(), handleCopy(), handleUpload(), and handleWrite().

PaperFileManager.uploadDirectorDecisionFile ( fileName,
fileId = null 
)

Upload a file to the director decision file folder.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
Returns:
int file ID, is false if failure

Definition at line 114 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadLayoutFile ( fileName,
fileId = null,
overwrite = true 
)

Upload a track director's layout editing file.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
$overwrite boolean
Returns:
int file ID, is null if failure

Definition at line 125 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadPublicFile ( fileName,
fileId = null,
overwrite = true 
)

Upload a public file.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
$overwrite boolean
Returns:
int file ID, is false if failure

Definition at line 147 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadReviewFile ( fileName,
fileId = null 
)

Upload a file to the review file folder.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
Returns:
int file ID, is false if failure

Definition at line 104 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadSubmissionFile ( fileName,
fileId = null,
overwrite = false 
)

Upload a submission file.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
Returns:
int file ID, is false if failure

Definition at line 71 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadSubmissionNoteFile ( fileName,
fileId = null,
overwrite = true 
)

Upload a note file.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
$overwrite boolean
Returns:
int file ID, is false if failure

Definition at line 158 of file PaperFileManager.inc.php.

References handleUpload().

PaperFileManager.uploadSuppFile ( fileName,
fileId = null,
overwrite = true 
)

Upload a supp file.

Parameters:
$fileName string the name of the file used in the POST form
$fileId int
$overwrite boolean
Returns:
int file ID, is false if failure

Definition at line 136 of file PaperFileManager.inc.php.

References handleUpload().

Referenced by SuppFileForm.execute().

PaperFileManager.viewFile ( fileId,
revision = null 
)

View a file inline (variant of downloadFile).

See also:
PaperFileManager.downloadFile

Definition at line 298 of file PaperFileManager.inc.php.

References downloadFile().

PaperFileManager.writePublicFile ( fileName,
&$  contents,
mimeType,
fileId = null,
overwrite = true 
)

Write a public file.

Parameters:
$fileName string The original filename
$contents string The contents to be written to the file
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 170 of file PaperFileManager.inc.php.

References handleWrite().

PaperFileManager.writeSubmissionFile ( fileName,
&$  contents,
mimeType,
fileId = null,
overwrite = true 
)

Write a submission file.

Parameters:
$fileName string The original filename
$contents string The contents to be written to the file
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 83 of file PaperFileManager.inc.php.

References handleWrite().

PaperFileManager.writeSuppFile ( fileName,
&$  contents,
mimeType,
fileId = null,
overwrite = true 
)

Write a supplemental file.

Parameters:
$fileName string The original filename
$contents string The contents to be written to the file
$mimeType string The mime type of the original file
$fileId int
$overwrite boolean

Definition at line 193 of file PaperFileManager.inc.php.

References handleWrite().


The documentation for this class was generated from the following file:
Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7