Skip to content

Commit 2a8e7d5

Browse files
authored
Send reminders to submitters of private data on Panorama Public (#566)
- Send automated reminders to submitters of private datasets. - Reminders can be enabled, and properties such as "delay until first reminder", "reminder frequency" and "extension duration" can be configured via the Panorama Public Admin Console, - The Admin Console also provides an option to send reminders manually. - Submitters can request an extension of the private data status or request deletion of their data from Panorama Public. - Links to request extension or deletion are included in the reminder message. - Extension and deletion requests by the submitter are posted to the data message thread for record keeping. - Escape tilde (~) when generating notification messages. In the LabKey Markdown flavor, text between single tildes as well as double tildes is rendered as strikethrough.
1 parent fdd9960 commit 2a8e7d5

23 files changed

+2932
-32
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CREATE TABLE panoramapublic.DatasetStatus
2+
(
3+
_ts TIMESTAMP,
4+
Id SERIAL NOT NULL,
5+
CreatedBy USERID,
6+
Created TIMESTAMP,
7+
ModifiedBy USERID,
8+
Modified TIMESTAMP,
9+
10+
ShortUrl ENTITYID NOT NULL,
11+
LastReminderDate TIMESTAMP,
12+
ExtensionRequestedDate TIMESTAMP,
13+
DeletionRequestedDate TIMESTAMP,
14+
15+
CONSTRAINT PK_DatasetStatus PRIMARY KEY (Id),
16+
17+
CONSTRAINT FK_DatasetStatus_ShortUrl FOREIGN KEY (ShortUrl) REFERENCES core.shorturl (entityId),
18+
19+
CONSTRAINT UQ_DatasetStatus_ShortUrl UNIQUE (ShortUrl)
20+
);
21+
CREATE INDEX IX_DatasetStatus_ShortUrl ON panoramapublic.DatasetStatus(ShortUrl);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- ------------------------------------------------------------------------
2+
-- Replace the ShortUrl column with an ExperimentAnnotationsId column.
3+
-- ------------------------------------------------------------------------
4+
5+
-- Add ExperimentAnnotationsId column as nullable first
6+
ALTER TABLE panoramapublic.DatasetStatus ADD COLUMN ExperimentAnnotationsId INT;
7+
8+
-- Populate the column by matching ShortUrl values
9+
UPDATE panoramapublic.DatasetStatus
10+
SET ExperimentAnnotationsId = ea.Id
11+
FROM panoramapublic.ExperimentAnnotations ea
12+
WHERE ea.ShortUrl = panoramapublic.DatasetStatus.ShortUrl;
13+
14+
-- Delete rows that couldn't be matched (where ExperimentAnnotationsId is still null)
15+
DELETE FROM panoramapublic.DatasetStatus WHERE ExperimentAnnotationsId IS NULL;
16+
17+
-- Now make ExperimentAnnotationsId NOT NULL
18+
ALTER TABLE panoramapublic.DatasetStatus ALTER COLUMN ExperimentAnnotationsId SET NOT NULL;
19+
20+
-- Add constraints and index
21+
ALTER TABLE panoramapublic.DatasetStatus ADD CONSTRAINT FK_DatasetStatus_ExperimentAnnotations FOREIGN KEY (ExperimentAnnotationsId) REFERENCES panoramapublic.ExperimentAnnotations(Id);
22+
ALTER TABLE panoramapublic.DatasetStatus ADD CONSTRAINT UQ_DatasetStatus_ExperimentAnnotations UNIQUE (ExperimentAnnotationsId);
23+
CREATE INDEX IX_DatasetStatus_ExperimentAnnotations ON panoramapublic.DatasetStatus(ExperimentAnnotationsId);
24+
25+
-- Drop old constraints and index
26+
ALTER TABLE panoramapublic.DatasetStatus DROP CONSTRAINT FK_DatasetStatus_ShortUrl;
27+
ALTER TABLE panoramapublic.DatasetStatus DROP CONSTRAINT UQ_DatasetStatus_ShortUrl;
28+
DROP INDEX panoramapublic.IX_DatasetStatus_ShortUrl;
29+
30+
-- Finally drop the ShortUrl column
31+
ALTER TABLE panoramapublic.DatasetStatus DROP COLUMN ShortUrl;
32+

panoramapublic/resources/schemas/panoramapublic.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,4 +832,38 @@
832832
<column columnName="Approved"/>
833833
</columns>
834834
</table>
835+
<table tableName="DatasetStatus" tableDbType="TABLE">
836+
<columns>
837+
<column columnName="_ts">
838+
<isHidden>true</isHidden>
839+
</column>
840+
<column columnName="Created">
841+
<isHidden>true</isHidden>
842+
</column>
843+
<column columnName="CreatedBy">
844+
<fk>
845+
<fkColumnName>UserId</fkColumnName>
846+
<fkDbSchema>core</fkDbSchema>
847+
<fkTable>UsersData</fkTable>
848+
</fk>
849+
<isHidden>true</isHidden>
850+
</column>
851+
<column columnName="Modified">
852+
<isHidden>true</isHidden>
853+
</column>
854+
<column columnName="ModifiedBy">
855+
<fk>
856+
<fkColumnName>UserId</fkColumnName>
857+
<fkDbSchema>core</fkDbSchema>
858+
<fkTable>UsersData</fkTable>
859+
</fk>
860+
<isHidden>true</isHidden>
861+
</column>
862+
<column columnName="Id"/>
863+
<column columnName="ExperimentAnnotationsId" />
864+
<column columnName="LastReminderDate" />
865+
<column columnName="ExtensionRequestedDate" />
866+
<column columnName="DeletionRequestedDate"/>
867+
</columns>
868+
</table>
835869
</tables>

0 commit comments

Comments
 (0)