Wiki source code of 08 Schnittstelle ONYX Reporter

Last modified by Carina Enke on 13.02.2024

Hide last authors
Carina Enke 130.1 1 {{layout-cell}}
Carina Enke 402.1 2 {{panel borderColor="#ddd" bgColor="#f0f0f0" borderStyle="solid" title="Content"}}
3 {{toc start="2"/}}
4
Carina Enke 396.1 5
Carina Enke 402.1 6 {{/panel}}
Carina Enke 130.1 7 {{/layout-cell}}
Carina Enke 286.1 8
Carina Enke 398.1 9
10
Carina Enke 402.1 11 == General information ==
Carina Enke 130.1 12
Carina Enke 402.1 13 The API to the ONYX WebReporter enables the communication between the LMS and the Reporter. Therefore, a couple of commands will be executed:
Carina Enke 130.1 14
15 |(((
16 armSite
17 )))|(((
Carina Enke 402.1 18 Registration of sequence requests at the ONYX Reporter
Carina Enke 130.1 19 )))
20 |(((
21 initiateSite
22 )))|(((
Carina Enke 402.1 23 Initiates the Reporter session (transmission of the CP).
Carina Enke 130.1 24 )))
25 |(((
26 disarmSite
27 )))|(((
Carina Enke 402.1 28 Release of all Reporter resources for this session.
Carina Enke 130.1 29 )))
30 |(((
31 getResultValues
32 )))|(((
Carina Enke 402.1 33 Returns all (requested) results for the test. Condition: There is only one student in the list transmitted with initiateSite.
Carina Enke 130.1 34 )))
35 |(% colspan="1" %)(% colspan="1" %)
36 (((
37 getResultVariables
38 )))|(% colspan="1" %)(% colspan="1" %)
39 (((
Carina Enke 402.1 40 Returns all (requested) outcome variables for the test. No armSite, initiateSite, or disarmSite is required.
Carina Enke 130.1 41 )))
42
Carina Enke 402.1 43 == Login through the LMS ==
Carina Enke 130.1 44
Carina Enke 402.1 45 {{code language="xml" title="Login through the LMS"}}
tleu 376.1 46 @WebMethod(operationName = „armSite")
Carina Enke 130.1 47 public String armSite(
48 @WebParam(name = „version") final Integer version,
49 @WebParam(name = „userId") final String userId,
50 @WebParam(name = „optionalRole") final Integer role,
51 @WebParam(name = „secretToShare") final String secretToShare,
52 @WebParam(name = „optionalUserLastName") final String userLastName,
53 @WebParam(name = „optionalUserFirstName") final String userFirstName,
54 @WebParam(name = „additionalParams") final HashMapWrapper additionalParams) {
tleu 376.1 55 }
56 {{/code}}
Carina Enke 130.1 57
tleu 376.1 58 === Parameter armSite ===
59
Carina Enke 130.1 60 |(((
tleu 376.1 61 version
Carina Enke 130.1 62 )))|(((
Carina Enke 402.1 63 Requested version: 1
Carina Enke 130.1 64 )))
65 |(((
tleu 376.1 66 userId
Carina Enke 130.1 67 )))|(((
Carina Enke 402.1 68 UserId of the requested Reporter user
Carina Enke 130.1 69 )))
70 |(((
tleu 376.1 71 optionalRole
Carina Enke 130.1 72 )))|(((
Carina Enke 402.1 73 Optional. User role. 0 = student, 1 = tutor
Carina Enke 130.1 74 )))
75 |(((
tleu 376.1 76 secretToShare
Carina Enke 130.1 77 )))|(((
Carina Enke 402.1 78 A secret string that allows the server and client to encrypt their communication. Must remain the same for any further communication.
Carina Enke 130.1 79 )))
80 |(((
tleu 376.1 81 optionalUserLastName
Carina Enke 130.1 82 )))|(((
Carina Enke 402.1 83 Optional. Last name of the user.
Carina Enke 130.1 84 )))
tleu 376.1 85 |(% colspan="1" %)(% colspan="1" %)
86 (((
87 optionalUserFirstName
88 )))|(% colspan="1" %)(% colspan="1" %)
89 (((
Carina Enke 402.1 90 Optional. First name of the user.
tleu 376.1 91 )))
92 |(% colspan="1" %)(% colspan="1" %)
93 (((
94 additionalParams
95 )))|(% colspan="1" %)(% colspan="1" %)
96 (((
97 Reserved for future use.
98 )))
Carina Enke 130.1 99
tleu 376.1 100 === ReturnValue armSite ===
Carina Enke 130.1 101
tleu 376.1 102 |(((
103 String
104 )))|(((
Carina Enke 402.1 105 Session ID which has to be used to mark any other Reporter call.
tleu 376.1 106 )))
107
Carina Enke 402.1 108 == Initialisation through LMS ==
tleu 376.1 109
Carina Enke 402.1 110 {{code language="xml" title="Initialisation through LMS"}}
tleu 376.1 111 @WebMethod(operationName = „initiateSite")
112 public String initiateSite(
113 @WebParam(name = „version") final Integer version,
114 @WebParam(name = „sessionId") final String sessionId,
115 @WebParam(name = „secretToShare") final String secretToShare,
116 @WebParam(name = „students") final ArrayList<ResultsForStudent> students,
117 @WebParam(name = „optionalContentPackage") final byte[] contentPackage,
118 @WebParam(name = „additionalParams") final HashMapWrapper additionalParams) {
119 }
120 {{/code}}
121
122 === Parameter initiateSite ===
123
124 |(((
125 version
126 )))|(((
Carina Enke 402.1 127 Requested version: 1
tleu 376.1 128 )))
129 |(% colspan="1" %)(% colspan="1" %)
130 (((
131 sessionId
132 )))|(% colspan="1" %)(% colspan="1" %)
133 (((
Carina Enke 402.1 134 SessionId, as returned by armSite.
tleu 376.1 135 )))
136 |(((
137 secretToShare
138 )))|(((
Carina Enke 402.1 139 A secret string that allows the server and client to encrypt their communication. Must remain the same for any further communication.
tleu 376.1 140 )))
141 |(((
142 students
143 )))|(((
Carina Enke 402.1 144 List of students and their results. See below.
tleu 376.1 145 )))
146 |(((
147 optionalContentPackage
148 )))|(((
Carina Enke 402.1 149 Optional. Content package (zipped) as byte array.
tleu 376.1 150 )))
151 |(((
152 additionalParams
153 )))|(((
154 Reserved for future use.
155 )))
156
157 === ReturnValue initiateSite ===
158
159 |(((
160 String
161 )))|(((
Carina Enke 402.1 162 Absolute URL of the Reporter site for the IFrame. The URL has to be amended by the LMS with the following URL parameters:
tleu 376.1 163
Carina Enke 402.1 164 * sid: Session ID, as returned by armSite
165 * (((
166 uid: Student ID, as registrated in the initiateSite at the ONYX Reporter
tleu 376.1 167 )))
Carina Enke 402.1 168 )))
tleu 376.1 169
170 {{code language="xml"}}
171 public class ResultsForStudent {
172    private String studentId = „";
173    private String firstname = „";
174    private String lastname = „";
175    private String groupname = „";
176    private String tutorname = „";
177    private File contentFile = null;
178    private byte[] resultsFile = null;
179 }
180 {{/code}}
181
Carina Enke 402.1 182 == Logout through the LMS ==
sandra_riediger 378.1 183
184
Carina Enke 390.1 185 {{code}}
186 @WebMethod(operationName = „disarmSite")
187 public Boolean disarmSite(
188 @WebParam(name = „version") final Integer version,
189 @WebParam(name = „sessionId") final String sessionId,
190 @WebParam(name = „secretToShare") final String secretToShare,
191 @WebParam(name = „additionalParams") final HashMapWrapper additionalParams) {
192 }
193 {{/code}}
sandra_riediger 378.1 194
Carina Enke 390.1 195
196 === Parameter disarmSite ===
197
sandra_riediger 378.1 198 |(((
199 version
200 )))|(((
Carina Enke 402.1 201 Requested version: 1
sandra_riediger 378.1 202 )))
203 |(% colspan="1" %)(% colspan="1" %)
204 (((
205 sessionId
206 )))|(% colspan="1" %)(% colspan="1" %)
207 (((
Carina Enke 402.1 208 SessionId, as returned by armSite.
sandra_riediger 378.1 209 )))
210 |(((
211 secretToShare
212 )))|(((
Carina Enke 402.1 213 A secret string that allows the server and client to encrypt their communication. Must remain the same for any further communication.
sandra_riediger 378.1 214 )))
215 |(((
216 additionalParams
217 )))|(((
218 Reserved for future use.
219 )))
220
221 === ReturnValue disarmSite ===
222
223 |(((
224 Boolean
225 )))|(((
Carina Enke 402.1 226 True in the case of success, otherwise false.
sandra_riediger 378.1 227 )))
228
Carina Enke 402.1 229 == Request of learner results through the LMS ==
sandra_riediger 378.1 230
Carina Enke 402.1 231 {{code language="xml" title="Request of learner results through the LMS"}}
tleu 388.1 232  @WebMethod(operationName = „getResultValues")
233 public HashMapWrapper getResultValues(
234 @WebParam(name = „version") final Integer version,
235 @WebParam(name = „sessionId") final String sessionId,
236 @WebParam(name = „secretToShare") final String secretToShare,
237 @WebParam(name = „requestedValues") final HashMap<String, String>
238 requestedValues,
239 @WebParam(name = „additionalParams") final HashMapWrapper additionalParams) {
240 }
sandra_riediger 378.1 241 {{/code}}
242
tleu 388.1 243 === Parameter getResultValues ===
244
sandra_riediger 378.1 245 |(((
246 version
247 )))|(((
Carina Enke 402.1 248 Requested version: 1
sandra_riediger 378.1 249 )))
250 |(% colspan="1" %)(% colspan="1" %)
251 (((
252 sessionId
253 )))|(% colspan="1" %)(% colspan="1" %)
254 (((
Carina Enke 402.1 255 SessionId, as returned by armSite.
sandra_riediger 378.1 256 )))
257 |(((
258 secretToShare
259 )))|(((
Carina Enke 402.1 260 A secret string that allows the server and client to encrypt their communication. Must remain the same for any further communication.
sandra_riediger 378.1 261 )))
262 |(((
tleu 388.1 263 requestedValues
sandra_riediger 378.1 264 )))|(((
Carina Enke 402.1 265 Can be empty, in which case all result variables are returned. If keys are included, only the keys will be returned.
sandra_riediger 378.1 266 )))
267 |(((
tleu 388.1 268 additionalParams
sandra_riediger 378.1 269 )))|(((
tleu 388.1 270 Reserved for future use.
sandra_riediger 378.1 271 )))
tleu 388.1 272
273 === ReturnValue getResultValues ===
274
sandra_riediger 378.1 275 |(((
tleu 388.1 276 HashMap<String, String>
277 )))|(((
Carina Enke 402.1 278 Map of result variables, key is the variable name, value is the respective variable's value (HashMap is wrapped)
tleu 388.1 279 )))
280
Carina Enke 402.1 281 == Request of result variables through the LMS ==
tleu 388.1 282
Carina Enke 402.1 283 {{code language="xml" title="Request of result variables through the LMS"}}
tleu 388.1 284  @WebMethod(operationName = „getResultVariables")
285 public HashMapWrapper getResultVariables(
286 @WebParam(name = „version") final Integer version,
287 @WebParam(name = „contentPackage") final byte[] contentPackage,
288 @WebParam(name = „additionalParams") final HashMapWrapper additionalParams) {
289 }
290 {{/code}}
291
292 === Parameter getResultVariables ===
293
294 |(((
295 version
296 )))|(((
Carina Enke 402.1 297 Requested version: 1
tleu 388.1 298 )))
299 |(((
300 contentPackage
301 )))|(((
Carina Enke 402.1 302 Content package (zipped) as byte array.
tleu 388.1 303 )))
304 |(((
sandra_riediger 378.1 305 additionalParams
306 )))|(((
307 Reserved for future use.
308 )))
tleu 388.1 309
310 === ReturnValue getResultVariables ===
311
312 |(((
313 HashMap<String, String>
314 )))|(((
Carina Enke 402.1 315 Map of result variables, key is the variable name, value is the respective variable's value (HashMap is wrapped)
tleu 388.1 316 )))
317
318 == Wrapper ==
319
Carina Enke 402.1 320 Since the transmission of maps and lists via JAX-WS can cause problems, they have to be wrapped.
tleu 388.1 321
Carina Enke 402.1 322 === Wrapper for HashMap<String, String> ===
tleu 388.1 323
324 HashMapWrapper.java:
325
Carina Enke 396.1 326 [[image:attach:HashMapWrapperjava.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]]
tleu 388.1 327
Carina Enke 396.1 328 [[image:attach:HashMapWrapperjava2.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]]
tleu 388.1 329
Carina Enke 402.1 330 === Wrapper for the ArrayList<ResultsForStudent> ===
tleu 388.1 331
332 ResultsForStudentsWrapper.java:
333
Carina Enke 396.1 334 [[image:attach:ResultsForStudentsWrapperjava.png||data-xwiki-image-style="img-screen" data-xwiki-image-style-border="true" width="500"]]