\MigrateToDocumentSetsTask
This build task helps to migrate DMS data structures from DMS 1.x to 2.x which introduces document sets.
See the "document-sets.md" migration guide for more information and use examples.
Synopsis
class MigrateToDocumentSetsTask
extends BuildTask
{
- // members
- protected string $title = 'DMS 2.0 Migration Tool';
- protected string $description = 'Migration tool for upgrading from DMS 1.x to 2.x. Add "action=create-default-document-set" to create a default set. "reassign-documents" to reassign legacy document relations. "dryrun=1" to show changes without writing.';
- protected array $validActions = ;
- protected SS_HTTPRequest $request;
- protected array $results = ;
- // methods
- public void run()
- public bool isDryrun()
- protected $this createDefaultSet()
- protected $this reassignDocuments()
- protected $this addDefaultDocumentSet()
- protected $this addDocumentToSet()
- protected $this outputHeader()
- protected $this outputResults()
- protected $this addResult()
- public $this output()
- protected bool isCli()
Hierarchy
Extends
- BuildTask
Members
protected
- $description
- $request — SS_HTTPRequest
- $results
—
array
Holds number of pages/sets/documents processed for output at the end. Example: - $title
- $validActions
—
array
The valid actions that this task can perform (and the method that does them as the key)
Methods
protected
- addDefaultDocumentSet() — Create a "default" document set and add it to the given Page via the ORM relationship added by {@link DMSSiteTreeExtension}
- addDocumentToSet() — Add the given document to the given document set
- addResult() — Add the $increment to the result key identified by $key
- createDefaultSet() — Creates a default document set for any valid page that doesn't have one
- isCli() — Returns whether the task is called via CLI or not
- outputHeader() — Output a header info line
- outputResults() — Output a "finished" notice and the results of what was done
- reassignDocuments() — Reassign documents to the default document set, where they'd previously have been assigned to pages
public
- isDryrun() — Returns whether dryrun mode is enabled ("dryrun=1")
- output() — Outputs a message formatted either for CLI or browser output
- run()