\DMSDocument
Synopsis
class DMSDocument
extends DataObject
implements
DMSDocumentInterface
{
- // members
- private static array $db = ;
- private static array $belongs_many_many = ;
- private static array $has_one = ;
- private static array $many_many = ;
- private static array $display_fields = ;
- private static string $singular_name = 'Document';
- private static string $plural_name = 'Documents';
- private static array $summary_fields = ;
- private static string $default_download_behaviour = 'download';
- protected array $actionTasks = ;
- // methods
- public void canView()
- public void canEdit()
- public boolean canCreate()
- public boolean canDelete()
- public DMSDocument trackView()
- public string getLink()
- public string Link()
- public DMSDocument embargoIndefinitely()
- public DMSDocument embargoUntilPublished()
- public bool isHidden()
- public bool isEmbargoed()
- public DMSDocument embargoUntilDate()
- public DMSDocument clearEmbargo()
- public bool isExpired()
- public DMSDocument expireAtDate()
- public DMSDocument clearExpiry()
- public DataList getVersions()
- public string getFullPath()
- public string getFilename()
- public string getName()
- public string getFilenameWithoutID()
- public string getStorageFolder()
- public void delete()
- public DMSDocument storeDocument()
- public DMSDocument replaceDocument()
- public static string get_file_type()
- public string getDescriptionWithLineBreak()
- public FieldList getCMSFields()
- public CompositeField getPermissionsActionPanel()
- public string getTitle()
- public void onBeforeWrite()
- public string Icon()
- public string getExtension()
- public string getSize()
- public string getAbsoluteSize()
- public string getFileSizeFormatted()
- protected FieldList getFieldsForFile()
- public $this ingestFile()
- public DataList getRelatedDocuments()
- public ArrayList getRelatedPages()
- protected GridField getRelatedDocumentsGridField()
- protected DataList getRelatedDocumentsForAutocompleter()
- protected ValidationResult validate()
- public string getPermissionDeniedReason()
- public $this addActionPanelTask()
- public string getActionTaskHtml()
- public $this removeActionPanelTask()
Hierarchy
Members
private
- $belongs_many_many
- $db
- $default_download_behaviour — string
- $display_fields
- $has_one
- $many_many
- $plural_name
- $singular_name
- $summary_fields
protected
- $actionTasks
—
array
A key value map of the "actions" tabs that will be added to the CMS fields
Methods
protected
- getFieldsForFile()
- getRelatedDocumentsForAutocompleter() — Get the list of documents to show in "related documents". This can be modified via the extension point, for example if you wanted to exclude embargoed documents or something similar.
- getRelatedDocumentsGridField() — Get a GridField for managing related documents
- validate() — Checks at least one group is selected if CanViewType || CanEditType == 'OnlyTheseUsers'
public
- Icon() — Return the relative URL of an icon for the file type, based on the {@link appCategory()} value.
- Link()
- addActionPanelTask() — Add an "action panel" task
- canCreate()
- canDelete()
- canEdit()
- canView()
- clearEmbargo() — Clears any previously set embargos, so the Document always shows up in all queries.
- clearExpiry() — Clears any previously set expiry.
- delete() — Deletes the DMSDocument and its underlying file. Also calls the parent DataObject's delete method in order to complete an cascade.
- embargoIndefinitely() — Hides the document, so it does not show up when getByPage($myPage) is called (without specifying the $showEmbargoed = true parameter).
- embargoUntilDate() — Hides the document, so it does not show up when getByPage($myPage) is called. Automatically un-hides the Document at a specific date.
- embargoUntilPublished() — Hides the document until any page it is linked to is published
- expireAtDate() — Hides the document at a specific date, so it does not show up when getByPage($myPage) is called.
- getAbsoluteSize() — Return the size of the file associated with the document.
- getActionTaskHtml() — Returns a HTML representation of the action tasks for the CMS
- getCMSFields()
- getDescriptionWithLineBreak() — Returns the Description field with HTML <br> tags added when there is a line break.
- getExtension() — Return the extension of the file associated with the document
- getFileSizeFormatted() — An alias to DMSDocument::getSize()
- getFilename() — Returns the filename of this asset.
- getFilenameWithoutID() — Returns the filename of a document without the prefix, e.g. 0~filename.jpg -> filename.jpg
- getFullPath() — Returns the full filename of the document stored in this object.
- getLink() — Returns a link to download this document from the DMS store.
- getName()
- getPermissionDeniedReason() — Returns a reason as to why this document cannot be viewed.
- getPermissionsActionPanel() — Adds permissions selection fields to a composite field and returns so it can be used in the "actions panel"
- getRelatedDocuments() — Get a data list of documents related to this document
- getRelatedPages() — Get a list of related pages for this document by going through the associated document sets
- getSize()
- getStorageFolder()
- getTitle() — Return a title to use on the frontend, preferably the "title", otherwise the filename without it's numeric ID
- getVersions() — Returns a DataList of all previous Versions of this document (check the LastEdited date of each object to find the correct one).
- get_file_type() — Return the type of file for the given extension on the current file name.
- ingestFile() — Takes a file and adds it to the DMSDocument storage, replacing the current file.
- isEmbargoed() — Returns if this is Document is embargoed.
- isExpired() — Returns if this is Document is expired.
- isHidden() — Returns if this is Document is embargoed or expired.
- onBeforeWrite()
- removeActionPanelTask() — Removes an "action panel" tasks
- replaceDocument() — Takes a File object or a String (path to a file) and copies it into the DMS, replacing the original document file but keeping the rest of the document unchanged.
- storeDocument() — Relate an existing file on the filesystem to the document.
- trackView() — Increase ViewCount by 1, without update any other record fields such as LastEdited.