Public Member Functions

MonographFileManager Class Reference

Helper class for database-backed monograph file management tasks. More...

Inheritance diagram for MonographFileManager:
BaseMonographFileManager PressFileManager

List of all members.

Public Member Functions

_getFile ($fileId, $revision=null)
_handleUpload ($fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null)
_instantiateMonographFile ($sourceFilePath, $fileStage, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null)
 copyFileToFileStage ($sourceFileId, $sourceRevision, $newFileStage, $destFileId=null, $viewable=false)
 deleteFile ($fileId, $revision=null)
 downloadFile ($fileId, $revision=null, $inline=false)
 MonographFileManager ($pressId, $monographId)
 recordView (&$monographFile)
 temporaryFileToMonographFile (&$temporaryFile, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId, $genreId, $assocType, $assocId)
uploadMonographFile ($fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null)

Detailed Description

Helper class for database-backed monograph file management tasks.

Monograph directory structure: [monograph id]/note [monograph id]/public [monograph id]/submission [monograph id]/submission/original [monograph id]/submission/review [monograph id]/submission/review/attachment [monograph id]/submission/editor [monograph id]/submission/copyedit [monograph id]/submission/layout [monograph id]/attachment

Definition at line 29 of file MonographFileManager.inc.php.


Member Function Documentation

& MonographFileManager._getFile ( fileId,
revision = null 
)

Internal helper method to retrieve file information by file ID.

Parameters:
$fileId integer
$revision integer
Returns:
MonographFile

Definition at line 357 of file MonographFileManager.inc.php.

Referenced by deleteFile(), and downloadFile().

& MonographFileManager._handleUpload ( fileName,
fileStage,
uploaderUserId,
uploaderUserGroupId,
revisedFileId = null,
genreId = null,
assocType = null,
assocId = null 
)

Upload the file and add it to the database.

Parameters:
$fileName string index into the $_FILES array
$fileStage int monograph file stage (one of the MONOGRAPH_FILE_* constants)
$uploaderUserId int The id of the user that uploaded the file.
$uploaderUserGroupId int The id of the user group that the uploader acted in when uploading the file.
$revisedFileId int ID of an existing file to revise
$genreId int foreign key into genres table (e.g. manuscript, etc.)
$assocType int
$assocId int
Returns:
MonographFile the uploaded monograph file or null if an error occured.

Definition at line 218 of file MonographFileManager.inc.php.

References _instantiateMonographFile().

Referenced by uploadMonographFile().

& MonographFileManager._instantiateMonographFile ( sourceFilePath,
fileStage,
revisedFileId = null,
genreId = null,
assocType = null,
assocId = null 
)

Routine to instantiate and pre-populate a new monograph file.

Parameters:
$sourceFilePath string
$fileStage integer MONOGRAPH_FILE_...
$revisedFileId integer optional
$genreId integer optional
$assocId integer optional
$assocType integer optional
Returns:
MonographFile returns the instantiated monograph file or null if an error occurs.

Definition at line 263 of file MonographFileManager.inc.php.

References BaseMonographFileManager.getMonographId().

Referenced by _handleUpload(), and temporaryFileToMonographFile().

MonographFileManager.copyFileToFileStage ( sourceFileId,
sourceRevision,
newFileStage,
destFileId = null,
viewable = false 
)

Copies an existing ArticleFile and renames it.

Parameters:
$sourceFileId int
$sourceRevision int
$fileStage int
$destFileId int (optional)
$viewable boolean (optional)

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

MonographFileManager.deleteFile ( fileId,
revision = null 
)

Delete a file.

Parameters:
$fileId integer
$revisionId integer
Returns:
boolean returns true if successful

Definition at line 68 of file MonographFileManager.inc.php.

References _getFile().

MonographFileManager.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 84 of file MonographFileManager.inc.php.

References _getFile(), BaseMonographFileManager.getMonographId(), and recordView().

MonographFileManager.MonographFileManager ( pressId,
monographId 
)

Constructor.

Parameters:
$pressId int
$monographId int

Definition at line 35 of file MonographFileManager.inc.php.

References BaseMonographFileManager.BaseMonographFileManager().

MonographFileManager.recordView ( &$  monographFile  ) 

Record a file view in database.

Parameters:
$monographFile MonographFile

Definition at line 106 of file MonographFileManager.inc.php.

Referenced by downloadFile(), and FileApiHandler.recordDownload().

MonographFileManager.temporaryFileToMonographFile ( &$  temporaryFile,
fileStage,
uploaderUserId,
uploaderUserGroupId,
revisedFileId,
genreId,
assocType,
assocId 
)

Copy a temporary file to a monograph file.

Parameters:
$temporaryFile MonographFile
$fileStage integer
$assocId integer
$assocType integer
Returns:
integer the file ID (false if upload failed)

Definition at line 128 of file MonographFileManager.inc.php.

References _instantiateMonographFile().

& MonographFileManager.uploadMonographFile ( fileName,
fileStage,
uploaderUserId,
uploaderUserGroupId,
revisedFileId = null,
genreId = null,
assocType = null,
assocId = null 
)

Upload a monograph file.

Parameters:
$fileName string the name of the file used in the POST form
$fileStage int monograph file workflow stage
$uploaderUserId int The id of the user that uploaded the file.
$uploaderUserGroupId int The id of the user group that the uploader acted in when uploading the file.
$revisedFileId int
$genreId int (e.g. Manuscript, Appendix, etc.)
Returns:
MonographFile

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

References _handleUpload().


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