@abgov/adsp-sdk-mcp-server 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +51 -0
  2. package/assets/docs/architecture.md +79 -0
  3. package/assets/docs/getting-started.md +118 -0
  4. package/assets/docs/important-notes.md +47 -0
  5. package/assets/docs/index.md +9 -0
  6. package/assets/docs/platform/deployment.md +80 -0
  7. package/assets/docs/platform/getting-started.md +66 -0
  8. package/assets/docs/platform/operations.md +8 -0
  9. package/assets/docs/platform/platform-django-sdk.md +330 -0
  10. package/assets/docs/platform/platform-dotnet-sdk.md +457 -0
  11. package/assets/docs/platform/platform-flask-sdk.md +355 -0
  12. package/assets/docs/platform/platform-node-sdk.md +433 -0
  13. package/assets/docs/platform/platform-spring-sdk.md +344 -0
  14. package/assets/docs/platform/platform.md +8 -0
  15. package/assets/docs/services/access-service.md +75 -0
  16. package/assets/docs/services/agent-service.md +316 -0
  17. package/assets/docs/services/cache-service.md +61 -0
  18. package/assets/docs/services/calendar-service.md +86 -0
  19. package/assets/docs/services/comment-service.md +87 -0
  20. package/assets/docs/services/configuration-service.md +92 -0
  21. package/assets/docs/services/directory-service.md +57 -0
  22. package/assets/docs/services/event-service.md +122 -0
  23. package/assets/docs/services/feedback-service.md +152 -0
  24. package/assets/docs/services/file-service.md +164 -0
  25. package/assets/docs/services/form-service.md +149 -0
  26. package/assets/docs/services/notification-service.md +151 -0
  27. package/assets/docs/services/pdf-service.md +116 -0
  28. package/assets/docs/services/pii-service.md +45 -0
  29. package/assets/docs/services/push-service.md +106 -0
  30. package/assets/docs/services/services.md +6 -0
  31. package/assets/docs/services/status-service.md +29 -0
  32. package/assets/docs/services/task-service.md +139 -0
  33. package/assets/docs/services/tenant-service.md +18 -0
  34. package/assets/docs/services/token-handler.md +135 -0
  35. package/assets/docs/services/value-service.md +80 -0
  36. package/assets/docs/services/verify-service.md +61 -0
  37. package/assets/docs/tutorials/access-service/access-service.md +9 -0
  38. package/assets/docs/tutorials/access-service/adsp-clients.md +29 -0
  39. package/assets/docs/tutorials/access-service/application-clients.md +61 -0
  40. package/assets/docs/tutorials/access-service/front-end-access.md +53 -0
  41. package/assets/docs/tutorials/access-service/introduction.md +33 -0
  42. package/assets/docs/tutorials/access-service/tenants.md +68 -0
  43. package/assets/docs/tutorials/access-service/themes.md +43 -0
  44. package/assets/docs/tutorials/feedback-service/accessing-data.md +41 -0
  45. package/assets/docs/tutorials/feedback-service/feedback-service.md +9 -0
  46. package/assets/docs/tutorials/feedback-service/installation.md +142 -0
  47. package/assets/docs/tutorials/feedback-service/introduction.md +28 -0
  48. package/assets/docs/tutorials/feedback-service/security.md +40 -0
  49. package/assets/docs/tutorials/feedback-service/triggering.md +21 -0
  50. package/assets/docs/tutorials/file-service/file-service.md +9 -0
  51. package/assets/docs/tutorials/file-service/file-types.md +35 -0
  52. package/assets/docs/tutorials/file-service/introduction.md +34 -0
  53. package/assets/docs/tutorials/file-service/security.md +31 -0
  54. package/assets/docs/tutorials/file-service/working-with.md +65 -0
  55. package/assets/docs/tutorials/form-service/Integration.md +31 -0
  56. package/assets/docs/tutorials/form-service/ai-agent.md +450 -0
  57. package/assets/docs/tutorials/form-service/building-forms.md +264 -0
  58. package/assets/docs/tutorials/form-service/cheat-sheet.md +1461 -0
  59. package/assets/docs/tutorials/form-service/custom-error-messages.md +87 -0
  60. package/assets/docs/tutorials/form-service/data-registers.md +204 -0
  61. package/assets/docs/tutorials/form-service/file-uploader.md +81 -0
  62. package/assets/docs/tutorials/form-service/form-app.md +72 -0
  63. package/assets/docs/tutorials/form-service/form-editor.md +62 -0
  64. package/assets/docs/tutorials/form-service/form-service.md +9 -0
  65. package/assets/docs/tutorials/form-service/form-submissions.md +77 -0
  66. package/assets/docs/tutorials/form-service/instructions.md +173 -0
  67. package/assets/docs/tutorials/form-service/introduction.md +66 -0
  68. package/assets/docs/tutorials/form-service/repeated-items.md +87 -0
  69. package/assets/docs/tutorials/form-service/security.md +36 -0
  70. package/assets/docs/tutorials/form-service/steppers.md +237 -0
  71. package/assets/docs/tutorials/notification-service/emailAttachment.md +75 -0
  72. package/assets/docs/tutorials/notification-service/events.md +20 -0
  73. package/assets/docs/tutorials/notification-service/introduction.md +37 -0
  74. package/assets/docs/tutorials/notification-service/notification-service.md +9 -0
  75. package/assets/docs/tutorials/notification-service/notification-types.md +86 -0
  76. package/assets/docs/tutorials/notification-service/subscribers.md +33 -0
  77. package/assets/docs/tutorials/pdf-service/building-a-template.md +339 -0
  78. package/assets/docs/tutorials/pdf-service/generate-a-pdf.md +150 -0
  79. package/assets/docs/tutorials/pdf-service/handlebars.md +51 -0
  80. package/assets/docs/tutorials/pdf-service/introduction.md +26 -0
  81. package/assets/docs/tutorials/pdf-service/pdf-service.md +9 -0
  82. package/assets/docs/tutorials/pdf-service/puppeteer.md +25 -0
  83. package/assets/docs/tutorials/pdf-service/video.md +18 -0
  84. package/assets/docs/tutorials/status-service/Introduction.md +46 -0
  85. package/assets/docs/tutorials/status-service/health.md +51 -0
  86. package/assets/docs/tutorials/status-service/notices.md +34 -0
  87. package/assets/docs/tutorials/status-service/notifications.md +107 -0
  88. package/assets/docs/tutorials/status-service/status-service.md +9 -0
  89. package/assets/docs/tutorials/status-service/status.md +35 -0
  90. package/assets/docs/tutorials/status-service/webhooks.md +24 -0
  91. package/assets/docs/tutorials/task-service/introduction.md +23 -0
  92. package/assets/docs/tutorials/task-service/task-app.md +43 -0
  93. package/assets/docs/tutorials/task-service/task-definitions.md +49 -0
  94. package/assets/docs/tutorials/task-service/task-queues.md +67 -0
  95. package/assets/docs/tutorials/task-service/task-service.md +9 -0
  96. package/assets/docs/tutorials/tutorials.md +8 -0
  97. package/package.json +18 -0
  98. package/src/docs/docsRepository.d.ts +22 -0
  99. package/src/docs/docsRepository.js +110 -0
  100. package/src/docs/docsRepository.js.map +1 -0
  101. package/src/main.d.ts +2 -0
  102. package/src/main.js +16 -0
  103. package/src/main.js.map +1 -0
  104. package/src/sdk-reference/reference.d.ts +17 -0
  105. package/src/sdk-reference/reference.js +547 -0
  106. package/src/sdk-reference/reference.js.map +1 -0
  107. package/src/sdk-reference/search.d.ts +6 -0
  108. package/src/sdk-reference/search.js +41 -0
  109. package/src/sdk-reference/search.js.map +1 -0
  110. package/src/server.d.ts +6 -0
  111. package/src/server.js +30 -0
  112. package/src/server.js.map +1 -0
  113. package/src/tools/registerDocsTools.d.ts +3 -0
  114. package/src/tools/registerDocsTools.js +66 -0
  115. package/src/tools/registerDocsTools.js.map +1 -0
  116. package/src/tools/registerQuickstartTool.d.ts +2 -0
  117. package/src/tools/registerQuickstartTool.js +82 -0
  118. package/src/tools/registerQuickstartTool.js.map +1 -0
  119. package/src/tools/registerSdkTools.d.ts +2 -0
  120. package/src/tools/registerSdkTools.js +43 -0
  121. package/src/tools/registerSdkTools.js.map +1 -0
  122. package/src/tools/types.d.ts +12 -0
  123. package/src/tools/types.js +3 -0
  124. package/src/tools/types.js.map +1 -0
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: Custom error messages
3
+ layout: page
4
+ parent: Form Service
5
+ grand_parent: Tutorials
6
+ nav_exclude: false
7
+ ---
8
+
9
+ ### Custom Error Messages
10
+
11
+ To modify the standard default messages that Ajv provides for the error messages such pattern, minLength, maxLength etc to a more user friendly and descriptive error message you will need to modify the data schema in the form definition.
12
+
13
+ There are a couple approaches you can take to customizing the error messages and they involve modifying the data schema.
14
+
15
+ The first approach is to add an `errorMessage` object to the JSON data schema describing the input field. Then map each constraint on the input field to an error message inside the object, as follows:
16
+
17
+ ```
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "firstName": {
22
+ "type": "string",
23
+ "minLength": 2,
24
+ "maxLength": 15,
25
+ "pattern": "^[a-zA-Z]*$",
26
+ "errorMessage": {
27
+ "pattern": "First name must only contain letters. ",
28
+ "minLength": "Minimum length for first name is 2 characters.",
29
+ "maxLength": "Max length for first name is 15 characters."
30
+ }
31
+ }
32
+
33
+ }
34
+ ```
35
+
36
+ If you don't want to override AJV's default error message for some of the constraints, simply leave it out of the errorMessage object.
37
+
38
+ In the example below, only the `pattern` constraint will have a custom error message, while `minLength` and `maxLength` will have the standard Ajv error message.
39
+
40
+ ```
41
+ {
42
+ "type": "object",
43
+ "properties": {
44
+ "firstName": {
45
+ "type": "string",
46
+ "minLength": 2,
47
+ "maxLength": 15,
48
+ "pattern": "^[a-zA-Z]*$",
49
+ "errorMessage": {
50
+ "pattern": "First name must only contain letters."
51
+ }
52
+ }
53
+
54
+ }
55
+ ```
56
+
57
+ In cases where you just want to have a default custom error message for all the constraints in your schema, you can use `_` in the `errorMessage` to define one concise error message for them all.
58
+
59
+ For example:
60
+
61
+ ```
62
+ {
63
+ "type": "object",
64
+ "properties": {
65
+ "firstName": {
66
+ "type": "string",
67
+ "minLength": 2,
68
+ "maxLength": 15,
69
+ "pattern": "^[a-zA-Z]*$",
70
+ "errorMessage": {
71
+ "_": "default error message for first name."
72
+ }
73
+ }
74
+ }
75
+
76
+ ```
77
+
78
+ This will display `default error message for first Name` for the pattern, minLength, maxLength constraints instead of using the standard Ajv error messsages for each constraints.
79
+
80
+ Furthermore, customizing error messages doesnt limit constraint to `pattern`, `maxLength`, `minLength`.
81
+
82
+ Any standard JSON schema keyword that can be used to constraint an input field, such as type or format can have its own custom error messages.
83
+
84
+ The exception to this is that the required field validation for an input is not customizable and
85
+ the error message will always show as {fieldName} is required if it left empty..
86
+
87
+ Please visit [Ajv errors website](https://ajv.js.org/packages/ajv-errors.html) for more information on customizing error messages.
@@ -0,0 +1,204 @@
1
+ ---
2
+ title: Data registers
3
+ layout: page
4
+ parent: Form Service
5
+ grand_parent: Tutorials
6
+ nav_exclude: false
7
+ ---
8
+
9
+ To setup data registers that can populate drop down list there is two areas that you must do to
10
+ achieve this.
11
+
12
+ - [Data registers](#data-registers)
13
+ - [Data register context](#context)
14
+
15
+ <h3 id="data-registers">Data registers</h3>
16
+
17
+ When there is a need to retrieve a list of values that are needed to populate a drop down from an external data source.
18
+ We have two options to accomplish this operation.
19
+
20
+ <ol>
21
+ <li>
22
+ Using ADSP Configuration service by adding a configuration definition to retrieving the list of values.
23
+ </li>
24
+ <li>
25
+ Provide a URL REST API endpoint to retrieve the list of values.
26
+ </li>
27
+ </ol>
28
+
29
+ ### Using Configuration service - defining the JSON payload schema
30
+
31
+ #### Example 1:
32
+
33
+ In this example we are only accepting array of string values.
34
+
35
+ ```
36
+ {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ },
41
+ "required": [],
42
+ "additionalProperties": true
43
+ }
44
+ ```
45
+
46
+ #### Example 2:
47
+
48
+ In this example, we are defining a couple properties called "label" and "value" which is usually part of
49
+ a drop down for array object.
50
+
51
+ ```
52
+ {
53
+ "type": "array",
54
+ "items": {
55
+ "type": "object",
56
+ "properties": {
57
+ "value": {
58
+ "type": "string"
59
+ },
60
+ "label": {
61
+ "type": "string"
62
+ }
63
+ }
64
+ },
65
+ "properties": {},
66
+ "required": [],
67
+ "additionalProperties": true
68
+ }
69
+ ```
70
+
71
+ Once you have defined your schema you will go to the Configuration Service &rarr; Revisions tab and select the configuration definition from the drop down and click on the edit button and enter the data for the list of values.
72
+
73
+ This example maps to example 1 from the schema above:
74
+
75
+ ```
76
+ [
77
+ "value1",
78
+ "value2",
79
+ "value3",
80
+ ]
81
+ ```
82
+
83
+ This example maps to example 2 from the schema above that has "label" and "value" as a property.
84
+
85
+ ```
86
+ [
87
+ {
88
+ "label": "label 1",
89
+ "value": "value 1"
90
+ },
91
+ {
92
+ "label": "label 2",
93
+ "value": "value 2"
94
+ }
95
+ ]
96
+ ```
97
+
98
+ Once you have configured the configuration service schema for your data registers you are ready to go to the form editor and make modifications to your UI and data schema to include your data registers on the file upload control.
99
+
100
+ #### Data schema
101
+
102
+ ```
103
+ {
104
+ "type": "object",
105
+ "properties": {
106
+ "provinces": {
107
+ "type": "string",
108
+ "enum": [
109
+ ""
110
+ ]
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ #### UI schema
117
+
118
+ For the UI schema there are two methods that you use to populate your drop down.
119
+
120
+ The first method is to use the Configuration service and use the data register configuration service using the URN.
121
+
122
+ The example below shows what the UI schema you would need.
123
+
124
+ ```
125
+ {
126
+ "type": "Control",
127
+ "scope": "#/properties/provinces",
128
+ "label": "Province",
129
+ "options": {
130
+ "register": {
131
+ "urn": "urn:ads:platform:configuration:v2:/configuration/public-register/public-register-1"
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ Please refer to [Configuration service](/adsp-monorepo/services/configuration-service.html) for more details.
138
+
139
+ The second method is to use an external REST API endpoint to retrieve data to populate the drop down.
140
+
141
+ For example, the following is a JSON returned back from the REST API
142
+
143
+ ```
144
+ [
145
+ {
146
+ "codigo": "1",
147
+ "nome": "Acura"
148
+ }
149
+ ]
150
+ ```
151
+
152
+ The `objectPathInArray` property is used to populate the label and value for the drop down item. So from the above JSON object 'nome' will be the property that is used to populate the label and value for the drop down item.
153
+
154
+ ```
155
+ {
156
+ "type": "Control",
157
+ "scope": "#/properties/cars",
158
+ "options": {
159
+ "register": {
160
+ "url": "https://parallelum.com.br/fipe/api/v1/carros/marcas",
161
+ "objectPathInArray": "nome"
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ <h3 id="context"> Data register context</h3>
168
+
169
+ In conjunction with setting up data registers through the configuration service or through an external endpoint. We will need to add in the ADSP context for the data registers through React code.
170
+
171
+ ```typescript
172
+ import { GoARenderers, createDefaultAjv, JsonFormRegisterProvider } from '@abgov/jsonforms-components';
173
+ ```
174
+
175
+ ```typescript
176
+ export const populateDropdown = (schema, enumerators) => {
177
+ const newSchema = JSON.parse(JSON.stringify(schema));
178
+
179
+ Object.keys(newSchema.properties || {}).forEach((propertyName) => {
180
+ const property = newSchema.properties || {};
181
+ if (property[propertyName]?.enum?.length === 1 && property[propertyName]?.enum[0] === '') {
182
+ property[propertyName].enum = enumerators?.getFormContextData(propertyName) as string[];
183
+ }
184
+ });
185
+
186
+ return newSchema as JsonSchema;
187
+ };
188
+ ```
189
+
190
+ ```jsx
191
+ const enumerators = useContext(JsonFormContext) as enumerators;
192
+ <JsonFormRegisterProvider defaultRegisters={definition?.registerData || []}>
193
+ <JsonForms
194
+ ajv={createDefaultAjv()}
195
+ readonly={false}
196
+ schema={populateDropdown(definition.dataSchema, enumerators)}
197
+ uischema={definition.uiSchema}
198
+ data={data}
199
+ validationMode="ValidateAndShow"
200
+ renderers={GoARenderers}
201
+ onChange={onChange}
202
+ />
203
+ </JsonFormRegisterProvider>;
204
+ ```
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: Uploading Files
3
+ layout: page
4
+ nav_order: 12
5
+ parent: Form Service
6
+ grand_parent: Tutorials
7
+ ---
8
+
9
+ ## Uploading Files
10
+
11
+ Adding a file upload widget is quite straight forward in the _Form Service_, you simply declare the format of the control to be _file-urn_ in the JSON schema, e.g.
12
+
13
+ ```json
14
+ {
15
+ "type": "object",
16
+ "properties": {
17
+ "certificateOfOwnership": {
18
+ "type": "string",
19
+ "format": "file-urn",
20
+ "variant": "button"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ In the example above the _button_ variant (the default) is used, which renders as a button labeled _Choose file_. You can also use the _dragdrop_ variant to render a drag and drop widget to upload files, as illustrated:
27
+
28
+ ![](/adsp-monorepo/assets/form-service/dragAndDrop.png)
29
+
30
+ ### Accessing the Files
31
+
32
+ The uploaded files are stored in our secure Azure Blog storage account. A download link is always available to the applicant through the form itself, and if your reviewers are using the [Task App](/adsp-monorepo/tutorials/task-service/task-app.html) to review an application they can download the documents through the form review page.
33
+
34
+ However, if you are writing your own Application you can access the files through our [File Service](/adsp-monorepo/tutorials/file-service/introduction.html). In the example above the "certificateOfOwnership" field will be populated with the URN of the file that was uploaded, e.g.
35
+
36
+ ```json
37
+ {
38
+ "certificateOfOwnership": "urn:ads:platform:file-service:v1:/files/20b125e5-d7e2-4971-9316-c3829ccd85a8"
39
+ }
40
+ ```
41
+
42
+ You can use this URN, for example, to parse out the file Id (the UUID) and download it with the following endpoint:
43
+
44
+ ```
45
+ https://file/v1/files/<file Id>/download
46
+ ```
47
+
48
+ ### Retrieve and store files from your own file storage
49
+
50
+ If in the use case where you would need to store and retrieve files from your own defined, file storage
51
+ instead of using the [File service](/adsp-monorepo/tutorials/file-service/file-service.html) you can
52
+ accomplish this by adding a React Context provided by ADSP Form service and injecting your own custom callback functions.
53
+
54
+ In order to use the file upload control and be able to setup how and where files are stored and retrieved we
55
+ need to add in a Context provided by ADSP as shown below as an example.
56
+
57
+ ```
58
+ <ContextProvider
59
+ fileManagement={{
60
+ fileList: metadata,
61
+ uploadFile: uploadFormFile,
62
+ downloadFile: downloadFormFile,
63
+ deleteFile: deleteFormFile,
64
+ }}
65
+ >
66
+ <JsonForms
67
+ ajv={createDefaultAjv()}
68
+ readonly={false}
69
+ schema={definition.dataSchema}
70
+ uischema={definition.uiSchema}
71
+ data={data}
72
+ validationMode="ValidateAndShow"
73
+ renderers={GoARenderers}
74
+ onChange={onChange}
75
+ />
76
+ </ContextProvider>
77
+ ```
78
+
79
+ Under the Context there is a property called fileMangement that contains a few functions that you can add in with your own callback functions to perform upload, download and delete operations.
80
+
81
+ To see an example of the usage, please goto the [Github repo](https://github.com/GovAlta/adsp-monorepo/blob/main/apps/form-app/src/app/components/DraftForm.tsx)
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: The Form App
3
+ layout: page
4
+ nav_order: 7
5
+ parent: Form Service
6
+ grand_parent: Tutorials
7
+ ---
8
+
9
+ ## Form App
10
+
11
+ The _Form App_ is a standalone application designed to allow users to securely log in and enter data into various _forms_. It utilizes the _Form Service_ APIs to retrieve the schemas and data necessary to render specific forms, save data as it is entered, and submit the forms for review upon completion. This means developers can quickly build and deploy forms without the need to create a new application from scratch.
12
+
13
+ The form data is stored in an ADSP database and can be accessed via [an API call](/adsp-monorepo/tutorials/task-service/task-app.html) or through the [Task App](/adsp-monorepo/tutorials/task-service/task-app.html), another standalone application by ADSP. If your requirements include simply reviewing and assessing the information (e.g., determining if an applicant is successful, after which a clerk or another application takes over), then the _Task App_ is ideal, requiring no additional coding. For more sophisticated processing of the information, developers can build their own applications to access the form data from ADSP and potentially distribute it to their own databases for further processing and reporting.
14
+
15
+ The URL for a specific form is derived from your ADSP tenant-name and the ID of the form. E.g. the URL below allows a user to log in and work with the _Farmers Market License Application_ form in the _AFIDS_ tenant:
16
+
17
+ ```
18
+ https://form.adsp-uat.alberta.ca/afids/Farmers-Market-License-Application
19
+ ```
20
+
21
+ ### Users
22
+
23
+ Forms can be configured to allow only those people with GoA or Alberta.ca credentials to access and fill them in. This gives users the best experience, as they will be able to fill in the information over several sessions, as needed. In addition, they will be able to initiate online conversations with form administrators if they have questions.
24
+
25
+ However, you can also configure a form to allow anonymous access. Anyone will be able to fill in and submit a form, without logging in. In this case, they will have to complete the form in one session, and they will not have access to the "chat" capability.
26
+
27
+ ### Security
28
+
29
+ Developers can define the roles that are required to create, review and disposition their forms, as described in the [security section](/adsp-monorepo/tutorials/task-service/security.html) of the tutorial. In addition, they will need the ADSP-specific roles for accessing a form. The former should be specific to your _Tenant_ and _Form Definition_, as they will lock down access so that only your users can log-in and fill in the information. For the _Form App_, a user will need to be an _applicant_. _Clerks_ and _assessors_ will be able to review and disposition this forms through the [Task App](/adsp-monorepo/tutorials/task-service/task-app.html).
30
+
31
+ #### Client Security
32
+
33
+ The _Form App_ uses the _form-app_ keycloak client, configured in your tenant, to access the necessary resources, specifically _urn:ads:platform:form-app_. To ensure that resource access is requested with a valid access token, the token must include both the _form service audience_ and the _comment service audience_.
34
+
35
+ If your tenant is recent you can likely just ignore its configuration, as that will have been done for you when you when it was created. If not, however, you must add the client and configure it as follows:
36
+
37
+ ![](/adsp-monorepo/assets/form-service/formAppClientConfiguration.png){: width="800" }
38
+
39
+ You can added an audience by clicking on the "Create" button and filling in the information as shown here:
40
+
41
+ ![](/adsp-monorepo/assets/form-service/addAudience.png){: width="400" }
42
+
43
+ ### User Experience
44
+
45
+ Ideally users will be able to access the link to the _Form App_ directly from the alberta.ca website. Clicking on it will bring them to the form app where they will be asked to log in. If all their roles and permissions are correct they will see the form in question, e.g.
46
+
47
+ ![](/adsp-monorepo/assets/form-service/formAppExample.png){: width="800" }
48
+
49
+ ### Summary PDF
50
+
51
+ You can give users of the Form App the capability of downloading a PDF summary of their completed application. In the [Tenant Management Webapp](https://adsp-uat.alberta.ca), go to the form editor for the form in question. There you will see a "Lifecycle" tab and a checkbox for creating a PDF upon submission.
52
+
53
+ ![](/adsp-monorepo/assets/form-service/lifecycleTab.png){: width="400" }
54
+
55
+ When checked you will see a PDF Preview tab in on the right-hand pane of the editor that shows what the generated PDF will look like. In the form app the user will see this after submission:
56
+
57
+ ![](/adsp-monorepo/assets/form-service/PDF-download.png){: width="400" }
58
+
59
+ **NOTE**: The download capability is only available to forms that require login. It is not available to anonymous forms.
60
+
61
+ ### ADSP form-app client audience
62
+
63
+ To fetch summary PDF file, aud of the access token used in the form app must include <b>urn:ads:platform:form-service</b> and <b>urn:ads:platform:form-gateway</b>. Otherwise, the user will see 401 error message on the submission summary page.
64
+
65
+ Based on the business logic, there are different ways to add the two audiences into access token. The most widely used method is to add the two audiences on <b>urn:ads:platform:form-app</b>. The following are the details:
66
+
67
+ - Navigate to the client configuration of the <b>urn:ads:platform:form-app</b> client.
68
+ - Click the <b>Client scopes</b> and choose the <b>urn:ads:platform:form-app-dedicated</b> scope.
69
+ ![](/adsp-monorepo/assets/form-service/form-app-client-scope.png){: width="600" }
70
+ - Add the two audience mappers in the <b>urn:ads:platform:form-app-dedicated</b> scope. The configurations of the two audiences mappers are shown as follows.
71
+ ![](/adsp-monorepo/assets/form-service/form-service-aud-mapper.png){: width="400" }
72
+ ![](/adsp-monorepo/assets/form-service/form-gateway-aud-mapper.png){: width="400" }
@@ -0,0 +1,62 @@
1
+ ---
2
+ layout: page
3
+ title: Form Editor
4
+ parent: Form Service
5
+ grand_parent: Tutorials
6
+ nav_exclude: false
7
+ ---
8
+
9
+ # ADSP's Form Editor
10
+
11
+ You build forms using the ADSP Form Service's _Form Editor_. Log in to the [Tenant-Management-Webapp](https://adsp-uat.alberta.ca) and select the _form service_. You will see something like this:
12
+
13
+ ![](/adsp-monorepo/assets/form-service/FormDefinition.png){: width="400" }
14
+
15
+ Add a new _form definition_ to try things out. When you click save to create your form definition you will be brought to the form editor:
16
+
17
+ ![](/adsp-monorepo/assets/form-service/FormEditor.png){: width="600" }
18
+
19
+ The editor has two components; the editor itself, and the preview. The latter shows you how your form will look to the end users and is useful as a guide when building. Try entering a simple data-schema:
20
+
21
+ ```json
22
+ {
23
+ "type": "object",
24
+ "properties": {
25
+ "firstName": {
26
+ "type": "string"
27
+ },
28
+ "lastName": {
29
+ "type": "string"
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ followed by its corresponding ui-schema:
36
+
37
+ ```json
38
+ {
39
+ "type": "HorizontalLayout",
40
+ "label": "Name",
41
+ "elements": [
42
+ {
43
+ "type": "Control",
44
+ "scope": "#/properties/firstName"
45
+ },
46
+ {
47
+ "type": "Control",
48
+ "scope": "#/properties/lastName"
49
+ }
50
+ ]
51
+ }
52
+ ```
53
+
54
+ You will see something like this:
55
+
56
+ ![](/adsp-monorepo/assets/form-service/FormPreview.png){: width="400" }
57
+
58
+ That's it. Once you learn the basics of building forms through schemas, you'll be able to build some pretty impressive forms for your end-users to fill in.
59
+
60
+ ## Learn More
61
+
62
+ In addition to the [components included with Jsonforms](https://jsonforms.io/) itself, ADSP has extended the concept with several other, [useful components](/adsp-monorepo/tutorials/form-service/building-forms.html) that includes steppers, help & user guidelines, and the ability to upload files.
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: page
3
+ title: Form Service
4
+ nav_order: 7
5
+ parent: Tutorials
6
+ has_children: true
7
+ ---
8
+
9
+ # Form Service
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: Form Submissions
3
+ layout: page
4
+ nav_order: 4
5
+ parent: Form Service
6
+ grand_parent: Tutorials
7
+ ---
8
+
9
+ ## Form Submissions
10
+
11
+ Forms can be in one of several states - draft, locked, submitted, or archived - and it is the application's responsibility to manage them (if desired). The intended usage for these states is as follows:
12
+
13
+ - **Draft**: Some forms can be very complex and applicants may need days to complete them. While in draft mode data is being saved, but the application is not considered complete until submitted. Form data cannot be modified unless it is in the draft state.
14
+
15
+ - **Submitted**: The applicant has completed the form to the best of their ability and wishes it to be reviewed. An assessor will determine the suitability of the application, but can request changes if any are needed. The form would go back into draft mode and the applicant can make the requested revisions. This back-and-forth revision process can go on as ling as needed. Each submission is saved separately, so there is a full history of application changes.
16
+
17
+ - **Archived**: This is useful for cases where the application is in the draft state, but the form was abandoned for whatever reason. When a form is archived, its data cannot be modified. It is up to the software application to determine when a draft form has become stale and can be archived.
18
+
19
+ - **Locked**: A draft application can become locked if there is some reason a reviewer needs to temporarily halt the application process. When a form is locked, its data cannot be modified. It is up to the software application to decide when it may be necessary to lock an application.
20
+
21
+ ## Submission Records
22
+
23
+ If desired, the developer can opt-in to save a _submission record_ whenever a form is submitted, or re-submitted.
24
+
25
+ ![](/adsp-monorepo/assets/form-service/submissionOptIn.png){: width="400" }
26
+
27
+ _Submission records_ contain a snapshot of the form at the time of the submission, and can be used as audit trails and other purposes. The snapshot contains the data, any uploaded files, the disposition, and other pertinent bits of metadata.
28
+
29
+ ### Disposition
30
+
31
+ _Submission records_ can be used to help manage _Form Disposition_; that is, the status of the document throughout its history. For example, an assessor may determine the disposition of an application to _accepted_, or _active_, when first submitted, later move it to _inactive_, and finally _archived_. The disposition depends entirely on the intent of the form and what the ministry's policies are. For this reason, developers can define the _disposition states_ that their forms can have when creating a _form definition_:
32
+
33
+ ![](/adsp-monorepo/assets/form-service/dispositionStates.png){: width="600" }
34
+
35
+ ### Submission Queues
36
+
37
+ In addition, developers can also opt-in to have the submission record placed in a [Task Queue](/adsp-monorepo/tutorials/task-service.html) for further processing:
38
+
39
+ ![](/adsp-monorepo/assets/form-service/submissionQueue.png){: width="400" }
40
+
41
+ Advantages of using _Task Service_ queues include:
42
+
43
+ - GOA personnel can use the _Task App_ to manage submissions and dispositions, so your application doesn't have to.
44
+ - You can decouple your intake apps from processing apps,
45
+ - you can have asynchronous processing between different parts of the system,
46
+ - and you get the other benefits of message queues (RabbitMQ), such as scalability, reliability, priority handling, etc.
47
+
48
+ ### Managing submission records
49
+
50
+ There are APIs to [manage submission records](https://api.adsp-uat.alberta.ca/autotest/?urls.primaryName=Form%20service#) that can be used to:
51
+
52
+ - update the submission's disposition,
53
+ - get the details of a submission, including the data and metadata, or
54
+ - retrieve a curated list of the form's submissions.
55
+
56
+ To get a submissionID for use in fist two endpoints it is necessary to first search the form's submission records. You can narrow the search using query criteria as documented in swagger.
57
+
58
+ ## Events
59
+
60
+ Changes to a form or its _state_ will trigger an event, which developers can use for various purposes such as [issuing notifications](/adsp-monorepo/tutorials/notification-service/introduction.html) to subscribers, or keeping an audit trail of the form's history. The events include:
61
+
62
+ ### Existence
63
+
64
+ - form-service:form-created
65
+ - form-service:form-deleted
66
+
67
+ ### State Changes
68
+
69
+ - form-service:form-archived
70
+ - form-service:form-locked
71
+ - form-service:form-submitted
72
+ - form-service:form-to-draft
73
+ - form-service:form-unlocked
74
+
75
+ ### Disposition
76
+
77
+ - form-service:submission-dispositioned