mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
API-CHANGE: initial commit for dms
This commit is contained in:
commit
97be98315c
0
_config.php
Normal file
0
_config.php
Normal file
34
code/DMSInterface.php
Normal file
34
code/DMSInterface.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface DMSInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory method that returns an instance of the DMS. This could be anything that implements the DMSInterface
|
||||||
|
* @static
|
||||||
|
* @abstract
|
||||||
|
* @return DMSinstance
|
||||||
|
*/
|
||||||
|
static function getDMSInstance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When storing a document, sets the fields on the File has "tag" metadata. E.g: filename, path, etc. all become
|
||||||
|
* single-value tags on the Document.
|
||||||
|
* @abstract
|
||||||
|
* @param File $file
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function storeDocument(File $file);
|
||||||
|
|
||||||
|
function getByTag($category = null, $value = null);
|
||||||
|
function getByFullTextSearch($searchText);
|
||||||
|
function getByTitle($searchTitle);
|
||||||
|
|
||||||
|
}
|
50
code/DocumentInterface.php
Normal file
50
code/DocumentInterface.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Interface for a Document used in the Document Management System. A document is create by storing a File object in an
|
||||||
|
* instance of the DMSInterface. All write operations on the Document create a new relation, so there is no explicit
|
||||||
|
* write() method that needs to be called.
|
||||||
|
*/
|
||||||
|
interface DocumentInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the document, its underlying file, as well as any tags related to this document.
|
||||||
|
* @abstract
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function delete();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Could be a simple wrapper around $myDoc->Pages()->add($myPage)
|
||||||
|
* @abstract
|
||||||
|
* @param $pageObject
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function addPage($pageObject);
|
||||||
|
function removePage($pageObject);
|
||||||
|
function getPages();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be implemented as a key/value store table (although it is more like category/value, because the same category can occur multiple times)
|
||||||
|
* @abstract
|
||||||
|
* @param $category
|
||||||
|
* @param $value
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function addTag($category, $value, $multiValue = true);
|
||||||
|
|
||||||
|
function addTags($twoDimensionalArray);
|
||||||
|
function removeTag($category = null, $value = null);
|
||||||
|
function removeAllTags();
|
||||||
|
function getAllTags();
|
||||||
|
|
||||||
|
function downloadLink();
|
||||||
|
|
||||||
|
function getVersions();
|
||||||
|
|
||||||
|
function embargo();
|
||||||
|
function embargoUntilDate();
|
||||||
|
function clearEmbargo();
|
||||||
|
function expire();
|
||||||
|
function expireAtDate();
|
||||||
|
function clearExpiry();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user