interface DMSInterface (View source)

When storing a document, the DMS sucks up the file and stores it separately from the assets section.

When initializing the DMS, it should create some kind of storage system. For file-based storage, that could be a series of folders. Within the folders there are a number of files, keeping the same filename, but prefixed with an ID number, which corresponds to the document's ID. So "my-important-document" becomes: "/4000/4332~my-important-document" (folder structure to avoid storing too many files within one folder. Perhaps 10000 files per folder is a good amount)

Methods

public static 
inst()

Factory method that returns an instance of the DMS. This could be any class that implements the DMSInterface.

public
DMSDocumentInstance
storeDocument($file)

Takes a File object or a String (path to a file) and copies it into the DMS. The original file remains unchanged.

public
getByFullTextSearch($searchText, bool $showEmbargoed = false)

Returns a number of Document objects that match a full-text search of the Documents and their contents (if contents is searchable and compatible search module is installed - e.g. FullTextSearch module)

public
getByPage(SiteTree $page, bool $showEmbargoed = false)

Returns a list of Document objects associated with a Page via intermediary document sets

public
getDocumentSetsByPage(SiteTree $page)

Returns a list of Document Set objects associated with a Page

Details

static DMSInterface inst()

Factory method that returns an instance of the DMS. This could be any class that implements the DMSInterface.

Return Value

DMSInterface

An instance of the Document Management System

DMSDocumentInstance storeDocument($file)

Takes a File object or a String (path to a file) and copies it into the DMS. The original file remains unchanged.

When storing a document, sets the fields on the File has "tag" metadata.

Parameters

$file

File object, or String that is path to a file to store

Return Value

DMSDocumentInstance

Document object that we just created

DMSDocumentInterface getByFullTextSearch($searchText, bool $showEmbargoed = false)

Returns a number of Document objects that match a full-text search of the Documents and their contents (if contents is searchable and compatible search module is installed - e.g. FullTextSearch module)

Parameters

$searchText

String to search for

bool $showEmbargoed

Boolean that specifies if embargoed documents should be included in results

Return Value

DMSDocumentInterface

ArrayList getByPage(SiteTree $page, bool $showEmbargoed = false)

Returns a list of Document objects associated with a Page via intermediary document sets

Parameters

SiteTree $page

SiteTree to fetch the associated Documents from

bool $showEmbargoed

Boolean that specifies if embargoed documents should be included in results

Return Value

ArrayList

Document list associated with the Page

ArrayList getDocumentSetsByPage(SiteTree $page)

Returns a list of Document Set objects associated with a Page

Parameters

SiteTree $page

SiteTree to fetch the associated Document Sets from

Return Value

ArrayList

Document list associated with the Page