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