Requirements
See BRIDGE-2485, BRIDGE-647, BRIDGE-769, BRIDGE-453, BRIDGE-2382, BRIDGE-2383
- The ability to select templates (like the email address verification email) by criteria such as the user's language, or the version of the app;
- The ability to clearly specify the template that should be used if the criteria filtering is ambiguous (unlike app configurations where we just take the first one);
- The ability to audit changes to templates (like study consents, which create immutable revisions... just record who created the revision);
- The possibility later to create custom templates that can be used with scheduling or notifications (right now, you have to manage these outside the system and can't schedule anything);
- The possibility later to add additional documents (the privacy document has long been considered, because it's required to submit an app to the App Store);
- Should replace the templates on the study object; could conceivably replace the study consent documents as well;
...
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
...
TemplateService getTemplateForUser(CriteriaContext context, TemplateType type);
/** Get all the templates for a given type. (I am assuming this will not need to be paged). */
List<TemplateService> getTemplatesForType(StudyIdentifier studyId, TemplateType type);
/** Get a specific template. */
TemplateService getTemplate(StudyIdentifier studyId, String guid);
/** Create a new template. */
GuidVersionHolder createTemplate(StudyIdentifier studyId, TemplateService template);
/**
* Update a template. You can delete it logically, change the published revision of the associated document, and you
...
GuidVersionHolder updateTemplate(StudyIdentifier studyId, TemplateService template);
/** Delete a template. */
void deleteTemplate(StudyIdentifier studyId, String guid);
/** Physically delete the template (probably leaving the revisions). */
void deleteTemplatePermanently(StudyIdentifier studyId, String guid);
/** Get a page of revisions from a SQL-type data store. */
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 three deployments:
...