MAJOR: adding namespaces

This commit is contained in:
thiemen 2019-04-23 18:19:36 +12:00
parent 2262eadad6
commit a5fe10acac
25 changed files with 310 additions and 0 deletions

25
.upgrade.yml Normal file
View File

@ -0,0 +1,25 @@
mappings:
DMS: Sunnysideup\DMS\DMS
DMSShortcodeHandler: Sunnysideup\DMS\DMSShortcodeHandler
MigrateToDocumentSetsTask: Sunnysideup\DMS\Tasks\MigrateToDocumentSetsTask
DMSJsonField: Sunnysideup\DMS\Forms\DMSJsonField
DMSGridFieldAddNewButton: Sunnysideup\DMS\Cms\DMSGridFieldAddNewButton
DMSUploadField_ItemHandler: Sunnysideup\DMS\Cms\DMSUploadField_ItemHandler
DMSGridFieldEditButton: Sunnysideup\DMS\Cms\DMSGridFieldEditButton
DMSDocumentAddExistingField: Sunnysideup\DMS\Cms\DMSDocumentAddExistingField
DocumentHTMLEditorFieldToolbar: Sunnysideup\DMS\Cms\DocumentHTMLEditorFieldToolbar
DMSDocumentAddController: Sunnysideup\DMS\Cms\DMSDocumentAddController
DMSUploadField: Sunnysideup\DMS\Cms\DMSUploadField
DMSDocumentAdmin: Sunnysideup\DMS\Cms\DMSDocumentAdmin
DMSGridFieldDetailForm_ItemRequest: Sunnysideup\DMS\Cms\DMSGridFieldDetailForm_ItemRequest
DMSInterface: Sunnysideup\DMS\Interface\DMSInterface
DMSDocumentInterface: Sunnysideup\DMS\Interface\DMSDocumentInterface
DMSDocumentTaxonomyExtension: Sunnysideup\DMS\Extensions\DMSDocumentTaxonomyExtension
DMSTaxonomyTypeExtension: Sunnysideup\DMS\Extensions\DMSTaxonomyTypeExtension
DMSSiteTreeExtension: Sunnysideup\DMS\Extensions\DMSSiteTreeExtension
FileNotFoundException: Sunnysideup\DMS\Exceptions\FileNotFoundException
DMSDocument_versions: Sunnysideup\DMS\Model\DMSDocument_versions
DMSDocument: Sunnysideup\DMS\Model\DMSDocument
DMSDocument_Controller: Sunnysideup\DMS\Model\DMSDocument_Controller
DMSDocumentSet: Sunnysideup\DMS\Model\DMSDocumentSet
ShortCodeRelationFinder: Sunnysideup\DMS\Tools\ShortCodeRelationFinder

View File

@ -1,5 +1,27 @@
<?php
namespace Sunnysideup\DMS\Cms;
use LeftAndMain;
use SiteTree;
use DMSDocumentSet;
use Requirements;
use Form;
use FieldList;
use TabSet;
use Tab;
use LiteralField;
use HiddenField;
use Controller;
use ArrayData;
use CMSPageEditController;
use Convert;
use DMSDocument;
use Config;
use Member;
use Permission;
/**
* @package dms
*/

View File

@ -1,5 +1,12 @@
<?php
namespace Sunnysideup\DMS\Cms;
use CompositeField;
use TreeDropdownField;
use Requirements;
class DMSDocumentAddExistingField extends CompositeField
{
public $useFieldContext = true;

View File

@ -1,5 +1,14 @@
<?php
namespace Sunnysideup\DMS\Cms;
use ModelAdmin;
use Requirements;
use CMSForm;
use GridField;
use SiteTree;
class DMSDocumentAdmin extends ModelAdmin
{
private static $managed_models = array(

View File

@ -1,5 +1,15 @@
<?php
namespace Sunnysideup\DMS\Cms;
use GridFieldAddNewButton;
use GridField_HTMLProvider;
use Controller;
use DMSDocumentSet;
use CMSPageEditController;
use ArrayData;
class DMSGridFieldAddNewButton extends GridFieldAddNewButton implements GridField_HTMLProvider
{
/**

View File

@ -1,5 +1,11 @@
<?php
namespace Sunnysideup\DMS\Cms;
use GridFieldDetailForm_ItemRequest;
use ShortCodeRelationFinder;
/**
* Custom ItemRequest class the provides custom delete behaviour for the CMSFields of DMSDocument
*/

View File

@ -1,5 +1,13 @@
<?php
namespace Sunnysideup\DMS\Cms;
use GridFieldEditButton;
use GridField_ColumnProvider;
use ArrayData;
use Controller;
class DMSGridFieldEditButton extends GridFieldEditButton implements GridField_ColumnProvider
{

View File

@ -1,5 +1,23 @@
<?php
namespace Sunnysideup\DMS\Cms;
use UploadField;
use DMS;
use DMSDocument;
use DMSDocumentSet;
use SS_HTTPRequest;
use SS_Object;
use Exception;
use SS_HTTPResponse;
use Convert;
use ArrayList;
use Requirements;
use FieldList;
use FormAction;
use Validator;
/**
* Field for uploading files into a DMSDocument. Replacing the existing file.
* Not ideally suited for the purpose, as the base implementation

View File

@ -1,5 +1,12 @@
<?php
namespace Sunnysideup\DMS\Cms;
use UploadField_ItemHandler;
use DMSDocument;
use Form;
class DMSUploadField_ItemHandler extends UploadField_ItemHandler
{
private static $allowed_actions = array(

View File

@ -1,4 +1,12 @@
<?php
namespace Sunnysideup\DMS\Cms;
use Extension;
use Form;
use HiddenField;
use DMS;
/**
* Extends the original toolbar with document picking capability - modified lines are commented.
*/

View File

@ -1,4 +1,15 @@
<?php
namespace Sunnysideup\DMS;
use SS_Object;
use DMSInterface;
use Director;
use FileNotFoundException;
use DMSDocument;
use SiteTree;
use Config;
class DMS extends SS_Object implements DMSInterface
{
/**

View File

@ -1,5 +1,12 @@
<?php
namespace Sunnysideup\DMS;
use ShortcodeParser;
use DMSDocument;
use ErrorPage;
/**
* Handles replacing `dms_document_link` shortcodes with links to the actual
* document.

View File

@ -1,4 +1,9 @@
<?php
namespace Sunnysideup\DMS\Exceptions;
use Exception;
/**
* Simple exception extension so that we can tell the difference between internally
* raised exceptions and those thrown by DMS.

View File

@ -1,5 +1,14 @@
<?php
namespace Sunnysideup\DMS\Extensions;
use DataExtension;
use FieldList;
use ListboxField;
use TaxonomyTerm;
use Config;
/**
* ### @@@@ START REPLACEMENT @@@@ ###

View File

@ -1,5 +1,19 @@
<?php
namespace Sunnysideup\DMS\Extensions;
use DataExtension;
use FieldList;
use Permission;
use Member;
use GridField;
use GridFieldConfig_RelationEditor;
use DMSDocumentSet;
use Deprecation;
use ArrayList;
use Versioned;
/**
* @package dms
*/

View File

@ -1,4 +1,11 @@
<?php
namespace Sunnysideup\DMS\Extensions;
use DataExtension;
use Config;
use TaxonomyType;
/**
* Creates default taxonomy type records if they don't exist already
*/

View File

@ -1,5 +1,12 @@
<?php
namespace Sunnysideup\DMS\Forms;
use CompositeField;
use FieldList;
use Convert;
/**
* Combines form inputs into a key-value pair
*/

View File

@ -1,4 +1,9 @@
<?php
namespace Sunnysideup\DMS\Interface;
/**
* Interface for a DMSDocument used in the Document Management System. A DMSDocument is create by storing a File
* object in an instance of the DMSInterface. All write operations on the DMSDocument create a new relation, so we

View File

@ -1,4 +1,9 @@
<?php
namespace Sunnysideup\DMS\Interface;
use SiteTree;
/**
* 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

View File

@ -1,5 +1,51 @@
<?php
namespace Sunnysideup\DMS\Model;
use DataObject;
use DMSDocumentInterface;
use Member;
use Permission;
use DB;
use URLSegmentFilter;
use Controller;
use Director;
use Versioned;
use SS_Datetime;
use DBField;
use Exception;
use DMS;
use Requirements;
use FieldList;
use ShortCodeRelationFinder;
use TextField;
use TextareaField;
use UploadField;
use Config;
use OptionsetField;
use DMSUploadField;
use GridFieldConfig;
use GridFieldToolbarHeader;
use GridFieldSortableHeader;
use GridFieldDataColumns;
use GridFieldPaginator;
use GridFieldDetailForm;
use GridField;
use DatetimeField;
use FieldGroup;
use LiteralField;
use DropdownField;
use CompositeField;
use File;
use ReadonlyField;
use DateField_Disabled;
use ArrayList;
use GridFieldConfig_RelationEditor;
use DMSGridFieldEditButton;
use GridFieldAddExistingAutocompleter;
use Convert;
/**
* @package dms
*

View File

@ -1,4 +1,40 @@
<?php
namespace Sunnysideup\DMS\Model;
use DataObject;
use FieldList;
use LiteralField;
use GridFieldConfig;
use GridFieldButtonRow;
use GridFieldToolbarHeader;
use GridFieldFilterHeader;
use GridFieldSortableHeader;
use GridFieldDataColumns;
use DMSGridFieldEditButton;
use GridFieldDeleteAction;
use GridFieldDetailForm;
use GridFieldPaginatorWithShowAll;
use GridFieldPaginator;
use GridFieldSortableRows;
use GridFieldOrderableRows;
use CMSPageEditController;
use Controller;
use GridField;
use DMSGridFieldAddNewButton;
use HiddenField;
use DMS;
use Requirements;
use Member;
use ListboxField;
use DMSJsonField;
use FieldGroup;
use DropdownField;
use Convert;
use DataList;
use SS_Datetime;
use Permission;
/**
* A document set is attached to Pages, and contains many DMSDocuments
*

View File

@ -1,5 +1,15 @@
<?php
namespace Sunnysideup\DMS\Model;
use Controller;
use Versioned;
use Convert;
use DataObject;
use InvalidArgumentException;
use SS_HTTPRequest;
class DMSDocument_Controller extends Controller
{
/**

View File

@ -1,5 +1,15 @@
<?php
namespace Sunnysideup\DMS\Model;
use DataObject;
use Controller;
use Director;
use DMS;
use File;
use DB;
/**
* DataObject to store versions of uploaded Documents.
*

View File

@ -1,4 +1,14 @@
<?php
namespace Sunnysideup\DMS\Tasks;
use BuildTask;
use SiteTree;
use SQLSelect;
use DMSDocument;
use DMSDocumentSet;
use Director;
/**
* This build task helps to migrate DMS data structures from DMS 1.x to 2.x which introduces document sets.
*

View File

@ -1,4 +1,12 @@
<?php
namespace Sunnysideup\DMS\Tools;
use DataList;
use DMS;
use ClassInfo;
use DataObject;
/**
* Finds {@link DataObject} instances using certain shortcodes
* by fulltext-querying only fields which are capable of parsing shortcodes.