Compare commits
532 Commits
master
...
dmp-refact
Author | SHA1 | Date |
---|---|---|
George Kalampokis | cd696bf55a | |
George Kalampokis | 01d78cd491 | |
George Kalampokis | aa75b3e3ab | |
George Kalampokis | 7b963858f2 | |
George Kalampokis | 3d5be3a00a | |
George Kalampokis | 742fa49a7c | |
George Kalampokis | 71746419fc | |
Thomas Georgios Giannos | e8553b1605 | |
amentis | 34df0b640c | |
amentis | 8807d42121 | |
amentis | a5f88db680 | |
Thomas Georgios Giannos | 9dd0405dc8 | |
Thomas Georgios Giannos | b7d1424e0c | |
Thomas Georgios Giannos | 897d099c2c | |
amentis | 7ba374d844 | |
amentis | a3fb03b41b | |
Efstratios Giannopoulos | c9640bcb54 | |
Efstratios Giannopoulos | 1a567c9a81 | |
amentis | 6a077d2b09 | |
Efstratios Giannopoulos | f8e1b4ab8b | |
amentis | 065cd249c9 | |
Thomas Georgios Giannos | 0e1a9c88b1 | |
Efstratios Giannopoulos | c056e04a89 | |
Efstratios Giannopoulos | a53396e38a | |
Efstratios Giannopoulos | 26ab1fb612 | |
Efstratios Giannopoulos | 5b18809da0 | |
Efstratios Giannopoulos | 73b0272672 | |
Efstratios Giannopoulos | f253fd965c | |
Thomas Georgios Giannos | 29022ee1cd | |
Thomas Georgios Giannos | 18a4684859 | |
Efstratios Giannopoulos | ccd7d069cb | |
Thomas Georgios Giannos | eb2b5d4df3 | |
amentis | 659c213360 | |
Efstratios Giannopoulos | 503fe2c3dc | |
Efstratios Giannopoulos | a4ced2be21 | |
Thomas Georgios Giannos | c4ec41bec1 | |
amentis | 8bccb9a224 | |
amentis | 438333786b | |
Thomas Georgios Giannos | e5410f39fc | |
Efstratios Giannopoulos | b87612c783 | |
Efstratios Giannopoulos | 71343c51e5 | |
amentis | 88b4bb0d2f | |
Thomas Georgios Giannos | 8d5b3d0426 | |
Thomas Georgios Giannos | 3f554554fd | |
Thomas Georgios Giannos | 1462b9944d | |
amentis | 28238c7a6d | |
George Kalampokis | 1fb516c8ef | |
George Kalampokis | e6278bff41 | |
Diamantis Tziotzios | de67f17603 | |
Diamantis Tziotzios | 7b28f499a8 | |
Diamantis Tziotzios | 244e0e83a2 | |
Diamantis Tziotzios | 2d377f6003 | |
Thomas Georgios Giannos | 2a6b047327 | |
Thomas Georgios Giannos | 63ffeabe62 | |
Diamantis Tziotzios | 17150126cb | |
amentis | 62970ebd35 | |
amentis | a8ee89fbc4 | |
Diamantis Tziotzios | 4178e2c619 | |
George Kalampokis | ea371cb1a1 | |
George Kalampokis | acc4557836 | |
Thomas Georgios Giannos | 306053acba | |
George Kalampokis | 8d7f6582ee | |
Diamantis Tziotzios | 128fc3d29e | |
Diamantis Tziotzios | c6508a0082 | |
amentis | b3b619d354 | |
amentis | 35b0d58ec9 | |
George Kalampokis | 3b12e89ac2 | |
George Kalampokis | 8f6d0cc33d | |
Thomas Georgios Giannos | aa648cda1d | |
Thomas Georgios Giannos | f9a47f2de7 | |
Efstratios Giannopoulos | f09e031e0c | |
Efstratios Giannopoulos | 4fa4cdc671 | |
Efstratios Giannopoulos | 68c56d70a4 | |
Thomas Georgios Giannos | 3e97d0fdd1 | |
Thomas Georgios Giannos | 6e0821f703 | |
Thomas Georgios Giannos | 54a83e98ac | |
Efstratios Giannopoulos | bd64566e8c | |
amentis | ab68a0bd4d | |
amentis | 18a1d43f01 | |
George Kalampokis | f06d3de1ec | |
George Kalampokis | 625a322467 | |
amentis | 6a6840fc79 | |
Thomas Georgios Giannos | 0fd552f29c | |
Thomas Georgios Giannos | 25e9f2a5c7 | |
amentis | 653991a066 | |
Thomas Georgios Giannos | a9eb2ff8a7 | |
amentis | fd1d6c9b1a | |
amentis | bcd42e7ec1 | |
amentis | 3990be182c | |
Thomas Georgios Giannos | a213ca3e84 | |
George Kalampokis | f405fdc32a | |
George Kalampokis | 0b45dd6981 | |
amentis | e2c352bf00 | |
Thomas Georgios Giannos | e4d2cde296 | |
amentis | a72770868e | |
Efstratios Giannopoulos | 8eda8402ab | |
Efstratios Giannopoulos | 048980ac39 | |
Thomas Georgios Giannos | baae057c6a | |
Thomas Georgios Giannos | 9f781853a7 | |
Thomas Georgios Giannos | 24bfd69e4d | |
amentis | f47f9721fe | |
Thomas Georgios Giannos | f46543f1a4 | |
Thomas Georgios Giannos | b46c4e19e2 | |
amentis | a94473be49 | |
amentis | 86628a59a7 | |
amentis | f6100a8ea2 | |
Thomas Georgios Giannos | a42e858f71 | |
amentis | 2a00fe7ec1 | |
amentis | 28fad3ccc4 | |
Efstratios Giannopoulos | aa8c73b6ed | |
Thomas Georgios Giannos | e70db447c8 | |
amentis | 880e8c5aa8 | |
Thomas Georgios Giannos | 0c34502f08 | |
Thomas Georgios Giannos | 038c78fb04 | |
Thomas Georgios Giannos | e7c7d1f991 | |
Thomas Georgios Giannos | 08a5b49d1d | |
amentis | 903388c3ce | |
amentis | 0c6e800118 | |
amentis | 5e72a4197b | |
Diamantis Tziotzios | 56bd12a4e3 | |
Efstratios Giannopoulos | c1b197ea30 | |
Thomas Georgios Giannos | b9eba9edcb | |
Thomas Georgios Giannos | 8227f60cda | |
Thomas Georgios Giannos | 9ba8751564 | |
amentis | 5825aa642a | |
Thomas Georgios Giannos | 37c170ea54 | |
amentis | dd7007128b | |
amentis | 46dccbfbdb | |
amentis | 908c530922 | |
Efstratios Giannopoulos | 85bd0de2d5 | |
amentis | bee0e9f152 | |
amentis | 2dac2326ee | |
amentis | ce0075f30a | |
Diamantis Tziotzios | 9e13eb4d01 | |
amentis | 9685b323e1 | |
Efstratios Giannopoulos | dfb4761276 | |
Efstratios Giannopoulos | c286838a30 | |
amentis | d2d6013389 | |
Efstratios Giannopoulos | 2fb99d2fe7 | |
Efstratios Giannopoulos | 2dee73ce1f | |
amentis | 5047d3b154 | |
Efstratios Giannopoulos | bc0d39a72f | |
Diamantis Tziotzios | 46e56111f0 | |
Diamantis Tziotzios | ad1539af59 | |
Efstratios Giannopoulos | 1a76942b5f | |
Diamantis Tziotzios | a72c7001f9 | |
Efstratios Giannopoulos | e441fc958c | |
Efstratios Giannopoulos | 418d36dd67 | |
Diamantis Tziotzios | 84726a250f | |
Diamantis Tziotzios | 7c9e36341b | |
Efstratios Giannopoulos | df87dbf76c | |
Diamantis Tziotzios | 567b09a26b | |
Diamantis Tziotzios | 6e997b300d | |
amentis | 3ea60a4b43 | |
amentis | 04d97fc2e2 | |
amentis | 63e5cde313 | |
Efstratios Giannopoulos | 5965acc4aa | |
Efstratios Giannopoulos | 3a70b4d700 | |
Efstratios Giannopoulos | 2d5c9df855 | |
Efstratios Giannopoulos | 2a766dc37f | |
amentis | 4417532935 | |
Diamantis Tziotzios | 40ae38e8d9 | |
Efstratios Giannopoulos | 17d57dbc7a | |
Efstratios Giannopoulos | 345c020869 | |
Efstratios Giannopoulos | b40134e6a7 | |
amentis | f1f987a157 | |
amentis | 37349d8fca | |
Thomas Georgios Giannos | e3d00fb72e | |
Thomas Georgios Giannos | 351e2cb78d | |
Efstratios Giannopoulos | 0decfb1474 | |
amentis | 388af4410d | |
Thomas Georgios Giannos | baaddb6284 | |
amentis | 10923d4d48 | |
amentis | cabb35cf19 | |
amentis | 8bcc11d9a1 | |
amentis | 63a8820681 | |
Diamantis Tziotzios | d436fb4b2c | |
amentis | 2c914ead90 | |
Diamantis Tziotzios | b7ff88be3a | |
Diamantis Tziotzios | 7430477903 | |
Thomas Georgios Giannos | bf07fed0f8 | |
Thomas Georgios Giannos | 2fae4f41a7 | |
Thomas Georgios Giannos | f5f5d6345f | |
Thomas Georgios Giannos | b4d7312751 | |
amentis | 3dd7a42224 | |
Thomas Georgios Giannos | 5b5f547b27 | |
Thomas Georgios Giannos | c6642a726e | |
amentis | 439efbd98a | |
amentis | 126d47f9e4 | |
amentis | 3d5c718d52 | |
Thomas Georgios Giannos | 319e1f0dca | |
Thomas Georgios Giannos | b3bc801cd4 | |
Efstratios Giannopoulos | d3d57e8838 | |
Efstratios Giannopoulos | 337556265e | |
Thomas Georgios Giannos | e6cba30e4c | |
Thomas Georgios Giannos | b00b048632 | |
Thomas Georgios Giannos | 693f1dba7f | |
Diamantis Tziotzios | eb19b9a7d5 | |
Diamantis Tziotzios | 00e5c69fac | |
Efstratios Giannopoulos | 1b92af8762 | |
Efstratios Giannopoulos | 75d31cf627 | |
Efstratios Giannopoulos | c5461dbc62 | |
Thomas Georgios Giannos | df2086a0a7 | |
Thomas Georgios Giannos | 92956f6598 | |
Thomas Georgios Giannos | 0166bf8ece | |
amentis | 61218ed220 | |
Thomas Georgios Giannos | 6fb601929a | |
amentis | 516e639153 | |
amentis | 39802c6e5b | |
Thomas Georgios Giannos | c3bb9b8ffa | |
Efstratios Giannopoulos | 8dbf275f3a | |
amentis | 6b4424c634 | |
Diamantis Tziotzios | e6b22a5b27 | |
Diamantis Tziotzios | 396c6e5b95 | |
Efstratios Giannopoulos | aa0a86b4d1 | |
Diamantis Tziotzios | 8a20687491 | |
Efstratios Giannopoulos | c67e4c8c9f | |
Thomas Georgios Giannos | ccd650217b | |
Efstratios Giannopoulos | c6f10b6a29 | |
Thomas Georgios Giannos | 8ee149f094 | |
amentis | 3d18ed1fa6 | |
amentis | d554e87093 | |
Thomas Georgios Giannos | 0934774b86 | |
Diamantis Tziotzios | 9d37900a86 | |
Thomas Georgios Giannos | 58d224b739 | |
Efstratios Giannopoulos | e698b198e7 | |
Thomas Georgios Giannos | c60e90d638 | |
Thomas Georgios Giannos | a6d175dcb3 | |
Diamantis Tziotzios | 1914444ff8 | |
Efstratios Giannopoulos | e4801f94ed | |
Diamantis Tziotzios | 07daf34077 | |
Thomas Georgios Giannos | eae9a5f7d3 | |
Thomas Georgios Giannos | f38febc22b | |
Diamantis Tziotzios | 3dbfc18fd6 | |
Efstratios Giannopoulos | 9433beaaa6 | |
Efstratios Giannopoulos | e47a370088 | |
Thomas Georgios Giannos | 1e92d86356 | |
Thomas Georgios Giannos | 2936cbbb7a | |
Diamantis Tziotzios | c779bd00f0 | |
Efstratios Giannopoulos | d426711904 | |
Efstratios Giannopoulos | be4e723911 | |
amentis | 18452725bc | |
Efstratios Giannopoulos | 93bbde9623 | |
Diamantis Tziotzios | dbd4e6b549 | |
amentis | f2c03c71cb | |
Diamantis Tziotzios | 231efd05ac | |
Diamantis Tziotzios | 6b95730280 | |
Efstratios Giannopoulos | ac91b62d63 | |
Efstratios Giannopoulos | 6f2d4f016d | |
amentis | 4187943654 | |
amentis | 62a5a6fe1d | |
amentis | c19920afb2 | |
Thomas Georgios Giannos | ad75ee1238 | |
Thomas Georgios Giannos | 17b0f9bc06 | |
Efstratios Giannopoulos | db6cb44ff8 | |
Efstratios Giannopoulos | a7f70568bb | |
Thomas Georgios Giannos | dc381c197d | |
Efstratios Giannopoulos | 08ea46f79b | |
Efstratios Giannopoulos | 8536d8d03a | |
Efstratios Giannopoulos | f92b0c238a | |
Efstratios Giannopoulos | 91af36cdcd | |
Efstratios Giannopoulos | c0e57b363d | |
amentis | e1985368aa | |
Efstratios Giannopoulos | e62d765796 | |
Efstratios Giannopoulos | 64d92e864d | |
Thomas Georgios Giannos | f6a6bab04d | |
Diamantis Tziotzios | 033492a25c | |
Diamantis Tziotzios | 8908936ec6 | |
Thomas Georgios Giannos | 99bf7d29f9 | |
Thomas Georgios Giannos | eb9ae3af48 | |
Efstratios Giannopoulos | ff93e4e39b | |
Thomas Georgios Giannos | 4d01463c72 | |
Thomas Georgios Giannos | caf7ec09c4 | |
Efstratios Giannopoulos | 6de7268465 | |
Efstratios Giannopoulos | 3b3dc6fffd | |
Thomas Georgios Giannos | 3a033a655b | |
Thomas Georgios Giannos | ea7fa62922 | |
Thomas Georgios Giannos | ee4636e508 | |
Thomas Georgios Giannos | 75471e5587 | |
Efstratios Giannopoulos | 91f7dbd785 | |
Efstratios Giannopoulos | a97976296b | |
Diamantis Tziotzios | 63f9fead96 | |
Thomas Georgios Giannos | 765eff356d | |
Thomas Georgios Giannos | 6e65d22fce | |
Diamantis Tziotzios | df58a254b2 | |
amentis | f2ee851bab | |
Diamantis Tziotzios | f1d2b9d8d4 | |
Diamantis Tziotzios | 22bd07451a | |
Efstratios Giannopoulos | dec8f6354c | |
Efstratios Giannopoulos | 7c8b385146 | |
Efstratios Giannopoulos | 6c49b7e7c2 | |
amentis | e9ae5126f8 | |
Thomas Georgios Giannos | 9cff8fb762 | |
Efstratios Giannopoulos | 5cfdc4be07 | |
Thomas Georgios Giannos | 3aa6cdaf29 | |
Efstratios Giannopoulos | 332ee8c59e | |
Efstratios Giannopoulos | e103f40763 | |
Efstratios Giannopoulos | 0e1408e532 | |
Efstratios Giannopoulos | 1324029804 | |
Efstratios Giannopoulos | f0264eefb9 | |
Thomas Georgios Giannos | 34ce4f6928 | |
Thomas Georgios Giannos | d50a058296 | |
Thomas Georgios Giannos | 5edaf1c74e | |
Thomas Georgios Giannos | ff35ad6aab | |
Thomas Georgios Giannos | 1cee5fb49f | |
Thomas Georgios Giannos | 0c4cf467d8 | |
amentis | c2c1d834cc | |
amentis | 3ecb1ed982 | |
amentis | 33672e5ce8 | |
Thomas Georgios Giannos | 009dad8cba | |
Efstratios Giannopoulos | 41fc3407eb | |
Efstratios Giannopoulos | 7ef668eede | |
Efstratios Giannopoulos | c1b9e72c2f | |
Thomas Georgios Giannos | dab5986688 | |
Efstratios Giannopoulos | 0bbad595f5 | |
Thomas Georgios Giannos | e22ba13caf | |
Efstratios Giannopoulos | e81e6dd89a | |
Efstratios Giannopoulos | 8cd8da6d98 | |
Thomas Georgios Giannos | 24aba556ef | |
Thomas Georgios Giannos | 3e15749b56 | |
Thomas Georgios Giannos | 4e99fb08e9 | |
Thomas Georgios Giannos | 0e6a59ef3d | |
Efstratios Giannopoulos | 0644e61962 | |
Thomas Georgios Giannos | 4a8c3640de | |
Thomas Georgios Giannos | 001cd0828b | |
amentis | cfb7da7968 | |
amentis | 5001968da7 | |
amentis | 88bf760165 | |
Efstratios Giannopoulos | df5ae4a278 | |
Efstratios Giannopoulos | ac8d36d1d5 | |
Efstratios Giannopoulos | 1469e22185 | |
Thomas Georgios Giannos | f878601609 | |
Thomas Georgios Giannos | ee68224f58 | |
Thomas Georgios Giannos | ea58ed2e44 | |
Efstratios Giannopoulos | 05f73889be | |
Efstratios Giannopoulos | 662c5ad7e8 | |
Diamantis Tziotzios | a9eb2b4513 | |
George Kalampokis | 1ef613c87e | |
George Kalampokis | 9e27558df7 | |
Thomas Georgios Giannos | d3cd37d57a | |
Thomas Georgios Giannos | a5f46e9328 | |
George Kalampokis | 49e34f9abc | |
George Kalampokis | 5ceed08b9c | |
Efstratios Giannopoulos | 20873ca13e | |
Efstratios Giannopoulos | 87e22040c5 | |
George Kalampokis | e42bdcfc0a | |
George Kalampokis | c6cdcc4b15 | |
Efstratios Giannopoulos | d8b1211a12 | |
Efstratios Giannopoulos | 81528dfe55 | |
amentis | 11bb1a3c8c | |
Thomas Georgios Giannos | 9b9cf0de4d | |
amentis | fda8fcef2c | |
George Kalampokis | c636b3e6b4 | |
George Kalampokis | 7bb8e850e8 | |
Thomas Georgios Giannos | b389ebf160 | |
Thomas Georgios Giannos | 2f20675348 | |
Efstratios Giannopoulos | 9cf91aab50 | |
Efstratios Giannopoulos | 08caf64d02 | |
amentis | c37530c022 | |
Efstratios Giannopoulos | b6278ab1ef | |
Efstratios Giannopoulos | d38f22ccbf | |
Thomas Georgios Giannos | e02237e599 | |
Thomas Georgios Giannos | 02d8132f3d | |
Thomas Georgios Giannos | 281475bb85 | |
Thomas Georgios Giannos | 752935f6e5 | |
Efstratios Giannopoulos | 732dfd9bfb | |
Thomas Georgios Giannos | c3808b5548 | |
Efstratios Giannopoulos | ac15e33a87 | |
George Kalampokis | 3c799063cc | |
Efstratios Giannopoulos | 4e08d9f073 | |
amentis | be9761b103 | |
Efstratios Giannopoulos | 7e391582b5 | |
Diamantis Tziotzios | c08f05bc04 | |
Efstratios Giannopoulos | 2b074f268d | |
amentis | 477e4e498e | |
amentis | f744573f02 | |
Diamantis Tziotzios | 557c444bc1 | |
Efstratios Giannopoulos | c06253bb20 | |
amentis | 49d400662b | |
amentis | a0ac8df5ba | |
Diamantis Tziotzios | 36c17b5853 | |
Diamantis Tziotzios | 9201f265d2 | |
Diamantis Tziotzios | 7214745162 | |
Efstratios Giannopoulos | bdcaee004d | |
Efstratios Giannopoulos | 57facf98e5 | |
amentis | 9d3cc9e3d2 | |
amentis | 92c165e904 | |
Thomas Georgios Giannos | 65e8635c2f | |
Thomas Georgios Giannos | 5d882c7e88 | |
Thomas Georgios Giannos | e31970c7ea | |
Thomas Georgios Giannos | 8d1c988135 | |
Thomas Georgios Giannos | 60ca51fe00 | |
amentis | 7508cf8698 | |
Diamantis Tziotzios | e4203a3bb4 | |
George Kalampokis | d983e1e38e | |
amentis | aecac1995d | |
amentis | f006587f4a | |
amentis | 5a55e5d739 | |
amentis | bbb21fadba | |
Diamantis Tziotzios | 4eca9b32c9 | |
Diamantis Tziotzios | 129dbd163a | |
Diamantis Tziotzios | 51cc5f4fd9 | |
Diamantis Tziotzios | d1bac40f0f | |
amentis | 45f8f51288 | |
amentis | 032b30ed04 | |
Thomas Georgios Giannos | 9a78d98751 | |
Thomas Georgios Giannos | c169a103b7 | |
amentis | 1b66d19bde | |
amentis | 7df098a010 | |
Thomas Georgios Giannos | 079382556f | |
Thomas Georgios Giannos | 7ab1313b83 | |
amentis | bf8edfad92 | |
Efstratios Giannopoulos | a68ddd42ce | |
Efstratios Giannopoulos | de566729f1 | |
Thomas Georgios Giannos | e149b61b58 | |
Thomas Georgios Giannos | 1e733cf704 | |
Thomas Georgios Giannos | 3e7b9ca90b | |
Thomas Georgios Giannos | e27468b596 | |
Thomas Georgios Giannos | 485f7311cd | |
Thomas Georgios Giannos | e3536285aa | |
Efstratios Giannopoulos | a68668f07e | |
Thomas Georgios Giannos | dc380cdc01 | |
Diamantis Tziotzios | 2472f6de42 | |
Efstratios Giannopoulos | 167d3d4a4b | |
amentis | 10615c6fa9 | |
Efstratios Giannopoulos | 3b9b348d4d | |
Efstratios Giannopoulos | fe7d6f59b1 | |
Thomas Georgios Giannos | f4d84aa807 | |
Thomas Georgios Giannos | 074ca35970 | |
Thomas Georgios Giannos | eeaa35fab5 | |
Diamantis Tziotzios | 172caabcd2 | |
Diamantis Tziotzios | 6a8cb2c853 | |
Alexandros Mandilaras | 65e80c9877 | |
Thomas Georgios Giannos | 61f2810fcc | |
Diamantis Tziotzios | 6d6a4e0341 | |
Diamantis Tziotzios | 0c1509a1a1 | |
Thomas Georgios Giannos | 10df3db7aa | |
Thomas Georgios Giannos | c338a93d71 | |
Efstratios Giannopoulos | 6cde8ae2a9 | |
Efstratios Giannopoulos | 3ad7441bb5 | |
Diamantis Tziotzios | 3422b147c8 | |
Efstratios Giannopoulos | 30bff76163 | |
Efstratios Giannopoulos | 88088d64fd | |
Diamantis Tziotzios | 9ed94450bd | |
Diamantis Tziotzios | 4d3098860d | |
amentis | 0bd3ff6898 | |
Thomas Georgios Giannos | a94cce47e8 | |
George Kalampokis | 7d4b4c171b | |
Efstratios Giannopoulos | 0b3178177a | |
Thomas Georgios Giannos | 2a4e61f08f | |
Thomas Georgios Giannos | 727702023f | |
Efstratios Giannopoulos | 16604a8a50 | |
Thomas Georgios Giannos | 07ff58fbd9 | |
Efstratios Giannopoulos | a235eb98f4 | |
Efstratios Giannopoulos | ce8ff28955 | |
Efstratios Giannopoulos | 52e59ac11c | |
George Kalampokis | dc752f73ca | |
George Kalampokis | 5885e3ae5c | |
George Kalampokis | 093837c395 | |
amentis | 7cba7b2346 | |
Thomas Georgios Giannos | a38342e534 | |
Diamantis Tziotzios | 8574f33e56 | |
Efstratios Giannopoulos | 941f2d69cc | |
Efstratios Giannopoulos | 5c17027df2 | |
amentis | 5203ec4b72 | |
amentis | b2119abc08 | |
Thomas Georgios Giannos | b7d22b5b07 | |
amentis | 1cda821d9c | |
Diamantis Tziotzios | e97479aa03 | |
amentis | ad91234fd9 | |
amentis | 17bb6bd4b0 | |
Efstratios Giannopoulos | 66c650495f | |
Efstratios Giannopoulos | 27bcc31e54 | |
amentis | 3dee4857f8 | |
amentis | f67ada842e | |
Thomas Georgios Giannos | 651319ac5c | |
amentis | b8affa3033 | |
Efstratios Giannopoulos | 43f77a4497 | |
Efstratios Giannopoulos | b3a73a50aa | |
Diamantis Tziotzios | 9fd30b1198 | |
Diamantis Tziotzios | 3eaf326c50 | |
Efstratios Giannopoulos | 7ed111e936 | |
Efstratios Giannopoulos | 419c4d64f8 | |
Efstratios Giannopoulos | bd2807fbdf | |
Efstratios Giannopoulos | 925f195f5a | |
Efstratios Giannopoulos | 6443654343 | |
Efstratios Giannopoulos | 191f887530 | |
Thomas Georgios Giannos | b537810406 | |
Thomas Georgios Giannos | 234aa359c0 | |
Efstratios Giannopoulos | d5c62539c5 | |
George Kalampokis | 5976084473 | |
George Kalampokis | 959185a6c3 | |
George Kalampokis | a9a3273f62 | |
Efstratios Giannopoulos | 9c8488febb | |
Efstratios Giannopoulos | d14107062a | |
Efstratios Giannopoulos | 5009d658ed | |
Efstratios Giannopoulos | 055d29b95f | |
Diamantis Tziotzios | 958fc468fa | |
Diamantis Tziotzios | 6b2fae03dd | |
George Kalampokis | b845450ebd | |
Efstratios Giannopoulos | 968f45d5b3 | |
Efstratios Giannopoulos | 8b05ee1d0f | |
George Kalampokis | de2f5e67fd | |
George Kalampokis | 755c79b7af | |
George Kalampokis | d45867585f | |
George Kalampokis | 166bea73bf | |
Thomas Georgios Giannos | 55aecd9c57 | |
George Kalampokis | cab2f1bc64 | |
George Kalampokis | b5cbe6a3d8 | |
George Kalampokis | 70308db668 | |
Thomas Georgios Giannos | 51fbbc933a | |
Thomas Georgios Giannos | c7778e80b9 | |
Thomas Georgios Giannos | 39163ed6bc | |
Thomas Georgios Giannos | 0bb4c7ca15 | |
Thomas Georgios Giannos | 0b901205ee | |
Diamantis Tziotzios | 922c2110ac | |
Diamantis Tziotzios | 5a46345f15 | |
Diamantis Tziotzios | 96c2940eb0 | |
Diamantis Tziotzios | 203ee4fb29 | |
George Kalampokis | 05a724d757 | |
George Kalampokis | 3d612812b0 | |
Diamantis Tziotzios | 66052f8af6 | |
Bernaldo Mihasi | b7f68f1a7e | |
Bernaldo Mihasi | f841c2a2cc | |
Bernaldo Mihasi | 03f2bc862e | |
Bernaldo Mihasi | 4373bf4b00 | |
Bernaldo Mihasi | 09dcf5328d | |
Bernaldo Mihasi | c58de51b33 | |
Bernaldo Mihasi | 94c0f7ac9c | |
Thomas Georgios Giannos | 3f14528f16 | |
Thomas Georgios Giannos | 074e374d9a | |
Thomas Georgios Giannos | 7c96078570 |
|
@ -46,5 +46,9 @@ ELK.Docker/shared/data-elk/
|
|||
.settings/
|
||||
bin/
|
||||
*.classpath
|
||||
.run
|
||||
openDMP/dmp-backend/uploads/
|
||||
openDMP/dmp-backend/tmp/
|
||||
logs/
|
||||
dmp-backend/web/src/main/resources/certificates/
|
||||
/storage/
|
||||
|
|
|
@ -13,3 +13,4 @@ FROM adoptopenjdk/openjdk11:alpine-jre
|
|||
WORKDIR /app
|
||||
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app/app.jar
|
||||
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${PROF}", "-Dspring.config.additional-location=/files/config/", "-cp", "/app/app.jar", "-Dloader.path=/files/repo-jars", "org.springframework.boot.loader.PropertiesLauncher"]
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>eu.eudat</groupId>
|
||||
<artifactId>dmp-backend</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>core</artifactId>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-csv</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>validation</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>oidc-authz</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite.opendmp</groupId>
|
||||
<artifactId>repositorydepositbase</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite.opendmp</groupId>
|
||||
<artifactId>file-transformer-base</artifactId>
|
||||
<version>0.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>gr.cite</groupId>
|
||||
<artifactId>elastic</artifactId>
|
||||
<version>2.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.angus</groupId>
|
||||
<artifactId>jakarta.mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,133 @@
|
|||
package eu.eudat.audit;
|
||||
|
||||
import gr.cite.tools.logging.EventId;
|
||||
|
||||
public class AuditableAction {
|
||||
|
||||
public static final EventId DescriptionTemplateType_Query = new EventId(1000, "DescriptionTemplateType_Query");
|
||||
public static final EventId DescriptionTemplateType_Lookup = new EventId(1001, "DescriptionTemplateType_Lookup");
|
||||
public static final EventId DescriptionTemplateType_Persist = new EventId(1002, "DescriptionTemplateType_Persist");
|
||||
public static final EventId DescriptionTemplateType_Delete = new EventId(1003, "DescriptionTemplateType_Delete");
|
||||
|
||||
public static final EventId EntityDoi_Query = new EventId(2000, "EntityDoi_Query");
|
||||
public static final EventId EntityDoi_Lookup = new EventId(2001, "EntityDoi_Lookup");
|
||||
public static final EventId EntityDoi_Persist = new EventId(2002, "EntityDoi_Persist");
|
||||
public static final EventId EntityDoi_Delete = new EventId(2003, "EntityDoi_Delete");
|
||||
|
||||
public static final EventId DmpBlueprint_Query = new EventId(3000, "DmpBlueprint_Query");
|
||||
public static final EventId DmpBlueprint_Lookup = new EventId(3001, "DmpBlueprint_Lookup");
|
||||
public static final EventId DmpBlueprint_Persist = new EventId(3002, "DmpBlueprint_Persist");
|
||||
public static final EventId DmpBlueprint_Delete = new EventId(3003, "DmpBlueprint_Delete");
|
||||
public static final EventId DmpBlueprint_Clone = new EventId(3004, "DmpBlueprint_Clone");
|
||||
public static final EventId DmpBlueprint_GetXml = new EventId(3005, "DmpBlueprint_GetXml");
|
||||
public static final EventId DmpBlueprint_Import = new EventId(3006, "DmpBlueprint_Import");
|
||||
|
||||
public static final EventId User_Settings_Query = new EventId(4000, "User_Settings_Query");
|
||||
public static final EventId User_Settings_Lookup = new EventId(4001, "User_Settings_Lookup");
|
||||
public static final EventId User_Settings_Persist = new EventId(4002, "User_Settings_Persist");
|
||||
public static final EventId User_Settings_Delete = new EventId(4003, "User_Settings_Delete");
|
||||
|
||||
public static final EventId Dmp_Query = new EventId(5000, "Dmp_Query");
|
||||
public static final EventId Dmp_Lookup = new EventId(5001, "Dmp_Lookup");
|
||||
public static final EventId Dmp_Persist = new EventId(5002, "Dmp_Persist");
|
||||
public static final EventId Dmp_Delete = new EventId(5003, "Dmp_Delete");
|
||||
public static final EventId Dmp_Clone = new EventId(5004, "Dmp_Clone");
|
||||
public static final EventId Dmp_PersistNewVersion = new EventId(5005, "Dmp_PersistNewVersion");
|
||||
public static final EventId Dmp_Assign_Users = new EventId(5006, "Dmp_Assign_Users");
|
||||
public static final EventId Dmp_RemoveUser = new EventId(5007, "Dmp_RemoveUser");
|
||||
public static final EventId Dmp_Invite_Users = new EventId(5008, "Dmp_Invite_Users");
|
||||
public static final EventId Dmp_Invite_Accept = new EventId(5009, "Dmp_Invite_Accept");
|
||||
|
||||
public static final EventId Description_Query = new EventId(6000, "Description_Query");
|
||||
public static final EventId Description_Lookup = new EventId(6001, "Description_Lookup");
|
||||
public static final EventId Description_Persist = new EventId(6002, "Description_Persist");
|
||||
public static final EventId Description_Delete = new EventId(6003, "Description_Delete");
|
||||
public static final EventId Description_PublicQuery = new EventId(6004, "Description_PublicQuery");
|
||||
public static final EventId Description_PublicLookup = new EventId(6005, "Description_PublicLookup");
|
||||
public static final EventId Description_PersistStatus = new EventId(6006, "Description_PersistStatus");
|
||||
|
||||
public static final EventId Reference_Query = new EventId(7000, "Reference_Query");
|
||||
public static final EventId Reference_Lookup = new EventId(7001, "Reference_Lookup");
|
||||
public static final EventId Reference_Persist = new EventId(7002, "Reference_Persist");
|
||||
public static final EventId Reference_Delete = new EventId(7003, "Reference_Delete");
|
||||
public static final EventId Reference_Search = new EventId(7004, "Reference_Search");
|
||||
|
||||
public static final EventId DescriptionTemplate_Query = new EventId(8000, "DescriptionTemplate_Query");
|
||||
public static final EventId DescriptionTemplate_Lookup = new EventId(8001, "DescriptionTemplate_Lookup");
|
||||
public static final EventId DescriptionTemplate_Persist = new EventId(8002, "DescriptionTemplate_Persist");
|
||||
public static final EventId DescriptionTemplate_Delete = new EventId(8003, "DescriptionTemplate_Delete");
|
||||
public static final EventId DescriptionTemplate_Clone = new EventId(8004, "DescriptionTemplate_Clone");
|
||||
public static final EventId DescriptionTemplate_PersistNewVersion = new EventId(8005, "DescriptionTemplate_PersistNewVersion");
|
||||
public static final EventId DescriptionTemplate_GetXml = new EventId(8006, "DescriptionTemplate_GetXml");
|
||||
public static final EventId DescriptionTemplate_Import = new EventId(8007, "DescriptionTemplate_Import");
|
||||
public static final EventId DescriptionTemplate_GetSemantics = new EventId(8007, "DescriptionTemplate_GetSemantics");
|
||||
|
||||
public static final EventId SupportiveMaterial_Query = new EventId(9000, "SupportiveMaterial_Query");
|
||||
public static final EventId SupportiveMaterial_Lookup = new EventId(9001, "SupportiveMaterial_Lookup");
|
||||
public static final EventId SupportiveMaterial_Persist = new EventId(9002, "SupportiveMaterial_Persist");
|
||||
public static final EventId SupportiveMaterial_Delete = new EventId(9003, "SupportiveMaterial_Delete");
|
||||
|
||||
public static final EventId ReferenceType_Query = new EventId(10000, "ReferenceType_Query");
|
||||
public static final EventId ReferenceType_Lookup = new EventId(10001, "ReferenceType_Lookup");
|
||||
public static final EventId ReferenceType_Persist = new EventId(10002, "ReferenceType_Persist");
|
||||
public static final EventId ReferenceType_Delete = new EventId(10003, "ReferenceType_Delete");
|
||||
|
||||
public static final EventId User_Query = new EventId(11000, "User_Query");
|
||||
public static final EventId User_Lookup = new EventId(11001, "User_Lookup");
|
||||
public static final EventId User_Persist = new EventId(11002, "User_Persist");
|
||||
public static final EventId User_Delete = new EventId(11003, "User_Delete");
|
||||
public static final EventId User_LookupByEmail = new EventId(11004, "User_LookupByEmail");
|
||||
public static final EventId User_ExportCsv = new EventId(11005, "User_ExportCsv");
|
||||
public static final EventId User_PersistRoles = new EventId(11006, "User_PersistRoles");
|
||||
public static final EventId User_LanguageMine = new EventId(11007, "User_LanguageMine");
|
||||
public static final EventId User_TimezoneMine = new EventId(11008, "User_TimezoneMine");
|
||||
public static final EventId User_CultureMine = new EventId(11009, "User_CultureMine");
|
||||
public static final EventId User_MergeRequest = new EventId(11010, "User_MergeRequest");
|
||||
public static final EventId User_MergeConfirm = new EventId(11011, "User_MergeConfirm");
|
||||
public static final EventId User_RemoveCredentialRequest = new EventId(11012, "User_RemoveCredentialRequest");
|
||||
public static final EventId User_RemoveCredentialConfirm = new EventId(11013, "User_RemoveCredentialConfirm");
|
||||
public static final EventId User_DmpAssociatedQuery = new EventId(11014, "User_DmpAssociatedQuery");
|
||||
|
||||
public static final EventId Tenant_Query = new EventId(12000, "Tenant_Query");
|
||||
public static final EventId Tenant_Lookup = new EventId(12001, "Tenant_Lookup");
|
||||
public static final EventId Tenant_Persist = new EventId(12002, "Tenant_Persist");
|
||||
public static final EventId Tenant_Delete = new EventId(12003, "Tenant_Delete");
|
||||
|
||||
public static final EventId Language_Query = new EventId(13000, "Language_Query");
|
||||
public static final EventId Language_Lookup = new EventId(13001, "Language_Lookup");
|
||||
public static final EventId Language_Persist = new EventId(13002, "Language_Persist");
|
||||
public static final EventId Language_Delete = new EventId(13003, "Language_Delete");
|
||||
|
||||
public static final EventId StorageFile_Download = new EventId(14000, "StorageFile_Download");
|
||||
public static final EventId StorageFile_Upload = new EventId(14001, "StorageFile_Upload");
|
||||
|
||||
public static final EventId Dashboard_MyRecentActivityItems = new EventId(15000, "Dashboard_MyRecentActivityItems");
|
||||
public static final EventId Dashboard_MyDashboardStatistics = new EventId(15001, "Dashboard_MyDashboardStatistics");
|
||||
public static final EventId Dashboard_PublicDashboardStatistics = new EventId(15002, "Dashboard_PublicDashboardStatistics");
|
||||
|
||||
public static final EventId Notification_Persist = new EventId(16000, "Notification_Persist");
|
||||
|
||||
public static final EventId Lock_Query = new EventId(17000, "Lock_Query");
|
||||
public static final EventId Lock_Lookup = new EventId(17001, "Lock_Lookup");
|
||||
public static final EventId Lock_Persist = new EventId(17002, "Lock_Persist");
|
||||
public static final EventId Lock_Delete = new EventId(17003, "Lock_Delete");
|
||||
public static final EventId Lock_IsLocked = new EventId(17004, "Lock_IsLocked");
|
||||
public static final EventId Lock_UnLocked = new EventId(17005, "Lock_UnLocked");
|
||||
|
||||
public static final EventId Deposit_GetAvailableRepositories = new EventId(18000, "Deposit_GetAvailableRepositories");
|
||||
public static final EventId Deposit_GetAccessToken = new EventId(18001, "Deposit_GetAccessToken");
|
||||
public static final EventId Deposit_Deposit = new EventId(18002, "Deposit_Deposit");
|
||||
public static final EventId Deposit_GetLogo = new EventId(18003, "Deposit_GetLogo");
|
||||
|
||||
public static final EventId Tag_Query = new EventId(19000, "Tag_Query");
|
||||
public static final EventId Tag_Lookup = new EventId(19001, "Tag_Lookup");
|
||||
public static final EventId Tag_Persist = new EventId(19002, "Tag_Persist");
|
||||
public static final EventId Tag_Delete = new EventId(19003, "Tag_Delete");
|
||||
|
||||
public static final EventId FileTransformer_GetAvailableConfigurations = new EventId(20000, "FileTransformer_GetAvailableConfigurations");
|
||||
|
||||
public static final EventId ContactSupport_Sent = new EventId(210000, "ContactSupport_Sent");
|
||||
public static final EventId ContactSupport_PublicSent = new EventId(210001, "ContactSupport_PublicSent");
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package eu.eudat.authorization;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public enum AuthorizationFlags {
|
||||
None, Permission, DmpAssociated, Public, Owner;
|
||||
public static final EnumSet<AuthorizationFlags> OwnerOrDmpAssociatedOrPermissionOrPublic = EnumSet.of(DmpAssociated, Permission, Public, Owner);
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package eu.eudat.authorization;
|
||||
|
||||
import gr.cite.commons.web.authz.policy.AuthorizationRequirement;
|
||||
|
||||
public class OwnedAuthorizationRequirement implements AuthorizationRequirement {
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package eu.eudat.authorization;
|
||||
|
||||
import gr.cite.commons.web.authz.policy.AuthorizationResource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class OwnedResource extends AuthorizationResource {
|
||||
private List<UUID> userIds;
|
||||
|
||||
public OwnedResource(UUID userId) {
|
||||
this(List.of(userId));
|
||||
}
|
||||
|
||||
public OwnedResource(List<UUID> userIds) {
|
||||
this.userIds = userIds;
|
||||
}
|
||||
|
||||
public List<UUID> getUserIds() {
|
||||
return userIds;
|
||||
}
|
||||
|
||||
public void setUserIds(List<UUID> userIds) {
|
||||
this.userIds = userIds;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package eu.eudat.authorization;
|
||||
|
||||
public final class Permission {
|
||||
/////// Should Remove after Refactor
|
||||
|
||||
public static String AnonymousRole = "AnonymousRole";
|
||||
public static String AdminRole = "AdminRole";
|
||||
public static String ManagerRole = "ManagerRole";
|
||||
public static String UserRole = "UserRole";
|
||||
public static String AuthenticatedRole = "AuthenticatedRole";
|
||||
public static String PublicRole = "PublicRole";
|
||||
public static String DatasetProfileManagerRole = "DatasetProfileManagerRole";
|
||||
|
||||
/////
|
||||
|
||||
//Public
|
||||
public static String PublicBrowseDescription = "PublicBrowseDescription";
|
||||
public static String PublicBrowseDescriptionTemplate = "BrowseDescriptionTemplate";
|
||||
public static String PublicBrowseDmp = "PublicBrowseDmp";
|
||||
public static String PublicBrowseDmpReference = "PublicBrowseDmpReference";
|
||||
public static String PublicBrowseDmpUser = "PublicBrowseDmpUser";
|
||||
public static String PublicBrowseReference = "PublicBrowseReference";
|
||||
public static String PublicBrowseUser = "PublicBrowseUser";
|
||||
public static String PublicBrowseDashboardStatistics = "PublicBrowseDashboardStatistics";
|
||||
public static String PublicSendContactSupport = "PublicSendContactSupport";
|
||||
//Elastic
|
||||
public static String ManageElastic = "ManageElastic";
|
||||
|
||||
//Deposit
|
||||
public static String BrowseDeposit = "BrowseDeposit";
|
||||
public static String EditDeposit = "BrowseDeposit";
|
||||
|
||||
|
||||
//Language
|
||||
public static String BrowseLanguage = "BrowseLanguage";
|
||||
public static String EditLanguage = "EditLanguage";
|
||||
public static String DeleteLanguage = "DeleteLanguage";
|
||||
|
||||
//Language
|
||||
public static String BrowseStatistics = "BrowseStatistics";
|
||||
public static String BrowsePublicStatistics = "BrowsePublicStatistics";
|
||||
|
||||
//DescriptionTemplate
|
||||
public static String BrowseDescriptionTemplate = "BrowseDescriptionTemplate";
|
||||
public static String EditDescriptionTemplate = "EditDescriptionTemplate";
|
||||
public static String DeleteDescriptionTemplate = "DeleteDescriptionTemplate";
|
||||
public static String CloneDescriptionTemplate = "CloneDescriptionTemplate";
|
||||
public static String CreateNewVersionDescriptionTemplate = "CreateNewVersionDescriptionTemplate";
|
||||
public static String ImportDescriptionTemplate = "ImportDescriptionTemplate";
|
||||
public static String ExportDescriptionTemplate = "ExportDescriptionTemplate";
|
||||
|
||||
|
||||
|
||||
//User
|
||||
public static String BrowseUser = "BrowseUser";
|
||||
public static String EditUser = "EditUser";
|
||||
public static String DeleteUser = "DeleteUser";
|
||||
public static String ExportUsers = "ExportUsers";
|
||||
public static String BrowseDmpAssociatedUser = "BrowseDmpAssociatedUser";
|
||||
|
||||
|
||||
//StorageFile
|
||||
public static String BrowseStorageFile = "BrowseStorageFile";
|
||||
public static String EditStorageFile = "EditStorageFile";
|
||||
public static String DeleteStorageFile = "DeleteStorageFile";
|
||||
|
||||
//DescriptionTemplateType
|
||||
public static String BrowseDescriptionTemplateType = "BrowseDescriptionTemplateType";
|
||||
public static String EditDescriptionTemplateType = "EditDescriptionTemplateType";
|
||||
public static String DeleteDescriptionTemplateType = "DeleteDescriptionTemplateType";
|
||||
|
||||
//Dmp
|
||||
public static String BrowseDmp = "BrowseDmp";
|
||||
public static String EditDmp = "EditDmp";
|
||||
public static String DeleteDmp = "DeleteDmp";
|
||||
public static String CloneDmp = "CloneDmp";
|
||||
public static String CreateNewVersionDmp = "CreateNewVersionDmp";
|
||||
public static String ExportDmp = "ExportDmp";
|
||||
public static String FinalizeDmp = "FinalizeDmp";
|
||||
public static String AssignDmpUsers = "AssignDmpUsers";
|
||||
public static String InviteDmpUsers = "InviteDmpUsers";
|
||||
|
||||
//DmpBlueprint
|
||||
public static String BrowseDmpBlueprint = "BrowseDmpBlueprint";
|
||||
public static String EditDmpBlueprint = "EditDmpBlueprint";
|
||||
public static String DeleteDmpBlueprint = "DeleteDmpBlueprint";
|
||||
public static String CloneDmpBlueprint = "CloneDmpBlueprint";
|
||||
public static String ExportDmpBlueprint = "ExportDmpBlueprint";
|
||||
public static String ImportDmpBlueprint = "ImportDmpBlueprint";
|
||||
|
||||
//DmpDescriptionTemplate
|
||||
public static String BrowseDmpDescriptionTemplate = "BrowseDmpDescriptionTemplate";
|
||||
public static String EditDmpDescriptionTemplate = "EditDmpDescriptionTemplate";
|
||||
public static String DeleteDmpDescriptionTemplate = "DeleteDmpDescriptionTemplate";
|
||||
|
||||
//DmpUser
|
||||
public static String BrowseDmpUser = "BrowseDmpUser";
|
||||
public static String EditDmpUser = "EditDmpUser";
|
||||
public static String DeleteDmpUser = "DeleteDmpUser";
|
||||
|
||||
//Description
|
||||
public static String BrowseDescription = "BrowseDescription";
|
||||
public static String EditDescription = "EditDescription";
|
||||
public static String DeleteDescription = "DeleteDescription";
|
||||
public static String CloneDescription = "CloneDescription";
|
||||
|
||||
//DescriptionTag
|
||||
public static String BrowseDescriptionTag = "BrowseDescriptionTag";
|
||||
public static String EditDescriptionTag = "EditDescriptionTag";
|
||||
public static String DeleteDescriptionTag = "DeleteDescriptionTag";
|
||||
|
||||
//DescriptionTemplateType
|
||||
public static String BrowseEntityDoi = "BrowseEntityDoi";
|
||||
public static String EditEntityDoi = "EditEntityDoi";
|
||||
public static String DeleteEntityDoi = "DeleteEntityDoi";
|
||||
|
||||
//UserSettings
|
||||
public static String BrowseUserSettings = "BrowseUserSettings";
|
||||
public static String EditUserSettings = "EditUserSettings";
|
||||
public static String DeleteUserSettings = "DeleteUserSettings";
|
||||
|
||||
|
||||
// UI Pages
|
||||
public static String ViewDescriptionTemplateTypePage = "ViewDescriptionTemplateTypePage";
|
||||
public static String ViewDmpBlueprintPage = "ViewDmpBlueprintPage";
|
||||
|
||||
//Reference
|
||||
public static String BrowseReference = "BrowseReference";
|
||||
public static String EditReference = "EditReference";
|
||||
public static String DeleteReference = "DeleteReference";
|
||||
|
||||
//Tag
|
||||
public static String BrowseTag = "BrowseTag";
|
||||
public static String EditTag = "EditTag";
|
||||
public static String DeleteTag = "DeleteTag";
|
||||
|
||||
//DmpReference
|
||||
public static String BrowseDmpReference = "BrowseDmpReference";
|
||||
public static String EditDmpReference = "EditDmpReference";
|
||||
public static String DeleteDmpReference = "DeleteDmpReference";
|
||||
|
||||
//DescriptionReference
|
||||
public static String BrowseDescriptionReference = "BrowseDescriptionReference";
|
||||
public static String EditDescriptionReference = "EditDescriptionReference";
|
||||
public static String DeleteDescriptionReference = "DeleteDescriptionReference";
|
||||
|
||||
//SupportiveMaterial
|
||||
public static String BrowseSupportiveMaterial = "BrowseSupportiveMaterial";
|
||||
public static String EditSupportiveMaterial= "EditSupportiveMaterial";
|
||||
public static String DeleteSupportiveMaterial = "DeleteSupportiveMaterial";
|
||||
|
||||
//ReferenceType
|
||||
public static String BrowseReferenceType = "BrowseReferenceType";
|
||||
public static String EditReferenceType= "EditReferenceType";
|
||||
public static String DeleteReferenceType = "DeleteReferenceType";
|
||||
|
||||
//Tenant
|
||||
public static String BrowseTenant = "BrowseTenant";
|
||||
public static String EditTenant= "EditTenant";
|
||||
public static String DeleteTenant = "DeleteTenant";
|
||||
public static String AllowNoTenant = "AllowNoTenant";
|
||||
|
||||
//TenantUser
|
||||
public static String BrowseTenantUser = "BrowseTenantUser";
|
||||
public static String EditTenantUser = "EditTenantUser";
|
||||
public static String DeleteTenantUser = "DeleteTenantUser";
|
||||
|
||||
//Lock
|
||||
public static String BrowseLock = "BrowseLock";
|
||||
public static String EditLock = "EditLock";
|
||||
public static String DeleteLock = "DeleteLock";
|
||||
|
||||
//ContactSupport
|
||||
public static String SendContactSupport = "SendContactSupport";
|
||||
|
||||
//ActionConfirmation
|
||||
public static String BrowseActionConfirmation = "BrowseActionConfirmation";
|
||||
public static String EditActionConfirmation = "EditActionConfirmation";
|
||||
public static String DeleteActionConfirmation = "DeleteActionConfirmation";
|
||||
|
||||
|
||||
}
|
24
dmp-backend/core/src/main/java/eu/eudat/cache/transformer/FileTransformerConfigurationCache.java
vendored
Normal file
24
dmp-backend/core/src/main/java/eu/eudat/cache/transformer/FileTransformerConfigurationCache.java
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
package eu.eudat.cache.transformer;
|
||||
|
||||
|
||||
import eu.eudat.configurations.deposit.DepositCacheOptions;
|
||||
import eu.eudat.configurations.transformer.TransformerCacheOptions;
|
||||
import eu.eudat.model.file.TransformerCacheModel;
|
||||
import gr.cite.tools.cache.CacheService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class FileTransformerConfigurationCache extends CacheService<TransformerCacheModel> {
|
||||
@Autowired
|
||||
public FileTransformerConfigurationCache(TransformerCacheOptions options) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<TransformerCacheModel> valueClass() {
|
||||
return TransformerCacheModel.class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package eu.eudat.commons;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectReader;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)
|
||||
public class JsonHandlingService {
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public JsonHandlingService() {
|
||||
this.objectMapper = new ObjectMapper();
|
||||
objectMapper.registerModule(new JavaTimeModule());
|
||||
}
|
||||
|
||||
public String toJson(Object item) throws JsonProcessingException {
|
||||
if (item == null) return null;
|
||||
return objectMapper.writeValueAsString(item);
|
||||
}
|
||||
|
||||
public String toJsonSafe(Object item) {
|
||||
if (item == null) return null;
|
||||
try {
|
||||
return objectMapper.writeValueAsString(item);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T fromJson(Class<T> type, String json) throws JsonProcessingException {
|
||||
if (json == null) return null;
|
||||
return objectMapper.readValue(json, type);
|
||||
}
|
||||
|
||||
public HashMap<String, String> mapFromJson(String json) throws JsonProcessingException {
|
||||
ObjectReader reader = objectMapper.readerFor(Map.class);
|
||||
return reader.readValue(json);
|
||||
}
|
||||
|
||||
public <T> T fromJsonSafe(Class<T> type, String json) {
|
||||
if (json == null) return null;
|
||||
try {
|
||||
return objectMapper.readValue(json, type);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package eu.eudat.commons;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import eu.eudat.commons.types.dmpblueprint.DefinitionEntity;
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import jakarta.xml.bind.JAXBContext;
|
||||
import jakarta.xml.bind.JAXBException;
|
||||
import jakarta.xml.bind.Marshaller;
|
||||
import jakarta.xml.bind.Unmarshaller;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
||||
@Component
|
||||
@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)
|
||||
public class XmlHandlingService {
|
||||
|
||||
public String generateXml(Document doc) throws TransformerException {
|
||||
TransformerFactory tFact = TransformerFactory.newInstance();
|
||||
Transformer trans = tFact.newTransformer();
|
||||
StringWriter writer = new StringWriter();
|
||||
StreamResult result = new StreamResult(writer);
|
||||
DOMSource source = new DOMSource(doc);
|
||||
trans.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||
trans.transform(source, result);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public String toXml(Object item) throws JsonProcessingException, JAXBException, ParserConfigurationException, InvalidApplicationException, TransformerException {
|
||||
if (XmlSerializable.class.isAssignableFrom(item.getClass())){
|
||||
Document document = this.getDocument();
|
||||
if (document == null) throw new InvalidApplicationException("Can not create document");
|
||||
document.appendChild(((XmlSerializable)item).toXml(document));
|
||||
return this.generateXml(document);
|
||||
}
|
||||
|
||||
JAXBContext context = JAXBContext.newInstance(item.getClass());
|
||||
Marshaller marshaller = context.createMarshaller();
|
||||
StringWriter out = new StringWriter();
|
||||
marshaller.marshal(item, out);
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
public String toXmlSafe(Object item) {
|
||||
if (item == null) return null;
|
||||
try {
|
||||
return this.toXml(item);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T fromXml(Class<T> type, String xmlString) throws JAXBException, InstantiationException, IllegalAccessException, ParserConfigurationException, IOException, SAXException {
|
||||
if (XmlSerializable.class.isAssignableFrom(type)){
|
||||
XmlSerializable<T> object = (XmlSerializable<T>)type.newInstance();
|
||||
return (T) object.fromXml(this.getDocument(xmlString).getDocumentElement());
|
||||
} else {
|
||||
JAXBContext jaxbContext = JAXBContext.newInstance(type);
|
||||
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
|
||||
|
||||
return (T) jaxbUnmarshaller.unmarshal(new StringReader(xmlString));
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T fromXmlSafe(Class<T> type, String xmlString) {
|
||||
if (xmlString == null) return null;
|
||||
try {
|
||||
return this.fromXml(type, xmlString);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// public <T extends XmlSerializable<T>> T xmlSerializableFromXml(Class<T> type, String xmlString) throws JAXBException, InstantiationException, IllegalAccessException, ParserConfigurationException, IOException, SAXException {
|
||||
// T object = type.newInstance();
|
||||
// return (T) object.fromXml(this.getDocument(xmlString).getDocumentElement());
|
||||
// }
|
||||
//
|
||||
// public <T extends XmlSerializable<T>> T xmlSerializableFromXmlSafe(Class<T> type, String xmlString) {
|
||||
// if (xmlString == null) return null;
|
||||
// try {
|
||||
// return this.xmlSerializableFromXml(type, xmlString);
|
||||
// } catch (Exception ex) {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
public Document getDocument(String xml) throws ParserConfigurationException, IOException, SAXException {
|
||||
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
||||
InputSource inputStream = new InputSource(new StringReader(xml));
|
||||
return docBuilder.parse(inputStream);
|
||||
}
|
||||
|
||||
public Document getDocument() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
|
||||
return docBuilder.newDocument();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ActionConfirmationStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Requested((short) 0),
|
||||
Accepted((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
ActionConfirmationStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ActionConfirmationStatus> map = EnumUtils.getEnumValueMap(ActionConfirmationStatus.class);
|
||||
|
||||
public static ActionConfirmationStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ActionConfirmationType implements DatabaseEnum<Short> {
|
||||
|
||||
MergeAccount((short) 0),
|
||||
RemoveCredential((short) 1),
|
||||
DmpInvitation((short) 2);
|
||||
|
||||
private final Short value;
|
||||
|
||||
ActionConfirmationType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ActionConfirmationType> map = EnumUtils.getEnumValueMap(ActionConfirmationType.class);
|
||||
|
||||
public static ActionConfirmationType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ContactInfoType implements DatabaseEnum<Short> {
|
||||
|
||||
Email((short) 0);
|
||||
|
||||
private final Short value;
|
||||
|
||||
ContactInfoType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ContactInfoType> map = EnumUtils.getEnumValueMap(ContactInfoType.class);
|
||||
|
||||
public static ContactInfoType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DescriptionStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Draft((short) 0),
|
||||
Finalized((short) 1),
|
||||
Canceled((short) 2);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DescriptionStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DescriptionStatus> map = EnumUtils.getEnumValueMap(DescriptionStatus.class);
|
||||
|
||||
public static DescriptionStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DescriptionTemplateStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Draft((short) 0),
|
||||
Finalized((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DescriptionTemplateStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DescriptionTemplateStatus> map = EnumUtils.getEnumValueMap(DescriptionTemplateStatus.class);
|
||||
|
||||
public static DescriptionTemplateStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DescriptionTemplateTypeStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Draft((short) 0),
|
||||
Finalized((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DescriptionTemplateTypeStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DescriptionTemplateTypeStatus> map = EnumUtils.getEnumValueMap(DescriptionTemplateTypeStatus.class);
|
||||
|
||||
public static DescriptionTemplateTypeStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DescriptionTemplateVersionStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Current((short) 0), Previous ((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DescriptionTemplateVersionStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DescriptionTemplateVersionStatus> map = EnumUtils.getEnumValueMap(DescriptionTemplateVersionStatus.class);
|
||||
|
||||
public static DescriptionTemplateVersionStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpAccessType implements DatabaseEnum<Short> {
|
||||
|
||||
Public((short) 0), Restricted((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpAccessType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpAccessType> map = EnumUtils.getEnumValueMap(DmpAccessType.class);
|
||||
|
||||
public static DmpAccessType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpBlueprintExtraFieldDataType implements DatabaseEnum<Short> {
|
||||
|
||||
Text((short) 0),
|
||||
RichTex((short) 1),
|
||||
Date((short) 2),
|
||||
Number((short) 3),
|
||||
;
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpBlueprintExtraFieldDataType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpBlueprintExtraFieldDataType> map = EnumUtils.getEnumValueMap(DmpBlueprintExtraFieldDataType.class);
|
||||
|
||||
public static DmpBlueprintExtraFieldDataType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpBlueprintFieldCategory implements DatabaseEnum<Short> {
|
||||
System((short) 0),
|
||||
Extra((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpBlueprintFieldCategory(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpBlueprintFieldCategory> map = EnumUtils.getEnumValueMap(DmpBlueprintFieldCategory.class);
|
||||
|
||||
public static DmpBlueprintFieldCategory of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpBlueprintStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Draft((short) 0),
|
||||
Finalized((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpBlueprintStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpBlueprintStatus> map = EnumUtils.getEnumValueMap(DmpBlueprintStatus.class);
|
||||
|
||||
public static DmpBlueprintStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpBlueprintSystemFieldType implements DatabaseEnum<Short> {
|
||||
|
||||
Text((short)0),
|
||||
HtmlText((short)1),
|
||||
Researchers((short)2),
|
||||
Organizations((short)3),
|
||||
Language((short)4),
|
||||
Contact((short)5),
|
||||
Funder((short)6),
|
||||
Grant((short)7),
|
||||
Project((short)8),
|
||||
License((short)9),
|
||||
AccessRights((short)10);
|
||||
private final Short value;
|
||||
|
||||
DmpBlueprintSystemFieldType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpBlueprintSystemFieldType> map = EnumUtils.getEnumValueMap(DmpBlueprintSystemFieldType.class);
|
||||
|
||||
public static DmpBlueprintSystemFieldType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Draft((short) 0), Finalized((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpStatus> map = EnumUtils.getEnumValueMap(DmpStatus.class);
|
||||
|
||||
public static DmpStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpUserRole implements DatabaseEnum<Short> {
|
||||
|
||||
Owner((short) 0), User((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpUserRole(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpUserRole> map = EnumUtils.getEnumValueMap(DmpUserRole.class);
|
||||
|
||||
public static DmpUserRole of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum DmpVersionStatus implements DatabaseEnum<Short> {
|
||||
|
||||
Current((short) 0), Previous ((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
DmpVersionStatus(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, DmpVersionStatus> map = EnumUtils.getEnumValueMap(DmpVersionStatus.class);
|
||||
|
||||
public static DmpVersionStatus of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum EntityType implements DatabaseEnum<Short> {
|
||||
|
||||
DMP((short) 0);
|
||||
|
||||
private final Short value;
|
||||
|
||||
EntityType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, EntityType> map = EnumUtils.getEnumValueMap(EntityType.class);
|
||||
|
||||
public static EntityType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EnumUtils {
|
||||
public static <EnumType extends Enum<EnumType> & DatabaseEnum<EnumValue>, EnumValue> Map<EnumValue, EnumType> getEnumValueMap(Class<EnumType> enumType){
|
||||
HashMap<EnumValue, EnumType> map = new HashMap<>();
|
||||
for (EnumType v : enumType.getEnumConstants()) {
|
||||
map.put(v.getValue(), v);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum FieldDataComboBoxType implements DatabaseEnum<String> {
|
||||
Autocomplete("autocomplete"),
|
||||
Wordlist("wordlist");
|
||||
private final String value;
|
||||
|
||||
FieldDataComboBoxType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<String, FieldDataComboBoxType> map = EnumUtils.getEnumValueMap(FieldDataComboBoxType.class);
|
||||
|
||||
public static FieldDataComboBoxType of(String i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum FieldDataExternalDatasetType implements DatabaseEnum<String> {
|
||||
ReusedDataset("reused_dataset"),
|
||||
ProducedDataset("produced_dataset"),
|
||||
Other("other");
|
||||
private final String value;
|
||||
|
||||
FieldDataExternalDatasetType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<String, FieldDataExternalDatasetType> map = EnumUtils.getEnumValueMap(FieldDataExternalDatasetType.class);
|
||||
|
||||
public static FieldDataExternalDatasetType of(String i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum FieldDataInternalDmpEntryType implements DatabaseEnum<String> {
|
||||
Researchers("researchers"),
|
||||
Dmps("dmps"),
|
||||
Datasets("datasets");
|
||||
private final String value;
|
||||
|
||||
FieldDataInternalDmpEntryType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<String, FieldDataInternalDmpEntryType> map = EnumUtils.getEnumValueMap(FieldDataInternalDmpEntryType.class);
|
||||
|
||||
public static FieldDataInternalDmpEntryType of(String i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum FieldType implements DatabaseEnum<String> {
|
||||
COMBO_BOX(Names.ComboBox), //TODO remove from xml an keep subtypes only AUTO_COMPLETE, WORD_LIST
|
||||
AUTO_COMPLETE(Names.Autocomplete),
|
||||
WORD_LIST(Names.Wordlist),
|
||||
BOOLEAN_DECISION(Names.BooleanDecision),
|
||||
RADIO_BOX(Names.RadioBox),
|
||||
INTERNAL_DMP_ENTRIES(Names.InternalDmpEntities), //TODO remove from xml an keep subtypes only INTERNAL_DMP_ENTRIES_RESEARCHERS. INTERNAL_DMP_ENTRIES_DMPS, INTERNAL_DMP_ENTRIES_DATASETS
|
||||
INTERNAL_DMP_ENTRIES_RESEARCHERS(Names.InternalDmpResearchers),
|
||||
INTERNAL_DMP_ENTRIES_DMPS(Names.InternalDmpDmps),
|
||||
INTERNAL_DMP_ENTRIES_DATASETS(Names.InternalDmpDatasets),
|
||||
CHECK_BOX(Names.CheckBox),
|
||||
FREE_TEXT(Names.FreeText),
|
||||
TEXT_AREA(Names.TextArea),
|
||||
RICH_TEXT_AREA(Names.RichTextarea),
|
||||
UPLOAD(Names.Upload),
|
||||
DATE_PICKER(Names.DatePicker),
|
||||
EXTERNAL_DATASETS(Names.ExternalDatasets),
|
||||
DATA_REPOSITORIES(Names.DataRepositories),
|
||||
JOURNAL_REPOSITORIES(Names.JournalRepositories),
|
||||
PUB_REPOSITORIES(Names.PubRepositories),
|
||||
LICENSES(Names.Licenses),
|
||||
TAXONOMIES(Names.Taxonomies),
|
||||
PUBLICATIONS(Names.Publications),
|
||||
REGISTRIES(Names.Registries),
|
||||
SERVICES(Names.Services),
|
||||
TAGS(Names.Tags),
|
||||
RESEARCHERS(Names.Researchers),
|
||||
ORGANIZATIONS(Names.Organizations),
|
||||
DATASET_IDENTIFIER(Names.DatasetIdentifier),
|
||||
CURRENCY(Names.Currency),
|
||||
VALIDATION(Names.Validation);
|
||||
private final String value;
|
||||
|
||||
public static class Names {
|
||||
public static final String ComboBox = "combobox";
|
||||
public static final String Autocomplete = "autocomplete";
|
||||
public static final String Wordlist = "wordlist";
|
||||
public static final String BooleanDecision = "booleanDecision";
|
||||
public static final String RadioBox = "radiobox";
|
||||
public static final String InternalDmpEntities = "internalDmpEntities";
|
||||
public static final String InternalDmpResearchers = "internalDmpResearchers";
|
||||
public static final String InternalDmpDmps = "internalDmpDmps";
|
||||
public static final String InternalDmpDatasets = "internalDmpDatasets";
|
||||
public static final String CheckBox = "checkBox";
|
||||
public static final String FreeText = "freetext";
|
||||
public static final String TextArea = "textarea";
|
||||
public static final String RichTextarea = "richTextarea";
|
||||
public static final String Upload = "upload";
|
||||
public static final String DatePicker = "datePicker";
|
||||
public static final String ExternalDatasets = "externalDatasets";
|
||||
public static final String DataRepositories = "dataRepositories";
|
||||
public static final String JournalRepositories = "journalRepositories";
|
||||
public static final String PubRepositories = "pubRepositories";
|
||||
public static final String Licenses = "licenses";
|
||||
public static final String Taxonomies = "taxonomies";
|
||||
public static final String Publications = "publications";
|
||||
public static final String Registries = "registries";
|
||||
public static final String Services = "services";
|
||||
public static final String Tags = "tags";
|
||||
public static final String Researchers = "researchers";
|
||||
public static final String Organizations = "organizations";
|
||||
public static final String DatasetIdentifier = "datasetIdentifier";
|
||||
public static final String Currency = "currency";
|
||||
public static final String Validation = "validation";
|
||||
}
|
||||
|
||||
FieldType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<String, FieldType> map = EnumUtils.getEnumValueMap(FieldType.class);
|
||||
|
||||
public static FieldType of(String i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum FieldValidationType implements DatabaseEnum<Short> {
|
||||
|
||||
None((short) 0),
|
||||
Required((short) 1),
|
||||
Url((short) 2);
|
||||
|
||||
private final Short value;
|
||||
|
||||
FieldValidationType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, FieldValidationType> map = EnumUtils.getEnumValueMap(FieldValidationType.class);
|
||||
|
||||
public static FieldValidationType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum IsActive implements DatabaseEnum<Short> {
|
||||
|
||||
Inactive((short) 0),
|
||||
Active((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
IsActive(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, IsActive> map = EnumUtils.getEnumValueMap(IsActive.class);
|
||||
|
||||
public static IsActive of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum LockTargetType implements DatabaseEnum<Short> {
|
||||
Dmp((short) 0),
|
||||
Decription((short) 1);
|
||||
private final Short value;
|
||||
|
||||
LockTargetType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, LockTargetType> map = EnumUtils.getEnumValueMap(LockTargetType.class);
|
||||
|
||||
public static LockTargetType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ProviderType implements DatabaseEnum<Integer> {
|
||||
|
||||
Google (1),
|
||||
Facebook ( 2),
|
||||
Twitter ( 3),
|
||||
LinkedIn (4),
|
||||
NativeLogin ( 5),
|
||||
B2Access ( 6),
|
||||
ORCID (7),
|
||||
OpenAire ( 8),
|
||||
Configurable ( 9),
|
||||
Zenodo (10),
|
||||
Keycloack ( 128);
|
||||
|
||||
private final Integer value;
|
||||
|
||||
ProviderType(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() { return this.value; }
|
||||
|
||||
private static final Map<Integer, ProviderType> map = EnumUtils.getEnumValueMap(ProviderType.class);
|
||||
public static ProviderType of(Integer i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum RecentActivityItemType implements DatabaseEnum<Short> {
|
||||
|
||||
Dmp((short) 0),
|
||||
Description((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
RecentActivityItemType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, RecentActivityItemType> map = EnumUtils.getEnumValueMap(RecentActivityItemType.class);
|
||||
|
||||
public static RecentActivityItemType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum RecentActivityOrder implements DatabaseEnum<Short> {
|
||||
UpdatedAt((short) 0),
|
||||
Label((short) 1),
|
||||
Status((short) 2);
|
||||
|
||||
private final Short value;
|
||||
|
||||
RecentActivityOrder(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, RecentActivityOrder> map = EnumUtils.getEnumValueMap(RecentActivityOrder.class);
|
||||
|
||||
public static RecentActivityOrder of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ReferenceFieldDataType implements DatabaseEnum<Short> {
|
||||
Text((short) 0),
|
||||
Date((short) 1);
|
||||
private final Short value;
|
||||
|
||||
ReferenceFieldDataType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ReferenceFieldDataType> map = EnumUtils.getEnumValueMap(ReferenceFieldDataType.class);
|
||||
|
||||
public static ReferenceFieldDataType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ReferenceSourceType implements DatabaseEnum<Short> {
|
||||
|
||||
Internal((short) 0),
|
||||
External((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
ReferenceSourceType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ReferenceSourceType> map = EnumUtils.getEnumValueMap(ReferenceSourceType.class);
|
||||
|
||||
public static ReferenceSourceType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ReferenceType implements DatabaseEnum<Short> {
|
||||
Taxonomies((short) 0),
|
||||
Licenses((short) 1),
|
||||
Publications((short) 2),
|
||||
Journals((short) 3),
|
||||
PubRepositories((short) 4),
|
||||
DataRepositories((short) 5),
|
||||
Registries((short) 6),
|
||||
Services((short) 7),
|
||||
Project((short) 8),
|
||||
Funder((short) 9),
|
||||
Datasets((short) 10),
|
||||
Organizations((short) 11),
|
||||
Grants((short) 12),
|
||||
Researcher((short) 13);
|
||||
private final Short value;
|
||||
|
||||
ReferenceType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ReferenceType> map = EnumUtils.getEnumValueMap(ReferenceType.class);
|
||||
|
||||
public static ReferenceType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
import jakarta.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ReferenceTypeExternalApiHTTPMethodType implements DatabaseEnum<Short> {
|
||||
@XmlEnumValue(value = "0")
|
||||
GET((short) 0),
|
||||
@XmlEnumValue(value = "1")
|
||||
POST((short) 1);
|
||||
private final Short value;
|
||||
|
||||
ReferenceTypeExternalApiHTTPMethodType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ReferenceTypeExternalApiHTTPMethodType> map = EnumUtils.getEnumValueMap(ReferenceTypeExternalApiHTTPMethodType.class);
|
||||
|
||||
public static ReferenceTypeExternalApiHTTPMethodType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
import jakarta.xml.bind.annotation.XmlEnumValue;
|
||||
import jakarta.xml.bind.annotation.XmlValue;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum ReferenceTypeSourceType implements DatabaseEnum<Short> {
|
||||
@XmlEnumValue(value = "0")
|
||||
API((short) 0),
|
||||
@XmlEnumValue(value = "1")
|
||||
STATIC((short) 1);
|
||||
private final Short value;
|
||||
|
||||
public static class Names {
|
||||
public static final String API = "api";
|
||||
public static final String STATIC = "static";
|
||||
}
|
||||
|
||||
ReferenceTypeSourceType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, ReferenceTypeSourceType> map = EnumUtils.getEnumValueMap(ReferenceTypeSourceType.class);
|
||||
|
||||
public static ReferenceTypeSourceType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum StorageFilePermission implements DatabaseEnum<Short> {
|
||||
|
||||
Read((short) 0),
|
||||
Write((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
StorageFilePermission(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, StorageFilePermission> map = EnumUtils.getEnumValueMap(StorageFilePermission.class);
|
||||
|
||||
public static StorageFilePermission of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum StorageType implements DatabaseEnum<Short> {
|
||||
|
||||
Temp((short) 0),
|
||||
Main((short) 1),
|
||||
Transformer((short)2);
|
||||
|
||||
private final Short value;
|
||||
|
||||
StorageType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, StorageType> map = EnumUtils.getEnumValueMap(StorageType.class);
|
||||
|
||||
public static StorageType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum SupportiveMaterialFieldType implements DatabaseEnum<Short> {
|
||||
|
||||
Faq((short) 0),
|
||||
About((short) 1),
|
||||
Glossary((short) 2),
|
||||
TermsOfService((short) 3),
|
||||
UserGuide((short) 4);
|
||||
|
||||
private final Short value;
|
||||
|
||||
SupportiveMaterialFieldType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, SupportiveMaterialFieldType> map = EnumUtils.getEnumValueMap(SupportiveMaterialFieldType.class);
|
||||
|
||||
public static SupportiveMaterialFieldType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum UserDescriptionTemplateRole implements DatabaseEnum<Short> {
|
||||
|
||||
Owner((short) 0),
|
||||
Member((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
UserDescriptionTemplateRole(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, UserDescriptionTemplateRole> map = EnumUtils.getEnumValueMap(UserDescriptionTemplateRole.class);
|
||||
|
||||
public static UserDescriptionTemplateRole of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package eu.eudat.commons.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum UserSettingsType implements DatabaseEnum<Short> {
|
||||
|
||||
Settings((short) 0),
|
||||
Config((short) 1);
|
||||
|
||||
private final Short value;
|
||||
|
||||
UserSettingsType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, UserSettingsType> map = EnumUtils.getEnumValueMap(UserSettingsType.class);
|
||||
|
||||
public static UserSettingsType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package eu.eudat.commons.enums.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.commons.enums.EnumUtils;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum NotificationContactType implements DatabaseEnum<Short> {
|
||||
EMAIL((short)0),
|
||||
SLACK_BROADCAST((short)1),
|
||||
SMS((short)2),
|
||||
IN_APP((short)3);
|
||||
|
||||
private final Short value;
|
||||
|
||||
NotificationContactType(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, NotificationContactType> map = EnumUtils.getEnumValueMap(NotificationContactType.class);
|
||||
|
||||
public static NotificationContactType of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.commons.enums.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.commons.enums.EnumUtils;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum NotificationNotifyState implements DatabaseEnum<Short> {
|
||||
PENDING((short)0),
|
||||
PROCESSING((short)1),
|
||||
SUCCESSFUL((short)2),
|
||||
ERROR((short)3),
|
||||
OMITTED((short)4);
|
||||
|
||||
private final Short value;
|
||||
|
||||
NotificationNotifyState(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, NotificationNotifyState> map = EnumUtils.getEnumValueMap(NotificationNotifyState.class);
|
||||
|
||||
public static NotificationNotifyState of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package eu.eudat.commons.enums.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.commons.enums.EnumUtils;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum NotificationTrackingProcess implements DatabaseEnum<Short> {
|
||||
PENDING((short)0),
|
||||
PROCESSING((short)1),
|
||||
COMPLETED((short)2),
|
||||
ERROR((short)3),
|
||||
OMITTED((short)4);
|
||||
|
||||
private final Short value;
|
||||
|
||||
NotificationTrackingProcess(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, NotificationTrackingProcess> map = EnumUtils.getEnumValueMap(NotificationTrackingProcess.class);
|
||||
|
||||
public static NotificationTrackingProcess of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package eu.eudat.commons.enums.notification;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
import eu.eudat.commons.enums.EnumUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public enum NotificationTrackingState implements DatabaseEnum<Short> {
|
||||
UNDEFINED((short)0),
|
||||
NA((short)1),
|
||||
QUEUED((short)2),
|
||||
SENT((short)3),
|
||||
DELIVERED((short)4),
|
||||
UNDELIVERED((short)5),
|
||||
FAILED((short)6),
|
||||
UNSENT((short)7);
|
||||
|
||||
private final Short value;
|
||||
|
||||
NotificationTrackingState(Short value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Short getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Short, NotificationTrackingState> map = EnumUtils.getEnumValueMap(NotificationTrackingState.class);
|
||||
|
||||
public static NotificationTrackingState of(Short i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package eu.eudat.commons.exceptions;
|
||||
|
||||
public class HugeResultSetException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -6961447213733280563L;
|
||||
|
||||
|
||||
public HugeResultSetException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package eu.eudat.commons.fake;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class FakeRequestAttributes implements RequestAttributes {
|
||||
private final Map<String, Object> requestAttributeMap = new HashMap<>();
|
||||
private final Map<String, Runnable> requestDestructionCallbacks = new LinkedHashMap<>(8);
|
||||
private volatile boolean requestActive = true;
|
||||
|
||||
@Override
|
||||
public Object getAttribute(@NotNull String name, int scope) {
|
||||
if (scope == RequestAttributes.SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
throw new IllegalStateException("Cannot ask for request attribute - request is not active anymore!");
|
||||
}
|
||||
return this.requestAttributeMap.get(name);
|
||||
} else {
|
||||
throw new IllegalStateException("Only " + RequestAttributes.SCOPE_REQUEST + " allowed for " + FakeRequestAttributes.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(@NotNull String name, @NotNull Object value, int scope) {
|
||||
if (scope == RequestAttributes.SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
throw new IllegalStateException("Cannot set request attribute - request is not active anymore!");
|
||||
}
|
||||
this.requestAttributeMap.put(name, value);
|
||||
} else {
|
||||
throw new IllegalStateException("Only " + RequestAttributes.SCOPE_REQUEST + " allowed for " + FakeRequestAttributes.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAttribute(@NotNull String name, int scope) {
|
||||
if (scope == RequestAttributes.SCOPE_REQUEST) {
|
||||
if (isRequestActive()) {
|
||||
removeRequestDestructionCallback(name);
|
||||
this.requestAttributeMap.remove(name);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException("Only " + RequestAttributes.SCOPE_REQUEST + " allowed for " + FakeRequestAttributes.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String @NotNull [] getAttributeNames(int scope) {
|
||||
if (scope == RequestAttributes.SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
throw new IllegalStateException("Cannot ask for request attributes - request is not active anymore!");
|
||||
}
|
||||
return this.requestAttributeMap.keySet().toArray(new String[0]);
|
||||
} else {
|
||||
throw new IllegalStateException("Only " + RequestAttributes.SCOPE_REQUEST + " allowed for " + FakeRequestAttributes.class.getSimpleName());
|
||||
}
|
||||
//return new String[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDestructionCallback(@NotNull String name, @NotNull Runnable callback, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
registerRequestDestructionCallback(name, callback);
|
||||
} else {
|
||||
throw new IllegalStateException("Only " + RequestAttributes.SCOPE_REQUEST + " allowed for " + FakeRequestAttributes.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
protected final void registerRequestDestructionCallback(String name, Runnable callback) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(callback, "Callback must not be null");
|
||||
synchronized (this.requestDestructionCallbacks) {
|
||||
this.requestDestructionCallbacks.put(name, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolveReference(@NotNull String key) {
|
||||
// Not supported
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getSessionId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Object getSessionMutex() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
public void requestCompleted() {
|
||||
executeRequestDestructionCallbacks();
|
||||
for (String name : getAttributeNames(RequestAttributes.SCOPE_REQUEST)) {
|
||||
this.removeAttribute(name, RequestAttributes.SCOPE_REQUEST);
|
||||
}
|
||||
this.requestActive = false;
|
||||
}
|
||||
|
||||
private boolean isRequestActive() {
|
||||
return this.requestActive;
|
||||
}
|
||||
|
||||
|
||||
private void removeRequestDestructionCallback(String name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
synchronized (this.requestDestructionCallbacks) {
|
||||
this.requestDestructionCallbacks.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeRequestDestructionCallbacks() {
|
||||
synchronized (this.requestDestructionCallbacks) {
|
||||
for (Runnable runnable : this.requestDestructionCallbacks.values()) {
|
||||
runnable.run();
|
||||
}
|
||||
this.requestDestructionCallbacks.clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package eu.eudat.commons.fake;
|
||||
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
public class FakeRequestScope implements Closeable {
|
||||
private RequestAttributes initialRequestAttributes = null;
|
||||
private FakeRequestAttributes currentRequestAttributes = null;
|
||||
boolean isInUse = false;
|
||||
|
||||
public FakeRequestScope() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public final void reset() {
|
||||
this.close();
|
||||
this.isInUse = true;
|
||||
|
||||
this.initialRequestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
this.currentRequestAttributes = new FakeRequestAttributes();
|
||||
RequestContextHolder.setRequestAttributes(this.currentRequestAttributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (!this.isInUse)
|
||||
return;
|
||||
this.isInUse = false;
|
||||
|
||||
if (initialRequestAttributes != null)
|
||||
RequestContextHolder.setRequestAttributes(initialRequestAttributes);
|
||||
else
|
||||
RequestContextHolder.resetRequestAttributes();
|
||||
|
||||
if (currentRequestAttributes != null)
|
||||
currentRequestAttributes.requestCompleted();
|
||||
|
||||
this.initialRequestAttributes = null;
|
||||
this.currentRequestAttributes = null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package eu.eudat.commons.lock;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@Service
|
||||
public class LockByKeyManager {
|
||||
|
||||
private static class LockWrapper {
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private final AtomicInteger numberOfThreadsInQueue = new AtomicInteger(1);
|
||||
|
||||
private LockWrapper addThreadInQueue() {
|
||||
numberOfThreadsInQueue.incrementAndGet();
|
||||
return this;
|
||||
}
|
||||
|
||||
private int removeThreadFromQueue() {
|
||||
return numberOfThreadsInQueue.decrementAndGet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static ConcurrentHashMap<String, LockWrapper> locks = new ConcurrentHashMap<String, LockWrapper>();
|
||||
|
||||
public void lock(String key) {
|
||||
LockWrapper lockWrapper = locks.compute(key, (k, v) -> v == null ? new LockWrapper() : v.addThreadInQueue());
|
||||
lockWrapper.lock.lock();
|
||||
}
|
||||
|
||||
public boolean tryLock(String key, long timeout, TimeUnit unit) throws InterruptedException {
|
||||
LockWrapper lockWrapper = null;
|
||||
try {
|
||||
lockWrapper = locks.compute(key, (k, v) -> v == null ? new LockWrapper() : v.addThreadInQueue());
|
||||
return lockWrapper.lock.tryLock(timeout, unit);
|
||||
} catch (Exception ex){
|
||||
if (lockWrapper != null && lockWrapper.removeThreadFromQueue() == 0) {
|
||||
// NB : We pass in the specific value to remove to handle the case where another thread would queue right before the removal
|
||||
locks.remove(key, lockWrapper);
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public void unlock(String key) {
|
||||
LockWrapper lockWrapper = locks.get(key);
|
||||
lockWrapper.lock.unlock();
|
||||
if (lockWrapper.removeThreadFromQueue() == 0) {
|
||||
// NB : We pass in the specific value to remove to handle the case where another thread would queue right before the removal
|
||||
locks.remove(key, lockWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package eu.eudat.commons.scope.tenant;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(MultitenancyProperties.class)
|
||||
public class MultitenancyConfiguration {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package eu.eudat.commons.scope.tenant;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "tenant.multitenancy")
|
||||
public class MultitenancyProperties {
|
||||
private boolean isMultitenant;
|
||||
|
||||
public boolean isMultitenant() {
|
||||
return isMultitenant;
|
||||
}
|
||||
|
||||
public void setIsMultitenant(boolean multitenant) {
|
||||
isMultitenant = multitenant;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package eu.eudat.commons.scope.tenant;
|
||||
|
||||
import eu.eudat.data.tenant.TenantScopedBaseEntity;
|
||||
import gr.cite.tools.logging.LoggerService;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import org.hibernate.Session;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@Component
|
||||
//@RequestScope
|
||||
public class TenantScope {
|
||||
public static final String TenantReplaceParameter = "::TenantCode::";
|
||||
public static final String TenantCodesClaimName = "TenantCodes";
|
||||
public static final String TenantClaimName = "x-tenant";
|
||||
|
||||
private final MultitenancyProperties multitenancy;
|
||||
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(TenantScope.class));
|
||||
private final AtomicReference<UUID> tenant = new AtomicReference<>();
|
||||
private final AtomicReference<String> tenantCode = new AtomicReference<>();
|
||||
private final AtomicReference<UUID> initialTenant = new AtomicReference<>();
|
||||
private final AtomicReference<String> initialTenantCode = new AtomicReference<>();
|
||||
|
||||
@Autowired
|
||||
public TenantScope(MultitenancyProperties multitenancy) {
|
||||
this.multitenancy = multitenancy;
|
||||
}
|
||||
|
||||
public Boolean isMultitenant() {
|
||||
return multitenancy.isMultitenant();
|
||||
}
|
||||
|
||||
public Boolean isSet() {
|
||||
if (!this.isMultitenant())
|
||||
return Boolean.TRUE;
|
||||
return this.tenant.get() != null;
|
||||
}
|
||||
|
||||
public UUID getTenant() throws InvalidApplicationException {
|
||||
if (!this.isMultitenant())
|
||||
return null;
|
||||
if (this.tenant.get() == null)
|
||||
throw new InvalidApplicationException("tenant not set");
|
||||
return this.tenant.get();
|
||||
}
|
||||
|
||||
public String getTenantCode() throws InvalidApplicationException {
|
||||
if (!this.isMultitenant())
|
||||
return null;
|
||||
if (this.tenant.get() == null)
|
||||
throw new InvalidApplicationException("tenant not set");
|
||||
return this.tenantCode.get();
|
||||
}
|
||||
|
||||
public void setTempTenant(EntityManager entityManager, UUID tenant) {
|
||||
this.tenant.set(tenant);
|
||||
|
||||
if (this.tenant.get() != null) {
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.enableFilter(TenantScopedBaseEntity.tenantFilter).setParameter(TenantScopedBaseEntity.tenantFilterTenantParam, this.tenant.get().toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void removeTempTenant(EntityManager entityManager) {
|
||||
this.tenant.set(this.initialTenant.get());
|
||||
this.tenantCode.set(this.initialTenantCode.get());
|
||||
if (this.initialTenant.get() != null) {
|
||||
entityManager
|
||||
.unwrap(Session.class)
|
||||
.enableFilter(TenantScopedBaseEntity.tenantFilter).setParameter(TenantScopedBaseEntity.tenantFilterTenantParam, this.initialTenant.get().toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void setTenant(UUID tenant, String tenantCode) {
|
||||
if (this.isMultitenant()) {
|
||||
this.tenant.set(tenant);
|
||||
this.initialTenant.set(tenant);
|
||||
this.tenantCode.set(tenantCode);
|
||||
this.initialTenantCode.set(tenantCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package eu.eudat.commons.scope.tenant;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface TenantScoped {
|
||||
void setTenantId(UUID tenantId);
|
||||
UUID getTenantId();
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package eu.eudat.commons.scope.user;
|
||||
|
||||
import gr.cite.tools.logging.LoggerService;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
|
||||
import javax.management.InvalidApplicationException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@Component
|
||||
@RequestScope
|
||||
public class UserScope {
|
||||
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(UserScope.class));
|
||||
private final AtomicReference<UUID> userId = new AtomicReference<>();
|
||||
|
||||
public Boolean isSet() {
|
||||
return this.userId.get() != null;
|
||||
}
|
||||
|
||||
public UUID getUserId() throws InvalidApplicationException {
|
||||
if (this.userId.get() == null) throw new InvalidApplicationException("user not set");
|
||||
return this.userId.get();
|
||||
}
|
||||
|
||||
public UUID getUserIdSafe() {
|
||||
return this.userId.get();
|
||||
}
|
||||
|
||||
public void setUserId(UUID userId) {
|
||||
this.userId.set(userId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package eu.eudat.commons.types.actionconfirmation;
|
||||
|
||||
import eu.eudat.commons.enums.DmpUserRole;
|
||||
import jakarta.xml.bind.annotation.*;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@XmlRootElement(name = "dmp-invitation")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class DmpInvitationEntity {
|
||||
|
||||
@XmlAttribute(name = "email")
|
||||
private String email;
|
||||
|
||||
@XmlAttribute(name = "dmp")
|
||||
private UUID dmpId;
|
||||
|
||||
@XmlAttribute(name = "dmp-role")
|
||||
private DmpUserRole role;
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public UUID getDmpId() {
|
||||
return dmpId;
|
||||
}
|
||||
|
||||
public void setDmpId(UUID dmpId) {
|
||||
this.dmpId = dmpId;
|
||||
}
|
||||
|
||||
public DmpUserRole getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(DmpUserRole role) {
|
||||
this.role = role;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package eu.eudat.commons.types.actionconfirmation;
|
||||
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlAttribute;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "email-confirmation")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class EmailConfirmationEntity {
|
||||
|
||||
@XmlAttribute(name = "email")
|
||||
private String email;
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package eu.eudat.commons.types.common;
|
||||
|
||||
|
||||
public interface DatabaseDefinition {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package eu.eudat.commons.types.common;
|
||||
|
||||
import eu.eudat.commons.types.common.DatabaseDefinition;
|
||||
|
||||
public interface DatabaseModelDefinition extends DatabaseDefinition {
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package eu.eudat.commons.types.common;
|
||||
|
||||
import eu.eudat.commons.types.common.DatabaseDefinition;
|
||||
|
||||
public interface DatabaseViewStyleDefinition extends DatabaseDefinition {
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package eu.eudat.commons.types.dashborad;
|
||||
|
||||
import eu.eudat.commons.enums.RecentActivityItemType;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.UUID;
|
||||
|
||||
public class RecentActivityItemEntity {
|
||||
private RecentActivityItemType type;
|
||||
private UUID id;
|
||||
private Instant updatedAt;
|
||||
private String label;
|
||||
private Short statusValue;
|
||||
|
||||
public RecentActivityItemEntity(RecentActivityItemType type, UUID id, Instant updatedAt, String label, Short statusValue) {
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
this.updatedAt = updatedAt;
|
||||
this.label = label;
|
||||
this.statusValue = statusValue;
|
||||
}
|
||||
|
||||
public RecentActivityItemType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(RecentActivityItemType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Instant getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Instant updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public Short getStatusValue() {
|
||||
return statusValue;
|
||||
}
|
||||
|
||||
public void setStatusValue(Short statusValue) {
|
||||
this.statusValue = statusValue;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package eu.eudat.commons.types.description;
|
||||
|
||||
public class FieldEntity {
|
||||
private String key;
|
||||
private String value;
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package eu.eudat.commons.types.description;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PropertyDefinitionEntity {
|
||||
private List<FieldEntity> fields;
|
||||
|
||||
public List<FieldEntity> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public void setFields(List<FieldEntity> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class DefinitionEntity implements XmlSerializable<DefinitionEntity> {
|
||||
private List<SectionEntity> sections;
|
||||
private List<PageEntity> pages;
|
||||
|
||||
public List<SectionEntity> getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
public void setSections(List<SectionEntity> sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
||||
public List<PageEntity> getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public void setPages(List<PageEntity> pageEntities) {
|
||||
this.pages = pageEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = doc.createElement("root");
|
||||
Element sections = doc.createElement("sections");
|
||||
Element pages = doc.createElement("pages");
|
||||
for (SectionEntity sectionEntity : this.sections) {
|
||||
sectionEntity.setNumbering("" + (this.sections.indexOf(sectionEntity) + 1));
|
||||
sections.appendChild(sectionEntity.toXml(doc));
|
||||
}
|
||||
|
||||
for (PageEntity pageEntity : this.pages) {
|
||||
pages.appendChild(pageEntity.toXml(doc));
|
||||
}
|
||||
|
||||
root.appendChild(pages);
|
||||
root.appendChild(sections);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DefinitionEntity fromXml(Element element) {
|
||||
|
||||
this.sections = new LinkedList();
|
||||
Element sections = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "sections");
|
||||
if (sections != null) {
|
||||
NodeList sectionElements = sections.getChildNodes();
|
||||
for (int temp = 0; temp < sectionElements.getLength(); temp++) {
|
||||
Node sectionElement = sectionElements.item(temp);
|
||||
if (sectionElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.sections.add(new SectionEntity().fromXml((Element) sectionElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
this.pages = new LinkedList<>();
|
||||
Element pages = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "pages");
|
||||
if (pages != null) {
|
||||
NodeList pagesElements = pages.getChildNodes();
|
||||
for (int temp = 0; temp < pagesElements.getLength(); temp++) {
|
||||
Node pageElement = pagesElements.item(temp);
|
||||
if (pageElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.pages.add(new PageEntity().fromXml((Element) pageElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public List<FieldEntity> getFieldById(String id){
|
||||
List<FieldEntity> fieldEntities = new ArrayList<>();
|
||||
if (id == null || id.isBlank()) return fieldEntities;
|
||||
if (this.getSections() != null){
|
||||
for (SectionEntity sectionEntity: this.getSections()) {
|
||||
fieldEntities.addAll(sectionEntity.getFieldById(id));
|
||||
}
|
||||
}
|
||||
return fieldEntities;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.enums.FieldValidationType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.common.DatabaseViewStyleDefinition;
|
||||
import eu.eudat.commons.types.descriptiontemplate.fielddata.*;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class FieldEntity implements DatabaseViewStyleDefinition, XmlSerializable<FieldEntity> {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private List<String> schematics;
|
||||
private String numbering;
|
||||
private String defaultValue;
|
||||
private List<RuleEntity> visibilityRules;
|
||||
private BaseFieldDataEntity<?> data;
|
||||
private List<FieldValidationType> validations;
|
||||
private Boolean includeInExport;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public List<String> getSchematics() {
|
||||
return schematics;
|
||||
}
|
||||
public void setSchematics(List<String> schematics) {
|
||||
this.schematics = schematics;
|
||||
}
|
||||
|
||||
public BaseFieldDataEntity<?> getData() {
|
||||
return data;
|
||||
}
|
||||
public void setData(BaseFieldDataEntity<?> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
|
||||
public List<FieldValidationType> getValidations() {
|
||||
return validations;
|
||||
}
|
||||
public void setValidations(List<FieldValidationType> validations) {
|
||||
this.validations = validations;
|
||||
}
|
||||
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
public Boolean getIncludeInExport() {
|
||||
return includeInExport;
|
||||
}
|
||||
|
||||
public void setIncludeInExport(Boolean includeInExport) {
|
||||
this.includeInExport = includeInExport;
|
||||
}
|
||||
|
||||
public List<RuleEntity> getVisibilityRules() {
|
||||
return visibilityRules;
|
||||
}
|
||||
|
||||
public void setVisibilityRules(List<RuleEntity> visibilityRules) {
|
||||
this.visibilityRules = visibilityRules;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element rootElement = doc.createElement("field");
|
||||
rootElement.setAttribute("id", this.id);
|
||||
rootElement.setAttribute("ordinal", "" + this.ordinal);
|
||||
|
||||
Element schematics = doc.createElement("schematics");
|
||||
if (this.schematics != null) {
|
||||
for (String s : this.schematics) {
|
||||
Element schematic = doc.createElement("schematic");
|
||||
schematic.setTextContent(s);
|
||||
schematics.appendChild(schematic);
|
||||
}
|
||||
}
|
||||
|
||||
Element viewStyle = doc.createElement("viewStyle");
|
||||
if (this.data != null) {
|
||||
switch (this.data.getFieldType()){
|
||||
case COMBO_BOX:
|
||||
case AUTO_COMPLETE:
|
||||
case WORD_LIST:{
|
||||
viewStyle.setAttribute("renderstyle", FieldType.COMBO_BOX.getValue());
|
||||
break;
|
||||
}
|
||||
case INTERNAL_DMP_ENTRIES:
|
||||
case INTERNAL_DMP_ENTRIES_DMPS:
|
||||
case INTERNAL_DMP_ENTRIES_DATASETS:
|
||||
case INTERNAL_DMP_ENTRIES_RESEARCHERS:{
|
||||
viewStyle.setAttribute("renderstyle", FieldType.INTERNAL_DMP_ENTRIES.getValue());
|
||||
break;
|
||||
}
|
||||
case BOOLEAN_DECISION: viewStyle.setAttribute("renderstyle", this.data.getFieldType().getValue());
|
||||
}
|
||||
|
||||
}
|
||||
Element visibilityRulesElement = doc.createElement("visible");
|
||||
if (this.visibilityRules != null && !this.visibilityRules.isEmpty()) {
|
||||
for (RuleEntity rule : this.visibilityRules) {
|
||||
visibilityRulesElement.appendChild(rule.toXml(doc));
|
||||
}
|
||||
}
|
||||
Element defaultValue = doc.createElement("defaultValue");
|
||||
defaultValue.setAttribute("value", this.getDefaultValue());
|
||||
|
||||
Element validations = doc.createElement("validations");
|
||||
for (FieldValidationType validationType : this.validations) {
|
||||
Element validation = doc.createElement("validation");
|
||||
validation.setAttribute("type", "" + validationType.getValue());
|
||||
validations.appendChild(validation);
|
||||
}
|
||||
|
||||
Element numbering = doc.createElement("numbering");
|
||||
numbering.setTextContent(this.numbering);
|
||||
|
||||
rootElement.appendChild(schematics);
|
||||
rootElement.appendChild(numbering);
|
||||
rootElement.appendChild(validations);
|
||||
rootElement.appendChild(defaultValue);
|
||||
rootElement.appendChild(visibilityRulesElement);
|
||||
rootElement.appendChild(viewStyle);
|
||||
if (this.data != null) {
|
||||
rootElement.appendChild(this.data.toXml(doc));
|
||||
|
||||
}
|
||||
rootElement.setAttribute("export", this.includeInExport == null || this.includeInExport ? "true" : "false");
|
||||
return rootElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldEntity fromXml(Element element) {
|
||||
this.id = element.getAttribute("id");
|
||||
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
||||
|
||||
|
||||
Element viewStyle = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "viewStyle");
|
||||
|
||||
FieldType fieldType = FieldType.of(viewStyle.getAttribute("renderstyle"));
|
||||
|
||||
Element visibility = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "visible");
|
||||
NodeList rulesElements = visibility.getChildNodes();
|
||||
this.visibilityRules = new LinkedList();
|
||||
for (int temp = 0; temp < rulesElements.getLength(); temp++) {
|
||||
Node ruleElement = rulesElements.item(temp);
|
||||
if (ruleElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.visibilityRules.add(new RuleEntity().fromXml((Element) ruleElement));
|
||||
}
|
||||
}
|
||||
|
||||
Element numbering = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "numbering");
|
||||
if (numbering != null) this.numbering = numbering.getTextContent();
|
||||
|
||||
this.schematics = new LinkedList<>();
|
||||
Element schematics = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "schematics");
|
||||
if(schematics != null){
|
||||
NodeList schematicElements = schematics.getChildNodes();
|
||||
for (int temp = 0; temp < schematicElements.getLength(); temp++) {
|
||||
Node schematicElement = schematicElements.item(temp);
|
||||
if (schematicElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.schematics.add(schematicElement.getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Element dataElement = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "data");
|
||||
|
||||
Element defaultValue = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "defaultValue");
|
||||
|
||||
this.defaultValue = defaultValue.getAttribute("value");
|
||||
String subType = dataElement != null ? dataElement.getAttribute("type") : null;
|
||||
this.data = new FieldDataHelper().create(fieldType, subType);
|
||||
if (this.data != null) this.data.fromXml(dataElement);
|
||||
|
||||
this.validations = new LinkedList<>();
|
||||
Element validations = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "validations");
|
||||
if (validations != null) {
|
||||
NodeList validationElements = validations.getChildNodes();
|
||||
for (int temp = 0; temp < validationElements.getLength(); temp++) {
|
||||
Node validationElement = validationElements.item(temp);
|
||||
if (validationElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
Short enumValue = Short.parseShort(((Element) validationElement).getAttribute("type"));
|
||||
FieldValidationType validationType = FieldValidationType.of(enumValue);
|
||||
this.validations.add(validationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (element.hasAttribute("export")) {
|
||||
this.includeInExport = Boolean.parseBoolean(element.getAttribute("export"));
|
||||
} else {
|
||||
this.includeInExport = true;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.types.common.DatabaseViewStyleDefinition;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class FieldSetEntity implements DatabaseViewStyleDefinition, XmlSerializable<FieldSetEntity> {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private List<FieldEntity> fields;
|
||||
private String numbering;
|
||||
private String title;
|
||||
private String description;
|
||||
private String extendedDescription;
|
||||
private String additionalInformation;
|
||||
private MultiplicityEntity multiplicity;
|
||||
private boolean hasCommentField;
|
||||
// private String commentFieldValue; //TODO: DescriptionTemplate
|
||||
|
||||
public List<FieldEntity> getFields() {
|
||||
return fields;
|
||||
}
|
||||
public void setFields(List<FieldEntity> fieldEntities) {
|
||||
this.fields = fieldEntities;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getExtendedDescription() {
|
||||
return extendedDescription;
|
||||
}
|
||||
public void setExtendedDescription(String extendedDescription) {
|
||||
this.extendedDescription = extendedDescription;
|
||||
}
|
||||
|
||||
public MultiplicityEntity getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
public void setMultiplicity(MultiplicityEntity multiplicity) {
|
||||
this.multiplicity = multiplicity;
|
||||
}
|
||||
|
||||
public boolean getHasCommentField() {
|
||||
return hasCommentField;
|
||||
}
|
||||
public void setHasCommentField(boolean hasCommentField) {
|
||||
this.hasCommentField = hasCommentField;
|
||||
}
|
||||
|
||||
// public String getCommentFieldValue() {
|
||||
// return commentFieldValue;
|
||||
// }
|
||||
// public void setCommentFieldValue(String commentFieldValue) {
|
||||
// this.commentFieldValue = commentFieldValue;
|
||||
// }
|
||||
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
public String getAdditionalInformation() {
|
||||
return additionalInformation;
|
||||
}
|
||||
public void setAdditionalInformation(String additionalInformation) {
|
||||
this.additionalInformation = additionalInformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element fieldSet = doc.createElement("fieldSet");
|
||||
fieldSet.setAttribute("id", this.id);
|
||||
fieldSet.setAttribute("ordinal", "" + this.ordinal);
|
||||
Element title = doc.createElement("title");
|
||||
title.setTextContent(this.title);
|
||||
|
||||
Element description = doc.createElement("description");
|
||||
description.setTextContent(this.description);
|
||||
|
||||
Element extendedDescription = doc.createElement("extendedDescription");
|
||||
extendedDescription.setTextContent(this.extendedDescription);
|
||||
|
||||
Element additionalInformation = doc.createElement("additionalInformation");
|
||||
additionalInformation.setTextContent(this.additionalInformation);
|
||||
|
||||
Element multiplicity = doc.createElement("multiplicity");
|
||||
multiplicity.setAttribute("min", "" + this.multiplicity.getMin());
|
||||
multiplicity.setAttribute("max", "" + this.multiplicity.getMax());
|
||||
multiplicity.setAttribute("placeholder", this.multiplicity.getPlaceholder());
|
||||
multiplicity.setAttribute("tableView", String.valueOf(this.multiplicity.getTableView()));
|
||||
|
||||
Element commentField = doc.createElement("commentField");
|
||||
commentField.setAttribute("hasCommentField", "" + this.hasCommentField);
|
||||
// commentField.setAttribute("commentFieldValue", this.commentFieldValue);
|
||||
|
||||
Element numbering = doc.createElement("numbering");
|
||||
numbering.setTextContent(this.numbering);
|
||||
|
||||
Element fieldsElement = doc.createElement("fields");
|
||||
for (FieldEntity fieldEntity : fields) {
|
||||
fieldEntity.setNumbering(this.numbering + "." + (this.fields.indexOf(fieldEntity) + 1));
|
||||
fieldsElement.appendChild(fieldEntity.toXml(doc));
|
||||
}
|
||||
|
||||
fieldSet.appendChild(numbering);
|
||||
fieldSet.appendChild(commentField);
|
||||
fieldSet.appendChild(fieldsElement);
|
||||
fieldSet.appendChild(multiplicity);
|
||||
fieldSet.appendChild(title);
|
||||
fieldSet.appendChild(description);
|
||||
fieldSet.appendChild(extendedDescription);
|
||||
fieldSet.appendChild(additionalInformation);
|
||||
return fieldSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldSetEntity fromXml(Element element) {
|
||||
this.id = element.getAttribute("id");
|
||||
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
||||
this.fields = new LinkedList();
|
||||
Element title = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "title");
|
||||
this.title = title.getTextContent();
|
||||
Element description = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "description");
|
||||
this.description = description.getTextContent();
|
||||
Element extendedDescription = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "extendedDescription");
|
||||
this.extendedDescription = extendedDescription.getTextContent();
|
||||
Element additionalInformation = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "additionalInformation");
|
||||
if (additionalInformation != null)
|
||||
this.additionalInformation = additionalInformation.getTextContent();
|
||||
Element commentField = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "commentField");
|
||||
this.hasCommentField = Boolean.parseBoolean(commentField.getAttribute("hasCommentField"));
|
||||
// this.commentFieldValue = commentField.getAttribute("commentFieldValue");
|
||||
Element fields = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "fields");
|
||||
|
||||
Element numbering = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "numbering");
|
||||
if (numbering != null) this.numbering = numbering.getTextContent();
|
||||
|
||||
if (fields != null) {
|
||||
NodeList fieldElements = fields.getChildNodes();
|
||||
for (int temp = 0; temp < fieldElements.getLength(); temp++) {
|
||||
Node fieldElement = fieldElements.item(temp);
|
||||
if (fieldElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.fields.add(new FieldEntity().fromXml((Element) fieldElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.multiplicity = new MultiplicityEntity();
|
||||
Element multiplicity = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "multiplicity");
|
||||
|
||||
this.multiplicity.setMin(Integer.parseInt(multiplicity.getAttribute("min")));
|
||||
this.multiplicity.setMax(Integer.parseInt(multiplicity.getAttribute("max")));
|
||||
this.multiplicity.setPlaceholder(multiplicity.getAttribute("placeholder"));
|
||||
this.multiplicity.setTableView(Boolean.parseBoolean(multiplicity.getAttribute("tableView")));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<FieldEntity> getFieldById(String id){
|
||||
if (this.getFields() == null || id == null || id.isBlank()) return new ArrayList<>();
|
||||
|
||||
return this.getFields().stream().filter(x-> id.equals(x.getId())).toList();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
public class MultiplicityEntity {
|
||||
|
||||
private int min;
|
||||
private int max;
|
||||
private String placeholder;
|
||||
private boolean tableView;
|
||||
|
||||
public int getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public void setMin(int min) {
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public void setMax(int max) {
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public String getPlaceholder() {
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
public void setPlaceholder(String placeholder) {
|
||||
this.placeholder = placeholder;
|
||||
}
|
||||
|
||||
public boolean getTableView() {
|
||||
return tableView;
|
||||
}
|
||||
|
||||
public void setTableView(boolean tableView) {
|
||||
this.tableView = tableView;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.types.common.DatabaseViewStyleDefinition;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
||||
public class PageEntity implements DatabaseViewStyleDefinition, XmlSerializable<PageEntity> {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private String title;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = doc.createElement("page");
|
||||
root.setAttribute("title", this.title);
|
||||
root.setAttribute("ordinal", "" + this.ordinal);
|
||||
root.setAttribute("id", this.id);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageEntity fromXml(Element item) {
|
||||
this.ordinal = Integer.parseInt(item.getAttribute("ordinal"));
|
||||
this.id = item.getAttribute("id");
|
||||
this.title = item.getAttribute("title");
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class RuleEntity implements XmlSerializable<RuleEntity> {
|
||||
private String target;
|
||||
private String value;
|
||||
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element rule = doc.createElement("rule");
|
||||
rule.setAttribute("target", this.target);
|
||||
|
||||
Element value = doc.createElement("value");
|
||||
value.setTextContent(this.value);
|
||||
|
||||
rule.appendChild(value);
|
||||
return rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuleEntity fromXml(Element item) {
|
||||
this.target = item.getAttribute("target");
|
||||
|
||||
Element value = (Element) item.getElementsByTagName("value").item(0);
|
||||
if (value != null) {
|
||||
this.value = value.getTextContent();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate;
|
||||
|
||||
import eu.eudat.commons.types.common.DatabaseViewStyleDefinition;
|
||||
import eu.eudat.commons.types.xml.XmlBuilder;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class SectionEntity implements DatabaseViewStyleDefinition, XmlSerializable<SectionEntity> {
|
||||
private String id;
|
||||
private int ordinal;
|
||||
private boolean defaultVisibility;
|
||||
private String numbering;
|
||||
private String page;
|
||||
private String title;
|
||||
private String description;
|
||||
private String extendedDescription;
|
||||
private List<SectionEntity> sections;
|
||||
private List<FieldSetEntity> fieldSets;
|
||||
private Boolean multiplicity;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getOrdinal() {
|
||||
return ordinal;
|
||||
}
|
||||
|
||||
public void setOrdinal(int ordinal) {
|
||||
this.ordinal = ordinal;
|
||||
}
|
||||
|
||||
public boolean isDefaultVisibility() {
|
||||
return defaultVisibility;
|
||||
}
|
||||
|
||||
public void setDefaultVisibility(boolean defaultVisibility) {
|
||||
this.defaultVisibility = defaultVisibility;
|
||||
}
|
||||
|
||||
public String getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(String page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<SectionEntity> getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
public void setSections(List<SectionEntity> sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
||||
public List<FieldSetEntity> getFieldSets() {
|
||||
return fieldSets;
|
||||
}
|
||||
|
||||
public void setFieldSets(List<FieldSetEntity> fieldSetEntities) {
|
||||
this.fieldSets = fieldSetEntities;
|
||||
}
|
||||
|
||||
public String getExtendedDescription() {
|
||||
return extendedDescription;
|
||||
}
|
||||
|
||||
public void setExtendedDescription(String extendedDescription) {
|
||||
this.extendedDescription = extendedDescription;
|
||||
}
|
||||
|
||||
public String getNumbering() {
|
||||
return numbering;
|
||||
}
|
||||
|
||||
public void setNumbering(String numbering) {
|
||||
this.numbering = numbering;
|
||||
}
|
||||
|
||||
public Boolean getMultiplicity() {
|
||||
return multiplicity;
|
||||
}
|
||||
|
||||
public void setMultiplicity(Boolean multiplicity) {
|
||||
this.multiplicity = multiplicity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element rootElement = doc.createElement("section");
|
||||
rootElement.setAttribute("id", this.id);
|
||||
rootElement.setAttribute("ordinal", "" + this.ordinal);
|
||||
rootElement.setAttribute("defaultVisibility", "" + this.defaultVisibility);
|
||||
rootElement.setAttribute("page", "" + this.page);
|
||||
rootElement.setAttribute("multiplicity", (this.multiplicity != null ? "" + this.multiplicity : "false"));
|
||||
|
||||
Element description = doc.createElement("description");
|
||||
description.setTextContent(this.description);
|
||||
|
||||
Element extendedDescription = doc.createElement("extendedDescription");
|
||||
extendedDescription.setTextContent(this.extendedDescription);
|
||||
|
||||
Element numbering = doc.createElement("numbering");
|
||||
numbering.setTextContent(this.numbering);
|
||||
|
||||
Element title = doc.createElement("title");
|
||||
title.setTextContent(this.title);
|
||||
|
||||
if (sections != null) {
|
||||
Element sections = doc.createElement("sections");
|
||||
for (SectionEntity sectionEntity : this.sections) {
|
||||
sectionEntity.setNumbering(this.numbering + "." + (this.sections.indexOf(sectionEntity) + 1));
|
||||
sections.appendChild(sectionEntity.toXml(doc));
|
||||
}
|
||||
rootElement.appendChild(sections);
|
||||
}
|
||||
|
||||
if (this.fieldSets != null) {
|
||||
Element formGroups = doc.createElement("fieldSets");
|
||||
for (FieldSetEntity fieldSetEntity : this.fieldSets) {
|
||||
fieldSetEntity.setNumbering(this.numbering + "." + (this.fieldSets.indexOf(fieldSetEntity) + 1));
|
||||
formGroups.appendChild(fieldSetEntity.toXml(doc));
|
||||
}
|
||||
rootElement.appendChild(formGroups);
|
||||
}
|
||||
|
||||
rootElement.appendChild(numbering);
|
||||
rootElement.appendChild(title);
|
||||
rootElement.appendChild(extendedDescription);
|
||||
rootElement.appendChild(description);
|
||||
|
||||
return rootElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectionEntity fromXml(Element element) {
|
||||
|
||||
this.id = element.getAttribute("id");
|
||||
this.ordinal = Integer.parseInt(element.getAttribute("ordinal"));
|
||||
this.defaultVisibility = Boolean.valueOf(element.getAttribute("defaultVisibility"));
|
||||
this.page = element.getAttribute("page");
|
||||
this.multiplicity = element.hasAttribute("multiplicity") ? Boolean.valueOf(element.getAttribute("multiplicity")) : false;
|
||||
|
||||
Element description = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "description");
|
||||
if (description != null) this.description = description.getTextContent();
|
||||
|
||||
Element extendedDescription = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "extendedDescription");
|
||||
if (extendedDescription != null) this.extendedDescription = extendedDescription.getTextContent();
|
||||
|
||||
Element numbering = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "numbering");
|
||||
if (numbering != null) this.numbering = numbering.getTextContent();
|
||||
|
||||
Element title = XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "title");
|
||||
if (title != null) this.title = title.getTextContent();
|
||||
|
||||
this.sections = new LinkedList<SectionEntity>();
|
||||
Element sections = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "sections");
|
||||
if (sections != null) {
|
||||
NodeList sectionElements = sections.getChildNodes();
|
||||
for (int temp = 0; temp < sectionElements.getLength(); temp++) {
|
||||
Node sectionElement = sectionElements.item(temp);
|
||||
if (sectionElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.sections.add(new SectionEntity().fromXml((Element) sectionElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.fieldSets = new LinkedList<FieldSetEntity>();
|
||||
Element fieldGroups = (Element) XmlBuilder.getNodeFromListByTagName(element.getChildNodes(), "fieldSets");
|
||||
|
||||
if (fieldGroups != null) {
|
||||
NodeList fieldGroupElements = fieldGroups.getChildNodes();
|
||||
for (int temp = 0; temp < fieldGroupElements.getLength(); temp++) {
|
||||
Node fieldGroupElement = fieldGroupElements.item(temp);
|
||||
if (fieldGroupElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.fieldSets.add(new FieldSetEntity().fromXml((Element) fieldGroupElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<FieldEntity> getFieldById(String id){
|
||||
List<FieldEntity> fieldEntities = new ArrayList<>();
|
||||
if (id == null || id.isBlank()) return fieldEntities;
|
||||
if (this.getFieldSets() != null){
|
||||
for (FieldSetEntity fieldSetEntity: this.getFieldSets()) {
|
||||
fieldEntities.addAll(fieldSetEntity.getFieldById(id));
|
||||
}
|
||||
}
|
||||
if (this.getSections() != null){
|
||||
for (SectionEntity sectionEntity: this.getSections()) {
|
||||
fieldEntities.addAll(sectionEntity.getFieldById(id));
|
||||
}
|
||||
}
|
||||
return fieldEntities;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,257 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import eu.eudat.commons.enums.EnumUtils;
|
||||
import eu.eudat.commons.enums.FieldDataComboBoxType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AutoCompleteDataEntity extends ComboBoxDataEntity<AutoCompleteDataEntity> {
|
||||
|
||||
public static class AuthAutoCompleteData {
|
||||
private String url;
|
||||
private String method;
|
||||
private String body;
|
||||
private String path;
|
||||
private String type;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
public static class AutoCompleteSingleData {
|
||||
private AutocompleteType autocompleteType;
|
||||
private String url;
|
||||
private ComboBoxDataEntity.Option autoCompleteOptions;
|
||||
private String optionsRoot;
|
||||
private Boolean hasAuth;
|
||||
private AuthAutoCompleteData auth;
|
||||
private String method;
|
||||
|
||||
public AutocompleteType getAutocompleteType() {
|
||||
return autocompleteType;
|
||||
}
|
||||
|
||||
public void setAutocompleteType(AutocompleteType autocompleteType) {
|
||||
this.autocompleteType = autocompleteType;
|
||||
}
|
||||
|
||||
public String getOptionsRoot() {
|
||||
return optionsRoot;
|
||||
}
|
||||
public void setOptionsRoot(String optionsRoot) {
|
||||
this.optionsRoot = optionsRoot;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public Boolean getHasAuth() {
|
||||
return hasAuth;
|
||||
}
|
||||
|
||||
public void setHasAuth(Boolean hasAuth) {
|
||||
this.hasAuth = hasAuth;
|
||||
}
|
||||
|
||||
public AuthAutoCompleteData getAuth() {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public void setAuth(AuthAutoCompleteData auth) {
|
||||
this.auth = auth;
|
||||
}
|
||||
|
||||
public ComboBoxDataEntity.Option getAutoCompleteOptions() {
|
||||
return autoCompleteOptions;
|
||||
}
|
||||
public void setAutoCompleteOptions(ComboBoxDataEntity.Option autoCompleteOptions) {
|
||||
this.autoCompleteOptions = autoCompleteOptions;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean multiAutoComplete;
|
||||
private List<AutoCompleteSingleData> autoCompleteSingleDataList;
|
||||
|
||||
public Boolean getMultiAutoComplete() { return multiAutoComplete; }
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) { this.multiAutoComplete = multiAutoComplete; }
|
||||
|
||||
public List<AutoCompleteSingleData> getAutoCompleteSingleDataList() {
|
||||
return autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
public void setAutoCompleteSingleDataList(List<AutoCompleteSingleData> autoCompleteSingleDataList) {
|
||||
this.autoCompleteSingleDataList = autoCompleteSingleDataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldDataComboBoxType getFieldSubType() {
|
||||
return FieldDataComboBoxType.Autocomplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.AUTO_COMPLETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.multiAutoComplete != null)
|
||||
root.setAttribute("multiAutoComplete", this.multiAutoComplete.toString());
|
||||
for (AutoCompleteSingleData singleData: this.autoCompleteSingleDataList) {
|
||||
Element parent = doc.createElement("autocompleteSingle");
|
||||
parent.setAttribute("url", singleData.url);
|
||||
parent.setAttribute("optionsRoot", singleData.optionsRoot);
|
||||
parent.setAttribute("autoCompleteType", Integer.toString(singleData.autocompleteType.getValue()));
|
||||
parent.setAttribute("hasAuth", Boolean.toString(singleData.hasAuth));
|
||||
parent.setAttribute("method", singleData.method);
|
||||
Element element = doc.createElement("option");
|
||||
element.setAttribute("label", singleData.autoCompleteOptions.getLabel());
|
||||
element.setAttribute("value", singleData.autoCompleteOptions.getValue());
|
||||
element.setAttribute("source", singleData.autoCompleteOptions.getSource());
|
||||
parent.appendChild(element);
|
||||
if (singleData.hasAuth) {
|
||||
Element authElement = doc.createElement("auth");
|
||||
authElement.setAttribute("url", singleData.auth.url);
|
||||
authElement.setAttribute("method", singleData.auth.method);
|
||||
authElement.setAttribute("body", singleData.auth.body);
|
||||
authElement.setAttribute("path", singleData.auth.path);
|
||||
authElement.setAttribute("type", singleData.auth.type);
|
||||
parent.appendChild(authElement);
|
||||
}
|
||||
root.appendChild(parent);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoCompleteDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.autoCompleteSingleDataList = new ArrayList<>();
|
||||
NodeList items = item.getElementsByTagName("autocompleteSingle");
|
||||
if (items != null && items.getLength() > 0) {
|
||||
for (int i = 0; i < items.getLength(); i++) {
|
||||
this.autoCompleteSingleDataList.add(new AutoCompleteSingleData());
|
||||
Element single = (Element) items.item(i);
|
||||
this.mapFromXml(single, this.autoCompleteSingleDataList.get(i));
|
||||
}
|
||||
} else {
|
||||
this.autoCompleteSingleDataList.add(new AutoCompleteSingleData());
|
||||
this.mapFromXml(item, this.autoCompleteSingleDataList.get(0));
|
||||
}
|
||||
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
|
||||
return this;
|
||||
}
|
||||
|
||||
private void mapFromXml(Element item, AutoCompleteSingleData singleData) {
|
||||
singleData.url = item.getAttribute("url");
|
||||
singleData.optionsRoot = item.getAttribute("optionsRoot");
|
||||
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
|
||||
if (item.getAttribute("autoCompleteType") == null || item.getAttribute("autoCompleteType").equals("") ) {
|
||||
singleData.autocompleteType = AutocompleteType.UNCACHED;
|
||||
} else {
|
||||
singleData.autocompleteType = AutocompleteType.of(Integer.parseInt(item.getAttribute("autoCompleteType")));
|
||||
}
|
||||
singleData.hasAuth = Boolean.parseBoolean(item.getAttribute("hasAuth"));
|
||||
singleData.method = item.hasAttribute("method") ? item.getAttribute("method") : "GET";
|
||||
Element optionElement = (Element) item.getElementsByTagName("option").item(0);
|
||||
if (optionElement != null) {
|
||||
singleData.autoCompleteOptions = new Option();
|
||||
singleData.autoCompleteOptions.setLabel(optionElement.getAttribute("label"));
|
||||
singleData.autoCompleteOptions.setValue(optionElement.getAttribute("value"));
|
||||
singleData.autoCompleteOptions.setSource(optionElement.getAttribute("source"));
|
||||
singleData.autoCompleteOptions.setUri(optionElement.getAttribute("uri"));
|
||||
}
|
||||
if (singleData.hasAuth) {
|
||||
Element authElement = (Element) item.getElementsByTagName("auth").item(0);
|
||||
if (authElement != null) {
|
||||
singleData.auth = new AuthAutoCompleteData();
|
||||
singleData.auth.setUrl(authElement.getAttribute("url"));
|
||||
singleData.auth.setMethod(authElement.getAttribute("method"));
|
||||
singleData.auth.setBody(authElement.getAttribute("body"));
|
||||
singleData.auth.setPath(authElement.getAttribute("path"));
|
||||
singleData.auth.setType(authElement.getAttribute("type"));
|
||||
}
|
||||
}
|
||||
}
|
||||
public enum AutocompleteType implements DatabaseEnum<Integer> {
|
||||
UNCACHED(0),
|
||||
CACHED(1);
|
||||
|
||||
private final int value;
|
||||
|
||||
AutocompleteType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private static final Map<Integer, AutocompleteType> map = EnumUtils.getEnumValueMap(AutocompleteType.class);
|
||||
|
||||
public static AutocompleteType of(int i) {
|
||||
return map.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseFieldDataEntity<T> implements XmlSerializable<T> {
|
||||
private String label;
|
||||
|
||||
public abstract FieldType getFieldType();
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public Element toXml(Document doc) {
|
||||
Element root = doc.createElement("data");
|
||||
root.setAttribute("label", this.getLabel());
|
||||
return root;
|
||||
}
|
||||
|
||||
public T fromXml(Element item) {
|
||||
|
||||
this.setLabel(item.getAttribute("label"));
|
||||
return (T) this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BooleanDecisionDataEntity extends BaseFieldDataEntity<BooleanDecisionDataEntity> {
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.BOOLEAN_DECISION;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CheckBoxDataEntity extends BaseFieldDataEntity<CheckBoxDataEntity> {
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.CHECK_BOX;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataComboBoxType;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class ComboBoxDataEntity<T> extends BaseFieldDataEntity<T> {
|
||||
|
||||
public abstract FieldDataComboBoxType getFieldSubType();
|
||||
|
||||
public static class Option implements XmlSerializable<Option> {
|
||||
private String label;
|
||||
private String value;
|
||||
private String source;
|
||||
private String uri;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element option = doc.createElement("option");
|
||||
option.setAttribute("label", this.label);
|
||||
option.setAttribute("value", this.value);
|
||||
option.setAttribute("source", this.source);
|
||||
option.setAttribute("uri", this.uri);
|
||||
return option;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComboBoxDataEntity.Option fromXml(Element item) {
|
||||
this.label = item.getAttribute("label");
|
||||
this.value = item.getAttribute("value");
|
||||
this.source = item.getAttribute("source");
|
||||
this.uri = item.getAttribute("uri");
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
root.setAttribute("type", this.getFieldSubType().toString());
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
return (T) this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class CurrencyDataEntity extends BaseFieldDataEntity<CurrencyDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.CURRENCY;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DataRepositoryDataEntity extends BaseFieldDataEntity<DataRepositoryDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.DATA_REPOSITORIES;
|
||||
}
|
||||
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataRepositoryDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataComboBoxType;
|
||||
import eu.eudat.commons.enums.FieldDataInternalDmpEntryType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DatasetAutoCompleteDataEntity extends InternalDmpBaseDataEntity<DatasetAutoCompleteDataEntity> {
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldDataInternalDmpEntryType getFieldSubType() {
|
||||
return FieldDataInternalDmpEntryType.Datasets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.INTERNAL_DMP_ENTRIES_DATASETS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
root.setAttribute("multiAutoComplete", this.multiAutoComplete.toString());
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetAutoCompleteDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DatasetIdentifierDataEntity extends BaseFieldDataEntity<DatasetIdentifierDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.DATASET_IDENTIFIER;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DatePickerDataEntity extends BaseFieldDataEntity<DatePickerDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.DATE_PICKER;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataInternalDmpEntryType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DmpAutoCompleteDataEntity extends InternalDmpBaseDataEntity<DmpAutoCompleteDataEntity> {
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldDataInternalDmpEntryType getFieldSubType() {
|
||||
return FieldDataInternalDmpEntryType.Dmps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.INTERNAL_DMP_ENTRIES_DMPS;
|
||||
}
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
root.setAttribute("multiAutoComplete", this.multiAutoComplete.toString());
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DmpAutoCompleteDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataExternalDatasetType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExternalDatasetDataEntity extends BaseFieldDataEntity<ExternalDatasetDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.EXTERNAL_DATASETS;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
private FieldDataExternalDatasetType type;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
public FieldDataExternalDatasetType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(FieldDataExternalDatasetType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = doc.createElement("data");
|
||||
root.setAttribute("label", this.getLabel());
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
if (this.getType() != null) {
|
||||
root.setAttribute("type", this.getType().getValue());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExternalDatasetDataEntity fromXml(Element item) {
|
||||
this.setLabel(item != null ? item.getAttribute("label") : "");
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
this.setType(item.getAttribute("type") != null ? FieldDataExternalDatasetType.of(item.getAttribute("type")): FieldDataExternalDatasetType.Other);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataComboBoxType;
|
||||
import eu.eudat.commons.enums.FieldDataInternalDmpEntryType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Element;
|
||||
import java.util.Map;
|
||||
|
||||
public class FieldDataHelper {
|
||||
public BaseFieldDataEntity<?> create(FieldType type, String subType) {
|
||||
switch (type) {
|
||||
case COMBO_BOX: {
|
||||
if (subType != null && !subType.isBlank()) {
|
||||
switch (FieldDataComboBoxType.of(subType)) {
|
||||
case Wordlist: {
|
||||
return new WordListDataEntity();
|
||||
}
|
||||
case Autocomplete: {
|
||||
return new AutoCompleteDataEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case INTERNAL_DMP_ENTRIES: {
|
||||
if (subType != null && !subType.isBlank()) {
|
||||
switch (FieldDataInternalDmpEntryType.of(subType)){
|
||||
case Dmps: {
|
||||
return new DmpAutoCompleteDataEntity();
|
||||
}
|
||||
case Datasets: {
|
||||
return new DatasetAutoCompleteDataEntity();
|
||||
}
|
||||
case Researchers : {
|
||||
return new ResearcherAutoCompleteDataEntity();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BOOLEAN_DECISION: return new BooleanDecisionDataEntity();
|
||||
case RADIO_BOX: return new RadioBoxDataEntity();
|
||||
case CHECK_BOX: return new CheckBoxDataEntity();
|
||||
case FREE_TEXT: return new FreeTextDataEntity();
|
||||
case TEXT_AREA: return new TextAreaDataEntity();
|
||||
case RICH_TEXT_AREA: return new RichTextAreaDataEntity();
|
||||
case UPLOAD: return new UploadDataEntity();
|
||||
case DATE_PICKER: return new DatePickerDataEntity();
|
||||
case EXTERNAL_DATASETS: return new ExternalDatasetDataEntity();
|
||||
case DATA_REPOSITORIES: return new DataRepositoryDataEntity();
|
||||
case PUB_REPOSITORIES: return new PublicationRepositoryDataEntity();
|
||||
case JOURNAL_REPOSITORIES: return new JournalRepositoryDataEntity();
|
||||
case TAXONOMIES: return new TaxonomyDataEntity();
|
||||
case LICENSES: return new LicenseDataEntity();
|
||||
case PUBLICATIONS: return new PublicationDataEntity();
|
||||
case REGISTRIES: return new RegistryDataEntity();
|
||||
case SERVICES: return new ServiceDataEntity();
|
||||
case TAGS: return new TagDataEntity();
|
||||
case RESEARCHERS: return new ResearcherDataEntity();
|
||||
case ORGANIZATIONS: return new OrganizationDataEntity();
|
||||
case DATASET_IDENTIFIER: return new DatasetIdentifierDataEntity();
|
||||
case CURRENCY: return new CurrencyDataEntity();
|
||||
case VALIDATION: return new ValidationDataEntity();
|
||||
default: return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class FreeTextDataEntity extends BaseFieldDataEntity<FreeTextDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.FREE_TEXT;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataInternalDmpEntryType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class InternalDmpBaseDataEntity<T> extends BaseFieldDataEntity<T> {
|
||||
|
||||
public abstract FieldDataInternalDmpEntryType getFieldSubType();
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
root.setAttribute("type", this.getFieldSubType().toString());
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
return (T) this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class JournalRepositoryDataEntity extends BaseFieldDataEntity<JournalRepositoryDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.JOURNAL_REPOSITORIES;
|
||||
}
|
||||
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JournalRepositoryDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LicenseDataEntity extends BaseFieldDataEntity<LicenseDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.LICENSES;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LicenseDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class OrganizationDataEntity extends BaseFieldDataEntity<OrganizationDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.ORGANIZATIONS;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrganizationDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PublicationDataEntity extends BaseFieldDataEntity<PublicationDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.PUBLICATIONS;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PublicationRepositoryDataEntity extends BaseFieldDataEntity<PublicationRepositoryDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.PUB_REPOSITORIES;
|
||||
}
|
||||
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublicationRepositoryDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import eu.eudat.commons.types.xml.XmlSerializable;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RadioBoxDataEntity extends BaseFieldDataEntity<RadioBoxDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.RADIO_BOX;
|
||||
}
|
||||
public static class Option implements XmlSerializable<Option> {
|
||||
private String label;
|
||||
private String value;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element option = doc.createElement("option");
|
||||
option.setAttribute("label", this.label);
|
||||
option.setAttribute("value", this.value);
|
||||
return option;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Option fromXml(Element item) {
|
||||
this.label = item.getAttribute("label");
|
||||
this.value = item.getAttribute("value");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<Option> options;
|
||||
|
||||
public List<Option> getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void setOptions(List<Option> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
Element element = doc.createElement("options");
|
||||
for (Option option : this.options) {
|
||||
element.appendChild(option.toXml(doc));
|
||||
}
|
||||
root.appendChild(element);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadioBoxDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.options = new LinkedList<>();
|
||||
Element optionsElement = (Element) item.getElementsByTagName("options").item(0);
|
||||
if (optionsElement != null) {
|
||||
NodeList optionElements = optionsElement.getChildNodes();
|
||||
for (int temp = 0; temp < optionElements.getLength(); temp++) {
|
||||
Node optionElement = optionElements.item(temp);
|
||||
if (optionElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
this.options.add(new Option().fromXml((Element) optionElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class RegistryDataEntity extends BaseFieldDataEntity<RegistryDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.REGISTRIES;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistryDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldDataInternalDmpEntryType;
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ResearcherAutoCompleteDataEntity extends InternalDmpBaseDataEntity<ResearcherAutoCompleteDataEntity> {
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldDataInternalDmpEntryType getFieldSubType() {
|
||||
return FieldDataInternalDmpEntryType.Researchers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
root.setAttribute("multiAutoComplete", this.multiAutoComplete != null ? this.multiAutoComplete.toString() : "false");
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearcherAutoCompleteDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.multiAutoComplete = Boolean.parseBoolean(item.getAttribute("multiAutoComplete"));
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package eu.eudat.commons.types.descriptiontemplate.fielddata;
|
||||
|
||||
import eu.eudat.commons.enums.FieldType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ResearcherDataEntity extends BaseFieldDataEntity<ResearcherDataEntity> {
|
||||
@Override
|
||||
public FieldType getFieldType() {
|
||||
return FieldType.RESEARCHERS;
|
||||
}
|
||||
private Boolean multiAutoComplete;
|
||||
|
||||
public Boolean getMultiAutoComplete() {
|
||||
return multiAutoComplete;
|
||||
}
|
||||
|
||||
public void setMultiAutoComplete(Boolean multiAutoComplete) {
|
||||
this.multiAutoComplete = multiAutoComplete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element toXml(Document doc) {
|
||||
Element root = super.toXml(doc);
|
||||
if (this.getMultiAutoComplete() != null) {
|
||||
root.setAttribute("multiAutoComplete", this.getMultiAutoComplete().toString());
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearcherDataEntity fromXml(Element item) {
|
||||
super.fromXml(item);
|
||||
this.setMultiAutoComplete(Boolean.parseBoolean(item.getAttribute("multiAutoComplete")));
|
||||
return this;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue