Commit b4832bd7d992724f9f9f38115de996f8cc42a99c
1 parent
eb344fcf
split WEB_Session to generic part which is Session type. This Session type is mo…
…ved to folder generic and his definition into generic/types/session.anubis. This allow to use the Session type to many pourposes
Showing
5 changed files
with
1204 additions
and
1176 deletions
Show diff stats
| 1 | +/* | |
| 2 | + * Created by PyramIDE. | |
| 3 | + * User: フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 02/04/2020 | |
| 5 | + * Time: 16:34 | |
| 6 | + * © David RENÉ | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit calexium_lib/generic/types/session.anubis | |
| 10 | + | |
| 11 | +public define Var(List(Session_Field)) | |
| 12 | + empty_fields_list = | |
| 13 | + var([]). | |
| 14 | + | |
| 15 | +public define Session_Field | |
| 16 | + session_field | |
| 17 | + ( | |
| 18 | + String _field_name, | |
| 19 | + String _string | |
| 20 | + )= | |
| 21 | + session_field(_field_name, string_t, var(string(_string))) | |
| 22 | +. | |
| 23 | + | |
| 24 | +public define Var(List(Session_Field)) | |
| 25 | + to_Session_Field | |
| 26 | + ( | |
| 27 | + List(Session_Field_No_Var) fields | |
| 28 | + )= | |
| 29 | + var(map((Session_Field_No_Var field) |-> | |
| 30 | + with datum = if field.field_datum is{ | |
| 31 | + string(v) then string(v), | |
| 32 | + bool(v) then bool(v), | |
| 33 | + int(v) then int(v), | |
| 34 | + db_id(v) then db_id(v), | |
| 35 | + message(v) then message(v), | |
| 36 | + byte_array(v) then byte_array(v), | |
| 37 | + float(v) then float(v), | |
| 38 | + word128(v) then word128(v), | |
| 39 | + word64(v) then word64(v), | |
| 40 | + word32(v) then word32(v), | |
| 41 | + word16(v) then word16(v), | |
| 42 | + word8(v) then word8(v), | |
| 43 | + word4(v) then word4(v), | |
| 44 | + fields_set(v) then fields_set(to_Session_Field(v)) | |
| 45 | + }, | |
| 46 | + session_field(field.field_name, field.field_type, var(datum)) | |
| 47 | + , | |
| 48 | + fields) | |
| 49 | + ) | |
| 50 | +. | |
| 51 | + | |
| 52 | + | |
| 53 | +public define List(Session_Field_No_Var) | |
| 54 | + to_Session_Field_No_Var | |
| 55 | + ( | |
| 56 | + List(Session_Field) fields | |
| 57 | + )= | |
| 58 | + map((Session_Field field) |-> | |
| 59 | + with datum = if *field.field_datum is{ | |
| 60 | + string(v) then string(v), | |
| 61 | + bool(v) then bool(v), | |
| 62 | + int(v) then int(v), | |
| 63 | + db_id(v) then db_id(v), | |
| 64 | + message(v) then message(v), | |
| 65 | + byte_array(v) then byte_array(v), | |
| 66 | + float(v) then float(v), | |
| 67 | + word128(v) then word128(v), | |
| 68 | + word64(v) then word64(v), | |
| 69 | + word32(v) then word32(v), | |
| 70 | + word16(v) then word16(v), | |
| 71 | + word8(v) then word8(v), | |
| 72 | + word4(v) then word4(v), | |
| 73 | + fields_set(v) then fields_set(to_Session_Field_No_Var(*v)) | |
| 74 | + }, | |
| 75 | + session_field(field.field_name, field.field_type, datum), fields) | |
| 76 | +. | |
| 77 | + | |
| 78 | + | |
| 79 | +public define Maybe(Session_Field_Datum) | |
| 80 | + get_field | |
| 81 | + ( | |
| 82 | + List(Session_Field) fields, | |
| 83 | + Session_Field_Type _field_type, | |
| 84 | + String _field_name | |
| 85 | + ) = | |
| 86 | + if fields is | |
| 87 | + { | |
| 88 | + [] then failure, | |
| 89 | + [h . t] then | |
| 90 | + if h.field_name = _field_name & h.field_type = _field_type then | |
| 91 | + success(*h.field_datum) | |
| 92 | + else | |
| 93 | + get_field(t, _field_type, _field_name) | |
| 94 | + } | |
| 95 | +. | |
| 96 | + /******** ANY functions ***************/ | |
| 97 | + | |
| 98 | + | |
| 99 | +define List(Session_Field) | |
| 100 | + _remove_any | |
| 101 | + ( | |
| 102 | + List(Session_Field) fields, | |
| 103 | + Session_Field_Type _field_type, | |
| 104 | + String _field_name | |
| 105 | + )= | |
| 106 | + if fields is | |
| 107 | + { | |
| 108 | + [] then [], | |
| 109 | + [h . t] then | |
| 110 | + if h.field_name = _field_name & h.field_type = _field_type then | |
| 111 | + _remove_any(t, _field_type, _field_name) | |
| 112 | + else | |
| 113 | + [ h. _remove_any(t, _field_type, _field_name) ] | |
| 114 | + } | |
| 115 | +. | |
| 116 | + | |
| 117 | +define One | |
| 118 | + remove_any | |
| 119 | + ( | |
| 120 | + Var(List(Session_Field)) fields, | |
| 121 | + Session_Field_Type _field_type, | |
| 122 | + String _field_name | |
| 123 | + )= | |
| 124 | + fields <- _remove_any(*fields, _field_type, _field_name) | |
| 125 | +. | |
| 126 | + | |
| 127 | +define One | |
| 128 | + replace_any | |
| 129 | + ( | |
| 130 | + List(Session_Field) fields, | |
| 131 | + Session_Field_Type _field_type, | |
| 132 | + String _field_name, | |
| 133 | + Session_Field_Datum _field_value, | |
| 134 | + Var(List(Session_Field)) fields_org, | |
| 135 | + )= | |
| 136 | + if fields is | |
| 137 | + { | |
| 138 | + [] then fields_org <- [session_field(_field_name, _field_type, var(_field_value)) . *fields_org], | |
| 139 | + [h . t] then | |
| 140 | + //println("h.field_name = "+h.field_name+" _field_name = "+_field_name); | |
| 141 | + if h.field_name = _field_name & h.field_type = _field_type then | |
| 142 | + //println("replace field_name found"); | |
| 143 | + h.field_datum <- _field_value | |
| 144 | + else | |
| 145 | + replace_any(t, _field_type, _field_name, _field_value, fields_org) | |
| 146 | + } | |
| 147 | +. | |
| 148 | + | |
| 149 | + | |
| 150 | +define One | |
| 151 | + replace_any | |
| 152 | + ( | |
| 153 | + Var(List(Session_Field)) fields, | |
| 154 | + Session_Field_Type _field_type, | |
| 155 | + String _field_name, | |
| 156 | + Session_Field_Datum _field_value | |
| 157 | + )= | |
| 158 | + replace_any(*fields, _field_type, _field_name, _field_value, fields) | |
| 159 | +. | |
| 160 | + | |
| 161 | + /*************** String *****************/ | |
| 162 | + | |
| 163 | + Maybe(String) get_String(fields, _field_name) | |
| 164 | + String get_String(fields, _field_name, default_value) | |
| 165 | + | |
| 166 | +public define Maybe(String) | |
| 167 | + get_String | |
| 168 | + ( | |
| 169 | + Var(List(Session_Field)) fields, | |
| 170 | + String _field_name | |
| 171 | + ) = | |
| 172 | + if get_field(*fields, string_t, _field_name) is | |
| 173 | + { | |
| 174 | + failure then failure, | |
| 175 | + success(datum) then | |
| 176 | + if datum is string(value) then | |
| 177 | + success(value) | |
| 178 | + else | |
| 179 | + failure | |
| 180 | + } | |
| 181 | +. | |
| 182 | + | |
| 183 | +public define String | |
| 184 | + get_String | |
| 185 | + ( | |
| 186 | + Var(List(Session_Field)) fields, | |
| 187 | + String _field_name, | |
| 188 | + String default_value | |
| 189 | + ) = | |
| 190 | + if get_String(fields, _field_name) is | |
| 191 | + { | |
| 192 | + failure then default_value | |
| 193 | + success(value) then value | |
| 194 | + }. | |
| 195 | + | |
| 196 | +public define One | |
| 197 | + put_String | |
| 198 | + ( | |
| 199 | + Var(List(Session_Field)) fields, | |
| 200 | + String _field_name, | |
| 201 | + String _field_value | |
| 202 | + )= | |
| 203 | + fields <- [session_field(_field_name, string_t, var(string(_field_value))) . *fields] | |
| 204 | +. | |
| 205 | + | |
| 206 | +public define One | |
| 207 | + replace_String | |
| 208 | + ( | |
| 209 | + Var(List(Session_Field)) fields, | |
| 210 | + String _field_name, | |
| 211 | + String _field_value | |
| 212 | + )= | |
| 213 | + replace_any(fields, string_t, _field_name, string(_field_value)) | |
| 214 | +. | |
| 215 | + | |
| 216 | + | |
| 217 | +public define One | |
| 218 | + remove_String | |
| 219 | + ( | |
| 220 | + Var(List(Session_Field)) fields, | |
| 221 | + String _field_name | |
| 222 | + )= | |
| 223 | + remove_any(fields, string_t, _field_name) | |
| 224 | +. | |
| 225 | + | |
| 226 | + /*************** Bool *****************/ | |
| 227 | + | |
| 228 | + Maybe(Bool) get_Bool(fields, _field_name) | |
| 229 | + Bool get_Bool(fields, _field_name, default_value) | |
| 230 | + | |
| 231 | +public define Maybe(Bool) | |
| 232 | + get_Bool | |
| 233 | + ( | |
| 234 | + Var(List(Session_Field)) fields, | |
| 235 | + String _field_name | |
| 236 | + ) = | |
| 237 | + if get_field(*fields, bool_t, _field_name) is | |
| 238 | + { | |
| 239 | + failure then failure, | |
| 240 | + success(datum) then | |
| 241 | + if datum is bool(value) then | |
| 242 | + success(value) | |
| 243 | + else | |
| 244 | + failure | |
| 245 | + } | |
| 246 | +. | |
| 247 | + | |
| 248 | +public define Bool | |
| 249 | + get_Bool | |
| 250 | + ( | |
| 251 | + Var(List(Session_Field)) fields, | |
| 252 | + String _field_name, | |
| 253 | + Bool default_value | |
| 254 | + ) = | |
| 255 | + if get_Bool(fields, _field_name) is | |
| 256 | + { | |
| 257 | + failure then default_value | |
| 258 | + success(value) then value | |
| 259 | + }. | |
| 260 | + | |
| 261 | +public define One | |
| 262 | + put_Bool | |
| 263 | + ( | |
| 264 | + Var(List(Session_Field)) fields, | |
| 265 | + String _field_name, | |
| 266 | + Bool _field_value | |
| 267 | + )= | |
| 268 | + fields <- [session_field(_field_name, bool_t, var(bool(_field_value))) . *fields] | |
| 269 | +. | |
| 270 | + | |
| 271 | +public define One | |
| 272 | + replace_Bool | |
| 273 | + ( | |
| 274 | + Var(List(Session_Field)) fields, | |
| 275 | + String _field_name, | |
| 276 | + Bool _field_value | |
| 277 | + )= | |
| 278 | + replace_any(fields, bool_t, _field_name, bool(_field_value)) | |
| 279 | +. | |
| 280 | + | |
| 281 | + | |
| 282 | +public define One | |
| 283 | + remove_Bool | |
| 284 | + ( | |
| 285 | + Var(List(Session_Field)) fields, | |
| 286 | + String _field_name | |
| 287 | + )= | |
| 288 | + remove_any(fields, bool_t, _field_name) | |
| 289 | +. | |
| 290 | + | |
| 291 | + /*************** Int *****************/ | |
| 292 | + | |
| 293 | + Maybe(String) get_Int(fields, _field_name) | |
| 294 | + String get_Int(fields, _field_name, default_value) | |
| 295 | + | |
| 296 | +public define Maybe(Int) | |
| 297 | + get_Int | |
| 298 | + ( | |
| 299 | + Var(List(Session_Field)) fields, | |
| 300 | + String _field_name, | |
| 301 | + ) = | |
| 302 | + if get_field(*fields, int_t, _field_name) is | |
| 303 | + { | |
| 304 | + failure then failure, | |
| 305 | + success(datum) then | |
| 306 | + if datum is int(value) then | |
| 307 | + success(value) | |
| 308 | + else | |
| 309 | + failure | |
| 310 | + } | |
| 311 | +. | |
| 312 | + | |
| 313 | +public define Int | |
| 314 | + get_Int | |
| 315 | + ( | |
| 316 | + Var(List(Session_Field)) fields, | |
| 317 | + String _field_name, | |
| 318 | + Int default_value | |
| 319 | + ) = | |
| 320 | + if get_Int(fields, _field_name) is | |
| 321 | + { | |
| 322 | + failure then default_value | |
| 323 | + success(value) then value | |
| 324 | + }. | |
| 325 | + | |
| 326 | +public define One | |
| 327 | + put_Int | |
| 328 | + ( | |
| 329 | + Var(List(Session_Field)) fields, | |
| 330 | + String _field_name, | |
| 331 | + Int _field_value | |
| 332 | + )= | |
| 333 | + fields <- [session_field(_field_name, int_t, var(int(_field_value))) . *fields] | |
| 334 | +. | |
| 335 | + | |
| 336 | +public define One | |
| 337 | + replace_Int | |
| 338 | + ( | |
| 339 | + Var(List(Session_Field)) fields, | |
| 340 | + String _field_name, | |
| 341 | + Int _field_value | |
| 342 | + )= | |
| 343 | + replace_any(fields, int_t, _field_name, int(_field_value)) | |
| 344 | +. | |
| 345 | + | |
| 346 | + | |
| 347 | +public define One | |
| 348 | + remove_Int | |
| 349 | + ( | |
| 350 | + Var(List(Session_Field)) fields, | |
| 351 | + String _field_name | |
| 352 | + )= | |
| 353 | + remove_any(fields, int_t, _field_name) | |
| 354 | +. | |
| 355 | + | |
| 356 | + /*************** DB_id *****************/ | |
| 357 | + | |
| 358 | + Maybe(String) get_DB_id(fields, _field_name) | |
| 359 | + String get_DB_id(fields, _field_name, default_value) | |
| 360 | + | |
| 361 | +public define Maybe(DB_id) | |
| 362 | + get_DB_id | |
| 363 | + ( | |
| 364 | + Var(List(Session_Field)) fields, | |
| 365 | + String _field_name, | |
| 366 | + ) = | |
| 367 | + if get_field(*fields, db_id_t, _field_name) is | |
| 368 | + { | |
| 369 | + failure then failure, | |
| 370 | + success(datum) then | |
| 371 | + if datum is db_id(value) then | |
| 372 | + success(value) | |
| 373 | + else | |
| 374 | + failure | |
| 375 | + } | |
| 376 | +. | |
| 377 | + | |
| 378 | +public define DB_id | |
| 379 | + get_DB_id | |
| 380 | + ( | |
| 381 | + Var(List(Session_Field)) fields, | |
| 382 | + String _field_name, | |
| 383 | + DB_id default_value | |
| 384 | + ) = | |
| 385 | + if get_DB_id(fields, _field_name) is | |
| 386 | + { | |
| 387 | + failure then default_value | |
| 388 | + success(value) then value | |
| 389 | + }. | |
| 390 | + | |
| 391 | +public define One | |
| 392 | + put_DB_id | |
| 393 | + ( | |
| 394 | + Var(List(Session_Field)) fields, | |
| 395 | + String _field_name, | |
| 396 | + DB_id _field_value | |
| 397 | + )= | |
| 398 | + fields <- [session_field(_field_name, int_t, var(db_id(_field_value))) . *fields] | |
| 399 | +. | |
| 400 | + | |
| 401 | +public define One | |
| 402 | + replace_DB_id | |
| 403 | + ( | |
| 404 | + Var(List(Session_Field)) fields, | |
| 405 | + String _field_name, | |
| 406 | + DB_id _field_value | |
| 407 | + )= | |
| 408 | + replace_any(fields, db_id_t, _field_name, db_id(_field_value)) | |
| 409 | +. | |
| 410 | + | |
| 411 | + | |
| 412 | +public define One | |
| 413 | + remove_DB_id | |
| 414 | + ( | |
| 415 | + Var(List(Session_Field)) fields, | |
| 416 | + String _field_name | |
| 417 | + )= | |
| 418 | + remove_any(fields, db_id_t, _field_name) | |
| 419 | +. | |
| 420 | + | |
| 421 | + /*************** Message *****************/ | |
| 422 | + | |
| 423 | + Maybe(String) get_Message(fields, _field_name) | |
| 424 | + String get_Message(fiels, _field_name, default_value) | |
| 425 | + | |
| 426 | +public define Maybe(Message) | |
| 427 | + get_Message | |
| 428 | + ( | |
| 429 | + Var(List(Session_Field)) fields, | |
| 430 | + String _field_name | |
| 431 | + ) = | |
| 432 | + if get_field(*fields, message_t, _field_name) is | |
| 433 | + { | |
| 434 | + failure then failure, | |
| 435 | + success(datum) then | |
| 436 | + if datum is message(value) then | |
| 437 | + success(value) | |
| 438 | + else | |
| 439 | + failure | |
| 440 | + } | |
| 441 | +. | |
| 442 | + | |
| 443 | +public define Message | |
| 444 | + get_Message | |
| 445 | + ( | |
| 446 | + Var(List(Session_Field)) fields, | |
| 447 | + String _field_name, | |
| 448 | + Message default_value | |
| 449 | + ) = | |
| 450 | + if get_Message(fields, _field_name) is | |
| 451 | + { | |
| 452 | + failure then default_value | |
| 453 | + success(value) then value | |
| 454 | + }. | |
| 455 | + | |
| 456 | +public define One | |
| 457 | + put_Message | |
| 458 | + ( | |
| 459 | + Var(List(Session_Field)) fields, | |
| 460 | + String _field_name, | |
| 461 | + Message _field_value | |
| 462 | + )= | |
| 463 | + fields <- [session_field(_field_name, message_t, var(message(_field_value))) . *fields] | |
| 464 | +. | |
| 465 | + | |
| 466 | +public define One | |
| 467 | + replace_Message | |
| 468 | + ( | |
| 469 | + Var(List(Session_Field)) fields, | |
| 470 | + String _field_name, | |
| 471 | + Message _field_value | |
| 472 | + )= | |
| 473 | + replace_any(fields, message_t, _field_name, message(_field_value)) | |
| 474 | +. | |
| 475 | + | |
| 476 | +public define One | |
| 477 | + remove_Message | |
| 478 | + ( | |
| 479 | + Var(List(Session_Field)) fields, | |
| 480 | + String _field_name | |
| 481 | + )= | |
| 482 | + remove_any(fields, message_t, _field_name) | |
| 483 | +. | |
| 484 | + | |
| 485 | + /*************** ByteArray *****************/ | |
| 486 | + | |
| 487 | + Maybe(ByteArray) get_ByteArray(fields, _field_name) | |
| 488 | + ByteArray get_ByteArray(fiels, _field_name, default_value) | |
| 489 | + | |
| 490 | +public define Maybe(ByteArray) | |
| 491 | + get_ByteArray | |
| 492 | + ( | |
| 493 | + Var(List(Session_Field)) fields, | |
| 494 | + String _field_name, | |
| 495 | + ) = | |
| 496 | + if get_field(*fields, byte_array_t, _field_name) is | |
| 497 | + { | |
| 498 | + failure then failure, | |
| 499 | + success(datum) then | |
| 500 | + if datum is byte_array(value) then | |
| 501 | + success(value) | |
| 502 | + else | |
| 503 | + failure | |
| 504 | + } | |
| 505 | +. | |
| 506 | + | |
| 507 | +public define ByteArray | |
| 508 | + get_ByteArray | |
| 509 | + ( | |
| 510 | + Var(List(Session_Field)) fields, | |
| 511 | + String _field_name, | |
| 512 | + ByteArray default_value | |
| 513 | + ) = | |
| 514 | + if get_ByteArray(fields, _field_name) is | |
| 515 | + { | |
| 516 | + failure then default_value | |
| 517 | + success(value) then value | |
| 518 | + }. | |
| 519 | + | |
| 520 | +public define One | |
| 521 | + put_ByteArray | |
| 522 | + ( | |
| 523 | + Var(List(Session_Field)) fields, | |
| 524 | + String _field_name, | |
| 525 | + ByteArray _field_value | |
| 526 | + )= | |
| 527 | + fields <- [session_field(_field_name, byte_array_t, var(byte_array(_field_value))) . *fields] | |
| 528 | +. | |
| 529 | + | |
| 530 | +public define One | |
| 531 | + replace_ByteArray | |
| 532 | + ( | |
| 533 | + Var(List(Session_Field)) fields, | |
| 534 | + String _field_name, | |
| 535 | + ByteArray _field_value | |
| 536 | + )= | |
| 537 | + replace_any(fields, byte_array_t, _field_name, byte_array(_field_value)) | |
| 538 | +. | |
| 539 | + | |
| 540 | +public define One | |
| 541 | + remove_ByteArray | |
| 542 | + ( | |
| 543 | + Var(List(Session_Field)) fields, | |
| 544 | + String _field_name | |
| 545 | + )= | |
| 546 | + remove_any(fields, byte_array_t, _field_name) | |
| 547 | +. | |
| 548 | + | |
| 549 | + /*************** Float *****************/ | |
| 550 | + | |
| 551 | + Maybe(Float) get_Float(fields, _field_name) | |
| 552 | + Float get_Float(fiels, _field_name, default_value) | |
| 553 | + | |
| 554 | +public define Maybe(Float) | |
| 555 | + get_Float | |
| 556 | + ( | |
| 557 | + Var(List(Session_Field)) fields, | |
| 558 | + String _field_name, | |
| 559 | + ) = | |
| 560 | + if get_field(*fields, float_t, _field_name) is | |
| 561 | + { | |
| 562 | + failure then failure, | |
| 563 | + success(datum) then | |
| 564 | + if datum is float(value) then | |
| 565 | + success(value) | |
| 566 | + else | |
| 567 | + failure | |
| 568 | + } | |
| 569 | +. | |
| 570 | + | |
| 571 | +public define Float | |
| 572 | + get_Float | |
| 573 | + ( | |
| 574 | + Var(List(Session_Field)) fields, | |
| 575 | + String _field_name, | |
| 576 | + Float default_value | |
| 577 | + ) = | |
| 578 | + if get_Float(fields, _field_name) is | |
| 579 | + { | |
| 580 | + failure then default_value | |
| 581 | + success(value) then value | |
| 582 | + }. | |
| 583 | + | |
| 584 | +public define One | |
| 585 | + put_Float | |
| 586 | + ( | |
| 587 | + Var(List(Session_Field)) fields, | |
| 588 | + String _field_name, | |
| 589 | + Float _field_value | |
| 590 | + )= | |
| 591 | + fields <- [session_field(_field_name, float_t, var(float(_field_value))) . *fields] | |
| 592 | +. | |
| 593 | + | |
| 594 | +public define One | |
| 595 | + replace_Float | |
| 596 | + ( | |
| 597 | + Var(List(Session_Field)) fields, | |
| 598 | + String _field_name, | |
| 599 | + Float _field_value | |
| 600 | + )= | |
| 601 | + replace_any(fields, float_t, _field_name, float(_field_value)) | |
| 602 | +. | |
| 603 | + | |
| 604 | +public define One | |
| 605 | + remove_Float | |
| 606 | + ( | |
| 607 | + Var(List(Session_Field)) fields, | |
| 608 | + String _field_name | |
| 609 | + )= | |
| 610 | + remove_any(fields, float_t, _field_name) | |
| 611 | +. | |
| 612 | + | |
| 613 | + /*************** Word128 *****************/ | |
| 614 | + | |
| 615 | + Maybe(Word128) get_Word128t(fields, _field_name) | |
| 616 | + Word128 get_Word128(fields, _field_name, default_value) | |
| 617 | + | |
| 618 | +public define Maybe(Word128) | |
| 619 | + get_Word128 | |
| 620 | + ( | |
| 621 | + Var(List(Session_Field)) fields, | |
| 622 | + String _field_name, | |
| 623 | + ) = | |
| 624 | + if get_field(*fields, word128_t, _field_name) is | |
| 625 | + { | |
| 626 | + failure then failure, | |
| 627 | + success(datum) then | |
| 628 | + if datum is word128(value) then | |
| 629 | + success(value) | |
| 630 | + else | |
| 631 | + failure | |
| 632 | + } | |
| 633 | +. | |
| 634 | + | |
| 635 | +public define Word128 | |
| 636 | + get_Word128 | |
| 637 | + ( | |
| 638 | + Var(List(Session_Field)) fields, | |
| 639 | + String _field_name, | |
| 640 | + Word128 default_value | |
| 641 | + ) = | |
| 642 | + if get_Word128(fields, _field_name) is | |
| 643 | + { | |
| 644 | + failure then default_value | |
| 645 | + success(value) then value | |
| 646 | + }. | |
| 647 | + | |
| 648 | +public define One | |
| 649 | + put_Word128 | |
| 650 | + ( | |
| 651 | + Var(List(Session_Field)) fields, | |
| 652 | + String _field_name, | |
| 653 | + Word128 _field_value | |
| 654 | + )= | |
| 655 | + fields <- [session_field(_field_name, word128_t, var(word128(_field_value))) . *fields] | |
| 656 | +. | |
| 657 | + | |
| 658 | +public define One | |
| 659 | + replace_Word128 | |
| 660 | + ( | |
| 661 | + Var(List(Session_Field)) fields, | |
| 662 | + String _field_name, | |
| 663 | + Word128 _field_value | |
| 664 | + )= | |
| 665 | + replace_any(fields, word128_t, _field_name, word128(_field_value)) | |
| 666 | +. | |
| 667 | + | |
| 668 | +public define One | |
| 669 | + remove_Word128 | |
| 670 | + ( | |
| 671 | + Var(List(Session_Field)) fields, | |
| 672 | + String _field_name | |
| 673 | + )= | |
| 674 | + remove_any(fields, word128_t, _field_name) | |
| 675 | +. | |
| 676 | + | |
| 677 | + /*************** Word64 *****************/ | |
| 678 | + | |
| 679 | + Maybe(Word64) get_Word64(fields, _field_name) | |
| 680 | + Word64 get_Word64(fields, _field_name, default_value) | |
| 681 | + | |
| 682 | +public define Maybe(Word64) | |
| 683 | + get_Word64 | |
| 684 | + ( | |
| 685 | + Var(List(Session_Field)) fields, | |
| 686 | + String _field_name, | |
| 687 | + ) = | |
| 688 | + if get_field(*fields, word64_t, _field_name) is | |
| 689 | + { | |
| 690 | + failure then failure, | |
| 691 | + success(datum) then | |
| 692 | + if datum is word64(value) then | |
| 693 | + success(value) | |
| 694 | + else | |
| 695 | + failure | |
| 696 | + } | |
| 697 | +. | |
| 698 | + | |
| 699 | +public define Word64 | |
| 700 | + get_Word64 | |
| 701 | + ( | |
| 702 | + Var(List(Session_Field)) fields, | |
| 703 | + String _field_name, | |
| 704 | + Word64 default_value | |
| 705 | + ) = | |
| 706 | + if get_Word64(fields, _field_name) is | |
| 707 | + { | |
| 708 | + failure then default_value | |
| 709 | + success(value) then value | |
| 710 | + }. | |
| 711 | + | |
| 712 | +public define One | |
| 713 | + put_Word64 | |
| 714 | + ( | |
| 715 | + Var(List(Session_Field)) fields, | |
| 716 | + String _field_name, | |
| 717 | + Word64 _field_value | |
| 718 | + )= | |
| 719 | + fields <- [session_field(_field_name, word64_t, var(word64(_field_value))) . *fields] | |
| 720 | +. | |
| 721 | + | |
| 722 | +public define One | |
| 723 | + replace_Word64 | |
| 724 | + ( | |
| 725 | + Var(List(Session_Field)) fields, | |
| 726 | + String _field_name, | |
| 727 | + Word64 _field_value | |
| 728 | + )= | |
| 729 | + replace_any(fields, word64_t, _field_name, word64(_field_value)) | |
| 730 | +. | |
| 731 | + | |
| 732 | +public define One | |
| 733 | + remove_Word64 | |
| 734 | + ( | |
| 735 | + Var(List(Session_Field)) fields, | |
| 736 | + String _field_name | |
| 737 | + )= | |
| 738 | + remove_any(fields, word64_t, _field_name) | |
| 739 | +. | |
| 740 | + | |
| 741 | + /*************** Word32 *****************/ | |
| 742 | + | |
| 743 | + Maybe(Word32) get_Word32(fields, _field_name) | |
| 744 | + Word32 get_Word32(fields, _field_name, default_value) | |
| 745 | + | |
| 746 | +public define Maybe(Word32) | |
| 747 | + get_Word32 | |
| 748 | + ( | |
| 749 | + Var(List(Session_Field)) fields, | |
| 750 | + String _field_name, | |
| 751 | + ) = | |
| 752 | + if get_field(*fields, word32_t, _field_name) is | |
| 753 | + { | |
| 754 | + failure then failure, | |
| 755 | + success(datum) then | |
| 756 | + if datum is word32(value) then | |
| 757 | + success(value) | |
| 758 | + else | |
| 759 | + failure | |
| 760 | + } | |
| 761 | +. | |
| 762 | + | |
| 763 | +public define Word32 | |
| 764 | + get_Word32 | |
| 765 | + ( | |
| 766 | + Var(List(Session_Field)) fields, | |
| 767 | + String _field_name, | |
| 768 | + Word32 default_value | |
| 769 | + ) = | |
| 770 | + if get_Word32(fields, _field_name) is | |
| 771 | + { | |
| 772 | + failure then default_value | |
| 773 | + success(value) then value | |
| 774 | + }. | |
| 775 | + | |
| 776 | +public define One | |
| 777 | + put_Word32 | |
| 778 | + ( | |
| 779 | + Var(List(Session_Field)) fields, | |
| 780 | + String _field_name, | |
| 781 | + Word32 _field_value | |
| 782 | + )= | |
| 783 | + fields <- [session_field(_field_name, word32_t, var(word32(_field_value))) . *fields] | |
| 784 | +. | |
| 785 | + | |
| 786 | +public define One | |
| 787 | + replace_Word32 | |
| 788 | + ( | |
| 789 | + Var(List(Session_Field)) fields, | |
| 790 | + String _field_name, | |
| 791 | + Word32 _field_value | |
| 792 | + )= | |
| 793 | + replace_any(fields, word32_t, _field_name, word32(_field_value)) | |
| 794 | +. | |
| 795 | + | |
| 796 | +public define One | |
| 797 | + remove_Word32 | |
| 798 | + ( | |
| 799 | + Var(List(Session_Field)) fields, | |
| 800 | + String _field_name | |
| 801 | + )= | |
| 802 | + remove_any(fields, word32_t, _field_name) | |
| 803 | +. | |
| 804 | + | |
| 805 | + /*************** Word16 *****************/ | |
| 806 | + | |
| 807 | + Maybe(Word16) get_Word16(fields, _field_name) | |
| 808 | + Word16 get_Word16(fields, _field_name, default_value) | |
| 809 | + | |
| 810 | +public define Maybe(Word16) | |
| 811 | + get_Word16 | |
| 812 | + ( | |
| 813 | + Var(List(Session_Field)) fields, | |
| 814 | + String _field_name, | |
| 815 | + ) = | |
| 816 | + if get_field(*fields, word16_t, _field_name) is | |
| 817 | + { | |
| 818 | + failure then failure, | |
| 819 | + success(datum) then | |
| 820 | + if datum is word16(value) then | |
| 821 | + success(value) | |
| 822 | + else | |
| 823 | + failure | |
| 824 | + } | |
| 825 | +. | |
| 826 | + | |
| 827 | +public define Word16 | |
| 828 | + get_Word16 | |
| 829 | + ( | |
| 830 | + Var(List(Session_Field)) fields, | |
| 831 | + String _field_name, | |
| 832 | + Word16 default_value | |
| 833 | + ) = | |
| 834 | + if get_Word16(fields, _field_name) is | |
| 835 | + { | |
| 836 | + failure then default_value | |
| 837 | + success(value) then value | |
| 838 | + }. | |
| 839 | + | |
| 840 | +public define One | |
| 841 | + put_Word16 | |
| 842 | + ( | |
| 843 | + Var(List(Session_Field)) fields, | |
| 844 | + String _field_name, | |
| 845 | + Word16 _field_value | |
| 846 | + )= | |
| 847 | + fields <- [session_field(_field_name, word16_t, var(word16(_field_value))) . *fields] | |
| 848 | +. | |
| 849 | + | |
| 850 | +public define One | |
| 851 | + replace_Word16 | |
| 852 | + ( | |
| 853 | + Var(List(Session_Field)) fields, | |
| 854 | + String _field_name, | |
| 855 | + Word16 _field_value | |
| 856 | + )= | |
| 857 | + replace_any(fields, word16_t, _field_name, word16(_field_value)) | |
| 858 | +. | |
| 859 | + | |
| 860 | +public define One | |
| 861 | + remove_Word16 | |
| 862 | + ( | |
| 863 | + Var(List(Session_Field)) fields, | |
| 864 | + String _field_name | |
| 865 | + )= | |
| 866 | + remove_any(fields, word16_t, _field_name) | |
| 867 | +. | |
| 868 | + | |
| 869 | + /*************** Word8 *****************/ | |
| 870 | + | |
| 871 | + Maybe(Word8) get_Word8(fields, _field_name) | |
| 872 | + Word8 get_Word8(fields, _field_name, default_value) | |
| 873 | + | |
| 874 | +public define Maybe(Word8) | |
| 875 | + get_Word8 | |
| 876 | + ( | |
| 877 | + Var(List(Session_Field)) fields, | |
| 878 | + String _field_name, | |
| 879 | + ) = | |
| 880 | + if get_field(*fields, word8_t, _field_name) is | |
| 881 | + { | |
| 882 | + failure then failure, | |
| 883 | + success(datum) then | |
| 884 | + if datum is word8(value) then | |
| 885 | + success(value) | |
| 886 | + else | |
| 887 | + failure | |
| 888 | + } | |
| 889 | +. | |
| 890 | + | |
| 891 | +public define Word8 | |
| 892 | + get_Word8 | |
| 893 | + ( | |
| 894 | + Var(List(Session_Field)) fields, | |
| 895 | + String _field_name, | |
| 896 | + Word8 default_value | |
| 897 | + ) = | |
| 898 | + if get_Word8(fields, _field_name) is | |
| 899 | + { | |
| 900 | + failure then default_value | |
| 901 | + success(value) then value | |
| 902 | + }. | |
| 903 | + | |
| 904 | +public define One | |
| 905 | + put_Word8 | |
| 906 | + ( | |
| 907 | + Var(List(Session_Field)) fields, | |
| 908 | + String _field_name, | |
| 909 | + Word8 _field_value | |
| 910 | + )= | |
| 911 | + fields <- [session_field(_field_name, word8_t, var(word8(_field_value))) . *fields] | |
| 912 | +. | |
| 913 | + | |
| 914 | +public define One | |
| 915 | + replace_Word8 | |
| 916 | + ( | |
| 917 | + Var(List(Session_Field)) fields, | |
| 918 | + String _field_name, | |
| 919 | + Word8 _field_value | |
| 920 | + )= | |
| 921 | + replace_any(fields, word8_t, _field_name, word8(_field_value)) | |
| 922 | +. | |
| 923 | + | |
| 924 | +public define One | |
| 925 | + remove_Word8 | |
| 926 | + ( | |
| 927 | + Var(List(Session_Field)) fields, | |
| 928 | + String _field_name | |
| 929 | + )= | |
| 930 | + remove_any(fields, word8_t, _field_name) | |
| 931 | +. | |
| 932 | + | |
| 933 | + /*************** Word4 *****************/ | |
| 934 | + | |
| 935 | + Maybe(Word4) get_Word4(fields, _field_name) | |
| 936 | + Word4 get_Word4(fields, _field_name, default_value) | |
| 937 | + | |
| 938 | +public define Maybe(Word4) | |
| 939 | + get_Word4 | |
| 940 | + ( | |
| 941 | + Var(List(Session_Field)) fields, | |
| 942 | + String _field_name, | |
| 943 | + ) = | |
| 944 | + if get_field(*fields, word4_t, _field_name) is | |
| 945 | + { | |
| 946 | + failure then failure, | |
| 947 | + success(datum) then | |
| 948 | + if datum is word4(value) then | |
| 949 | + success(value) | |
| 950 | + else | |
| 951 | + failure | |
| 952 | + } | |
| 953 | +. | |
| 954 | + | |
| 955 | +public define Word4 | |
| 956 | + get_Word4 | |
| 957 | + ( | |
| 958 | + Var(List(Session_Field)) fields, | |
| 959 | + String _field_name, | |
| 960 | + Word4 default_value | |
| 961 | + ) = | |
| 962 | + if get_Word4(fields, _field_name) is | |
| 963 | + { | |
| 964 | + failure then default_value | |
| 965 | + success(value) then value | |
| 966 | + }. | |
| 967 | + | |
| 968 | +public define One | |
| 969 | + put_Word4 | |
| 970 | + ( | |
| 971 | + Var(List(Session_Field)) fields, | |
| 972 | + String _field_name, | |
| 973 | + Word4 _field_value | |
| 974 | + )= | |
| 975 | + fields <- [session_field(_field_name, word4_t, var(word4(_field_value))) . *fields] | |
| 976 | +. | |
| 977 | + | |
| 978 | +public define One | |
| 979 | + replace_Word4 | |
| 980 | + ( | |
| 981 | + Var(List(Session_Field)) fields, | |
| 982 | + String _field_name, | |
| 983 | + Word4 _field_value | |
| 984 | + )= | |
| 985 | + replace_any(fields, word4_t, _field_name, word4(_field_value)) | |
| 986 | +. | |
| 987 | + | |
| 988 | +public define One | |
| 989 | + remove_Word4 | |
| 990 | + ( | |
| 991 | + Var(List(Session_Field)) fields, | |
| 992 | + String _field_name | |
| 993 | + )= | |
| 994 | + remove_any(fields, word4_t, _field_name) | |
| 995 | +. | |
| 996 | + | |
| 997 | + /*************** Fields_set *****************/ | |
| 998 | + | |
| 999 | + Maybe(Word4) get_Word4(fields, _field_name) | |
| 1000 | + Word4 get_Word4(fields, _field_name, default_value) | |
| 1001 | + | |
| 1002 | +public define Maybe(Var(List(Session_Field))) | |
| 1003 | + get_Fields_set | |
| 1004 | + ( | |
| 1005 | + Var(List(Session_Field)) fields, | |
| 1006 | + String _field_name, | |
| 1007 | + ) = | |
| 1008 | + if get_field(*fields, fields_set_t, _field_name) is | |
| 1009 | + { | |
| 1010 | + failure then failure, | |
| 1011 | + success(datum) then | |
| 1012 | + if datum is fields_set(value) then | |
| 1013 | + success(value) | |
| 1014 | + else | |
| 1015 | + failure | |
| 1016 | + } | |
| 1017 | +. | |
| 1018 | + | |
| 1019 | +public define Var(List(Session_Field)) | |
| 1020 | + get_Fields_set | |
| 1021 | + ( | |
| 1022 | + Var(List(Session_Field)) fields, | |
| 1023 | + String _field_name, | |
| 1024 | + Var(List(Session_Field)) default_value | |
| 1025 | + ) = | |
| 1026 | + if get_Fields_set(fields, _field_name) is | |
| 1027 | + { | |
| 1028 | + failure then default_value | |
| 1029 | + success(value) then value | |
| 1030 | + }. | |
| 1031 | + | |
| 1032 | + | |
| 1033 | +public define One | |
| 1034 | + put_Fields_set | |
| 1035 | + ( | |
| 1036 | + Var(List(Session_Field)) _fields, | |
| 1037 | + String _field_name, | |
| 1038 | + Var(List(Session_Field)) _field_value | |
| 1039 | + )= | |
| 1040 | + _fields <- [session_field(_field_name, fields_set_t, var(fields_set(_field_value))) . *_fields] | |
| 1041 | +. | |
| 1042 | + | |
| 1043 | +public define One | |
| 1044 | + replace_Fields_set | |
| 1045 | + ( | |
| 1046 | + Var(List(Session_Field)) _fields, | |
| 1047 | + String _field_name, | |
| 1048 | + Var(List(Session_Field)) _field_value | |
| 1049 | + )= | |
| 1050 | + replace_any(_fields, fields_set_t, _field_name, fields_set(_field_value)) | |
| 1051 | +. | |
| 1052 | + | |
| 1053 | +public define One | |
| 1054 | + remove_Fields_set | |
| 1055 | + ( | |
| 1056 | + Var(List(Session_Field)) _fields, | |
| 1057 | + String _field_name | |
| 1058 | + )= | |
| 1059 | + remove_any(_fields, fields_set_t, _field_name) | |
| 1060 | +. | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + /************************************************/ | |
| 1064 | + | |
| 1065 | +public define String dump_Session_Field_list(List(Session_Field) _fields, String indent). | |
| 1066 | + | |
| 1067 | +public define String | |
| 1068 | + dump_Session_Field | |
| 1069 | + ( | |
| 1070 | + Session_Field _field, | |
| 1071 | + String indent | |
| 1072 | + )= | |
| 1073 | + with name = "Name = ["+_field.field_name+"]", | |
| 1074 | + if *_field.field_datum is | |
| 1075 | + { | |
| 1076 | + string(_string) then name+", Type = String, Value = ["+_string+"]", | |
| 1077 | + bool(_bool) then name+", Type = Bool, Value = ["+to_String(_bool)+"]", | |
| 1078 | + int(_int) then name+", Type = Int, Value = ["+_int+"]", | |
| 1079 | + db_id(_db_id) then name+", Type = DB_id, Value = ["+_db_id+"]", | |
| 1080 | + message(_message) then name+", Type = Message, Value = ["+dump(_message)+"]", | |
| 1081 | + byte_array(_byte_array) then name+", Type = ByteArray", | |
| 1082 | + float(_float) then name+", Type = Float, Value = ["+float_to_string(_float, 10)+"]", | |
| 1083 | + word128(_word128) then name+", Type = Word128, Value = ["+to_decimal(_word128)+"]", | |
| 1084 | + word64(_word64) then name+", Type = Word64, Value = ["+to_decimal(_word64)+"]", | |
| 1085 | + word32(_word32) then name+", Type = Word32, Value = ["+to_decimal(_word32)+"]", | |
| 1086 | + word16(_word16) then name+", Type = Word16, Value = ["+to_decimal(_word16)+"]", | |
| 1087 | + word8(_word8) then name+", Type = Word8, Value = ["+to_decimal(_word8)+"]", | |
| 1088 | + word4(_word4) then name+", Type = Word4, Value = ["+to_decimal(_word4)+"]", | |
| 1089 | + fields_set(_fields) then name+", Type = Fields_set, \n"+dump_Session_Field_list(*_fields, indent+" ") | |
| 1090 | + } | |
| 1091 | +. | |
| 1092 | + | |
| 1093 | +public define String | |
| 1094 | + dump_Session_Field_list | |
| 1095 | + ( | |
| 1096 | + List(Session_Field) _fields, | |
| 1097 | + String indent | |
| 1098 | + )= | |
| 1099 | + join("\n", map((Session_Field _field) |-> dump_Session_Field(_field, indent), _fields)) | |
| 1100 | +. | |
| 1101 | + | ... | ... |
| 1 | +/* | |
| 2 | + * Created by PyramIDE. | |
| 3 | + * User: フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 02/04/2020 | |
| 5 | + * Time: 16:39 | |
| 6 | + * © David RENÉ | |
| 7 | + */ | |
| 8 | + | |
| 9 | +transmit tools/basis.anubis | |
| 10 | +transmit calexium_lib/database/db_types.anubis | |
| 11 | + | |
| 12 | +public type Session_Field:... | |
| 13 | +public type Session_Field_No_Var:... | |
| 14 | + | |
| 15 | +public type Session_Field_Datum: | |
| 16 | + string(String), //fully implented | |
| 17 | + bool(Bool), //fully implented | |
| 18 | + int(Int), //fully implemented | |
| 19 | + db_id(DB_id), | |
| 20 | + message(Message), //fully implemented | |
| 21 | + byte_array(ByteArray), | |
| 22 | + float(Float), | |
| 23 | + word128(Word128), | |
| 24 | + word64(Word64), | |
| 25 | + word32(Word32), | |
| 26 | + word16(Word16), | |
| 27 | + word8(Word8), | |
| 28 | + word4(Word4), | |
| 29 | + fields_set(Var(List(Session_Field))) | |
| 30 | + //WEB_Request | |
| 31 | +. | |
| 32 | + | |
| 33 | +public type Session_Field_Datum_No_Var: | |
| 34 | + string(String), //fully implented | |
| 35 | + bool(Bool), //fully implented | |
| 36 | + int(Int), //fully implemented | |
| 37 | + db_id(DB_id), | |
| 38 | + message(Message), //fully implemented | |
| 39 | + byte_array(ByteArray), | |
| 40 | + float(Float), | |
| 41 | + word128(Word128), | |
| 42 | + word64(Word64), | |
| 43 | + word32(Word32), | |
| 44 | + word16(Word16), | |
| 45 | + word8(Word8), | |
| 46 | + word4(Word4), | |
| 47 | + fields_set(List(Session_Field_No_Var)) | |
| 48 | + //WEB_Request | |
| 49 | +. | |
| 50 | + | |
| 51 | +public type Session_Field_Type: | |
| 52 | + string_t, | |
| 53 | + bool_t, | |
| 54 | + int_t, | |
| 55 | + db_id_t, | |
| 56 | + message_t, | |
| 57 | + byte_array_t, | |
| 58 | + float_t, | |
| 59 | + word128_t, | |
| 60 | + word64_t, | |
| 61 | + word32_t, | |
| 62 | + word16_t, | |
| 63 | + word8_t, | |
| 64 | + word4_t, | |
| 65 | + fields_set_t | |
| 66 | +. | |
| 67 | + | |
| 68 | +public type Session_Field: | |
| 69 | + session_field( | |
| 70 | + String field_name, | |
| 71 | + Session_Field_Type field_type, | |
| 72 | + Var(Session_Field_Datum) field_datum //Var because it can be replaced | |
| 73 | + ) | |
| 74 | +. | |
| 75 | + | |
| 76 | +public type Session_Field_No_Var: | |
| 77 | + session_field( | |
| 78 | + String field_name, | |
| 79 | + Session_Field_Type field_type, | |
| 80 | + Session_Field_Datum_No_Var field_datum //Var because it can be replaced | |
| 81 | + ) | |
| 82 | +. | ... | ... |
web/CXM_web_session.anubis
| ... | ... | @@ -10,6 +10,7 @@ read system/convert.anubis |
| 10 | 10 | read system/muscle.anubis |
| 11 | 11 | read calexium_lib/database/db_types.anubis |
| 12 | 12 | transmit types/web_session.anubis |
| 13 | +transmit calexium_lib/generic/session.anubis | |
| 13 | 14 | read CXM_common.anubis |
| 14 | 15 | read CXM_web_dump.anubis |
| 15 | 16 | |
| ... | ... | @@ -25,18 +26,6 @@ read CXM_web_dump.anubis |
| 25 | 26 | //"AWS_CURRENT_MENU" Menu current menu, on the top of the page |
| 26 | 27 | |
| 27 | 28 | |
| 28 | -public define Var(List(WEB_Session_Field)) | |
| 29 | - empty_fields_list = | |
| 30 | - var([]). | |
| 31 | - | |
| 32 | -public define WEB_Session_Field | |
| 33 | - session_field | |
| 34 | - ( | |
| 35 | - String _field_name, | |
| 36 | - String _string | |
| 37 | - )= | |
| 38 | - session_field(_field_name, string_t, var(string(_string))) | |
| 39 | -. | |
| 40 | 29 | |
| 41 | 30 | *----------------------------------------------------------------* |
| 42 | 31 | |
| ... | ... | @@ -48,66 +37,14 @@ public define String |
| 48 | 37 | . |
| 49 | 38 | |
| 50 | 39 | |
| 51 | -define Var(List(WEB_Session_Field)) | |
| 52 | - to_WEB_Session_Field | |
| 53 | - ( | |
| 54 | - List(WEB_Session_Field_No_Var) fields | |
| 55 | - )= | |
| 56 | - var(map((WEB_Session_Field_No_Var field) |-> | |
| 57 | - with datum = if field.field_datum is{ | |
| 58 | - string(v) then string(v), | |
| 59 | - bool(v) then bool(v), | |
| 60 | - int(v) then int(v), | |
| 61 | - db_id(v) then db_id(v), | |
| 62 | - message(v) then message(v), | |
| 63 | - byte_array(v) then byte_array(v), | |
| 64 | - float(v) then float(v), | |
| 65 | - word128(v) then word128(v), | |
| 66 | - word64(v) then word64(v), | |
| 67 | - word32(v) then word32(v), | |
| 68 | - word16(v) then word16(v), | |
| 69 | - word8(v) then word8(v), | |
| 70 | - word4(v) then word4(v), | |
| 71 | - fields_set(v) then fields_set(to_WEB_Session_Field(v)) | |
| 72 | - }, | |
| 73 | - session_field(field.field_name, field.field_type, var(datum)) | |
| 74 | - , | |
| 75 | - fields) | |
| 76 | - ) | |
| 77 | -. | |
| 78 | - | |
| 79 | -define List(WEB_Session_Field_No_Var) | |
| 80 | - to_WEB_Session_Field_No_Var | |
| 81 | - ( | |
| 82 | - List(WEB_Session_Field) fields | |
| 83 | - )= | |
| 84 | - map((WEB_Session_Field field) |-> | |
| 85 | - with datum = if *field.field_datum is{ | |
| 86 | - string(v) then string(v), | |
| 87 | - bool(v) then bool(v), | |
| 88 | - int(v) then int(v), | |
| 89 | - db_id(v) then db_id(v), | |
| 90 | - message(v) then message(v), | |
| 91 | - byte_array(v) then byte_array(v), | |
| 92 | - float(v) then float(v), | |
| 93 | - word128(v) then word128(v), | |
| 94 | - word64(v) then word64(v), | |
| 95 | - word32(v) then word32(v), | |
| 96 | - word16(v) then word16(v), | |
| 97 | - word8(v) then word8(v), | |
| 98 | - word4(v) then word4(v), | |
| 99 | - fields_set(v) then fields_set(to_WEB_Session_Field_No_Var(*v)) | |
| 100 | - }, | |
| 101 | - session_field(field.field_name, field.field_type, datum), fields) | |
| 102 | -. | |
| 103 | - | |
| 40 | + | |
| 104 | 41 | public define WEB_Session |
| 105 | 42 | to_WEB_Session |
| 106 | 43 | ( |
| 107 | 44 | WEB_Session_No_Var _session |
| 108 | 45 | )= |
| 109 | 46 | since _session is web_session(id, language, fields, c_web_request, p_web_request, d_web_request), |
| 110 | - web_session(id, language, to_WEB_Session_Field(fields), | |
| 47 | + web_session(id, language, to_Session_Field(fields), | |
| 111 | 48 | web_request(c_web_request.http_info, var(c_web_request.lwa), c_web_request.is_https), |
| 112 | 49 | web_request(p_web_request.http_info, var(p_web_request.lwa), p_web_request.is_https), |
| 113 | 50 | web_request(d_web_request.http_info, var(d_web_request.lwa), d_web_request.is_https), |
| ... | ... | @@ -120,996 +57,13 @@ public define WEB_Session_No_Var |
| 120 | 57 | WEB_Session _session |
| 121 | 58 | )= |
| 122 | 59 | since _session is web_session(id, language, fields, c_web_request, p_web_request, d_web_request), |
| 123 | - web_session(id, language, to_WEB_Session_Field_No_Var(*fields), | |
| 60 | + web_session(id, language, to_Session_Field_No_Var(*fields), | |
| 124 | 61 | web_request(c_web_request.http_info, *c_web_request.lwa, c_web_request.is_https), |
| 125 | 62 | web_request(p_web_request.http_info, *p_web_request.lwa, p_web_request.is_https), |
| 126 | 63 | web_request(d_web_request.http_info, *d_web_request.lwa, d_web_request.is_https), |
| 127 | 64 | ) |
| 128 | 65 | . |
| 129 | 66 | |
| 130 | -public define Maybe(WEB_Session_Field_Datum) | |
| 131 | - get_field | |
| 132 | - ( | |
| 133 | - List(WEB_Session_Field) fields, | |
| 134 | - WEB_Session_Field_Type _field_type, | |
| 135 | - String _field_name | |
| 136 | - ) = | |
| 137 | - if fields is | |
| 138 | - { | |
| 139 | - [] then failure, | |
| 140 | - [h . t] then | |
| 141 | - if h.field_name = _field_name & h.field_type = _field_type then | |
| 142 | - success(*h.field_datum) | |
| 143 | - else | |
| 144 | - get_field(t, _field_type, _field_name) | |
| 145 | - } | |
| 146 | -. | |
| 147 | - /******** ANY functions ***************/ | |
| 148 | - | |
| 149 | - | |
| 150 | -define List(WEB_Session_Field) | |
| 151 | - _remove_any | |
| 152 | - ( | |
| 153 | - List(WEB_Session_Field) fields, | |
| 154 | - WEB_Session_Field_Type _field_type, | |
| 155 | - String _field_name | |
| 156 | - )= | |
| 157 | - if fields is | |
| 158 | - { | |
| 159 | - [] then [], | |
| 160 | - [h . t] then | |
| 161 | - if h.field_name = _field_name & h.field_type = _field_type then | |
| 162 | - _remove_any(t, _field_type, _field_name) | |
| 163 | - else | |
| 164 | - [ h. _remove_any(t, _field_type, _field_name) ] | |
| 165 | - } | |
| 166 | -. | |
| 167 | - | |
| 168 | -define One | |
| 169 | - remove_any | |
| 170 | - ( | |
| 171 | - Var(List(WEB_Session_Field)) fields, | |
| 172 | - WEB_Session_Field_Type _field_type, | |
| 173 | - String _field_name | |
| 174 | - )= | |
| 175 | - fields <- _remove_any(*fields, _field_type, _field_name) | |
| 176 | -. | |
| 177 | - | |
| 178 | -define One | |
| 179 | - replace_any | |
| 180 | - ( | |
| 181 | - List(WEB_Session_Field) fields, | |
| 182 | - WEB_Session_Field_Type _field_type, | |
| 183 | - String _field_name, | |
| 184 | - WEB_Session_Field_Datum _field_value, | |
| 185 | - Var(List(WEB_Session_Field)) fields_org, | |
| 186 | - )= | |
| 187 | - if fields is | |
| 188 | - { | |
| 189 | - [] then fields_org <- [session_field(_field_name, _field_type, var(_field_value)) . *fields_org], | |
| 190 | - [h . t] then | |
| 191 | - //println("h.field_name = "+h.field_name+" _field_name = "+_field_name); | |
| 192 | - if h.field_name = _field_name & h.field_type = _field_type then | |
| 193 | - //println("replace field_name found"); | |
| 194 | - h.field_datum <- _field_value | |
| 195 | - else | |
| 196 | - replace_any(t, _field_type, _field_name, _field_value, fields_org) | |
| 197 | - } | |
| 198 | -. | |
| 199 | - | |
| 200 | - | |
| 201 | -define One | |
| 202 | - replace_any | |
| 203 | - ( | |
| 204 | - Var(List(WEB_Session_Field)) fields, | |
| 205 | - WEB_Session_Field_Type _field_type, | |
| 206 | - String _field_name, | |
| 207 | - WEB_Session_Field_Datum _field_value | |
| 208 | - )= | |
| 209 | - replace_any(*fields, _field_type, _field_name, _field_value, fields) | |
| 210 | -. | |
| 211 | - | |
| 212 | - /*************** String *****************/ | |
| 213 | - | |
| 214 | - Maybe(String) get_String(fields, _field_name) | |
| 215 | - String get_String(fields, _field_name, default_value) | |
| 216 | - | |
| 217 | -public define Maybe(String) | |
| 218 | - get_String | |
| 219 | - ( | |
| 220 | - Var(List(WEB_Session_Field)) fields, | |
| 221 | - String _field_name | |
| 222 | - ) = | |
| 223 | - if get_field(*fields, string_t, _field_name) is | |
| 224 | - { | |
| 225 | - failure then failure, | |
| 226 | - success(datum) then | |
| 227 | - if datum is string(value) then | |
| 228 | - success(value) | |
| 229 | - else | |
| 230 | - failure | |
| 231 | - } | |
| 232 | -. | |
| 233 | - | |
| 234 | -public define String | |
| 235 | - get_String | |
| 236 | - ( | |
| 237 | - Var(List(WEB_Session_Field)) fields, | |
| 238 | - String _field_name, | |
| 239 | - String default_value | |
| 240 | - ) = | |
| 241 | - if get_String(fields, _field_name) is | |
| 242 | - { | |
| 243 | - failure then default_value | |
| 244 | - success(value) then value | |
| 245 | - }. | |
| 246 | - | |
| 247 | -public define One | |
| 248 | - put_String | |
| 249 | - ( | |
| 250 | - Var(List(WEB_Session_Field)) fields, | |
| 251 | - String _field_name, | |
| 252 | - String _field_value | |
| 253 | - )= | |
| 254 | - fields <- [session_field(_field_name, string_t, var(string(_field_value))) . *fields] | |
| 255 | -. | |
| 256 | - | |
| 257 | -public define One | |
| 258 | - replace_String | |
| 259 | - ( | |
| 260 | - Var(List(WEB_Session_Field)) fields, | |
| 261 | - String _field_name, | |
| 262 | - String _field_value | |
| 263 | - )= | |
| 264 | - replace_any(fields, string_t, _field_name, string(_field_value)) | |
| 265 | -. | |
| 266 | - | |
| 267 | - | |
| 268 | -public define One | |
| 269 | - remove_String | |
| 270 | - ( | |
| 271 | - Var(List(WEB_Session_Field)) fields, | |
| 272 | - String _field_name | |
| 273 | - )= | |
| 274 | - remove_any(fields, string_t, _field_name) | |
| 275 | -. | |
| 276 | - | |
| 277 | - /*************** Bool *****************/ | |
| 278 | - | |
| 279 | - Maybe(Bool) get_Bool(fields, _field_name) | |
| 280 | - Bool get_Bool(fields, _field_name, default_value) | |
| 281 | - | |
| 282 | -public define Maybe(Bool) | |
| 283 | - get_Bool | |
| 284 | - ( | |
| 285 | - Var(List(WEB_Session_Field)) fields, | |
| 286 | - String _field_name | |
| 287 | - ) = | |
| 288 | - if get_field(*fields, bool_t, _field_name) is | |
| 289 | - { | |
| 290 | - failure then failure, | |
| 291 | - success(datum) then | |
| 292 | - if datum is bool(value) then | |
| 293 | - success(value) | |
| 294 | - else | |
| 295 | - failure | |
| 296 | - } | |
| 297 | -. | |
| 298 | - | |
| 299 | -public define Bool | |
| 300 | - get_Bool | |
| 301 | - ( | |
| 302 | - Var(List(WEB_Session_Field)) fields, | |
| 303 | - String _field_name, | |
| 304 | - Bool default_value | |
| 305 | - ) = | |
| 306 | - if get_Bool(fields, _field_name) is | |
| 307 | - { | |
| 308 | - failure then default_value | |
| 309 | - success(value) then value | |
| 310 | - }. | |
| 311 | - | |
| 312 | -public define One | |
| 313 | - put_Bool | |
| 314 | - ( | |
| 315 | - Var(List(WEB_Session_Field)) fields, | |
| 316 | - String _field_name, | |
| 317 | - Bool _field_value | |
| 318 | - )= | |
| 319 | - fields <- [session_field(_field_name, bool_t, var(bool(_field_value))) . *fields] | |
| 320 | -. | |
| 321 | - | |
| 322 | -public define One | |
| 323 | - replace_Bool | |
| 324 | - ( | |
| 325 | - Var(List(WEB_Session_Field)) fields, | |
| 326 | - String _field_name, | |
| 327 | - Bool _field_value | |
| 328 | - )= | |
| 329 | - replace_any(fields, bool_t, _field_name, bool(_field_value)) | |
| 330 | -. | |
| 331 | - | |
| 332 | - | |
| 333 | -public define One | |
| 334 | - remove_Bool | |
| 335 | - ( | |
| 336 | - Var(List(WEB_Session_Field)) fields, | |
| 337 | - String _field_name | |
| 338 | - )= | |
| 339 | - remove_any(fields, bool_t, _field_name) | |
| 340 | -. | |
| 341 | - | |
| 342 | - /*************** Int *****************/ | |
| 343 | - | |
| 344 | - Maybe(String) get_Int(fields, _field_name) | |
| 345 | - String get_Int(fields, _field_name, default_value) | |
| 346 | - | |
| 347 | -public define Maybe(Int) | |
| 348 | - get_Int | |
| 349 | - ( | |
| 350 | - Var(List(WEB_Session_Field)) fields, | |
| 351 | - String _field_name, | |
| 352 | - ) = | |
| 353 | - if get_field(*fields, int_t, _field_name) is | |
| 354 | - { | |
| 355 | - failure then failure, | |
| 356 | - success(datum) then | |
| 357 | - if datum is int(value) then | |
| 358 | - success(value) | |
| 359 | - else | |
| 360 | - failure | |
| 361 | - } | |
| 362 | -. | |
| 363 | - | |
| 364 | -public define Int | |
| 365 | - get_Int | |
| 366 | - ( | |
| 367 | - Var(List(WEB_Session_Field)) fields, | |
| 368 | - String _field_name, | |
| 369 | - Int default_value | |
| 370 | - ) = | |
| 371 | - if get_Int(fields, _field_name) is | |
| 372 | - { | |
| 373 | - failure then default_value | |
| 374 | - success(value) then value | |
| 375 | - }. | |
| 376 | - | |
| 377 | -public define One | |
| 378 | - put_Int | |
| 379 | - ( | |
| 380 | - Var(List(WEB_Session_Field)) fields, | |
| 381 | - String _field_name, | |
| 382 | - Int _field_value | |
| 383 | - )= | |
| 384 | - fields <- [session_field(_field_name, int_t, var(int(_field_value))) . *fields] | |
| 385 | -. | |
| 386 | - | |
| 387 | -public define One | |
| 388 | - replace_Int | |
| 389 | - ( | |
| 390 | - Var(List(WEB_Session_Field)) fields, | |
| 391 | - String _field_name, | |
| 392 | - Int _field_value | |
| 393 | - )= | |
| 394 | - replace_any(fields, int_t, _field_name, int(_field_value)) | |
| 395 | -. | |
| 396 | - | |
| 397 | - | |
| 398 | -public define One | |
| 399 | - remove_Int | |
| 400 | - ( | |
| 401 | - Var(List(WEB_Session_Field)) fields, | |
| 402 | - String _field_name | |
| 403 | - )= | |
| 404 | - remove_any(fields, int_t, _field_name) | |
| 405 | -. | |
| 406 | - | |
| 407 | - /*************** DB_id *****************/ | |
| 408 | - | |
| 409 | - Maybe(String) get_DB_id(fields, _field_name) | |
| 410 | - String get_DB_id(fields, _field_name, default_value) | |
| 411 | - | |
| 412 | -public define Maybe(DB_id) | |
| 413 | - get_DB_id | |
| 414 | - ( | |
| 415 | - Var(List(WEB_Session_Field)) fields, | |
| 416 | - String _field_name, | |
| 417 | - ) = | |
| 418 | - if get_field(*fields, db_id_t, _field_name) is | |
| 419 | - { | |
| 420 | - failure then failure, | |
| 421 | - success(datum) then | |
| 422 | - if datum is db_id(value) then | |
| 423 | - success(value) | |
| 424 | - else | |
| 425 | - failure | |
| 426 | - } | |
| 427 | -. | |
| 428 | - | |
| 429 | -public define DB_id | |
| 430 | - get_DB_id | |
| 431 | - ( | |
| 432 | - Var(List(WEB_Session_Field)) fields, | |
| 433 | - String _field_name, | |
| 434 | - DB_id default_value | |
| 435 | - ) = | |
| 436 | - if get_DB_id(fields, _field_name) is | |
| 437 | - { | |
| 438 | - failure then default_value | |
| 439 | - success(value) then value | |
| 440 | - }. | |
| 441 | - | |
| 442 | -public define One | |
| 443 | - put_DB_id | |
| 444 | - ( | |
| 445 | - Var(List(WEB_Session_Field)) fields, | |
| 446 | - String _field_name, | |
| 447 | - DB_id _field_value | |
| 448 | - )= | |
| 449 | - fields <- [session_field(_field_name, int_t, var(db_id(_field_value))) . *fields] | |
| 450 | -. | |
| 451 | - | |
| 452 | -public define One | |
| 453 | - replace_DB_id | |
| 454 | - ( | |
| 455 | - Var(List(WEB_Session_Field)) fields, | |
| 456 | - String _field_name, | |
| 457 | - DB_id _field_value | |
| 458 | - )= | |
| 459 | - replace_any(fields, db_id_t, _field_name, db_id(_field_value)) | |
| 460 | -. | |
| 461 | - | |
| 462 | - | |
| 463 | -public define One | |
| 464 | - remove_DB_id | |
| 465 | - ( | |
| 466 | - Var(List(WEB_Session_Field)) fields, | |
| 467 | - String _field_name | |
| 468 | - )= | |
| 469 | - remove_any(fields, db_id_t, _field_name) | |
| 470 | -. | |
| 471 | - | |
| 472 | - /*************** Message *****************/ | |
| 473 | - | |
| 474 | - Maybe(String) get_Message(fields, _field_name) | |
| 475 | - String get_Message(fiels, _field_name, default_value) | |
| 476 | - | |
| 477 | -public define Maybe(Message) | |
| 478 | - get_Message | |
| 479 | - ( | |
| 480 | - Var(List(WEB_Session_Field)) fields, | |
| 481 | - String _field_name | |
| 482 | - ) = | |
| 483 | - if get_field(*fields, message_t, _field_name) is | |
| 484 | - { | |
| 485 | - failure then failure, | |
| 486 | - success(datum) then | |
| 487 | - if datum is message(value) then | |
| 488 | - success(value) | |
| 489 | - else | |
| 490 | - failure | |
| 491 | - } | |
| 492 | -. | |
| 493 | - | |
| 494 | -public define Message | |
| 495 | - get_Message | |
| 496 | - ( | |
| 497 | - Var(List(WEB_Session_Field)) fields, | |
| 498 | - String _field_name, | |
| 499 | - Message default_value | |
| 500 | - ) = | |
| 501 | - if get_Message(fields, _field_name) is | |
| 502 | - { | |
| 503 | - failure then default_value | |
| 504 | - success(value) then value | |
| 505 | - }. | |
| 506 | - | |
| 507 | -public define One | |
| 508 | - put_Message | |
| 509 | - ( | |
| 510 | - Var(List(WEB_Session_Field)) fields, | |
| 511 | - String _field_name, | |
| 512 | - Message _field_value | |
| 513 | - )= | |
| 514 | - fields <- [session_field(_field_name, message_t, var(message(_field_value))) . *fields] | |
| 515 | -. | |
| 516 | - | |
| 517 | -public define One | |
| 518 | - replace_Message | |
| 519 | - ( | |
| 520 | - Var(List(WEB_Session_Field)) fields, | |
| 521 | - String _field_name, | |
| 522 | - Message _field_value | |
| 523 | - )= | |
| 524 | - replace_any(fields, message_t, _field_name, message(_field_value)) | |
| 525 | -. | |
| 526 | - | |
| 527 | -public define One | |
| 528 | - remove_Message | |
| 529 | - ( | |
| 530 | - Var(List(WEB_Session_Field)) fields, | |
| 531 | - String _field_name | |
| 532 | - )= | |
| 533 | - remove_any(fields, message_t, _field_name) | |
| 534 | -. | |
| 535 | - | |
| 536 | - /*************** ByteArray *****************/ | |
| 537 | - | |
| 538 | - Maybe(ByteArray) get_ByteArray(fields, _field_name) | |
| 539 | - ByteArray get_ByteArray(fiels, _field_name, default_value) | |
| 540 | - | |
| 541 | -public define Maybe(ByteArray) | |
| 542 | - get_ByteArray | |
| 543 | - ( | |
| 544 | - Var(List(WEB_Session_Field)) fields, | |
| 545 | - String _field_name, | |
| 546 | - ) = | |
| 547 | - if get_field(*fields, byte_array_t, _field_name) is | |
| 548 | - { | |
| 549 | - failure then failure, | |
| 550 | - success(datum) then | |
| 551 | - if datum is byte_array(value) then | |
| 552 | - success(value) | |
| 553 | - else | |
| 554 | - failure | |
| 555 | - } | |
| 556 | -. | |
| 557 | - | |
| 558 | -public define ByteArray | |
| 559 | - get_ByteArray | |
| 560 | - ( | |
| 561 | - Var(List(WEB_Session_Field)) fields, | |
| 562 | - String _field_name, | |
| 563 | - ByteArray default_value | |
| 564 | - ) = | |
| 565 | - if get_ByteArray(fields, _field_name) is | |
| 566 | - { | |
| 567 | - failure then default_value | |
| 568 | - success(value) then value | |
| 569 | - }. | |
| 570 | - | |
| 571 | -public define One | |
| 572 | - put_ByteArray | |
| 573 | - ( | |
| 574 | - Var(List(WEB_Session_Field)) fields, | |
| 575 | - String _field_name, | |
| 576 | - ByteArray _field_value | |
| 577 | - )= | |
| 578 | - fields <- [session_field(_field_name, byte_array_t, var(byte_array(_field_value))) . *fields] | |
| 579 | -. | |
| 580 | - | |
| 581 | -public define One | |
| 582 | - replace_ByteArray | |
| 583 | - ( | |
| 584 | - Var(List(WEB_Session_Field)) fields, | |
| 585 | - String _field_name, | |
| 586 | - ByteArray _field_value | |
| 587 | - )= | |
| 588 | - replace_any(fields, byte_array_t, _field_name, byte_array(_field_value)) | |
| 589 | -. | |
| 590 | - | |
| 591 | -public define One | |
| 592 | - remove_ByteArray | |
| 593 | - ( | |
| 594 | - Var(List(WEB_Session_Field)) fields, | |
| 595 | - String _field_name | |
| 596 | - )= | |
| 597 | - remove_any(fields, byte_array_t, _field_name) | |
| 598 | -. | |
| 599 | - | |
| 600 | - /*************** Float *****************/ | |
| 601 | - | |
| 602 | - Maybe(Float) get_Float(fields, _field_name) | |
| 603 | - Float get_Float(fiels, _field_name, default_value) | |
| 604 | - | |
| 605 | -public define Maybe(Float) | |
| 606 | - get_Float | |
| 607 | - ( | |
| 608 | - Var(List(WEB_Session_Field)) fields, | |
| 609 | - String _field_name, | |
| 610 | - ) = | |
| 611 | - if get_field(*fields, float_t, _field_name) is | |
| 612 | - { | |
| 613 | - failure then failure, | |
| 614 | - success(datum) then | |
| 615 | - if datum is float(value) then | |
| 616 | - success(value) | |
| 617 | - else | |
| 618 | - failure | |
| 619 | - } | |
| 620 | -. | |
| 621 | - | |
| 622 | -public define Float | |
| 623 | - get_Float | |
| 624 | - ( | |
| 625 | - Var(List(WEB_Session_Field)) fields, | |
| 626 | - String _field_name, | |
| 627 | - Float default_value | |
| 628 | - ) = | |
| 629 | - if get_Float(fields, _field_name) is | |
| 630 | - { | |
| 631 | - failure then default_value | |
| 632 | - success(value) then value | |
| 633 | - }. | |
| 634 | - | |
| 635 | -public define One | |
| 636 | - put_Float | |
| 637 | - ( | |
| 638 | - Var(List(WEB_Session_Field)) fields, | |
| 639 | - String _field_name, | |
| 640 | - Float _field_value | |
| 641 | - )= | |
| 642 | - fields <- [session_field(_field_name, float_t, var(float(_field_value))) . *fields] | |
| 643 | -. | |
| 644 | - | |
| 645 | -public define One | |
| 646 | - replace_Float | |
| 647 | - ( | |
| 648 | - Var(List(WEB_Session_Field)) fields, | |
| 649 | - String _field_name, | |
| 650 | - Float _field_value | |
| 651 | - )= | |
| 652 | - replace_any(fields, float_t, _field_name, float(_field_value)) | |
| 653 | -. | |
| 654 | - | |
| 655 | -public define One | |
| 656 | - remove_Float | |
| 657 | - ( | |
| 658 | - Var(List(WEB_Session_Field)) fields, | |
| 659 | - String _field_name | |
| 660 | - )= | |
| 661 | - remove_any(fields, float_t, _field_name) | |
| 662 | -. | |
| 663 | - | |
| 664 | - /*************** Word128 *****************/ | |
| 665 | - | |
| 666 | - Maybe(Word128) get_Word128t(fields, _field_name) | |
| 667 | - Word128 get_Word128(fields, _field_name, default_value) | |
| 668 | - | |
| 669 | -public define Maybe(Word128) | |
| 670 | - get_Word128 | |
| 671 | - ( | |
| 672 | - Var(List(WEB_Session_Field)) fields, | |
| 673 | - String _field_name, | |
| 674 | - ) = | |
| 675 | - if get_field(*fields, word128_t, _field_name) is | |
| 676 | - { | |
| 677 | - failure then failure, | |
| 678 | - success(datum) then | |
| 679 | - if datum is word128(value) then | |
| 680 | - success(value) | |
| 681 | - else | |
| 682 | - failure | |
| 683 | - } | |
| 684 | -. | |
| 685 | - | |
| 686 | -public define Word128 | |
| 687 | - get_Word128 | |
| 688 | - ( | |
| 689 | - Var(List(WEB_Session_Field)) fields, | |
| 690 | - String _field_name, | |
| 691 | - Word128 default_value | |
| 692 | - ) = | |
| 693 | - if get_Word128(fields, _field_name) is | |
| 694 | - { | |
| 695 | - failure then default_value | |
| 696 | - success(value) then value | |
| 697 | - }. | |
| 698 | - | |
| 699 | -public define One | |
| 700 | - put_Word128 | |
| 701 | - ( | |
| 702 | - Var(List(WEB_Session_Field)) fields, | |
| 703 | - String _field_name, | |
| 704 | - Word128 _field_value | |
| 705 | - )= | |
| 706 | - fields <- [session_field(_field_name, word128_t, var(word128(_field_value))) . *fields] | |
| 707 | -. | |
| 708 | - | |
| 709 | -public define One | |
| 710 | - replace_Word128 | |
| 711 | - ( | |
| 712 | - Var(List(WEB_Session_Field)) fields, | |
| 713 | - String _field_name, | |
| 714 | - Word128 _field_value | |
| 715 | - )= | |
| 716 | - replace_any(fields, word128_t, _field_name, word128(_field_value)) | |
| 717 | -. | |
| 718 | - | |
| 719 | -public define One | |
| 720 | - remove_Word128 | |
| 721 | - ( | |
| 722 | - Var(List(WEB_Session_Field)) fields, | |
| 723 | - String _field_name | |
| 724 | - )= | |
| 725 | - remove_any(fields, word128_t, _field_name) | |
| 726 | -. | |
| 727 | - | |
| 728 | - /*************** Word64 *****************/ | |
| 729 | - | |
| 730 | - Maybe(Word64) get_Word64(fields, _field_name) | |
| 731 | - Word64 get_Word64(fields, _field_name, default_value) | |
| 732 | - | |
| 733 | -public define Maybe(Word64) | |
| 734 | - get_Word64 | |
| 735 | - ( | |
| 736 | - Var(List(WEB_Session_Field)) fields, | |
| 737 | - String _field_name, | |
| 738 | - ) = | |
| 739 | - if get_field(*fields, word64_t, _field_name) is | |
| 740 | - { | |
| 741 | - failure then failure, | |
| 742 | - success(datum) then | |
| 743 | - if datum is word64(value) then | |
| 744 | - success(value) | |
| 745 | - else | |
| 746 | - failure | |
| 747 | - } | |
| 748 | -. | |
| 749 | - | |
| 750 | -public define Word64 | |
| 751 | - get_Word64 | |
| 752 | - ( | |
| 753 | - Var(List(WEB_Session_Field)) fields, | |
| 754 | - String _field_name, | |
| 755 | - Word64 default_value | |
| 756 | - ) = | |
| 757 | - if get_Word64(fields, _field_name) is | |
| 758 | - { | |
| 759 | - failure then default_value | |
| 760 | - success(value) then value | |
| 761 | - }. | |
| 762 | - | |
| 763 | -public define One | |
| 764 | - put_Word64 | |
| 765 | - ( | |
| 766 | - Var(List(WEB_Session_Field)) fields, | |
| 767 | - String _field_name, | |
| 768 | - Word64 _field_value | |
| 769 | - )= | |
| 770 | - fields <- [session_field(_field_name, word64_t, var(word64(_field_value))) . *fields] | |
| 771 | -. | |
| 772 | - | |
| 773 | -public define One | |
| 774 | - replace_Word64 | |
| 775 | - ( | |
| 776 | - Var(List(WEB_Session_Field)) fields, | |
| 777 | - String _field_name, | |
| 778 | - Word64 _field_value | |
| 779 | - )= | |
| 780 | - replace_any(fields, word64_t, _field_name, word64(_field_value)) | |
| 781 | -. | |
| 782 | - | |
| 783 | -public define One | |
| 784 | - remove_Word64 | |
| 785 | - ( | |
| 786 | - Var(List(WEB_Session_Field)) fields, | |
| 787 | - String _field_name | |
| 788 | - )= | |
| 789 | - remove_any(fields, word64_t, _field_name) | |
| 790 | -. | |
| 791 | - | |
| 792 | - /*************** Word32 *****************/ | |
| 793 | - | |
| 794 | - Maybe(Word32) get_Word32(fields, _field_name) | |
| 795 | - Word32 get_Word32(fields, _field_name, default_value) | |
| 796 | - | |
| 797 | -public define Maybe(Word32) | |
| 798 | - get_Word32 | |
| 799 | - ( | |
| 800 | - Var(List(WEB_Session_Field)) fields, | |
| 801 | - String _field_name, | |
| 802 | - ) = | |
| 803 | - if get_field(*fields, word32_t, _field_name) is | |
| 804 | - { | |
| 805 | - failure then failure, | |
| 806 | - success(datum) then | |
| 807 | - if datum is word32(value) then | |
| 808 | - success(value) | |
| 809 | - else | |
| 810 | - failure | |
| 811 | - } | |
| 812 | -. | |
| 813 | - | |
| 814 | -public define Word32 | |
| 815 | - get_Word32 | |
| 816 | - ( | |
| 817 | - Var(List(WEB_Session_Field)) fields, | |
| 818 | - String _field_name, | |
| 819 | - Word32 default_value | |
| 820 | - ) = | |
| 821 | - if get_Word32(fields, _field_name) is | |
| 822 | - { | |
| 823 | - failure then default_value | |
| 824 | - success(value) then value | |
| 825 | - }. | |
| 826 | - | |
| 827 | -public define One | |
| 828 | - put_Word32 | |
| 829 | - ( | |
| 830 | - Var(List(WEB_Session_Field)) fields, | |
| 831 | - String _field_name, | |
| 832 | - Word32 _field_value | |
| 833 | - )= | |
| 834 | - fields <- [session_field(_field_name, word32_t, var(word32(_field_value))) . *fields] | |
| 835 | -. | |
| 836 | - | |
| 837 | -public define One | |
| 838 | - replace_Word32 | |
| 839 | - ( | |
| 840 | - Var(List(WEB_Session_Field)) fields, | |
| 841 | - String _field_name, | |
| 842 | - Word32 _field_value | |
| 843 | - )= | |
| 844 | - replace_any(fields, word32_t, _field_name, word32(_field_value)) | |
| 845 | -. | |
| 846 | - | |
| 847 | -public define One | |
| 848 | - remove_Word32 | |
| 849 | - ( | |
| 850 | - Var(List(WEB_Session_Field)) fields, | |
| 851 | - String _field_name | |
| 852 | - )= | |
| 853 | - remove_any(fields, word32_t, _field_name) | |
| 854 | -. | |
| 855 | - | |
| 856 | - /*************** Word16 *****************/ | |
| 857 | - | |
| 858 | - Maybe(Word16) get_Word16(fields, _field_name) | |
| 859 | - Word16 get_Word16(fields, _field_name, default_value) | |
| 860 | - | |
| 861 | -public define Maybe(Word16) | |
| 862 | - get_Word16 | |
| 863 | - ( | |
| 864 | - Var(List(WEB_Session_Field)) fields, | |
| 865 | - String _field_name, | |
| 866 | - ) = | |
| 867 | - if get_field(*fields, word16_t, _field_name) is | |
| 868 | - { | |
| 869 | - failure then failure, | |
| 870 | - success(datum) then | |
| 871 | - if datum is word16(value) then | |
| 872 | - success(value) | |
| 873 | - else | |
| 874 | - failure | |
| 875 | - } | |
| 876 | -. | |
| 877 | - | |
| 878 | -public define Word16 | |
| 879 | - get_Word16 | |
| 880 | - ( | |
| 881 | - Var(List(WEB_Session_Field)) fields, | |
| 882 | - String _field_name, | |
| 883 | - Word16 default_value | |
| 884 | - ) = | |
| 885 | - if get_Word16(fields, _field_name) is | |
| 886 | - { | |
| 887 | - failure then default_value | |
| 888 | - success(value) then value | |
| 889 | - }. | |
| 890 | - | |
| 891 | -public define One | |
| 892 | - put_Word16 | |
| 893 | - ( | |
| 894 | - Var(List(WEB_Session_Field)) fields, | |
| 895 | - String _field_name, | |
| 896 | - Word16 _field_value | |
| 897 | - )= | |
| 898 | - fields <- [session_field(_field_name, word16_t, var(word16(_field_value))) . *fields] | |
| 899 | -. | |
| 900 | - | |
| 901 | -public define One | |
| 902 | - replace_Word16 | |
| 903 | - ( | |
| 904 | - Var(List(WEB_Session_Field)) fields, | |
| 905 | - String _field_name, | |
| 906 | - Word16 _field_value | |
| 907 | - )= | |
| 908 | - replace_any(fields, word16_t, _field_name, word16(_field_value)) | |
| 909 | -. | |
| 910 | - | |
| 911 | -public define One | |
| 912 | - remove_Word16 | |
| 913 | - ( | |
| 914 | - Var(List(WEB_Session_Field)) fields, | |
| 915 | - String _field_name | |
| 916 | - )= | |
| 917 | - remove_any(fields, word16_t, _field_name) | |
| 918 | -. | |
| 919 | - | |
| 920 | - /*************** Word8 *****************/ | |
| 921 | - | |
| 922 | - Maybe(Word8) get_Word8(fields, _field_name) | |
| 923 | - Word8 get_Word8(fields, _field_name, default_value) | |
| 924 | - | |
| 925 | -public define Maybe(Word8) | |
| 926 | - get_Word8 | |
| 927 | - ( | |
| 928 | - Var(List(WEB_Session_Field)) fields, | |
| 929 | - String _field_name, | |
| 930 | - ) = | |
| 931 | - if get_field(*fields, word8_t, _field_name) is | |
| 932 | - { | |
| 933 | - failure then failure, | |
| 934 | - success(datum) then | |
| 935 | - if datum is word8(value) then | |
| 936 | - success(value) | |
| 937 | - else | |
| 938 | - failure | |
| 939 | - } | |
| 940 | -. | |
| 941 | - | |
| 942 | -public define Word8 | |
| 943 | - get_Word8 | |
| 944 | - ( | |
| 945 | - Var(List(WEB_Session_Field)) fields, | |
| 946 | - String _field_name, | |
| 947 | - Word8 default_value | |
| 948 | - ) = | |
| 949 | - if get_Word8(fields, _field_name) is | |
| 950 | - { | |
| 951 | - failure then default_value | |
| 952 | - success(value) then value | |
| 953 | - }. | |
| 954 | - | |
| 955 | -public define One | |
| 956 | - put_Word8 | |
| 957 | - ( | |
| 958 | - Var(List(WEB_Session_Field)) fields, | |
| 959 | - String _field_name, | |
| 960 | - Word8 _field_value | |
| 961 | - )= | |
| 962 | - fields <- [session_field(_field_name, word8_t, var(word8(_field_value))) . *fields] | |
| 963 | -. | |
| 964 | - | |
| 965 | -public define One | |
| 966 | - replace_Word8 | |
| 967 | - ( | |
| 968 | - Var(List(WEB_Session_Field)) fields, | |
| 969 | - String _field_name, | |
| 970 | - Word8 _field_value | |
| 971 | - )= | |
| 972 | - replace_any(fields, word8_t, _field_name, word8(_field_value)) | |
| 973 | -. | |
| 974 | - | |
| 975 | -public define One | |
| 976 | - remove_Word8 | |
| 977 | - ( | |
| 978 | - Var(List(WEB_Session_Field)) fields, | |
| 979 | - String _field_name | |
| 980 | - )= | |
| 981 | - remove_any(fields, word8_t, _field_name) | |
| 982 | -. | |
| 983 | - | |
| 984 | - /*************** Word4 *****************/ | |
| 985 | - | |
| 986 | - Maybe(Word4) get_Word4(fields, _field_name) | |
| 987 | - Word4 get_Word4(fields, _field_name, default_value) | |
| 988 | - | |
| 989 | -public define Maybe(Word4) | |
| 990 | - get_Word4 | |
| 991 | - ( | |
| 992 | - Var(List(WEB_Session_Field)) fields, | |
| 993 | - String _field_name, | |
| 994 | - ) = | |
| 995 | - if get_field(*fields, word4_t, _field_name) is | |
| 996 | - { | |
| 997 | - failure then failure, | |
| 998 | - success(datum) then | |
| 999 | - if datum is word4(value) then | |
| 1000 | - success(value) | |
| 1001 | - else | |
| 1002 | - failure | |
| 1003 | - } | |
| 1004 | -. | |
| 1005 | - | |
| 1006 | -public define Word4 | |
| 1007 | - get_Word4 | |
| 1008 | - ( | |
| 1009 | - Var(List(WEB_Session_Field)) fields, | |
| 1010 | - String _field_name, | |
| 1011 | - Word4 default_value | |
| 1012 | - ) = | |
| 1013 | - if get_Word4(fields, _field_name) is | |
| 1014 | - { | |
| 1015 | - failure then default_value | |
| 1016 | - success(value) then value | |
| 1017 | - }. | |
| 1018 | - | |
| 1019 | -public define One | |
| 1020 | - put_Word4 | |
| 1021 | - ( | |
| 1022 | - Var(List(WEB_Session_Field)) fields, | |
| 1023 | - String _field_name, | |
| 1024 | - Word4 _field_value | |
| 1025 | - )= | |
| 1026 | - fields <- [session_field(_field_name, word4_t, var(word4(_field_value))) . *fields] | |
| 1027 | -. | |
| 1028 | - | |
| 1029 | -public define One | |
| 1030 | - replace_Word4 | |
| 1031 | - ( | |
| 1032 | - Var(List(WEB_Session_Field)) fields, | |
| 1033 | - String _field_name, | |
| 1034 | - Word4 _field_value | |
| 1035 | - )= | |
| 1036 | - replace_any(fields, word4_t, _field_name, word4(_field_value)) | |
| 1037 | -. | |
| 1038 | - | |
| 1039 | -public define One | |
| 1040 | - remove_Word4 | |
| 1041 | - ( | |
| 1042 | - Var(List(WEB_Session_Field)) fields, | |
| 1043 | - String _field_name | |
| 1044 | - )= | |
| 1045 | - remove_any(fields, word4_t, _field_name) | |
| 1046 | -. | |
| 1047 | - | |
| 1048 | - /*************** Fields_set *****************/ | |
| 1049 | - | |
| 1050 | - Maybe(Word4) get_Word4(fields, _field_name) | |
| 1051 | - Word4 get_Word4(fields, _field_name, default_value) | |
| 1052 | - | |
| 1053 | -public define Maybe(Var(List(WEB_Session_Field))) | |
| 1054 | - get_Fields_set | |
| 1055 | - ( | |
| 1056 | - Var(List(WEB_Session_Field)) fields, | |
| 1057 | - String _field_name, | |
| 1058 | - ) = | |
| 1059 | - if get_field(*fields, fields_set_t, _field_name) is | |
| 1060 | - { | |
| 1061 | - failure then failure, | |
| 1062 | - success(datum) then | |
| 1063 | - if datum is fields_set(value) then | |
| 1064 | - success(value) | |
| 1065 | - else | |
| 1066 | - failure | |
| 1067 | - } | |
| 1068 | -. | |
| 1069 | - | |
| 1070 | -public define Var(List(WEB_Session_Field)) | |
| 1071 | - get_Fields_set | |
| 1072 | - ( | |
| 1073 | - Var(List(WEB_Session_Field)) fields, | |
| 1074 | - String _field_name, | |
| 1075 | - Var(List(WEB_Session_Field)) default_value | |
| 1076 | - ) = | |
| 1077 | - if get_Fields_set(fields, _field_name) is | |
| 1078 | - { | |
| 1079 | - failure then default_value | |
| 1080 | - success(value) then value | |
| 1081 | - }. | |
| 1082 | - | |
| 1083 | - | |
| 1084 | -public define One | |
| 1085 | - put_Fields_set | |
| 1086 | - ( | |
| 1087 | - Var(List(WEB_Session_Field)) _fields, | |
| 1088 | - String _field_name, | |
| 1089 | - Var(List(WEB_Session_Field)) _field_value | |
| 1090 | - )= | |
| 1091 | - _fields <- [session_field(_field_name, fields_set_t, var(fields_set(_field_value))) . *_fields] | |
| 1092 | -. | |
| 1093 | - | |
| 1094 | -public define One | |
| 1095 | - replace_Fields_set | |
| 1096 | - ( | |
| 1097 | - Var(List(WEB_Session_Field)) _fields, | |
| 1098 | - String _field_name, | |
| 1099 | - Var(List(WEB_Session_Field)) _field_value | |
| 1100 | - )= | |
| 1101 | - replace_any(_fields, fields_set_t, _field_name, fields_set(_field_value)) | |
| 1102 | -. | |
| 1103 | - | |
| 1104 | -public define One | |
| 1105 | - remove_Fields_set | |
| 1106 | - ( | |
| 1107 | - Var(List(WEB_Session_Field)) _fields, | |
| 1108 | - String _field_name | |
| 1109 | - )= | |
| 1110 | - remove_any(_fields, fields_set_t, _field_name) | |
| 1111 | -. | |
| 1112 | - | |
| 1113 | 67 | /************************************************/ |
| 1114 | 68 | "AWS_CURRENT_PAGE_TITLE" String current web page title |
| 1115 | 69 | "AWS_CURRENT_APP" String current web application |
| ... | ... | @@ -1118,82 +72,42 @@ public define One |
| 1118 | 72 | "AWS_CURRENT_PAGE_RENDERER" String current page renderer |
| 1119 | 73 | |
| 1120 | 74 | public define One set_web_app(WEB_Session s, String n) = replace_String(s.fields, "AWS_CURRENT_APP", n). |
| 1121 | -public define One set_web_app(Var(List(WEB_Session_Field)) fields, String n) = replace_String(fields, "AWS_CURRENT_APP", n). | |
| 75 | +public define One set_web_app(Var(List(Session_Field)) fields, String n) = replace_String(fields, "AWS_CURRENT_APP", n). | |
| 1122 | 76 | public define String get_web_app(WEB_Session s) = get_String (s.fields, "AWS_CURRENT_APP", ""). |
| 1123 | 77 | |
| 1124 | 78 | public define One set_web_space(WEB_Session s, String n)= replace_String(s.fields, "AWS_CURRENT_SPACE", n). |
| 1125 | -public define One set_web_space(Var(List(WEB_Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_SPACE", n). | |
| 79 | +public define One set_web_space(Var(List(Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_SPACE", n). | |
| 1126 | 80 | public define String get_web_space(WEB_Session s) = get_String (s.fields, "AWS_CURRENT_SPACE", ""). |
| 1127 | 81 | |
| 1128 | 82 | public define One set_web_content(WEB_Session s, String n)= replace_String(s.fields, "AWS_CURRENT_CONTENT", n). |
| 1129 | -public define One set_web_content(Var(List(WEB_Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_CONTENT", n). | |
| 83 | +public define One set_web_content(Var(List(Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_CONTENT", n). | |
| 1130 | 84 | public define String get_web_content(WEB_Session s) = get_String (s.fields, "AWS_CURRENT_CONTENT", ""). |
| 1131 | 85 | |
| 1132 | 86 | public define One set_page_title(WEB_Session s, String n)= replace_String(s.fields, "AWS_CURRENT_PAGE_TITLE", n). |
| 1133 | -public define One set_page_title(Var(List(WEB_Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_PAGE_TITLE", n). | |
| 87 | +public define One set_page_title(Var(List(Session_Field)) fields, String n)= replace_String(fields, "AWS_CURRENT_PAGE_TITLE", n). | |
| 1134 | 88 | public define String get_page_title(WEB_Session s) = get_String (s.fields, "AWS_CURRENT_PAGE_TITLE", ""). |
| 1135 | 89 | |
| 1136 | 90 | public define One set_renderer(WEB_Session s, String n) = replace_String(s.fields, "AWS_CURRENT_PAGE_RENDERER", n). |
| 1137 | -public define One set_renderer(Var(List(WEB_Session_Field)) fields, String n) = replace_String(fields, "AWS_CURRENT_PAGE_RENDERER", n). | |
| 91 | +public define One set_renderer(Var(List(Session_Field)) fields, String n) = replace_String(fields, "AWS_CURRENT_PAGE_RENDERER", n). | |
| 1138 | 92 | public define String get_renderer(WEB_Session s) = get_String (s.fields, "AWS_CURRENT_PAGE_RENDERER", ""). |
| 1139 | 93 | |
| 1140 | 94 | |
| 1141 | - /************************************************/ | |
| 1142 | - | |
| 1143 | -public define String dump_WEB_Session_Field_list(List(WEB_Session_Field) _fields, String indent). | |
| 1144 | - | |
| 1145 | -public define String | |
| 1146 | - dump_WEB_Session_Field | |
| 1147 | - ( | |
| 1148 | - WEB_Session_Field _field, | |
| 1149 | - String indent | |
| 1150 | - )= | |
| 1151 | - with name = "Name = ["+_field.field_name+"]", | |
| 1152 | - if *_field.field_datum is | |
| 1153 | - { | |
| 1154 | - string(_string) then name+", Type = String, Value = ["+_string+"]", | |
| 1155 | - bool(_bool) then name+", Type = Bool, Value = ["+to_String(_bool)+"]", | |
| 1156 | - int(_int) then name+", Type = Int, Value = ["+_int+"]", | |
| 1157 | - db_id(_db_id) then name+", Type = DB_id, Value = ["+_db_id+"]", | |
| 1158 | - message(_message) then name+", Type = Message, Value = ["+dump(_message)+"]", | |
| 1159 | - byte_array(_byte_array) then name+", Type = ByteArray", | |
| 1160 | - float(_float) then name+", Type = Float, Value = ["+float_to_string(_float, 10)+"]", | |
| 1161 | - word128(_word128) then name+", Type = Word128, Value = ["+to_decimal(_word128)+"]", | |
| 1162 | - word64(_word64) then name+", Type = Word64, Value = ["+to_decimal(_word64)+"]", | |
| 1163 | - word32(_word32) then name+", Type = Word32, Value = ["+to_decimal(_word32)+"]", | |
| 1164 | - word16(_word16) then name+", Type = Word16, Value = ["+to_decimal(_word16)+"]", | |
| 1165 | - word8(_word8) then name+", Type = Word8, Value = ["+to_decimal(_word8)+"]", | |
| 1166 | - word4(_word4) then name+", Type = Word4, Value = ["+to_decimal(_word4)+"]", | |
| 1167 | - fields_set(_fields) then name+", Type = Fields_set, \n"+dump_WEB_Session_Field_list(*_fields, indent+" ") | |
| 1168 | - } | |
| 1169 | -. | |
| 1170 | - | |
| 1171 | -public define String | |
| 1172 | - dump_WEB_Session_Field_list | |
| 1173 | - ( | |
| 1174 | - List(WEB_Session_Field) _fields, | |
| 1175 | - String indent | |
| 1176 | - )= | |
| 1177 | - join("\n", map((WEB_Session_Field _field) |-> dump_WEB_Session_Field(_field, indent), _fields)) | |
| 1178 | -. | |
| 1179 | - | |
| 1180 | - | |
| 1181 | 95 | public define String |
| 1182 | 96 | dump_WEB_Session_Fields |
| 1183 | 97 | ( |
| 1184 | - List(WEB_Session_Field) _fields, | |
| 98 | + List(Session_Field) _fields, | |
| 1185 | 99 | String indent |
| 1186 | 100 | )= |
| 1187 | 101 | "\n"+ |
| 1188 | 102 | indent+"-- BEGIN Fields of Session:---------------- \n"+ |
| 1189 | - join("\n", map((WEB_Session_Field _field) |-> dump_WEB_Session_Field(_field, indent), _fields))+ | |
| 103 | + join("\n", map((Session_Field _field) |-> dump_Session_Field(_field, indent), _fields))+ | |
| 1190 | 104 | "\n"+indent+"-- END Fields of Session:---------------- \n" |
| 1191 | 105 | . |
| 1192 | 106 | |
| 1193 | 107 | public define String |
| 1194 | 108 | dump_WEB_Session_Fields |
| 1195 | 109 | ( |
| 1196 | - Var(List(WEB_Session_Field)) _fields, | |
| 110 | + Var(List(Session_Field)) _fields, | |
| 1197 | 111 | String indent |
| 1198 | 112 | )= |
| 1199 | 113 | dump_WEB_Session_Fields(*_fields, indent) | ... | ... |
web/types/controllers_web_site.anubis
| ... | ... | @@ -31,7 +31,7 @@ public type WEB_Controller_Result: |
| 31 | 31 | ), |
| 32 | 32 | redirect_to_previous, |
| 33 | 33 | redirect_to_previous( |
| 34 | - Var(List(WEB_Session_Field)) fields | |
| 34 | + Var(List(Session_Field)) fields | |
| 35 | 35 | ), |
| 36 | 36 | ajax( |
| 37 | 37 | Maybe(WEB_Session) mb_session, //modified session if success else failure | ... | ... |
web/types/web_session.anubis
| ... | ... | @@ -8,76 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | read calexium_lib/web/CXM_common.anubis |
| 10 | 10 | read calexium_lib/database/db_types.anubis |
| 11 | - | |
| 12 | -public type WEB_Session_Field:... | |
| 13 | -public type WEB_Session_Field_No_Var:... | |
| 14 | - | |
| 15 | -public type WEB_Session_Field_Datum: | |
| 16 | - string(String), //fully implented | |
| 17 | - bool(Bool), //fully implented | |
| 18 | - int(Int), //fully implemented | |
| 19 | - db_id(DB_id), | |
| 20 | - message(Message), //fully implemented | |
| 21 | - byte_array(ByteArray), | |
| 22 | - float(Float), | |
| 23 | - word128(Word128), | |
| 24 | - word64(Word64), | |
| 25 | - word32(Word32), | |
| 26 | - word16(Word16), | |
| 27 | - word8(Word8), | |
| 28 | - word4(Word4), | |
| 29 | - fields_set(Var(List(WEB_Session_Field))) | |
| 30 | - //WEB_Request | |
| 31 | -. | |
| 32 | - | |
| 33 | -public type WEB_Session_Field_Datum_No_Var: | |
| 34 | - string(String), //fully implented | |
| 35 | - bool(Bool), //fully implented | |
| 36 | - int(Int), //fully implemented | |
| 37 | - db_id(DB_id), | |
| 38 | - message(Message), //fully implemented | |
| 39 | - byte_array(ByteArray), | |
| 40 | - float(Float), | |
| 41 | - word128(Word128), | |
| 42 | - word64(Word64), | |
| 43 | - word32(Word32), | |
| 44 | - word16(Word16), | |
| 45 | - word8(Word8), | |
| 46 | - word4(Word4), | |
| 47 | - fields_set(List(WEB_Session_Field_No_Var)) | |
| 48 | - //WEB_Request | |
| 49 | -. | |
| 50 | - | |
| 51 | -public type WEB_Session_Field_Type: | |
| 52 | - string_t, | |
| 53 | - bool_t, | |
| 54 | - int_t, | |
| 55 | - db_id_t, | |
| 56 | - message_t, | |
| 57 | - byte_array_t, | |
| 58 | - float_t, | |
| 59 | - word128_t, | |
| 60 | - word64_t, | |
| 61 | - word32_t, | |
| 62 | - word16_t, | |
| 63 | - word8_t, | |
| 64 | - word4_t, | |
| 65 | - fields_set_t | |
| 66 | -. | |
| 67 | - | |
| 68 | -public type WEB_Session_Field: | |
| 69 | - session_field( | |
| 70 | - String field_name, | |
| 71 | - WEB_Session_Field_Type field_type, | |
| 72 | - Var(WEB_Session_Field_Datum) field_datum //Var because it can be replaced | |
| 73 | - ). | |
| 74 | - | |
| 75 | -public type WEB_Session_Field_No_Var: | |
| 76 | - session_field( | |
| 77 | - String field_name, | |
| 78 | - WEB_Session_Field_Type field_type, | |
| 79 | - WEB_Session_Field_Datum_No_Var field_datum //Var because it can be replaced | |
| 80 | - ). | |
| 11 | +transmit calexium_lib/generic/types/session.anubis | |
| 81 | 12 | |
| 82 | 13 | public type WEB_Request: |
| 83 | 14 | web_request( |
| ... | ... | @@ -99,7 +30,7 @@ public type WEB_Session: |
| 99 | 30 | web_session( |
| 100 | 31 | String session_id, |
| 101 | 32 | String language, |
| 102 | - Var(List(WEB_Session_Field)) fields, | |
| 33 | + Var(List(Session_Field)) fields, | |
| 103 | 34 | WEB_Request web_request, |
| 104 | 35 | WEB_Request previous_web_request, |
| 105 | 36 | WEB_Request draw_web_request |
| ... | ... | @@ -108,12 +39,12 @@ public type WEB_Session: |
| 108 | 39 | |
| 109 | 40 | public type WEB_Session_No_Var: |
| 110 | 41 | web_session( |
| 111 | - String session_id, | |
| 112 | - String language, | |
| 113 | - List(WEB_Session_Field_No_Var) fields, | |
| 114 | - WEB_Request_No_Var web_request, | |
| 115 | - WEB_Request_No_Var previous_web_request, | |
| 116 | - WEB_Request_No_Var draw_web_request, | |
| 42 | + String session_id, | |
| 43 | + String language, | |
| 44 | + List(Session_Field_No_Var) fields, | |
| 45 | + WEB_Request_No_Var web_request, | |
| 46 | + WEB_Request_No_Var previous_web_request, | |
| 47 | + WEB_Request_No_Var draw_web_request, | |
| 117 | 48 | ) |
| 118 | 49 | . |
| 119 | 50 | ... | ... |