Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATE TABLE `TemplateRevision` (
  `studyId` VARCHAR(255) NOT NULL,
  `guid` VARCHAR(60) NOT NULL,
  `createdOn` BIGINT UNSIGNED NULL,
  `createdBy` VARCHAR(255) NOT NULL,
  `storagePath` VARCHAR(255) NOT NULL,
  `subject` VARCHAR(255) NULL,
  `mimeType` ENUM('HTML', 'TEXT') NULL,
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

REST API

All are accessible to developers, workers should be able to get published revision of whatever:

GET    /v3/templates?type=<type>
    get documents of type (type parameter is required)
POST   /v3/templates
    create new document with a single default revision with default content
GET    /v3/templates/<guid>
    get specific document
POST   /v3/templates/<guid>
    update specific document (not revisioned, but optimistically locked)
DELETE /v3/templates/<guid>?physical=true
    delete specific document (logical or physical); probably just leaves revisions on S3
GET    /v3/templates/<guid>/revisions
    get the revisions for a document (createdOn DESC) for history of edits
POST   /v3/templates/<guid>/revisions
    create a new revision of the given document (cannot update an existing revision)
GET    /v3/templates/<guid>/revisions/<createdOn>
    get a specific revision of a document
POST   /v3/templates/<guid>/revisions/<createdOn>/publish
    publish this revision as the revision to use when the document is selected