\DMSUploadField
Field for uploading files into a DMSDocument. Replacing the existing file.
Not ideally suited for the purpose, as the base implementation
assumes to operate on a record. We only use this as
a temporary container, which gets deleted as soon as the actual
is created.
<b>NOTE: this Field will call write() on the supplied record</b>
- Author: Julian Seidenberg
Synopsis
class DMSUploadField
extends UploadField
{
- // members
- private static array $allowed_actions = ;
- protected string $folderName = 'DMSTemporaryUploads';
- // methods
- protected void attachFile()
- public void validate()
- public string upload()
- public SS_List getItems()
- public void Field()
- public UploadField_ItemHandler getItemHandler()
- public FieldList getDMSFileEditFields()
- public FieldList getDMSFileEditActions()
- public Validator getDMSFileEditValidator()
- public $this setFolderName()
- public string getFolderName()
Hierarchy
Extends
- UploadField
Members
private
- $allowed_actions
protected
- $folderName
—
string
The temporary folder name to store files in during upload
Methods
protected
- attachFile() — Override the default behaviour of the UploadField and take the uploaded file (uploaded to assets) and add it into the DMS storage, deleting the old/uploaded file.
public
- Field()
- getDMSFileEditActions() — FieldList $actions or string $name (of a method on File to provide a actions) for the EditForm
- getDMSFileEditFields() — FieldList $fields for the EditForm
- getDMSFileEditValidator() — Determines the validator to use for the edit form
- getFolderName() — Get the folder name for storing the document
- getItemHandler()
- getItems() — Never directly display items uploaded
- setFolderName() — Set the folder name to store DMS files in
- upload() — Action to handle upload of a single file
- validate()