Wiki source code of 08 Schnittstelle ONYX Reporter

Last modified by Carina Enke on 15.11.2025

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