Versions Compared

Key

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

Requirements

See BRIDGE-2485, BRIDGE-647, BRIDGE-769, BRIDGE-453, BRIDGE-2382, BRIDGE-2383

...

CREATE TABLE `TemplateRevision` (
  `templateGuid` 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,
  PRIMARY_KEY (`guid``templateGuid`, `createdOn`)
  CONSTRAINT `Templates-Guid-Constraint`
    FOREIGN KEY (`templateGuid`) REFERENCES `Templates` (`guid`) ON DELETE CASCADE

) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

...

Sorry the formatting here is difficult to read, due to Jira.

public interface TemplateService {

    /**

     * Given a criteria context and a template type, return all the templates that match. If one is found through a

...

    Template getTemplateForUser(CriteriaContext context, TemplateType type);


    /** Get all the templates for a given type. (I am assuming this will not need to be paged). */

    List<Template> getTemplatesForType(StudyIdentifier studyId, TemplateType type, boolean includeDeleted);


    /** Get a specific template. */

    Template getTemplate(StudyIdentifier studyId, String guid);


    /** Create a new template. */

    GuidVersionHolder createTemplate(StudyIdentifier studyId, TemplateService template);


    /**

     * Update a template. You can delete it logically, and change the published revision of the associated document with this call as well.

...

    GuidVersionHolder updateTemplate(StudyIdentifier studyId, TemplateService template);


    /** Mark a template as deleted. */

    void deleteTemplate(StudyIdentifier studyId, String guid);


    /** Physically delete the template and all its revisions. */

    void deleteTemplatePermanently(StudyIdentifier studyId, String guid);


    /** Get a page of revisions from a SQL-type data store. These would not load the document contents from S3 or would not load the

...

    PagedResourceList<TemplateRevision> getTemplateRevisions(StudyIdentifier studyId, String guid,

            int offsetBy, int pageSize);


    /** Get a specific revision. */

    TemplateRevision getTemplateRevision(StudyIdentifier studyId, String guid, long createdOn);


    /** Create a new revision (this should fail if the createdOn timestamp for a given studyId and GUID already exists). */

    CreatedOnHolder createTemplateRevision(StudyIdentifier studyId, TemplateRevision templateRevision);

}

Migration

Can be done in four deployments:

...