-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.json
204 lines (204 loc) · 6.1 KB
/
config.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
"name": "REDCap_Notifications_API",
"namespace": "Stanford\\RedcapNotificationsAPI",
"description": "Notification System that can display messages to REDCap users",
"documentation": "README.md",
"authors": [
{
"name": "Irvin Szeto",
"email": "[email protected]",
"institution": "Stanford University"
},
{
"name": "Jordan Schulz",
"email": "[email protected]",
"institution": "Stanford University"
},
{
"name": "Ihab Zeedia ",
"email": "[email protected]",
"institution": "Stanford University"
}
],
"framework-version": 14,
"no-auth-pages": [
"ajax/rules"
],
"enable-every-page-hooks-on-system-pages": true,
"links": {
"project": [
],
"control-center": [
{
"name": "Test Page",
"icon": "pencil",
"url": "pages/TestPage.php",
"show-header-and-footer": true
},
{
"name": "DemoNote",
"icon": "pencil",
"url": "pages/DemoNote.php",
"show-header-and-footer": true
}
]
},
"enable-ajax-logging": true,
"auth-ajax-actions": [
"MyAction",
"get_full_payload",
"check_forced_refresh",
"save_dismissals"
],
"no-auth-ajax-actions": [
"MyAction",
"refresh",
"dismiss",
"force_refresh"
],
"project-settings": [
{
"key": "enable-project-debug-logging",
"name": "<b>Enable Debug Logging</b><br><i>(optional)</i> Requires installation and configuration of emLogger",
"required": false,
"type": "checkbox"
},
{
"key": "description",
"name": "<h6 style='text-align:center;color:red'><b>Notifications Rules</b></h6>. This feature automates notification distribution to specific projects. First, create a REDCap notification record containing your message. Second, define the source of project IDs: write an SQL query to pull a list or add a URI that returns an array of project IDs. A REDCap cron will then run hourly to retrieve the list and update the notification record's project IDs. ",
"type": "descriptive"
},
{
"key": "notification-rules",
"name": "<b>Notifications Rules</b>",
"required": false,
"type": "sub_settings",
"repeatable": true,
"sub_settings": [
{
"key": "notification_record_id",
"name": "<b>Notification Record Id where Project Ids list will be saved.</b><br/>",
"required": false,
"type": "text"
},
{
"key": "api_endpoint",
"name": "<b>URL to Endpoint to pull Project IDs list. </b><br/>",
"required": false,
"type": "textarea"
},
{
"key": "api_endpoint_body",
"name": "<b>Request body (has to be a valid JSON Object). </b><br/>",
"required": false,
"type": "textarea"
},
{
"key": "sql_query",
"name": "<b>SQL Query to pull list of Project IDs. </b><br/>",
"required": false,
"type": "textarea"
},
{
"key": "excluded_notification_record_id",
"name": "<b>Notification Record Id where PIDs will be excluded from this notification.</b><br/>",
"required": false,
"type": "text"
}
]
}
],
"system-settings": [
{
"key": "header",
"name": "<h6><b>REDCap Notification EM</b></h6></div>",
"type": "descriptive"
},
{
"key": "notification-cache",
"name": "Where do you want to cache notifications? (Default: Database)",
"type": "dropdown",
"choices": [
{
"name": "Database",
"value": "database"
},
{
"name": "Redis",
"value": "redis"
}
]
},
{
"key": "redis-host",
"name": "Redis Host",
"required": true,
"type": "text",
"branchingLogic": {
"field": "notification-cache",
"value": "redis"
}
},
{
"key": "redis-port",
"name": "Redis Port",
"required": true,
"type": "text",
"branchingLogic": {
"field": "notification-cache",
"value": "redis"
}
},
{
"key": "instructions",
"name": "<b>For First time setup</b><p>Please check the boxes above to enable this EM on all projects by default and to hide this EM from all non-admins</i></div>",
"type": "descriptive"
},
{
"key": "notification-pid",
"name": "<b>Notifications PID</b><i></i> Project ID where notifications are created and stored",
"required": true,
"type": "project-id"
},
{
"key": "enable-system-debug-logging",
"name": "<b>Enable Debug Logging (system-wide)</b><i>(optional)</i> Requires installation and configuration of emLogger",
"required": false,
"type": "checkbox"
},
{
"key": "max-expiry-days",
"name": "<b>Max number of days notifications will be displayed</b><i></i> If an expiry date is not entered, the notification will expire after this many days",
"required": true,
"type": "text"
},
{
"key": "user-specific-log-list",
"name": "<b>Comma separated List of UserIDs to trigger custom debugs</b><i></i> We are tryign to figure out why a subset of userids are triggering callbacks every 30 seconds instead of honoring the 6 hour grace time",
"required": false,
"type": "note"
}
],
"crons": [
{
"cron_name": "cleanup_expired_database_notifications",
"cron_description": "Daily cron to delete expired notifications saved in the Database cache. ",
"method": "cleanupExpiredDatabaseNotifications",
"cron_frequency": "86400",
"cron_max_run_time": "3600"
},
{
"cron_name": "execute_notifications_rules",
"cron_description": "A daily cron to check Notifications rules and update Project IDs list for each rule. ",
"method": "cronNotificationsRules",
"cron_frequency": "86400",
"cron_max_run_time": "3600"
}
],
"compatibility": {
"php-version-min": "",
"php-version-max": "",
"redcap-version-min": "",
"redcap-version-max": ""
}
}