silverstripe-dms/docs/en/changelogs/2.0.0.md
Robbie Averill e4bc553521 API Add document sets, remove *Page methods from DMSDocument
* Add 2.0.0 changelog
* Update DMSInterface and DMSDocumentInterface removing *page and adding getDocumentSetsByPage to DMSInterface
* Update use documentation and update unit tests

This commit changes the relationship from Pages has_many Documents to Pages has_many DocumentSets which are many_many to Documents. The upload field has been upated to attach documents to a set instead of a page, the tests updated and the DMSInterface and DMSDocumentInterface updated to be less relevant to pages and more relevant to document sets.
2017-05-09 13:04:29 +12:00

1.7 KiB

2.0.0 (unreleased)

Document sets

Documents now belong to "sets", which are attached to Pages. A Page can have many Document Sets, and a Set has a many_many relationship with Documents.

When upgrading from 1.x to 2.x you will need to migrate the relationships from your Pages to Documents so support having a Document Set intermediary (@todo Add a build task for this).

API changes

  • DMSSiteTreeExtension::no_documents_tab removed, use YAML configuration MyPage.documents_enabled: false instead
  • DMSSiteTreeExtension::show_documents_tab removed, use YAML configuration MyPage.documents_enabled: true instead
  • DMSSiteTreeExtension::PageDocuments removed, use DMSSiteTreeExtension::getDocumentSets instead
  • DMSSiteTreeExtension::getDocuments removed, use DMSSiteTreeExtension::getAllDocuments instead
  • DMSDocument::addPage removed, use document sets instead
  • DMSDocument::addPages removed, use document sets instead
  • DMSDocument::removePage removed, use document sets instead
  • DMSDocument::removeAllPages removed, use document sets instead
  • DMSDocument::getPages removed, use DMSDocument::getRelatedPages instead
  • DMSDocumentInterface has had the page manipulation methods removed, as above
  • DMSDocumentAddController::add_allowed_extensions removed, use YAML configuration DMSDocumentAddController::allowed_extensions instead
  • DMSInterface (and DMS) are stricter in the getByPage method, enforcing a SiteTree type hint
  • New method DMSInterface::getDocumentSetsByPage (and in DMS)

Template changes

The default template entry point is now DocumentSets.ss (previously Documents.ss). As well as this change, Documents.ss has been renamed to DocumentSet.ss.