Compare commits
1021 Commits
ui-redesig
...
master
Author | SHA1 | Date |
---|---|---|
Diamantis Tziotzios | e8aef281d4 | |
Diamantis Tziotzios | 00c6978594 | |
Diamantis Tziotzios | 3adb518e61 | |
Konstantina Galouni | eb74ef86b9 | |
Diamantis Tziotzios | a1ee9c82bc | |
Diamantis Tziotzios | 5e5bd39313 | |
Diamantis Tziotzios | 5e99cef60e | |
Diamantis Tziotzios | cc7edc2f49 | |
Diamantis Tziotzios | a1849c64ca | |
Diamantis Tziotzios | 192220161b | |
George Kalampokis | 87758c3e9a | |
Diamantis Tziotzios | 83342f5afa | |
Diamantis Tziotzios | 65cdb3b6ea | |
Diamantis Tziotzios | 536ba9b900 | |
Alexandros Mandilaras | 6bd3302788 | |
Diamantis Tziotzios | 4970f5812f | |
Diamantis Tziotzios | 9fed92dbcb | |
Diamantis Tziotzios | 44dab9c19a | |
Alexandros Mandilaras | 54f911d826 | |
Diamantis Tziotzios | 9879050eab | |
Diamantis Tziotzios | 8a41a7dcd9 | |
Diamantis Tziotzios | d60cc144d5 | |
Georgios Kakaletris | 9c37e5a073 | |
Georgios Kakaletris | 444c1aacb1 | |
Diamantis Tziotzios | 59d7383947 | |
Diamantis Tziotzios | 6caa1af134 | |
George Kalampokis | 74a6019a72 | |
George Kalampokis | 5c903c0f48 | |
George Kalampokis | ec8f6a6d48 | |
Bernaldo Mihasi | ecd86f413a | |
Bernaldo Mihasi | c238615b50 | |
Bernaldo Mihasi | 10d0f1fb0e | |
Bernaldo Mihasi | 846405435c | |
Bernaldo Mihasi | dfc9e14003 | |
Bernaldo Mihasi | bc1894586b | |
Bernaldo Mihasi | 2bf0a857bc | |
Bernaldo Mihasi | 3d10e8ad28 | |
Bernaldo Mihasi | 53b61853e1 | |
Bernaldo Mihasi | d644b1dc91 | |
Bernaldo Mihasi | 6b544e4702 | |
Bernaldo Mihasi | 0bd3422903 | |
Bernaldo Mihasi | 2f4e123ac9 | |
Bernaldo Mihasi | c99267d6cc | |
Bernaldo Mihasi | 32c45520b4 | |
Bernaldo Mihasi | 4cef17e999 | |
Bernaldo Mihasi | 34580f917f | |
Bernaldo Mihasi | 56a70636c3 | |
Bernaldo Mihasi | 0c9601d6f0 | |
Bernaldo Mihasi | 5f3ab00009 | |
Bernaldo Mihasi | beac6be706 | |
Bernaldo Mihasi | fbad63ee76 | |
Bernaldo Mihasi | 9cc42c57e9 | |
Bernaldo Mihasi | 79aaf23bb6 | |
Bernaldo Mihasi | b68070aa01 | |
Bernaldo Mihasi | db08662cac | |
Bernaldo Mihasi | 3c0dce93a8 | |
Bernaldo Mihasi | 69548e5a8b | |
Bernaldo Mihasi | 367861c050 | |
Bernaldo Mihasi | 93c5918251 | |
Bernaldo Mihasi | bfa310a074 | |
Bernaldo Mihasi | ec952820b1 | |
Bernaldo Mihasi | b1a832074d | |
Diamantis Tziotzios | cf6e041154 | |
Bernaldo Mihasi | c1858d582c | |
Bernaldo Mihasi | 29f5b6a6cc | |
Bernaldo Mihasi | 6154a5fa51 | |
Bernaldo Mihasi | 6f5fcabc79 | |
Bernaldo Mihasi | bbe4975176 | |
Bernaldo Mihasi | 4219d90039 | |
Bernaldo Mihasi | 6073c4cd85 | |
Bernaldo Mihasi | cd80e78e40 | |
George Kalampokis | 5019bc4271 | |
Bernaldo Mihasi | 3564cc16ff | |
Diamantis Tziotzios | 3b76397c24 | |
Bernaldo Mihasi | 78946de1b5 | |
Diamantis Tziotzios | c39c162979 | |
Konstantinos Triantafyllou | 655483b8e2 | |
Bernaldo Mihasi | 17dbd198ad | |
Bernaldo Mihasi | b94aa51489 | |
Diamantis Tziotzios | b6cade6e88 | |
Diamantis Tziotzios | 903026e2c2 | |
Bernaldo Mihasi | 59cba483b6 | |
Bernaldo Mihasi | 30abe4d4c9 | |
Konstantinos Triantafyllou | a4555f7303 | |
Bernaldo Mihasi | 634d49ea35 | |
Bernaldo Mihasi | e01709f886 | |
Bernaldo Mihasi | 09d6528f8f | |
Bernaldo Mihasi | 128b47d9c3 | |
Bernaldo Mihasi | bc279b1610 | |
Konstantinos Triantafyllou | a737fec19d | |
Bernaldo Mihasi | 3fc307c831 | |
Bernaldo Mihasi | ee90ac37b6 | |
Bernaldo Mihasi | 0918e55ac9 | |
Bernaldo Mihasi | 2db9ea613f | |
Konstantina Galouni | e878310b72 | |
Konstantina Galouni | e4af3bcbe9 | |
Konstantina Galouni | 77f40570ac | |
Konstantinos Triantafyllou | 7bc4f4055c | |
Konstantinos Triantafyllou | aec7126fd3 | |
Bernaldo Mihasi | dd6a2a0df7 | |
Bernaldo Mihasi | 1715463422 | |
Bernaldo Mihasi | a8ce14af70 | |
Bernaldo Mihasi | 1a15e1ddde | |
Bernaldo Mihasi | 000882cbdb | |
Bernaldo Mihasi | 1c0562d7e7 | |
Bernaldo Mihasi | 8fbc20c823 | |
Bernaldo Mihasi | 469a8b4def | |
Bernaldo Mihasi | cb972c394c | |
Bernaldo Mihasi | d996acdcc4 | |
Bernaldo Mihasi | 741179a53f | |
Bernaldo Mihasi | 3630727fed | |
Bernaldo Mihasi | 34e4761811 | |
Bernaldo Mihasi | dfa2f0cd38 | |
Bernaldo Mihasi | 3d367b0589 | |
Bernaldo Mihasi | b6505cda4e | |
Diamantis Tziotzios | 50c96ef821 | |
Konstantina Galouni | 1a2a93a95f | |
Konstantina Galouni | eb4f1d23e1 | |
Konstantina Galouni | 985b3de385 | |
Bernaldo Mihasi | 2aa1f76aab | |
Bernaldo Mihasi | 5cd1803e3a | |
Bernaldo Mihasi | 1f666a5bf9 | |
Bernaldo Mihasi | 4c9652abc3 | |
Bernaldo Mihasi | ce50a72ac1 | |
Bernaldo Mihasi | f20b420c2c | |
Bernaldo Mihasi | 730b60598a | |
Konstantina Galouni | 4bac942059 | |
Bernaldo Mihasi | 22dc9647f3 | |
Bernaldo Mihasi | b2f2a79a5d | |
Bernaldo Mihasi | 5e764559cf | |
Bernaldo Mihasi | a3ee9dccda | |
Bernaldo Mihasi | 758539eaa0 | |
Bernaldo Mihasi | af8fddb89c | |
Konstantina Galouni | b435994c51 | |
Konstantina Galouni | 0adc7044ab | |
Konstantinos Triantafyllou | 0d9b6f9622 | |
Bernaldo Mihasi | 5d5ebe7a55 | |
Bernaldo Mihasi | 7c347569fd | |
Konstantinos Triantafyllou | 50169222c7 | |
Konstantinos Triantafyllou | e84398f667 | |
Bernaldo Mihasi | a1fd03a444 | |
Bernaldo Mihasi | 8c30c558b2 | |
Konstantina Galouni | 2715db7365 | |
Diamantis Tziotzios | eb1abb1f24 | |
Diamantis Tziotzios | 92f56c073c | |
Diamantis Tziotzios | 6585fcf391 | |
Bernaldo Mihasi | 5d7e2cb307 | |
Konstantinos Triantafyllou | 681f73b865 | |
Konstantinos Triantafyllou | ef0816524f | |
Konstantinos Triantafyllou | b6709bac3c | |
Bernaldo Mihasi | 7b12d7b46d | |
Bernaldo Mihasi | 5733796674 | |
Diamantis Tziotzios | 89922eaecc | |
Bernaldo Mihasi | 11a9abae42 | |
Bernaldo Mihasi | 8293535bb0 | |
Bernaldo Mihasi | f822e06881 | |
Konstantina Galouni | c9b4b35e39 | |
Konstantinos Triantafyllou | fbaa175436 | |
Bernaldo Mihasi | 63c866d74f | |
Bernaldo Mihasi | b6b7a2444c | |
Bernaldo Mihasi | 18a200f099 | |
Bernaldo Mihasi | 18ccb3ca0c | |
Bernaldo Mihasi | a90f21b6aa | |
Bernaldo Mihasi | 376bb2ca53 | |
Bernaldo Mihasi | 969df0357a | |
Bernaldo Mihasi | c35bc2efed | |
Konstantinos Triantafyllou | 8c708f470d | |
Konstantinos Triantafyllou | 6ca77c2df2 | |
Konstantina Galouni | 13e62fd409 | |
Bernaldo Mihasi | 519cb260c6 | |
Diamantis Tziotzios | 34176bcb70 | |
Bernaldo Mihasi | 759c80420f | |
Bernaldo Mihasi | 87c9730524 | |
Diamantis Tziotzios | 35f9bbcf56 | |
Diamantis Tziotzios | 7af27c73cf | |
Diamantis Tziotzios | 9ebefa8369 | |
Diamantis Tziotzios | 7185b5d117 | |
Konstantina Galouni | 28c1c9b71d | |
Konstantinos Triantafyllou | 180e02c829 | |
Konstantinos Triantafyllou | 4c7dee3ece | |
Diamantis Tziotzios | 806ce4f584 | |
Konstantinos Triantafyllou | 3219132e86 | |
Konstantinos Triantafyllou | c2aba649af | |
Bernaldo Mihasi | e2505039df | |
Bernaldo Mihasi | b273ca4ed7 | |
Bernaldo Mihasi | 0c57bba0b4 | |
Bernaldo Mihasi | 9a8fc5e92e | |
Bernaldo Mihasi | e22e348330 | |
Diamantis Tziotzios | 6c5cb97050 | |
Bernaldo Mihasi | ab124e87ea | |
Diamantis Tziotzios | 72daadee7e | |
Diamantis Tziotzios | 554eb96824 | |
Diamantis Tziotzios | 34d63438e0 | |
Konstantinos Triantafyllou | 8b34d55706 | |
Konstantinos Triantafyllou | 6924d82c80 | |
Konstantinos Triantafyllou | 34f8e4f96d | |
Bernaldo Mihasi | 8f74c36205 | |
Konstantina Galouni | 1d45bddeca | |
Konstantina Galouni | a1dbd72bce | |
Konstantinos Triantafyllou | 455e3c8fe0 | |
Konstantinos Triantafyllou | 13d03e4459 | |
Bernaldo Mihasi | 57a400f817 | |
Bernaldo Mihasi | 030f1ccf8e | |
Diamantis Tziotzios | 95c9d599e1 | |
Diamantis Tziotzios | 26bd59de21 | |
Diamantis Tziotzios | 4dccaa93b8 | |
Konstantinos Triantafyllou | 3e5dc85e04 | |
Bernaldo Mihasi | 66b2596036 | |
Konstantinos Triantafyllou | 2f5f34948e | |
Bernaldo Mihasi | 749dbefc38 | |
Bernaldo Mihasi | 976d0221ce | |
Bernaldo Mihasi | 80fba7c655 | |
Bernaldo Mihasi | fbc274282c | |
Diamantis Tziotzios | ec985bf271 | |
Bernaldo Mihasi | d0cde3c4c4 | |
Bernaldo Mihasi | 39d709f41d | |
Bernaldo Mihasi | c6d37806c8 | |
Bernaldo Mihasi | 8c95b16164 | |
Bernaldo Mihasi | ad00695d4e | |
Bernaldo Mihasi | 572be373e5 | |
Konstantina Galouni | 1171a38ad1 | |
George Kalampokis | 5f131b9823 | |
Diamantis Tziotzios | e1a3e9b7bc | |
Bernaldo Mihasi | b7e69d5fdf | |
George Kalampokis | 6caef3e890 | |
Bernaldo Mihasi | 679354f699 | |
Konstantinos Triantafyllou | c9c99be603 | |
Konstantinos Triantafyllou | a2d07c93c8 | |
Diamantis Tziotzios | 75007286fc | |
Diamantis Tziotzios | ccc102a52d | |
Bernaldo Mihasi | ed79d27cdc | |
Konstantinos Triantafyllou | 9fd963a480 | |
Bernaldo Mihasi | da211ca756 | |
Bernaldo Mihasi | 7a0e1c89f2 | |
Diamantis Tziotzios | 93320f7c94 | |
Bernaldo Mihasi | 573aab059b | |
Bernaldo Mihasi | 5e2639848b | |
George Kalampokis | 0888b7cd74 | |
Bernaldo Mihasi | 6c13d3b68f | |
Konstantinos Triantafyllou | 925fc3ce4a | |
Bernaldo Mihasi | b4490cb0f3 | |
Konstantina Galouni | 2bbf89e779 | |
Diamantis Tziotzios | 876d99ce38 | |
Diamantis Tziotzios | 0cd20605f0 | |
Bernaldo Mihasi | 6b2bc3c1e0 | |
Bernaldo Mihasi | 59e26dbb8d | |
Konstantina Galouni | 37724380e9 | |
Bernaldo Mihasi | 7d624a2daa | |
Bernaldo Mihasi | ab66a5f1da | |
Bernaldo Mihasi | 18dcabbac2 | |
Bernaldo Mihasi | 7dd2030eb3 | |
Diamantis Tziotzios | 49ce0efb40 | |
Konstantinos Triantafyllou | 9f1c0352ea | |
Konstantinos Triantafyllou | 4a54915a8e | |
Konstantina Galouni | 4dd338d08e | |
Bernaldo Mihasi | 20f618a5d7 | |
Konstantinos Triantafyllou | 3361b6aff6 | |
Konstantina Galouni | dc197a5abc | |
Diamantis Tziotzios | b018dd42db | |
Bernaldo Mihasi | 2b692fa579 | |
Konstantinos Triantafyllou | 6720504b7b | |
Konstantinos Triantafyllou | fd2ec314a0 | |
Bernaldo Mihasi | ef327a0a57 | |
Konstantina Galouni | 4cab6ca160 | |
Bernaldo Mihasi | 5087a37e15 | |
Konstantina Galouni | 6a4d67de0c | |
argirok | 0d5f6de7c7 | |
argirok | 19d8218dea | |
Konstantina Galouni | 49e42e9cba | |
George Kalampokis | 7a71110033 | |
George Kalampokis | fa723c07ae | |
Konstantina Galouni | a2228a5fb6 | |
Konstantina Galouni | 9b4c7aeb6f | |
Konstantinos Triantafyllou | b21693bff1 | |
Konstantinos Triantafyllou | 989f07787c | |
Konstantina Galouni | e329ef763a | |
Konstantinos Triantafyllou | 304a6cfdb3 | |
Konstantina Galouni | 18e98938d5 | |
argirok | b1788c2dc2 | |
Diamantis Tziotzios | 2ecce0acb0 | |
Bernaldo Mihasi | 8b26ff19b6 | |
Bernaldo Mihasi | 9c4d246ef5 | |
Konstantina Galouni | 772a041851 | |
Bernaldo Mihasi | 0ac5902bfd | |
Konstantina Galouni | 941cca8103 | |
Bernaldo Mihasi | 73be5d9a98 | |
Bernaldo Mihasi | 3433f58506 | |
George Kalampokis | 0235406246 | |
George Kalampokis | 7985b13cca | |
George Kalampokis | 54c5017609 | |
George Kalampokis | 5cd79a6368 | |
George Kalampokis | ea8407eece | |
Diamantis Tziotzios | 91566c9710 | |
Konstantina Galouni | 79bc95b099 | |
Konstantina Galouni | d7ee7b8d93 | |
George Kalampokis | e8a87765ee | |
argirok | 03f7afede8 | |
George Kalampokis | 11b0db21ac | |
George Kalampokis | 757b1f70e8 | |
George Kalampokis | 66511d2ed6 | |
George Kalampokis | 0f4b209427 | |
George Kalampokis | 3aff6ac90e | |
Bernaldo Mihasi | ff6d068ddd | |
Diamantis Tziotzios | 14c267c97e | |
George Kalampokis | 912a3cc095 | |
Bernaldo Mihasi | 6c36253f09 | |
Bernaldo Mihasi | 3c3b9ef398 | |
Bernaldo Mihasi | cfd0707f2a | |
George Kalampokis | 78bceeb8ae | |
George Kalampokis | b891907724 | |
George Kalampokis | afa602bf39 | |
Konstantina Galouni | 579bb58afc | |
Bernaldo Mihasi | 8ac8f9588c | |
Konstantina Galouni | a5061759b8 | |
Konstantina Galouni | 943f84384c | |
George Kalampokis | 7c933d9f32 | |
George Kalampokis | e373baee7e | |
George Kalampokis | 2a12f1b5be | |
argirok | b9f8d2e162 | |
George Kalampokis | ae7988aa13 | |
George Kalampokis | a9199ab8f0 | |
George Kalampokis | 5faa44c015 | |
George Kalampokis | 4b879eb339 | |
George Kalampokis | ef6e3b8d7c | |
Bernaldo Mihasi | 7cfedf24a2 | |
Bernaldo Mihasi | db8f10ac1e | |
Diamantis Tziotzios | 07f499707e | |
Konstantinos Triantafyllou | 0bb98a4009 | |
Konstantinos Triantafyllou | a58e926c3d | |
George Kalampokis | afb0be5b18 | |
George Kalampokis | c41c89774b | |
George Kalampokis | 3eb27c04f6 | |
George Kalampokis | 72507dd1b8 | |
argirok | 35ea0b5d6c | |
argirok | f1746e49ff | |
Konstantina Galouni | 5ceea10c49 | |
Konstantina Galouni | 650e0ceb06 | |
Bernaldo Mihasi | 78895a1df1 | |
argirok | 1f71681fa2 | |
argirok | 62b60b93a8 | |
George Kalampokis | 864b4bfec8 | |
Bernaldo Mihasi | 116f9b99ea | |
Konstantina Galouni | 8734d7c1ba | |
Bernaldo Mihasi | 835ccaab89 | |
Bernaldo Mihasi | ba55881830 | |
argirok | d2ac550478 | |
argirok | 0393951abe | |
argirok | de5d8a9553 | |
George Kalampokis | 3101cf0e42 | |
George Kalampokis | 3c00d47407 | |
Bernaldo Mihasi | 65b4e58aad | |
Konstantina Galouni | 7f9e12c731 | |
Konstantina Galouni | 9671a827df | |
Konstantina Galouni | 63e27b1d4a | |
Konstantina Galouni | 5f89c26844 | |
Konstantina Galouni | 9ab9e6abc9 | |
Konstantina Galouni | 2a9d8b8296 | |
Konstantina Galouni | 744160c84a | |
George Kalampokis | dc06ba9201 | |
George Kalampokis | 4e0402df95 | |
George Kalampokis | 563711eae4 | |
George Kalampokis | d3a1e85ba9 | |
George Kalampokis | 56499223cf | |
George Kalampokis | 75fc8a1d13 | |
George Kalampokis | 608c4f3fc0 | |
George Kalampokis | 5ea8b9b964 | |
George Kalampokis | 1e572b3214 | |
Konstantina Galouni | 1dfcad7e88 | |
George Kalampokis | f373c9016e | |
George Kalampokis | ea72f64ed4 | |
Konstantina Galouni | b68ede8cd7 | |
George Kalampokis | c3aff92cd4 | |
George Kalampokis | 5a3f871c58 | |
Diamantis Tziotzios | b04b35d62b | |
George Kalampokis | 9f88bdae69 | |
George Kalampokis | 8d1c73deba | |
George Kalampokis | 93aa2d36e5 | |
George Kalampokis | 69a94fa236 | |
George Kalampokis | 94a225cf9f | |
Bernaldo Mihasi | 494ee47620 | |
George Kalampokis | 3c42ee3531 | |
Bernaldo Mihasi | 0bd08c2fac | |
George Kalampokis | 817ee9b44d | |
George Kalampokis | f6cb4a40d2 | |
George Kalampokis | d1eab0d019 | |
George Kalampokis | 4bdb27fcef | |
George Kalampokis | ad8239ca5e | |
Bernaldo Mihasi | 1a43c28496 | |
George Kalampokis | b6c28be3b3 | |
George Kalampokis | 71b1010ea1 | |
George Kalampokis | d16e130dc6 | |
George Kalampokis | 11ff99fd77 | |
argirok | 3aa1c1ae59 | |
argirok | cc926970ca | |
Konstantinos Triantafyllou | e4e009f5b1 | |
Bernaldo Mihasi | da5ba952e1 | |
Bernaldo Mihasi | bf77a85acb | |
Bernaldo Mihasi | eedcf0dfb0 | |
George Kalampokis | fac6a93c0a | |
George Kalampokis | 4740fbe8e0 | |
Konstantinos Triantafyllou | 6cdf560713 | |
Konstantinos Triantafyllou | 26e10b1299 | |
Bernaldo Mihasi | 80e5e12f29 | |
Bernaldo Mihasi | 815fc05af6 | |
Diamantis Tziotzios | 14550e0536 | |
Diamantis Tziotzios | 2b71cddc39 | |
Diamantis Tziotzios | e9b0bcf102 | |
argirok | 93cb1fd1a7 | |
Diamantis Tziotzios | df609fd359 | |
argirok | 938f98100f | |
Diamantis Tziotzios | 85859ce078 | |
Bernaldo Mihasi | 048189952c | |
Konstantina Galouni | bd5041e4e3 | |
George Kalampokis | eaa0c67177 | |
Diamantis Tziotzios | 1c318ddff5 | |
Bernaldo Mihasi | 1967e96702 | |
Bernaldo Mihasi | 125a97baed | |
Konstantina Galouni | 0478484d5e | |
George Kalampokis | 229555f42c | |
George Kalampokis | 70d37cead1 | |
argirok | 90b49194ac | |
George Kalampokis | 01d32427c3 | |
George Kalampokis | f95a704787 | |
argirok | a3c4b3c143 | |
argirok | 858fa3ee71 | |
George Kalampokis | 8f56b1874b | |
George Kalampokis | ce386ac047 | |
Bernaldo Mihasi | 61de8c4df0 | |
Konstantinos Triantafyllou | 99cecbc4fb | |
Konstantinos Triantafyllou | 6460d4087a | |
George Kalampokis | 64ec74363b | |
George Kalampokis | 5a70ce7602 | |
Bernaldo Mihasi | 641088e289 | |
DESKTOP-4ES9U2E\aldom | dc1f59d8b5 | |
DESKTOP-4ES9U2E\aldom | 9d5d685ad6 | |
George Kalampokis | 91f98a8759 | |
George Kalampokis | db01f2d119 | |
George Kalampokis | 1d68b2a379 | |
Konstantinos Triantafyllou | e1a4a64d81 | |
DESKTOP-4ES9U2E\aldom | 16c124cc3d | |
DESKTOP-4ES9U2E\aldom | e675ad7c9d | |
Konstantinos Triantafyllou | 7962c6a587 | |
Konstantinos Triantafyllou | c8b388b546 | |
Kristian Ntavidi | 4c2e17e987 | |
George Kalampokis | 814a9b2fee | |
George Kalampokis | 209b180158 | |
George Kalampokis | 22d3d131cc | |
George Kalampokis | eb7d0d04fc | |
George Kalampokis | cff9af75c6 | |
George Kalampokis | 316d0903c8 | |
Konstantinos Triantafyllou | feecac994d | |
Konstantinos Triantafyllou | ade9b42d12 | |
George Kalampokis | 42c5dbb3b2 | |
George Kalampokis | 6964aa1d47 | |
George Kalampokis | ba8bae1a88 | |
George Kalampokis | a9e7ef1798 | |
George Kalampokis | 728ea9a24f | |
Konstantinos Triantafyllou | 4425a0bb5d | |
Konstantinos Triantafyllou | 7b00d14a70 | |
George Kalampokis | 78688420d2 | |
Diamantis Tziotzios | 7a8375b988 | |
George Kalampokis | 17b72cde60 | |
George Kalampokis | 0a39e64f9a | |
George Kalampokis | 33784f3ee2 | |
Diamantis Tziotzios | 2cb985c23c | |
Diamantis Tziotzios | 197de17aa5 | |
George Kalampokis | de4c430d91 | |
George Kalampokis | b2825c8369 | |
Konstantina Galouni | b7d622e330 | |
George Kalampokis | e165259c81 | |
George Kalampokis | 6ce7fec059 | |
George Kalampokis | 19aa2bd411 | |
George Kalampokis | aed23a655b | |
George Kalampokis | 8524bce2e0 | |
George Kalampokis | fc71e95cf3 | |
George Kalampokis | e546362f58 | |
George Kalampokis | e8d71a8f66 | |
George Kalampokis | 53e298f66a | |
George Kalampokis | 9dc4d52f91 | |
Konstantina Galouni | bb0c398120 | |
Konstantina Galouni | 52c7796e8e | |
George Kalampokis | c0599d5fed | |
George Kalampokis | 38cd336bc9 | |
George Kalampokis | 4eb15da95a | |
George Kalampokis | 4da99d6d83 | |
George Kalampokis | cecc59eba6 | |
Konstantina Galouni | 7a7f12b83a | |
George Kalampokis | 7820235258 | |
Diamantis Tziotzios | adeca327a2 | |
Diamantis Tziotzios | 1ec46b6840 | |
George Kalampokis | 54b142000c | |
George Kalampokis | 1a373bc6f8 | |
Konstantina Galouni | 71b8742b0f | |
Konstantina Galouni | de99784b5e | |
George Kalampokis | a7badfd9d5 | |
George Kalampokis | 58ecadd79b | |
George Kalampokis | 8899e1ba65 | |
George Kalampokis | db4d1006c6 | |
Konstantina Galouni | ca5883724a | |
George Kalampokis | 39795f177f | |
Kristian Ntavidi | e46de79ec2 | |
Konstantina Galouni | 7fefdd6aad | |
Konstantina Galouni | 193e7410a8 | |
Konstantina Galouni | 03009edaa3 | |
Konstantina Galouni | 7bdfcb70af | |
George Kalampokis | 6ff9ea2d05 | |
George Kalampokis | 0010ad846a | |
George Kalampokis | 5a66754cbd | |
George Kalampokis | fd26e2a742 | |
George Kalampokis | 900a377d5f | |
George Kalampokis | 93baa4a281 | |
George Kalampokis | 2c29469590 | |
Kristian Ntavidi | ae0618d5be | |
George Kalampokis | 8e2fea2ea0 | |
George Kalampokis | e66362ec38 | |
George Kalampokis | 35c4ec821e | |
Konstantinos Triantafyllou | 81a5964a55 | |
Konstantinos Triantafyllou | 7a3f3f2fd5 | |
Konstantina Galouni | eeb5479a98 | |
Diamantis Tziotzios | c3f28936af | |
Diamantis Tziotzios | 887789d9e5 | |
George Kalampokis | e8366aa61a | |
George Kalampokis | 942782fe3c | |
George Kalampokis | d0d918682b | |
George Kalampokis | 65644c3a35 | |
George Kalampokis | 045dd51014 | |
George Kalampokis | 32e299fc45 | |
Konstantina Galouni | f9bf688085 | |
George Kalampokis | a4fef8e462 | |
Konstantina Galouni | 198061aeaa | |
George Kalampokis | 1a821179db | |
George Kalampokis | 6de12fd0e8 | |
George Kalampokis | 29919f981a | |
George Kalampokis | 7fe84d7de5 | |
George Kalampokis | a3af8ce3a5 | |
George Kalampokis | 0e97e6c0a8 | |
George Kalampokis | 1d48ee81b9 | |
George Kalampokis | 9919886c26 | |
George Kalampokis | 77d50773b8 | |
George Kalampokis | 0506f2d3a3 | |
George Kalampokis | 524cededb6 | |
Kristian Ntavidi | 74ec2126f0 | |
George Kalampokis | cb1d7b5340 | |
George Kalampokis | ef5e6a92e0 | |
George Kalampokis | 70538850a2 | |
George Kalampokis | 407961e137 | |
Kristian Ntavidi | 907ad14269 | |
George Kalampokis | 3ec942cfa7 | |
George Kalampokis | 54c862ecbb | |
George Kalampokis | b66bde871a | |
George Kalampokis | 67b10528e3 | |
George Kalampokis | 0886424b29 | |
George Kalampokis | 91729bab6d | |
George Kalampokis | defac6afcc | |
George Kalampokis | fc7c39081a | |
George Kalampokis | 99e4d231c2 | |
George Kalampokis | 06364873ca | |
Kristian Ntavidi | faeb7e0d62 | |
Diamantis Tziotzios | 9cac208546 | |
Kristian Ntavidi | d229189783 | |
Kristian Ntavidi | b40e30ee60 | |
Kristian Ntavidi | ba865c9708 | |
George Kalampokis | 1ae2788453 | |
Kristian Ntavidi | 52c26cd864 | |
George Kalampokis | a805e823e5 | |
George Kalampokis | 0257ff713b | |
George Kalampokis | 6f92409f1e | |
Kristian Ntavidi | 0780c629c9 | |
George Kalampokis | 93ba59ef5a | |
George Kalampokis | bfbc271b56 | |
George Kalampokis | c964af25b5 | |
Diamantis Tziotzios | 6bc5aaed25 | |
George Kalampokis | 5de811a76d | |
George Kalampokis | ce8b49deb0 | |
George Kalampokis | 6ccdeddf65 | |
George Kalampokis | 4e87bd270e | |
Diamantis Tziotzios | e185e94684 | |
George Kalampokis | 6a2099c2b9 | |
George Kalampokis | f01e89799b | |
George Kalampokis | 9da0f4e776 | |
Kristian Ntavidi | a7abe6c2d8 | |
Kristian Ntavidi | 06961c0254 | |
Kristian Ntavidi | 1be8e8e8f9 | |
Kristian Ntavidi | 501a7175e8 | |
Kristian Ntavidi | d8a2ad281c | |
Kristian Ntavidi | 59e3af2fa0 | |
Kristian Ntavidi | 4c22799f91 | |
Kristian Ntavidi | 1d397d28cf | |
Kristian Ntavidi | 008b6321ea | |
Kristian Ntavidi | a212f4e5a1 | |
George Kalampokis | 7ab5c56072 | |
George Kalampokis | 596550d3de | |
Kristian Ntavidi | 1b731fdf20 | |
Kristian Ntavidi | 5ddb7df2b4 | |
George Kalampokis | c91059c854 | |
George Kalampokis | 75d9726bca | |
George Kalampokis | 15af25e292 | |
George Kalampokis | 6fd81a9809 | |
George Kalampokis | 016acaaa0f | |
George Kalampokis | 4b3468d513 | |
George Kalampokis | 1512d0c424 | |
Kristian Ntavidi | ee0c7df170 | |
Kristian Ntavidi | c33ffc153b | |
Kristian Ntavidi | e793f10828 | |
Kristian Ntavidi | cce9df8eb7 | |
Diamantis Tziotzios | ad245dde5d | |
Diamantis Tziotzios | b8b78f6653 | |
Diamantis Tziotzios | 895dbcf098 | |
Diamantis Tziotzios | bd15b1e2c7 | |
Kristian Ntavidi | 6e21ad127d | |
George Kalampokis | d603fed61f | |
George Kalampokis | 1c22ed2321 | |
George Kalampokis | faabd343a9 | |
George Kalampokis | e5a929f259 | |
George Kalampokis | d5cd90814a | |
George Kalampokis | efe177f0b1 | |
George Kalampokis | d1fc10854c | |
George Kalampokis | cfff87b7d0 | |
George Kalampokis | c57e10a033 | |
Kristian Ntavidi | 684d784d1a | |
Kristian Ntavidi | 3e98297da9 | |
George Kalampokis | 2537923dc0 | |
George Kalampokis | 244bfa5c54 | |
George Kalampokis | c1adbe283a | |
George Kalampokis | 1c365a191e | |
George Kalampokis | 4e3b98f1ff | |
George Kalampokis | 295750684f | |
Kristian Ntavidi | 82c5586067 | |
Kristian Ntavidi | 57d1cf89b4 | |
George Kalampokis | 04f230dff1 | |
George Kalampokis | d1e3aae36d | |
George Kalampokis | f9814d3302 | |
George Kalampokis | 72d88d9db4 | |
George Kalampokis | dcd7f24cac | |
George Kalampokis | 143a4c0214 | |
George Kalampokis | 03b7699973 | |
George Kalampokis | e7e5ed02b3 | |
George Kalampokis | d1df83f689 | |
George Kalampokis | b5fcc5971e | |
George Kalampokis | 4a4042d621 | |
Diamantis Tziotzios | c16c35225f | |
Kristian Ntavidi | d878562d3d | |
Kristian Ntavidi | e486169ae5 | |
George Kalampokis | a48ac5fa0f | |
Kristian Ntavidi | ef7de5efe3 | |
Kristian Ntavidi | 1a6df44eeb | |
George Kalampokis | 25286603c8 | |
George Kalampokis | 11b4d462cf | |
Kristian Ntavidi | d90ab00833 | |
Kristian Ntavidi | ad0853dc20 | |
Kristian Ntavidi | e2f262b385 | |
Kristian Ntavidi | c9b376f76c | |
Kristian Ntavidi | 9cc765e7f5 | |
Kristian Ntavidi | 72b18b7770 | |
George Kalampokis | 42a22b4a65 | |
George Kalampokis | 885f897adc | |
George Kalampokis | e94944abb1 | |
George Kalampokis | 78186fb96d | |
Kristian Ntavidi | 92b60c7c90 | |
Kristian Ntavidi | 9161dbda56 | |
Kristian Ntavidi | 22ddc1311f | |
Kristian Ntavidi | 19bb843fe6 | |
Kristian Ntavidi | f4591549c2 | |
Diamantis Tziotzios | 6c6cc061fc | |
Diamantis Tziotzios | d3d6c4a6aa | |
George Kalampokis | 1eb9aadaea | |
Kristian Ntavidi | 54b2661ebd | |
George Kalampokis | c193dd2c09 | |
George Kalampokis | e615c403d3 | |
George Kalampokis | dcf88479bd | |
Kristian Ntavidi | add23dab2f | |
Kristian Ntavidi | d9826095bc | |
Kristian Ntavidi | bb80cfd300 | |
Kristian Ntavidi | a3c9df87df | |
Diamantis Tziotzios | ef3c2e4e83 | |
George Kalampokis | be311f238b | |
Diamantis Tziotzios | f5d266554b | |
Diamantis Tziotzios | 5483847754 | |
George Kalampokis | 8a5f9d3536 | |
Diamantis Tziotzios | ca91c14114 | |
Kristian Ntavidi | 29ad55b3f8 | |
George Kalampokis | b76a787972 | |
George Kalampokis | 95f8eb15c9 | |
George Kalampokis | b13f36afe8 | |
George Kalampokis | 6f658db27f | |
Kristian Ntavidi | 9eb1c12afd | |
George Kalampokis | 1d5befaf6a | |
George Kalampokis | 15c3a6fcb5 | |
George Kalampokis | af432cf329 | |
Kristian Ntavidi | c157ecc4e7 | |
Kristian Ntavidi | 9ccae4d2c7 | |
Diamantis Tziotzios | ae2168b2d7 | |
Kristian Ntavidi | b825a80e61 | |
Kristian Ntavidi | b82398d97e | |
George Kalampokis | a155f2cbec | |
George Kalampokis | fe8a0ff109 | |
Kristian Ntavidi | a8f75aafb9 | |
George Kalampokis | 8a7cfab3b8 | |
George Kalampokis | cdae5ae574 | |
Kristian Ntavidi | b486a27e48 | |
George Kalampokis | a28e26e594 | |
George Kalampokis | 8f2e0539d5 | |
George Kalampokis | df5281eeaa | |
Kristian Ntavidi | 57910d8271 | |
Kristian Ntavidi | e9e953aee3 | |
George Kalampokis | 501ca9fcc2 | |
George Kalampokis | 77bcb95ad7 | |
George Kalampokis | e5264780c3 | |
Diamantis Tziotzios | ede8bbf48e | |
Kristian Ntavidi | c6b8ad5639 | |
Kristian Ntavidi | 66d9f41081 | |
George Kalampokis | 961a4df270 | |
Kristian Ntavidi | e801bbf2e2 | |
George Kalampokis | 12a1f7da12 | |
George Kalampokis | 3d9a2b2331 | |
Kristian Ntavidi | 198eb838c5 | |
George Kalampokis | 4a1f260849 | |
George Kalampokis | 48730e7937 | |
Kristian Ntavidi | d038f42021 | |
George Kalampokis | c27ff1d446 | |
George Kalampokis | 27bf69268e | |
George Kalampokis | aca31dc9da | |
Kristian Ntavidi | 23d664a48b | |
Kristian Ntavidi | 167cae9e59 | |
Kristian Ntavidi | 20a92bea9d | |
George Kalampokis | c57820d6b1 | |
Kristian Ntavidi | a75f140893 | |
Kristian Ntavidi | ab9bb3e8cf | |
George Kalampokis | dd88167574 | |
Kristian Ntavidi | 45227cca10 | |
Kristian Ntavidi | 14c7770ae9 | |
George Kalampokis | 4156875bae | |
George Kalampokis | bc3c8b44d2 | |
Kristian Ntavidi | 037e246262 | |
George Kalampokis | 959479757a | |
George Kalampokis | 5ff57a6352 | |
George Kalampokis | af04e34b6f | |
Kristian Ntavidi | 49a15d2ccc | |
Kristian Ntavidi | 560e6100b7 | |
George Kalampokis | c929eb3a2b | |
Kristian Ntavidi | 6e70071a16 | |
Kristian Ntavidi | 450dbb519f | |
George Kalampokis | 5b930a6870 | |
Kristian Ntavidi | 9cab64b65e | |
Kristian Ntavidi | dc39cf9fdd | |
Kristian Ntavidi | ee1c09149e | |
Kristian Ntavidi | b04e2b3482 | |
Kristian Ntavidi | 2df5c6820a | |
Kristian Ntavidi | a3572f92ed | |
Kristian Ntavidi | cc8c771ae5 | |
Kristian Ntavidi | 7ebf61a28c | |
Kristian Ntavidi | 67223bc2f0 | |
Kristian Ntavidi | a50040cbef | |
Kristian Ntavidi | d667d574af | |
Kristian Ntavidi | b00e7bbcc0 | |
Kristian Ntavidi | c849ea13fe | |
Kristian Ntavidi | 94ecf92a09 | |
Kristian Ntavidi | 7dac466f71 | |
Kristian Ntavidi | 12f9e9ede9 | |
Kristian Ntavidi | fdf316a040 | |
Kristian Ntavidi | 7ff2516ddc | |
Kristian Ntavidi | 8ba546fef4 | |
Kristian Ntavidi | 8cd467cda8 | |
Kristian Ntavidi | b6236b7e0d | |
Kristian Ntavidi | 5e77f78a1c | |
Kristian Ntavidi | 41a1aeaf1f | |
Kristian Ntavidi | 427c04f631 | |
Kristian Ntavidi | c8ce77ff81 | |
Kristian Ntavidi | abaf61cf02 | |
Kristian Ntavidi | 97db10be12 | |
Kristian Ntavidi | 6f52f77459 | |
Kristian Ntavidi | 868de6bf78 | |
Kristian Ntavidi | 19ae882af9 | |
Kristian Ntavidi | 1389b3dbf5 | |
Kristian Ntavidi | 72d40b0f33 | |
Kristian Ntavidi | 9bdc426af1 | |
Kristian Ntavidi | f6f5fd15ae | |
Kristian Ntavidi | ae378899e2 | |
Kristian Ntavidi | 720fa60f9b | |
Kristian Ntavidi | 4d6e4fb2cd | |
Kristian Ntavidi | 615d30b977 | |
Kristian Ntavidi | 1528b91736 | |
Kristian Ntavidi | 2924db4409 | |
Kristian Ntavidi | 51228df7d5 | |
Kristian Ntavidi | 938e3b9554 | |
Kristian Ntavidi | efc882016b | |
Kristian Ntavidi | 87b79c2049 | |
Diamantis Tziotzios | ca0babc6af | |
Kristian Ntavidi | a4efbb7698 | |
Kristian Ntavidi | 70a99f0d23 | |
George Kalampokis | 535c250bae | |
Kristian Ntavidi | 081995e243 | |
Kristian Ntavidi | da7f91df96 | |
Kristian Ntavidi | ddd12cbba8 | |
Kristian Ntavidi | a4db1973d3 | |
George Kalampokis | e88f88d97c | |
Diamantis Tziotzios | 389aa3031c | |
Diamantis Tziotzios | 354695f6da | |
Diamantis Tziotzios | 3d9c154416 | |
Kristian Ntavidi | 3dde61a379 | |
Kristian Ntavidi | 96ebf7c0d0 | |
Kristian Ntavidi | a8074f6239 | |
Kristian Ntavidi | dd2db4ce1f | |
Kristian Ntavidi | 8579071cf7 | |
Kristian Ntavidi | 7445ec5042 | |
Kristian Ntavidi | 35eb42e631 | |
Diamantis Tziotzios | 8a9277f0e6 | |
Diamantis Tziotzios | 930ef59936 | |
Diamantis Tziotzios | 6470a8e6a6 | |
Kristian Ntavidi | 1614945185 | |
Diamantis Tziotzios | 8e93a02019 | |
Kristian Ntavidi | a8bc5d0622 | |
Diamantis Tziotzios | 3ce5302bac | |
Diamantis Tziotzios | 148bba67ce | |
Diamantis Tziotzios | 3a27f66dc5 | |
George Kalampokis | c56b7c59ed | |
George Kalampokis | 0367aa0431 | |
George Kalampokis | cf47898007 | |
George Kalampokis | 8bc3783847 | |
Diamantis Tziotzios | f30392864c | |
apapachristou | 99f780fa4c | |
apapachristou | 2ed101888d | |
apapachristou | d8b7161c73 | |
apapachristou | 558b506643 | |
Diamantis Tziotzios | af5ab43c2e | |
George Kalampokis | 4bbcb3d24e | |
George Kalampokis | 3477cf25fd | |
Diamantis Tziotzios | eb153e84bc | |
apapachristou | 7257be8629 | |
apapachristou | 0c60af543a | |
Diamantis Tziotzios | ef0a40b739 | |
apapachristou | 3e4a61153f | |
apapachristou | f94d4bad2b | |
apapachristou | fc689342cb | |
Diamantis Tziotzios | 6ea5dfff42 | |
George Kalampokis | ca38f0b0a4 | |
George Kalampokis | 3b00b76f19 | |
George Kalampokis | b5a9aa9ad3 | |
apapachristou | c62cc1068a | |
George Kalampokis | c18e3f8e3c | |
George Kalampokis | d4672f1e60 | |
George Kalampokis | d6970cc49a | |
apapachristou | f87f8e31af | |
apapachristou | 142c9ab5ea | |
apapachristou | 2f61e47139 | |
apapachristou | 06f156c687 | |
apapachristou | f5d5835edb | |
apapachristou | b3d820c892 | |
apapachristou | 208824f55b | |
apapachristou | c796745c73 | |
apapachristou | 4c94b48b2b | |
George Kalampokis | fcd24fd907 | |
apapachristou | 0542c17aae | |
George Kalampokis | fc72c014a5 | |
George Kalampokis | 66358acfcf | |
apapachristou | 5c8c1a13b2 | |
apapachristou | e3cfd47edb | |
apapachristou | 4552525e1c | |
apapachristou | 0159baf8ed | |
apapachristou | 52317c10f9 | |
George Kalampokis | 25d408c113 | |
apapachristou | 644d616ef8 | |
George Kalampokis | 54e0ac6ad4 | |
apapachristou | af849b6c36 | |
apapachristou | 8e074c4ca0 | |
apapachristou | 36ac02e9f9 | |
George Kalampokis | 1e0b828a48 | |
George Kalampokis | a3d662aed1 | |
George Kalampokis | 510142763e | |
George Kalampokis | cbbfec2ccc | |
apapachristou | b2ea14787c | |
apapachristou | 77b9a84105 | |
Diamantis Tziotzios | 4a82e86769 | |
apapachristou | 50fc4612b7 | |
George Kalampokis | 0ad797d033 | |
George Kalampokis | d20b8b459a | |
George Kalampokis | ffc140f84b | |
apapachristou | 188fcd539f | |
George Kalampokis | 7973e04090 | |
George Kalampokis | fbff31d287 | |
George Kalampokis | d40265544d | |
George Kalampokis | f5533e1b95 | |
George Kalampokis | 5d01519415 | |
apapachristou | 6fb7c81cd5 | |
apapachristou | bfdbce54c2 | |
apapachristou | 8d8dce8973 | |
George Kalampokis | 8161d382ad | |
George Kalampokis | cda31be0bd | |
George Kalampokis | eae7f22f72 | |
George Kalampokis | 2ff9b95fdf | |
apapachristou | 523a551e0a | |
apapachristou | 3a8d426d22 | |
apapachristou | 0bd5afffe1 | |
apapachristou | 2313cd1ca5 | |
apapachristou | aa35725823 | |
apapachristou | f8753de83a | |
George Kalampokis | e061448830 | |
George Kalampokis | da9872576e | |
Diamantis Tziotzios | 078d472859 | |
George Kalampokis | 2ed23c4676 | |
George Kalampokis | 07e8c51b79 | |
George Kalampokis | 70056bd0a9 | |
George Kalampokis | 47d5d8cb9e | |
George Kalampokis | 2d3dfbf919 | |
apapachristou | 0e906cb4b9 | |
apapachristou | b13dab598f | |
apapachristou | abfb6342b2 | |
apapachristou | d0d98bc520 | |
apapachristou | 0e2d288478 | |
apapachristou | 02d79165c4 | |
George Kalampokis | c391cd5521 | |
George Kalampokis | 86994c73ce | |
apapachristou | 0c9396bc11 | |
apapachristou | d043322014 | |
apapachristou | 45979922d5 | |
apapachristou | d27f8301c6 | |
George Kalampokis | df8af6e6cd | |
George Kalampokis | ba5c295187 | |
George Kalampokis | 2354d9bb5c | |
apapachristou | 992999a596 | |
apapachristou | e661eb3d0b | |
apapachristou | 638d5ca98c | |
apapachristou | ce6c0f3b20 | |
George Kalampokis | 8677cc85b9 | |
George Kalampokis | 03da1f3f7b | |
apapachristou | 19b751984b | |
apapachristou | f1cdacbe33 | |
George Kalampokis | d77fefc7c5 | |
George Kalampokis | c1d473f8d4 | |
apapachristou | a926d933e3 | |
apapachristou | 2f28e0c8ac | |
apapachristou | d889a527e3 | |
George Kalampokis | 35fe6a75fe | |
George Kalampokis | 4c60b2bb06 | |
George Kalampokis | ff169ae806 | |
apapachristou | 7792bed7f6 | |
George Kalampokis | eeca52d3ff | |
George Kalampokis | 22cc8bb3a3 | |
George Kalampokis | 981eb48d89 | |
George Kalampokis | baf4314a33 | |
apapachristou | 5534f4f4a9 | |
George Kalampokis | 2b89f646ee | |
apapachristou | 7f654cc472 | |
George Kalampokis | c8a163f4aa | |
George Kalampokis | df3a5e81a5 | |
George Kalampokis | 8c2ae8cf46 | |
apapachristou | cd618563bf | |
apapachristou | 5b78943131 | |
apapachristou | 708206c28a | |
apapachristou | d512ad1389 | |
apapachristou | f0b9b01695 | |
George Kalampokis | 96ffbe6670 | |
apapachristou | 29c6774558 | |
George Kalampokis | 9674ec2b6b | |
George Kalampokis | e1212383ff | |
apapachristou | d4ca651411 | |
apapachristou | 8946ea2fb7 | |
George Kalampokis | 56d6b12555 | |
apapachristou | 8dd728a85d | |
apapachristou | 2c5feb5fa9 | |
apapachristou | 1d0a375453 | |
apapachristou | 32caed9f6f | |
apapachristou | b8f3c5af70 | |
apapachristou | 9c2f1b12bd | |
apapachristou | a631594f5f | |
apapachristou | e179d90f12 | |
George Kalampokis | f08d8e2e01 | |
George Kalampokis | b878bf9d8f | |
George Kalampokis | a78044920a | |
apapachristou | f71f9b07e0 | |
apapachristou | 4c3775232a | |
apapachristou | 02c36c1f61 | |
apapachristou | 71a270137a | |
apapachristou | 103f89c0b6 | |
apapachristou | f575c9550b | |
Diamantis Tziotzios | 2316dd9b40 | |
apapachristou | 20c607d88a | |
George Kalampokis | 202ba64d21 | |
George Kalampokis | 78903bf930 | |
apapachristou | 129d5c6dda | |
apapachristou | 4479a0df80 | |
apapachristou | 7439281c50 | |
George Kalampokis | f4f3099b50 | |
George Kalampokis | 7a3b4a18ca | |
apapachristou | 7cc584ac33 | |
apapachristou | d856255405 | |
apapachristou | 166f0f7c37 | |
Diamantis Tziotzios | db31597fc0 | |
Diamantis Tziotzios | e65bce0f5a | |
George Kalampokis | f2613c4c87 | |
George Kalampokis | ac00b01943 | |
George Kalampokis | 8ffdfdba1f | |
George Kalampokis | 58e22926b1 | |
George Kalampokis | 7f56afad5f | |
Diamantis Tziotzios | 9f5054668e | |
George Kalampokis | 38986ef67b | |
Diamantis Tziotzios | bff260b85b | |
George Kalampokis | 9519300dc4 | |
George Kalampokis | 9373d3e038 | |
dtziotzios | d971f02a94 | |
Georgios Kakaletris | d3915e26e7 | |
George Kalampokis | c028aad615 | |
Diamantis Tziotzios | 4ee39074a3 | |
Diamantis Tziotzios | 1b4952a909 | |
Diamantis Tziotzios | 3ada5a0d3d | |
Diamantis Tziotzios | 63ee865dd9 | |
Diamantis Tziotzios | 2a52138124 | |
Diamantis Tziotzios | 7cf64c18f2 | |
Diamantis Tziotzios | 71d317bab7 | |
Ioannis Kalyvas | cd8b3448f5 | |
Ioannis Kalyvas | c3d4cb6fdd | |
Ioannis Kalyvas | b0ccac191f | |
Ioannis Kalyvas | 3b1f37ef22 | |
Ioannis Kalyvas | b8e040ee94 | |
Ioannis Kalyvas | 50444a0b73 | |
Diamantis Tziotzios | 85bdb7fad1 | |
annabakouli | b2e49fbb8a | |
Diamantis Tziotzios | bfc6b63067 | |
Nikolaos Laskaris | 9941c96dc2 | |
Nikolaos Laskaris | 06272c79da | |
Nikolaos Laskaris | a00eec68d8 |
11
.env
11
.env
|
@ -1,6 +1,5 @@
|
||||||
TAG=6.3.0
|
PROFILE=docker
|
||||||
ENV=prod
|
|
||||||
PROFILE=production
|
# Version of Elastic products
|
||||||
AOT=aot
|
ELK_VERSION=7.17.4
|
||||||
ELASTIC_VERSION=6.3.0
|
STACK_VERSION=7.17.4
|
||||||
ELASTIC_PASSWORD=changeme
|
|
||||||
|
|
|
@ -40,3 +40,12 @@ dmp-frontend/.vscode/
|
||||||
dmp-frontend/package-lock.json
|
dmp-frontend/package-lock.json
|
||||||
dmp-backend/logging/target/
|
dmp-backend/logging/target/
|
||||||
ELK.Docker/shared/data-elk/
|
ELK.Docker/shared/data-elk/
|
||||||
|
|
||||||
|
# Eclipse
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
bin/
|
||||||
|
*.classpath
|
||||||
|
openDMP/dmp-backend/uploads/
|
||||||
|
openDMP/dmp-backend/tmp/
|
||||||
|
dmp-frontend/.angular/
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
|
||||||
|
**Important note: The deployment, troubleshooting, maintenance and operation of on-premises / self-served OpenDMP instances for development, testing or production use, shall be the sole responsibility of the adopter. No support is guaranteed by OpenDMP implentation team for issues that may be encountered during deployment, extension or operation of such installations.**
|
||||||
|
|
||||||
|
**Documentation is provided on a best-effort basis for the code and processes around the development, deployment and operation of OpenDMP. If you find any misalignment of the actual processes with the related documentation, please let us know so that the misalignment is addressed for the benefit of future adopters.**
|
||||||
|
|
||||||
|
|
||||||
|
# Using Docker Compose with Argos
|
||||||
|
|
||||||
|
ARGOS is an open extensible service that simplifies the management, validation, monitoring and maintenance and of Data Management Plans. It allows actors (researchers, managers, supervisors etc) to create actionable DMPs that may be freely exchanged among infrastructures for carrying out specific aspects of the Data management process in accordance with the intentions and commitment of Data owners.
|
||||||
|
|
||||||
|
## Before running the docker compose commands, configurations must be set
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
First of all, database must be configured
|
||||||
|
|
||||||
|
The only file that has to be changed is **/dmp-db-scema/Docker/dmp-db.env**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ADMIN_USER: Admin username (app)
|
||||||
|
ADMIN_PASSWORD: Admin password (app)
|
||||||
|
|
||||||
|
POSTGRES_DB: database name
|
||||||
|
POSTGRES_USER: Admin username (database)
|
||||||
|
POSTGRES_PASSWORD: Admin password (database)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Backend
|
||||||
|
|
||||||
|
Secondly, a few more options should be asigned
|
||||||
|
|
||||||
|
The file **/dmp-backend/web/src/main/resources/config/application-docker.properties** contains all the necessary properties
|
||||||
|
|
||||||
|
Values to be modified:
|
||||||
|
```bash
|
||||||
|
database.url: the url that is used to connect to database (JDBC based)
|
||||||
|
database.username: database admin username
|
||||||
|
database.password: database admin password
|
||||||
|
|
||||||
|
elasticsearch.*(optional): setup elastic, check Elasticsearch(optional) section below
|
||||||
|
|
||||||
|
google.login.clientId(optional): google as login provider
|
||||||
|
```
|
||||||
|
**NOTE:** if you want to configure and integrate other providers, check this reference [Setup configurable login](https://code-repo.d4science.org/MaDgiK-CITE/argos/wiki/Page-2A:-Setup-configurable-login)
|
||||||
|
|
||||||
|
If you provide google.login.clientId, then the same value should be set in the field named **loginProviders.googleConfiguration.clientId** which belongs to **/dmp-frontend/src/assets/config/config.json**
|
||||||
|
|
||||||
|
## You are ready to build and run the entire application using Docker-compose
|
||||||
|
|
||||||
|
1. Go to the project's root directory
|
||||||
|
2. Type in the **Terminal** `docker volume create --name=dmpdata`
|
||||||
|
3. Type in the **Terminal** `docker-compose up -d --build`
|
||||||
|
4. After it's complete your application is running on [http://localhost:8080](http://localhost:8080)
|
||||||
|
|
||||||
|
### Elasticsearch(optional)
|
||||||
|
If you want to set up elasticsearch, you will need the password for the **elastic** user
|
||||||
|
|
||||||
|
After your application is running, type in the **Terminal** `docker exec -it elasticsearch /bin/sh`
|
||||||
|
|
||||||
|
Run the command `cat data/passwords.txt` in the shell and save its output
|
||||||
|
|
||||||
|
Finally, run `exit` to get back to your terminal
|
||||||
|
|
||||||
|
The elastic's password that you get has to be set in the **elasticsearch.password** property in the backend configuration
|
||||||
|
|
||||||
|
Rerun the application
|
||||||
|
|
||||||
|
1. Type in the **Terminal** `docker-compose down`
|
||||||
|
2. Type in the **Terminal** `docker-compose up -d --build`
|
|
@ -1 +1 @@
|
||||||
PROFILE=staging
|
PROFILE=docker
|
|
@ -1,22 +1,22 @@
|
||||||
FROM maven:3-jdk-8-alpine AS MAVEN_BUILD
|
FROM maven:3-jdk-11 AS MAVEN_BUILD
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
COPY pom.xml /build/
|
COPY pom.xml /build/
|
||||||
COPY data /build/data/
|
COPY data /build/data/
|
||||||
COPY elastic /build/elastic/
|
COPY elastic /build/elastic/
|
||||||
COPY logging /build/logging/
|
#COPY logging /build/logging/
|
||||||
COPY queryable /build/queryable/
|
COPY queryable /build/queryable/
|
||||||
COPY web /build/web/
|
COPY web /build/web/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
RUN mvn package
|
RUN mvn package -q
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM openjdk:8-jre-alpine
|
FROM amazoncorretto:11
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app.jar
|
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app.jar
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM maven:3-jdk-8-alpine AS MAVEN_BUILD
|
FROM maven:3-openjdk-11 AS MAVEN_BUILD
|
||||||
|
|
||||||
COPY pom.xml /build/
|
COPY pom.xml /build/
|
||||||
COPY data /build/data/
|
COPY data /build/data/
|
||||||
|
@ -9,7 +9,7 @@ COPY web /build/web/
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
RUN mvn package
|
RUN mvn package
|
||||||
|
|
||||||
FROM openjdk:8-jre-alpine
|
FROM adoptopenjdk/openjdk11:alpine-jre
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app/app.jar
|
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}","-jar","/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"]
|
||||||
|
|
|
@ -25,5 +25,10 @@
|
||||||
<artifactId>elastic</artifactId>
|
<artifactId>elastic</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
<version>1.5.20</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -1,9 +1,9 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
|
||||||
|
|
||||||
public abstract class Criteria<T> {
|
public abstract class Criteria<T> {
|
||||||
|
@ApiModelProperty(value = "like", name = "like", dataType = "String", allowEmptyValue = true, example = "\"\"")
|
||||||
private String like;
|
private String like;
|
||||||
|
|
||||||
public String getLike() {
|
public String getLike() {
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.data.entities.DMPProfile;
|
||||||
|
|
||||||
|
public class DataManagementPlanBlueprintCriteria extends Criteria<DMPProfile> {
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
import eu.eudat.data.entities.DMP;
|
import eu.eudat.data.entities.DMP;
|
||||||
|
import eu.eudat.data.entities.DMPProfile;
|
||||||
import eu.eudat.data.entities.Grant;
|
import eu.eudat.data.entities.Grant;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -10,6 +11,7 @@ import java.util.UUID;
|
||||||
public class DataManagementPlanCriteria extends Criteria<DMP> {
|
public class DataManagementPlanCriteria extends Criteria<DMP> {
|
||||||
private Date periodStart;
|
private Date periodStart;
|
||||||
private Date periodEnd;
|
private Date periodEnd;
|
||||||
|
private DMPProfile profile;
|
||||||
private List<eu.eudat.data.entities.Grant> grants;
|
private List<eu.eudat.data.entities.Grant> grants;
|
||||||
private boolean allVersions;
|
private boolean allVersions;
|
||||||
private List<UUID> groupIds;
|
private List<UUID> groupIds;
|
||||||
|
@ -21,6 +23,7 @@ public class DataManagementPlanCriteria extends Criteria<DMP> {
|
||||||
private boolean isPublic;
|
private boolean isPublic;
|
||||||
private boolean onlyPublic;
|
private boolean onlyPublic;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
|
private boolean hasDoi;
|
||||||
|
|
||||||
public Date getPeriodStart() {
|
public Date getPeriodStart() {
|
||||||
return periodStart;
|
return periodStart;
|
||||||
|
@ -36,6 +39,13 @@ public class DataManagementPlanCriteria extends Criteria<DMP> {
|
||||||
this.periodEnd = periodEnd;
|
this.periodEnd = periodEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DMPProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
public void setProfile(DMPProfile profile) {
|
||||||
|
this.profile = profile;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Grant> getGrants() {
|
public List<Grant> getGrants() {
|
||||||
return grants;
|
return grants;
|
||||||
}
|
}
|
||||||
|
@ -114,4 +124,12 @@ public class DataManagementPlanCriteria extends Criteria<DMP> {
|
||||||
public void setGrantStatus(Short grantStatus) {
|
public void setGrantStatus(Short grantStatus) {
|
||||||
this.grantStatus = grantStatus;
|
this.grantStatus = grantStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasDoi() {
|
||||||
|
return hasDoi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasDoi(boolean hasDoi) {
|
||||||
|
this.hasDoi = hasDoi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class DatasetCriteria extends Criteria<Dataset> {
|
||||||
private List<UUID> groupIds;
|
private List<UUID> groupIds;
|
||||||
private Boolean isPublic;
|
private Boolean isPublic;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
|
private boolean hasDoi;
|
||||||
|
|
||||||
public boolean getAllVersions() {
|
public boolean getAllVersions() {
|
||||||
return allVersions;
|
return allVersions;
|
||||||
|
@ -132,4 +133,12 @@ public class DatasetCriteria extends Criteria<Dataset> {
|
||||||
public void setGrantStatus(Short grantStatus) {
|
public void setGrantStatus(Short grantStatus) {
|
||||||
this.grantStatus = grantStatus;
|
this.grantStatus = grantStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasDoi() {
|
||||||
|
return hasDoi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasDoi(boolean hasDoi) {
|
||||||
|
this.hasDoi = hasDoi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
|
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
public class DatasetProfileCriteria extends Criteria<DescriptionTemplate> {
|
||||||
|
|
||||||
public enum DatasetProfileFilter {
|
public enum DatasetProfileFilter {
|
||||||
DMPs((short) 0), Datasets((short) 1);
|
DMPs((short) 0), Datasets((short) 1);
|
||||||
|
@ -23,7 +25,7 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
||||||
case 1:
|
case 1:
|
||||||
return Datasets;
|
return Datasets;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unsupported DatasetProfile filter");
|
throw new RuntimeException("Unsupported DescriptionTemplate filter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +36,9 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
private boolean finalized;
|
private boolean finalized;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
private Integer role;
|
||||||
|
private List<UUID> ids;
|
||||||
|
private Date periodStart;
|
||||||
|
|
||||||
public boolean getAllVersions() { return allVersions; }
|
public boolean getAllVersions() { return allVersions; }
|
||||||
public void setAllVersions(boolean allVersions) { this.allVersions = allVersions; }
|
public void setAllVersions(boolean allVersions) { this.allVersions = allVersions; }
|
||||||
|
@ -69,4 +74,28 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
||||||
public void setStatus(Integer status) {
|
public void setStatus(Integer status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UUID> getIds() {
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIds(List<UUID> ids) {
|
||||||
|
this.ids = ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPeriodStart() {
|
||||||
|
return periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodStart(Date periodStart) {
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public class DatasetProfileWizardCriteria extends Criteria<DatasetProfile> {
|
public class DatasetProfileWizardCriteria extends Criteria<DescriptionTemplate> {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
|
import eu.eudat.data.entities.EmailConfirmation;
|
||||||
|
|
||||||
|
public class EmailConfirmationCriteria extends Criteria<EmailConfirmation>{
|
||||||
|
}
|
|
@ -2,8 +2,12 @@ package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
import eu.eudat.data.entities.Funder;
|
import eu.eudat.data.entities.Funder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class FunderCriteria extends Criteria<Funder> {
|
public class FunderCriteria extends Criteria<Funder> {
|
||||||
private String reference;
|
private String reference;
|
||||||
|
private String exactReference;
|
||||||
|
private Date periodStart;
|
||||||
|
|
||||||
public String getReference() {
|
public String getReference() {
|
||||||
return reference;
|
return reference;
|
||||||
|
@ -11,4 +15,20 @@ public class FunderCriteria extends Criteria<Funder> {
|
||||||
public void setReference(String reference) {
|
public void setReference(String reference) {
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getExactReference() {
|
||||||
|
return exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExactReference(String exactReference) {
|
||||||
|
this.exactReference = exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPeriodStart() {
|
||||||
|
return periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodStart(Date periodStart) {
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ public class GrantCriteria extends Criteria<Grant> {
|
||||||
private boolean isPublic;
|
private boolean isPublic;
|
||||||
private String funderId;
|
private String funderId;
|
||||||
private String funderReference;
|
private String funderReference;
|
||||||
|
private String exactReference;
|
||||||
|
private boolean isActive;
|
||||||
|
|
||||||
public Date getPeriodStart() {
|
public Date getPeriodStart() {
|
||||||
return periodStart;
|
return periodStart;
|
||||||
|
@ -62,4 +64,20 @@ public class GrantCriteria extends Criteria<Grant> {
|
||||||
public void setFunderReference(String funderReference) {
|
public void setFunderReference(String funderReference) {
|
||||||
this.funderReference = funderReference;
|
this.funderReference = funderReference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getExactReference() {
|
||||||
|
return exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExactReference(String exactReference) {
|
||||||
|
this.exactReference = exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isActive() {
|
||||||
|
return isActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActive(boolean active) {
|
||||||
|
isActive = active;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
|
||||||
|
|
||||||
import eu.eudat.data.entities.LoginConfirmationEmail;
|
|
||||||
|
|
||||||
public class LoginConfirmationEmailCriteria extends Criteria<LoginConfirmationEmail>{
|
|
||||||
}
|
|
|
@ -5,6 +5,7 @@ import eu.eudat.data.entities.Organisation;
|
||||||
public class OrganisationCriteria extends Criteria<Organisation> {
|
public class OrganisationCriteria extends Criteria<Organisation> {
|
||||||
private String labelLike;
|
private String labelLike;
|
||||||
private Boolean isPublic;
|
private Boolean isPublic;
|
||||||
|
private boolean isActive;
|
||||||
|
|
||||||
public String getLabelLike() {
|
public String getLabelLike() {
|
||||||
return labelLike;
|
return labelLike;
|
||||||
|
@ -19,4 +20,12 @@ public class OrganisationCriteria extends Criteria<Organisation> {
|
||||||
public void setPublic(Boolean aPublic) {
|
public void setPublic(Boolean aPublic) {
|
||||||
isPublic = aPublic;
|
isPublic = aPublic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isActive() {
|
||||||
|
return isActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActive(boolean active) {
|
||||||
|
isActive = active;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,12 @@ package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
import eu.eudat.data.entities.Project;
|
import eu.eudat.data.entities.Project;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class ProjectCriteria extends Criteria<Project> {
|
public class ProjectCriteria extends Criteria<Project> {
|
||||||
private String reference;
|
private String reference;
|
||||||
|
private String exactReference;
|
||||||
|
private Date periodStart;
|
||||||
|
|
||||||
public String getReference() {
|
public String getReference() {
|
||||||
return reference;
|
return reference;
|
||||||
|
@ -11,4 +15,20 @@ public class ProjectCriteria extends Criteria<Project> {
|
||||||
public void setReference(String reference) {
|
public void setReference(String reference) {
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getExactReference() {
|
||||||
|
return exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExactReference(String exactReference) {
|
||||||
|
this.exactReference = exactReference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPeriodStart() {
|
||||||
|
return periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodStart(Date periodStart) {
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,12 @@ package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
import eu.eudat.data.entities.Researcher;
|
import eu.eudat.data.entities.Researcher;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class ResearcherCriteria extends Criteria<Researcher> {
|
public class ResearcherCriteria extends Criteria<Researcher> {
|
||||||
private String name;
|
private String name;
|
||||||
|
private String reference;
|
||||||
|
private Date periodStart;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
@ -12,4 +16,20 @@ public class ResearcherCriteria extends Criteria<Researcher> {
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPeriodStart() {
|
||||||
|
return periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodStart(Date periodStart) {
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ public class DatabaseService<T extends DataEntity> {
|
||||||
return this.databaseCtx.getQueryable(tClass);
|
return this.databaseCtx.getQueryable(tClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public T createOrUpdate(T item, Class<T> tClass) {
|
public T createOrUpdate(T item, Class<T> tClass) {
|
||||||
return this.databaseCtx.createOrUpdate(item, tClass);
|
return this.databaseCtx.createOrUpdate(item, tClass);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.persistence.criteria.Join;
|
import javax.persistence.criteria.Join;
|
||||||
import javax.persistence.criteria.JoinType;
|
import javax.persistence.criteria.JoinType;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -41,6 +42,8 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd()));
|
query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd()));
|
||||||
if (criteria.getPeriodStart() != null)
|
if (criteria.getPeriodStart() != null)
|
||||||
query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart()));
|
query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart()));
|
||||||
|
if (criteria.getProfile() != null)
|
||||||
|
query.where((builder, root) -> builder.equal(root.get("profile"), criteria.getProfile()));
|
||||||
if (criteria.getGrants() != null && !criteria.getGrants().isEmpty())
|
if (criteria.getGrants() != null && !criteria.getGrants().isEmpty())
|
||||||
query.where(((builder, root) -> root.get("grant").in(criteria.getGrants())));
|
query.where(((builder, root) -> root.get("grant").in(criteria.getGrants())));
|
||||||
if (!criteria.getAllVersions())
|
if (!criteria.getAllVersions())
|
||||||
|
@ -57,7 +60,9 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue()));
|
query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic())));
|
if (criteria.getIsPublic()) {
|
||||||
|
query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic())));
|
||||||
|
}
|
||||||
/*if (criteria.getRole() != null) {
|
/*if (criteria.getRole() != null) {
|
||||||
if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) {
|
if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) {
|
||||||
query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue()));
|
query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue()));
|
||||||
|
@ -72,7 +77,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
query.where((builder, root) -> root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators()));
|
query.where((builder, root) -> root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators()));
|
||||||
}
|
}
|
||||||
if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty()) {
|
if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty()) {
|
||||||
query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("id").in(criteria.getDatasetTemplates()));
|
query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("datasetprofile").get("id").in(criteria.getDatasetTemplates()));
|
||||||
}
|
}
|
||||||
if (criteria.getGrantStatus() != null) {
|
if (criteria.getGrantStatus() != null) {
|
||||||
if (criteria.getGrantStatus().equals(GrantStateType.FINISHED.getValue().shortValue()))
|
if (criteria.getGrantStatus().equals(GrantStateType.FINISHED.getValue().shortValue()))
|
||||||
|
@ -82,6 +87,10 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
builder.or(builder.greaterThan(root.get("grant").get("enddate"), new Date())
|
builder.or(builder.greaterThan(root.get("grant").get("enddate"), new Date())
|
||||||
, builder.isNull(root.get("grant").get("enddate"))));
|
, builder.isNull(root.get("grant").get("enddate"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (criteria.hasDoi()) {
|
||||||
|
query.where((builder, root) -> builder.not(builder.isNull(root.join("dois").get("id"))));
|
||||||
|
}
|
||||||
query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue()));
|
query.where((builder, root) -> builder.notEqual(root.get("status"), DMP.DMPStatus.DELETED.getValue()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +109,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public DMP createOrUpdate(DMP item) {
|
public DMP createOrUpdate(DMP item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item, DMP.class);
|
return this.getDatabaseService().createOrUpdate(item, DMP.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.eudat.data.dao.entities;
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccessLayer;
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.dao.criteria.DataManagementPlanBlueprintCriteria;
|
||||||
import eu.eudat.data.dao.criteria.DataManagementPlanProfileCriteria;
|
import eu.eudat.data.dao.criteria.DataManagementPlanProfileCriteria;
|
||||||
import eu.eudat.data.entities.DMP;
|
import eu.eudat.data.entities.DMP;
|
||||||
import eu.eudat.data.entities.DMPProfile;
|
import eu.eudat.data.entities.DMPProfile;
|
||||||
|
@ -15,4 +16,6 @@ public interface DMPProfileDao extends DatabaseAccessLayer<DMPProfile, UUID> {
|
||||||
|
|
||||||
QueryableList<DMPProfile> getWithCriteria(DataManagementPlanProfileCriteria criteria);
|
QueryableList<DMPProfile> getWithCriteria(DataManagementPlanProfileCriteria criteria);
|
||||||
|
|
||||||
|
QueryableList<DMPProfile> getWithCriteriaBlueprint(DataManagementPlanBlueprintCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.eudat.data.dao.entities;
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.criteria.DataManagementPlanBlueprintCriteria;
|
||||||
import eu.eudat.data.dao.criteria.DataManagementPlanProfileCriteria;
|
import eu.eudat.data.dao.criteria.DataManagementPlanProfileCriteria;
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.data.entities.DMPProfile;
|
import eu.eudat.data.entities.DMPProfile;
|
||||||
|
@ -65,4 +66,20 @@ public class DMPProfileDaoImpl extends DatabaseAccess<DMPProfile> implements DMP
|
||||||
query.where(((builder, root) -> builder.notEqual(root.get("status"), DMPProfile.Status.DELETED.getValue())));
|
query.where(((builder, root) -> builder.notEqual(root.get("status"), DMPProfile.Status.DELETED.getValue())));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DMPProfile> getWithCriteriaBlueprint(DataManagementPlanBlueprintCriteria criteria){
|
||||||
|
QueryableList<DMPProfile> query = getDatabaseService().getQueryable(DMPProfile.class);
|
||||||
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
|
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"));
|
||||||
|
if (criteria.getStatus() != null) {
|
||||||
|
if (criteria.getStatus() == DMPProfile.Status.FINALIZED.getValue()) {
|
||||||
|
query.where((builder, root) -> builder.equal(root.get("status"), DMPProfile.Status.FINALIZED.getValue()));
|
||||||
|
} else if (criteria.getStatus() == DMPProfile.Status.SAVED.getValue()) {
|
||||||
|
query.where((builder, root) -> builder.equal(root.get("status"), DMPProfile.Status.SAVED.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
query.where(((builder, root) -> builder.notEqual(root.get("status"), DMPProfile.Status.DELETED.getValue())));
|
||||||
|
return query;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ public interface DatasetDao extends DatabaseAccessLayer<Dataset, UUID> {
|
||||||
|
|
||||||
QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria);
|
QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria);
|
||||||
|
|
||||||
|
QueryableList<Dataset> filterFromElastic(DatasetCriteria criteria, List<UUID> ids);
|
||||||
|
|
||||||
QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal, List<Integer> roles);
|
QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal, List<Integer> roles);
|
||||||
|
|
||||||
Dataset isPublicDataset(UUID id);
|
Dataset isPublicDataset(UUID id);
|
||||||
|
|
|
@ -35,9 +35,9 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
|
||||||
if (criteria.getIsPublic() != null && criteria.getIsPublic()) {
|
if (criteria.getIsPublic() != null && criteria.getIsPublic()) {
|
||||||
query.where((builder, root) -> builder.equal(root.get("dmp").get("isPublic"), true));
|
query.where((builder, root) -> builder.equal(root.get("dmp").get("isPublic"), true));
|
||||||
query.where((builder, root) -> builder.equal(root.get("status"), Dataset.Status.FINALISED.getValue()));
|
query.where((builder, root) -> builder.equal(root.get("status"), Dataset.Status.FINALISED.getValue()));
|
||||||
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"),
|
/*query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"),
|
||||||
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")),
|
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")),
|
||||||
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));
|
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));*/
|
||||||
}
|
}
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
query.where((builder, root) -> builder.or(
|
query.where((builder, root) -> builder.or(
|
||||||
|
@ -78,11 +78,25 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
|
||||||
query.where((builder, root) -> root.join("dmp", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators()));
|
query.where((builder, root) -> root.join("dmp", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators()));
|
||||||
if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty())
|
if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty())
|
||||||
query.where((builder, root) -> root.get("profile").get("id").in(criteria.getDatasetTemplates()));
|
query.where((builder, root) -> root.get("profile").get("id").in(criteria.getDatasetTemplates()));
|
||||||
|
|
||||||
|
if (criteria.hasDoi()) {
|
||||||
|
query.where((builder, root) -> builder.not(builder.isNull(root.join("dmp").join("dois").get("id"))));
|
||||||
|
}
|
||||||
query.where((builder, root) -> builder.notEqual(root.get("status"), Dataset.Status.DELETED.getValue()));
|
query.where((builder, root) -> builder.notEqual(root.get("status"), Dataset.Status.DELETED.getValue()));
|
||||||
query.where((builder, root) -> builder.notEqual(root.get("status"), Dataset.Status.CANCELED.getValue()));
|
query.where((builder, root) -> builder.notEqual(root.get("status"), Dataset.Status.CANCELED.getValue()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueryableList<Dataset> filterFromElastic(DatasetCriteria criteria, List<UUID> ids) {
|
||||||
|
QueryableList<Dataset> query = getDatabaseService().getQueryable(Dataset.getHints(), Dataset.class);
|
||||||
|
|
||||||
|
query.where(((builder, root) -> root.get("id").in(ids)));
|
||||||
|
if (!criteria.getAllVersions())
|
||||||
|
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), builder1.notEqual(nestedRoot.get("dmp").get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dataset createOrUpdate(Dataset item) {
|
public Dataset createOrUpdate(Dataset item) {
|
||||||
return getDatabaseService().createOrUpdate(item, Dataset.class);
|
return getDatabaseService().createOrUpdate(item, Dataset.class);
|
||||||
|
@ -117,6 +131,7 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
query.where((builder, root) -> builder.equal(root.join("dmp", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal.getId()));
|
query.where((builder, root) -> builder.equal(root.join("dmp", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal.getId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package eu.eudat.data.dao.entities;
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.data.entities.DatasetExternalDataset;
|
import eu.eudat.data.entities.DatasetExternalDataset;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
|
|
@ -2,15 +2,23 @@ package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccessLayer;
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
|
import eu.eudat.data.entities.DescriptionTemplateType;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface DatasetProfileDao extends DatabaseAccessLayer<DatasetProfile, UUID> {
|
public interface DatasetProfileDao extends DatabaseAccessLayer<DescriptionTemplate, UUID> {
|
||||||
|
|
||||||
QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria);
|
QueryableList<DescriptionTemplate> getWithCriteria(DatasetProfileCriteria criteria);
|
||||||
|
|
||||||
QueryableList<DatasetProfile> getAll();
|
QueryableList<DescriptionTemplate> getAll();
|
||||||
|
|
||||||
|
QueryableList<DescriptionTemplate> getAuthenticated(QueryableList<DescriptionTemplate> query, UUID principal, List<Integer> roles);
|
||||||
|
|
||||||
|
List<DescriptionTemplate> getAllIds();
|
||||||
|
|
||||||
|
Long countWithType(DescriptionTemplateType type);
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,7 +3,8 @@ package eu.eudat.data.dao.entities;
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
|
import eu.eudat.data.entities.DescriptionTemplateType;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.types.FieldSelectionType;
|
import eu.eudat.queryable.types.FieldSelectionType;
|
||||||
import eu.eudat.queryable.types.SelectionField;
|
import eu.eudat.queryable.types.SelectionField;
|
||||||
|
@ -11,22 +12,25 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.Join;
|
||||||
import javax.persistence.criteria.JoinType;
|
import javax.persistence.criteria.JoinType;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@Component("datasetProfileDao")
|
@Component("datasetProfileDao")
|
||||||
public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implements DatasetProfileDao {
|
public class DatasetProfileDaoImpl extends DatabaseAccess<DescriptionTemplate> implements DatasetProfileDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DatasetProfileDaoImpl(DatabaseService<DatasetProfile> databaseService) {
|
public DatasetProfileDaoImpl(DatabaseService<DescriptionTemplate> databaseService) {
|
||||||
super(databaseService);
|
super(databaseService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria) {
|
public QueryableList<DescriptionTemplate> getWithCriteria(DatasetProfileCriteria criteria) {
|
||||||
QueryableList<DatasetProfile> query = getDatabaseService().getQueryable(DatasetProfile.class);
|
QueryableList<DescriptionTemplate> query = getDatabaseService().getQueryable(DescriptionTemplate.class);
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"));
|
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"));
|
||||||
if (!criteria.getAllVersions())
|
if (!criteria.getAllVersions())
|
||||||
|
@ -55,47 +59,76 @@ public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implem
|
||||||
if (criteria.getStatus() != null) {
|
if (criteria.getStatus() != null) {
|
||||||
query.where(((builder, root) -> builder.equal(root.get("status"), criteria.getStatus())));
|
query.where(((builder, root) -> builder.equal(root.get("status"), criteria.getStatus())));
|
||||||
}
|
}
|
||||||
if (criteria.getFinalized()) {
|
if (criteria.getIds() != null) {
|
||||||
query.where(((builder, root) -> builder.equal(root.get("status"), DatasetProfile.Status.FINALIZED.getValue())));
|
query.where(((builder, root) -> root.get("id").in(criteria.getIds())));
|
||||||
} else {
|
|
||||||
query.where(((builder, root) -> builder.notEqual(root.get("status"), DatasetProfile.Status.DELETED.getValue())));
|
|
||||||
}
|
}
|
||||||
|
if (criteria.getFinalized()) {
|
||||||
|
query.where(((builder, root) -> builder.equal(root.get("status"), DescriptionTemplate.Status.FINALIZED.getValue())));
|
||||||
|
} else {
|
||||||
|
query.where(((builder, root) -> builder.notEqual(root.get("status"), DescriptionTemplate.Status.DELETED.getValue())));
|
||||||
|
}
|
||||||
|
if (criteria.getPeriodStart() != null)
|
||||||
|
query.where((builder, root) -> builder.greaterThanOrEqualTo(root.get("created"), criteria.getPeriodStart()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile createOrUpdate(DatasetProfile item) {
|
public DescriptionTemplate createOrUpdate(DescriptionTemplate item) {
|
||||||
return this.getDatabaseService().createOrUpdate(item, DatasetProfile.class);
|
return this.getDatabaseService().createOrUpdate(item, DescriptionTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile find(UUID id) {
|
public DescriptionTemplate find(UUID id) {
|
||||||
return getDatabaseService().getQueryable(DatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
return getDatabaseService().getQueryable(DescriptionTemplate.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> getAll() {
|
public QueryableList<DescriptionTemplate> getAll() {
|
||||||
return getDatabaseService().getQueryable(DatasetProfile.class);
|
return getDatabaseService().getQueryable(DescriptionTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(DatasetProfile item) {
|
public List<DescriptionTemplate> getAllIds(){
|
||||||
|
return getDatabaseService().getQueryable(DescriptionTemplate.class).withFields(Collections.singletonList("id")).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(DescriptionTemplate item) {
|
||||||
this.getDatabaseService().delete(item);
|
this.getDatabaseService().delete(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> asQueryable() {
|
public QueryableList<DescriptionTemplate> asQueryable() {
|
||||||
return this.getDatabaseService().getQueryable(DatasetProfile.class);
|
return this.getDatabaseService().getQueryable(DescriptionTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<DatasetProfile> createOrUpdateAsync(DatasetProfile item) {
|
public CompletableFuture<DescriptionTemplate> createOrUpdateAsync(DescriptionTemplate item) {
|
||||||
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile find(UUID id, String hint) {
|
public DescriptionTemplate find(UUID id, String hint) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DescriptionTemplate> getAuthenticated(QueryableList<DescriptionTemplate> query, UUID principal, List<Integer> roles) {
|
||||||
|
if (roles != null && !roles.isEmpty()) {
|
||||||
|
query.where((builder, root) -> {
|
||||||
|
Join userJoin = root.join("users", JoinType.LEFT);
|
||||||
|
return builder.and(builder.equal(userJoin.join("user", JoinType.LEFT).get("id"), principal), userJoin.get("role").in(roles));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal));
|
||||||
|
}
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countWithType(DescriptionTemplateType type) {
|
||||||
|
return this.getDatabaseService().getQueryable(DescriptionTemplate.class).where((builder, root) -> builder.equal(root.get("type"), type)).count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package eu.eudat.data.dao.entities;
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccessLayer;
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
|
||||||
import eu.eudat.data.entities.DatasetService;
|
import eu.eudat.data.entities.DatasetService;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -2,8 +2,6 @@ package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
import eu.eudat.data.entities.DatasetExternalDataset;
|
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
|
||||||
import eu.eudat.data.entities.DatasetService;
|
import eu.eudat.data.entities.DatasetService;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.entities.DescriptionTemplateType;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface DescriptionTemplateTypeDao extends DatabaseAccessLayer<DescriptionTemplateType, UUID> {
|
||||||
|
DescriptionTemplateType findFromName(String name);
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.DescriptionTemplateType;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Component("descriptionTemplateTypeDao")
|
||||||
|
public class DescriptionTemplateTypeDaoImpl extends DatabaseAccess<DescriptionTemplateType> implements DescriptionTemplateTypeDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public DescriptionTemplateTypeDaoImpl(DatabaseService<DescriptionTemplateType> databaseService) {
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescriptionTemplateType findFromName(String name){
|
||||||
|
try {
|
||||||
|
return this.getDatabaseService().getQueryable(DescriptionTemplateType.class).where((builder, root) -> builder.and(builder.equal(root.get("name"), name), builder.notEqual(root.get("status"), DescriptionTemplateType.Status.DELETED.getValue()))).getSingle();
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public DescriptionTemplateType createOrUpdate(DescriptionTemplateType item) {
|
||||||
|
return this.getDatabaseService().createOrUpdate(item, DescriptionTemplateType.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescriptionTemplateType find(UUID id) {
|
||||||
|
return getDatabaseService().getQueryable(DescriptionTemplateType.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(DescriptionTemplateType item) {
|
||||||
|
this.getDatabaseService().delete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DescriptionTemplateType> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(DescriptionTemplateType.class).where((builder, root) -> builder.notEqual((root.get("status")), DescriptionTemplateType.Status.DELETED.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<DescriptionTemplateType> createOrUpdateAsync(DescriptionTemplateType item) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescriptionTemplateType find(UUID id, String hint) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.entities.DMPDatasetProfile;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface DmpDatasetProfileDao extends DatabaseAccessLayer<DMPDatasetProfile, UUID> {
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.Content;
|
||||||
|
import eu.eudat.data.entities.DMPDatasetProfile;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Service("dmpDatasetProfileDao")
|
||||||
|
public class DmpDatasetProfileDaoImpl extends DatabaseAccess<DMPDatasetProfile> implements DmpDatasetProfileDao {
|
||||||
|
@Autowired
|
||||||
|
public DmpDatasetProfileDaoImpl(DatabaseService<DMPDatasetProfile> databaseService) {
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DMPDatasetProfile createOrUpdate(DMPDatasetProfile item) {
|
||||||
|
return this.getDatabaseService().createOrUpdate(item, DMPDatasetProfile.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Async
|
||||||
|
public CompletableFuture<DMPDatasetProfile> createOrUpdateAsync(DMPDatasetProfile item) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DMPDatasetProfile find(UUID id) {
|
||||||
|
return this.getDatabaseService().getQueryable(DMPDatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DMPDatasetProfile find(UUID id, String hint) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(DMPDatasetProfile item) {
|
||||||
|
this.getDatabaseService().delete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DMPDatasetProfile> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(DMPDatasetProfile.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
package eu.eudat.data.dao.entities;
|
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccessLayer;
|
|
||||||
import eu.eudat.data.entities.DoiFunder;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public interface DoiFunderDao extends DatabaseAccessLayer<DoiFunder, UUID> {
|
|
||||||
|
|
||||||
DoiFunder findFunderByName(String name);
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
package eu.eudat.data.dao.entities;
|
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
|
||||||
import eu.eudat.data.entities.DoiFunder;
|
|
||||||
import eu.eudat.queryable.QueryableList;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
@Component("DoiFunderDao")
|
|
||||||
public class DoiFunderDaoImpl extends DatabaseAccess<DoiFunder> implements DoiFunderDao {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public DoiFunderDaoImpl(DatabaseService<DoiFunder> databaseService) {
|
|
||||||
super(databaseService);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DoiFunder findFunderByName(String name) {
|
|
||||||
return this.asQueryable().toList().stream().filter(doiFunder -> name.contains(doiFunder.getName()) || doiFunder.getName().contains(name)).findFirst().orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DoiFunder createOrUpdate(DoiFunder item) {
|
|
||||||
return this.getDatabaseService().createOrUpdate(item, DoiFunder.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<DoiFunder> createOrUpdateAsync(DoiFunder item) {
|
|
||||||
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DoiFunder find(UUID id) {
|
|
||||||
return this.getDatabaseService().getQueryable(DoiFunder.class).where(((builder, root) -> builder.equal(root.get("id"), id))).getSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DoiFunder find(UUID id, String hint) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delete(DoiFunder item) {
|
|
||||||
this.getDatabaseService().delete(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryableList<DoiFunder> asQueryable() {
|
|
||||||
return this.getDatabaseService().getQueryable(DoiFunder.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.dao.criteria.EmailConfirmationCriteria;
|
||||||
|
import eu.eudat.data.entities.EmailConfirmation;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface EmailConfirmationDao extends DatabaseAccessLayer<EmailConfirmation, UUID> {
|
||||||
|
|
||||||
|
QueryableList<EmailConfirmation> getWithCriteria(EmailConfirmationCriteria criteria);
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.criteria.EmailConfirmationCriteria;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.EmailConfirmation;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Service("LoginConfirmationEmailDao")
|
||||||
|
public class EmailConfirmationDaoImpl extends DatabaseAccess<EmailConfirmation> implements EmailConfirmationDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EmailConfirmationDaoImpl(DatabaseService<EmailConfirmation> databaseService) {
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<EmailConfirmation> getWithCriteria(EmailConfirmationCriteria criteria) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmailConfirmation createOrUpdate(EmailConfirmation item) {
|
||||||
|
return this.getDatabaseService().createOrUpdate(item, EmailConfirmation.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<EmailConfirmation> createOrUpdateAsync(EmailConfirmation item) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmailConfirmation find(UUID id) {
|
||||||
|
return this.getDatabaseService().getQueryable(EmailConfirmation.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmailConfirmation find(UUID id, String hint) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(EmailConfirmation item) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<EmailConfirmation> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(EmailConfirmation.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.entities.EntityDoi;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface EntityDoiDao extends DatabaseAccessLayer<EntityDoi, UUID> {
|
||||||
|
EntityDoi findFromDoi(String doi);
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.EntityDoi;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Component("EntityDoiDao")
|
||||||
|
public class EntityDoiDaoImpl extends DatabaseAccess<EntityDoi> implements EntityDoiDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EntityDoiDaoImpl(DatabaseService<EntityDoi> databaseService){
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDoi createOrUpdate(EntityDoi item) {
|
||||||
|
return this.getDatabaseService().createOrUpdate(item, EntityDoi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<EntityDoi> createOrUpdateAsync(EntityDoi item) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDoi find(UUID id) {
|
||||||
|
return this.getDatabaseService().getQueryable(EntityDoi.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDoi findFromDoi(String doi) {
|
||||||
|
return this.getDatabaseService().getQueryable(EntityDoi.class).where((builder, root) -> builder.equal(root.get("doi"), doi)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDoi find(UUID id, String hint) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(EntityDoi item) {
|
||||||
|
this.getDatabaseService().delete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<EntityDoi> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(EntityDoi.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.entities.FileUpload;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public interface FileUploadDao extends DatabaseAccessLayer<FileUpload, UUID> {
|
||||||
|
List<FileUpload> getFileUploads(UUID entityId);
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.FileUpload;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Component("FileUploadDao")
|
||||||
|
public class FileUploadDaoImpl extends DatabaseAccess<FileUpload> implements FileUploadDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public FileUploadDaoImpl(DatabaseService<FileUpload> databaseService) {
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload createOrUpdate(FileUpload item) {
|
||||||
|
return getDatabaseService().createOrUpdate(item, FileUpload.class);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<FileUpload> createOrUpdateAsync(FileUpload item) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload find(UUID id) {
|
||||||
|
return getDatabaseService().getQueryable(FileUpload.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FileUpload> getFileUploads(UUID entityId) {
|
||||||
|
return this.getDatabaseService().getQueryable(FileUpload.class).where((builder, root) -> builder.equal(root.get("entityId"), entityId)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload find(UUID id, String hint) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(FileUpload item) {
|
||||||
|
this.getDatabaseService().delete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<FileUpload> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(FileUpload.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,6 +29,10 @@ public class FunderDaoImpl extends DatabaseAccess<Funder> implements FunderDao {
|
||||||
builder.or(builder.like(builder.upper(root.get("definition")), "%" + criteria.getLike().toUpperCase() + "%"))));
|
builder.or(builder.like(builder.upper(root.get("definition")), "%" + criteria.getLike().toUpperCase() + "%"))));
|
||||||
if (criteria.getReference() != null)
|
if (criteria.getReference() != null)
|
||||||
query.where((builder, root) -> builder.like(builder.upper(root.get("reference")), "%" + criteria.getReference().toUpperCase() + "%"));
|
query.where((builder, root) -> builder.like(builder.upper(root.get("reference")), "%" + criteria.getReference().toUpperCase() + "%"));
|
||||||
|
if (criteria.getExactReference() != null)
|
||||||
|
query.where((builder, root) -> builder.like(builder.upper(root.get("reference")), criteria.getExactReference().toUpperCase()));
|
||||||
|
if (criteria.getPeriodStart() != null)
|
||||||
|
query.where((builder, root) -> builder.greaterThanOrEqualTo(root.get("created"), criteria.getPeriodStart()));
|
||||||
query.where((builder, root) -> builder.notEqual(root.get("status"), Funder.Status.DELETED.getValue()));
|
query.where((builder, root) -> builder.notEqual(root.get("status"), Funder.Status.DELETED.getValue()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,8 @@ public class GrantDaoImpl extends DatabaseAccess<Grant> implements GrantDao {
|
||||||
query.where((builder, root) -> builder.greaterThan(root.get("startdate"), criteria.getPeriodStart()));
|
query.where((builder, root) -> builder.greaterThan(root.get("startdate"), criteria.getPeriodStart()));
|
||||||
if (criteria.getReference() != null)
|
if (criteria.getReference() != null)
|
||||||
query.where((builder, root) -> builder.like(root.get("reference"), "%" + criteria.getReference() + "%"));
|
query.where((builder, root) -> builder.like(root.get("reference"), "%" + criteria.getReference() + "%"));
|
||||||
|
if (criteria.getExactReference() != null)
|
||||||
|
query.where((builder, root) -> builder.like(root.get("reference"), criteria.getExactReference()));
|
||||||
if (criteria.getGrantStateType() != null) {
|
if (criteria.getGrantStateType() != null) {
|
||||||
if (criteria.getGrantStateType().equals(GrantStateType.FINISHED.getValue()))
|
if (criteria.getGrantStateType().equals(GrantStateType.FINISHED.getValue()))
|
||||||
query.where((builder, root) -> builder.lessThan(root.get("enddate"), new Date()));
|
query.where((builder, root) -> builder.lessThan(root.get("enddate"), new Date()));
|
||||||
|
@ -50,6 +52,10 @@ public class GrantDaoImpl extends DatabaseAccess<Grant> implements GrantDao {
|
||||||
if (criteria.isPublic()) {
|
if (criteria.isPublic()) {
|
||||||
query.where((builder, root) -> builder.equal(root.join("dmps").get("status"), DMP.DMPStatus.FINALISED.getValue())).distinct();
|
query.where((builder, root) -> builder.equal(root.join("dmps").get("status"), DMP.DMPStatus.FINALISED.getValue())).distinct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (criteria.isActive()) {
|
||||||
|
query.where((builder, root) -> builder.notEqual(root.join("dmps").get("status"), DMP.DMPStatus.DELETED.getValue())).distinct();
|
||||||
|
}
|
||||||
if (criteria.getFunderId() != null && !criteria.getFunderId().trim().isEmpty())
|
if (criteria.getFunderId() != null && !criteria.getFunderId().trim().isEmpty())
|
||||||
query.where((builder, root) -> builder.equal(root.get("funder").get("id"), UUID.fromString(criteria.getFunderId())));
|
query.where((builder, root) -> builder.equal(root.get("funder").get("id"), UUID.fromString(criteria.getFunderId())));
|
||||||
if (criteria.getFunderReference() != null && !criteria.getFunderReference().isEmpty())
|
if (criteria.getFunderReference() != null && !criteria.getFunderReference().isEmpty())
|
||||||
|
@ -79,7 +85,7 @@ public class GrantDaoImpl extends DatabaseAccess<Grant> implements GrantDao {
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryableList<Grant> getAuthenticated(QueryableList<Grant> query, UserInfo principal) {
|
public QueryableList<Grant> getAuthenticated(QueryableList<Grant> query, UserInfo principal) {
|
||||||
query.where((builder, root) -> builder.or(builder.equal(root.get("creationUser"), principal), builder.equal(root.join("dmps", JoinType.LEFT).join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id"), principal.getId()))).distinct();
|
query.where((builder, root) -> builder.equal(root.get("creationUser").get("id"), principal.getId())).distinct();
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package eu.eudat.data.dao.entities;
|
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccessLayer;
|
|
||||||
import eu.eudat.data.dao.criteria.LoginConfirmationEmailCriteria;
|
|
||||||
import eu.eudat.data.entities.LoginConfirmationEmail;
|
|
||||||
import eu.eudat.queryable.QueryableList;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public interface LoginConfirmationEmailDao extends DatabaseAccessLayer<LoginConfirmationEmail, UUID> {
|
|
||||||
|
|
||||||
QueryableList<LoginConfirmationEmail> getWithCriteria(LoginConfirmationEmailCriteria criteria);
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
package eu.eudat.data.dao.entities;
|
|
||||||
|
|
||||||
import eu.eudat.data.dao.DatabaseAccess;
|
|
||||||
import eu.eudat.data.dao.criteria.LoginConfirmationEmailCriteria;
|
|
||||||
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
|
||||||
import eu.eudat.data.entities.LoginConfirmationEmail;
|
|
||||||
import eu.eudat.queryable.QueryableList;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
@Service("LoginConfirmationEmailDao")
|
|
||||||
public class LoginConfirmationEmailDaoImpl extends DatabaseAccess<LoginConfirmationEmail> implements LoginConfirmationEmailDao {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public LoginConfirmationEmailDaoImpl(DatabaseService<LoginConfirmationEmail> databaseService) {
|
|
||||||
super(databaseService);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryableList<LoginConfirmationEmail> getWithCriteria(LoginConfirmationEmailCriteria criteria) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LoginConfirmationEmail createOrUpdate(LoginConfirmationEmail item) {
|
|
||||||
return this.getDatabaseService().createOrUpdate(item, LoginConfirmationEmail.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<LoginConfirmationEmail> createOrUpdateAsync(LoginConfirmationEmail item) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LoginConfirmationEmail find(UUID id) {
|
|
||||||
return this.getDatabaseService().getQueryable(LoginConfirmationEmail.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public LoginConfirmationEmail find(UUID id, String hint) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void delete(LoginConfirmationEmail item) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryableList<LoginConfirmationEmail> asQueryable() {
|
|
||||||
return this.getDatabaseService().getQueryable(LoginConfirmationEmail.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -26,14 +26,23 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria) {
|
public QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria) {
|
||||||
QueryableList<Organisation> query = this.getDatabaseService().getQueryable(Organisation.class);
|
QueryableList<Organisation> query = this.getDatabaseService().getQueryable(Organisation.class);
|
||||||
if (criteria.getLike() != null)
|
if (criteria.getLabelLike() != null && criteria.getLike() != null) {
|
||||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
query.where((builder, root) -> builder.or(builder.equal(root.get("reference"), criteria.getLike()), builder.like(builder.upper(root.get("label")), "%" + criteria.getLabelLike().toUpperCase() + "%")));
|
||||||
if (criteria.getLabelLike() != null) {
|
} else {
|
||||||
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLabelLike().toUpperCase() + "%"));
|
if (criteria.getLike() != null)
|
||||||
|
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||||
|
if (criteria.getLabelLike() != null) {
|
||||||
|
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLabelLike().toUpperCase() + "%"));
|
||||||
|
}
|
||||||
|
if (criteria.getPublic() != null && criteria.getPublic()) {
|
||||||
|
query.where((builder, root) -> builder.equal(root.join("dmps", JoinType.LEFT).get("status"), DMP.DMPStatus.FINALISED.getValue()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (criteria.getPublic() != null && criteria.getPublic()) {
|
|
||||||
query.where((builder, root) -> builder.equal(root.join("dmps", JoinType.LEFT).get("status"), DMP.DMPStatus.FINALISED.getValue()));
|
if (criteria.isActive()) {
|
||||||
|
query.where((builder, root) -> builder.notEqual(root.join("dmps").get("status"), DMP.DMPStatus.DELETED.getValue())).distinct();
|
||||||
}
|
}
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +73,7 @@ public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryableList<Organisation> getAuthenticated(QueryableList<Organisation> query, UserInfo principal) {
|
public QueryableList<Organisation> getAuthenticated(QueryableList<Organisation> query, UserInfo principal) {
|
||||||
query.where((builder, root) -> builder.equal(root.join("dmps").get("creator"), principal));
|
query.where((builder, root) -> builder.equal(root.join("dmps").join("users").get("user"), principal));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,10 @@ public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDa
|
||||||
builder.or(builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))));
|
builder.or(builder.like(builder.upper(root.get("description")), "%" + criteria.getLike().toUpperCase() + "%"))));
|
||||||
if (criteria.getReference() != null)
|
if (criteria.getReference() != null)
|
||||||
query.where((builder, root) -> builder.like(root.get("reference"), "%" + criteria.getReference() + "%"));
|
query.where((builder, root) -> builder.like(root.get("reference"), "%" + criteria.getReference() + "%"));
|
||||||
|
if (criteria.getExactReference() != null)
|
||||||
|
query.where((builder, root) -> builder.like(root.get("reference"), criteria.getExactReference()));
|
||||||
|
if (criteria.getPeriodStart() != null)
|
||||||
|
query.where((builder, root) -> builder.greaterThanOrEqualTo(root.get("startdate"), criteria.getPeriodStart()));
|
||||||
query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue()));
|
query.where((builder, root) -> builder.notEqual(root.get("status"), Project.Status.DELETED.getValue()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,13 @@ public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements Res
|
||||||
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
||||||
QueryableList<Researcher> query = asQueryable();
|
QueryableList<Researcher> query = asQueryable();
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||||
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%")));
|
query.where((builder, root) ->builder.or(builder.like(builder.lower(root.get("reference")), "%" + criteria.getLike().toLowerCase() + "%")));
|
||||||
if (criteria.getName() != null && !criteria.getName().isEmpty())
|
if (criteria.getName() != null && !criteria.getName().isEmpty())
|
||||||
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getName().toUpperCase() + "%")));
|
query.where((builder, root) ->builder.or(builder.like(builder.lower(root.get("label")), "%" + criteria.getName().toLowerCase() + "%")));
|
||||||
|
if (criteria.getReference() != null && !criteria.getReference().isEmpty())
|
||||||
|
query.where((builder, root) ->builder.or(builder.like(root.get("reference"), criteria.getReference())));
|
||||||
|
if (criteria.getPeriodStart() != null)
|
||||||
|
query.where((builder, root) -> builder.greaterThanOrEqualTo(root.get("created"), criteria.getPeriodStart()));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccessLayer;
|
||||||
|
import eu.eudat.data.entities.UserDMP;
|
||||||
|
import eu.eudat.data.entities.UserDatasetProfile;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ikalyvas on 2/8/2018.
|
||||||
|
*/
|
||||||
|
public interface UserDatasetProfileDao extends DatabaseAccessLayer<UserDatasetProfile, UUID> {
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package eu.eudat.data.dao.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.DatabaseAccess;
|
||||||
|
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
|
||||||
|
import eu.eudat.data.entities.UserDMP;
|
||||||
|
import eu.eudat.data.entities.UserDatasetProfile;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@Component("userDatasetProfileDao")
|
||||||
|
public class UserDatasetProfileDaoImpl extends DatabaseAccess<UserDatasetProfile> implements UserDatasetProfileDao {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public UserDatasetProfileDaoImpl(DatabaseService<UserDatasetProfile> databaseService) {
|
||||||
|
super(databaseService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDatasetProfile createOrUpdate(UserDatasetProfile item) {
|
||||||
|
return this.getDatabaseService().createOrUpdate(item, UserDatasetProfile.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDatasetProfile find(UUID id) {
|
||||||
|
return this.getDatabaseService().getQueryable(UserDatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingleOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(UserDatasetProfile item) {
|
||||||
|
this.getDatabaseService().delete(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<UserDatasetProfile> asQueryable() {
|
||||||
|
return this.getDatabaseService().getQueryable(UserDatasetProfile.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<UserDatasetProfile> createOrUpdateAsync(UserDatasetProfile item) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDatasetProfile find(UUID id, String hint) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,6 +26,7 @@ public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInf
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria) {
|
public QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria) {
|
||||||
QueryableList<UserInfo> users = this.getDatabaseService().getQueryable(UserInfo.class);
|
QueryableList<UserInfo> users = this.getDatabaseService().getQueryable(UserInfo.class);
|
||||||
|
users.where(((builder, root) -> builder.equal(root.get("userStatus"), 0)));
|
||||||
if (criteria.getAppRoles() != null && !criteria.getAppRoles().isEmpty())
|
if (criteria.getAppRoles() != null && !criteria.getAppRoles().isEmpty())
|
||||||
users.where((builder, root) -> root.join("userRoles").get("role").in(criteria.getAppRoles()));
|
users.where((builder, root) -> root.join("userRoles").get("role").in(criteria.getAppRoles()));
|
||||||
if (criteria.getLike() != null)
|
if (criteria.getLike() != null)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "\"Content\"")
|
@Table(name = "\"Content\"")
|
||||||
public class Content implements DataEntity<Content, UUID> {
|
public class Content implements DataEntity<Content, UUID> { //IGNORE ME
|
||||||
|
|
||||||
public enum ParentType {
|
public enum ParentType {
|
||||||
GRANT(0);
|
GRANT(0);
|
||||||
|
|
|
@ -34,6 +34,8 @@ public class Credential implements DataEntity<Credential, UUID> {
|
||||||
private Integer provider;
|
private Integer provider;
|
||||||
@Column(name = "\"Public\"", nullable = false)
|
@Column(name = "\"Public\"", nullable = false)
|
||||||
private String publicValue;
|
private String publicValue;
|
||||||
|
@Column(name = "\"Email\"")
|
||||||
|
private String email;
|
||||||
@Column(name = "\"Secret\"", nullable = false)
|
@Column(name = "\"Secret\"", nullable = false)
|
||||||
private String secret;
|
private String secret;
|
||||||
|
|
||||||
|
@ -88,6 +90,14 @@ public class Credential implements DataEntity<Credential, UUID> {
|
||||||
this.publicValue = publicValue;
|
this.publicValue = publicValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecret() {
|
public String getSecret() {
|
||||||
return secret;
|
return secret;
|
||||||
}
|
}
|
||||||
|
@ -139,6 +149,7 @@ public class Credential implements DataEntity<Credential, UUID> {
|
||||||
public void update(Credential entity) {
|
public void update(Credential entity) {
|
||||||
this.status = entity.status;
|
this.status = entity.status;
|
||||||
this.publicValue = entity.getPublicValue();
|
this.publicValue = entity.getPublicValue();
|
||||||
|
this.email = entity.getEmail();
|
||||||
this.secret = entity.getSecret();
|
this.secret = entity.getSecret();
|
||||||
this.lastUpdateTime = new Date();
|
this.lastUpdateTime = new Date();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,17 +15,22 @@ import java.util.stream.Collectors;
|
||||||
@NamedEntityGraphs({
|
@NamedEntityGraphs({
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "dataManagementPlanListingModel",
|
name = "dataManagementPlanListingModel",
|
||||||
attributeNodes = {@NamedAttributeNode("organisations"), @NamedAttributeNode("researchers"), @NamedAttributeNode("associatedDmps"),
|
attributeNodes = {
|
||||||
@NamedAttributeNode("grant"), @NamedAttributeNode(value = "users", subgraph = "users"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile"), @NamedAttributeNode("dataset")},
|
@NamedAttributeNode("grant"), @NamedAttributeNode("creator"), @NamedAttributeNode("profile")}/*,*/
|
||||||
subgraphs = {
|
/*subgraphs = {
|
||||||
@NamedSubgraph(name = "users", attributeNodes = {@NamedAttributeNode("user")}),
|
@NamedSubgraph(name = "users", attributeNodes = {@NamedAttributeNode("user")}),
|
||||||
}
|
}*/
|
||||||
),
|
),
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "fullyDetailed",
|
name = "fullyDetailed",
|
||||||
attributeNodes = {
|
attributeNodes = {
|
||||||
@NamedAttributeNode("grant"), @NamedAttributeNode("profile"),
|
@NamedAttributeNode("grant"), @NamedAttributeNode("profile"),
|
||||||
@NamedAttributeNode("users"), @NamedAttributeNode("organisations"), @NamedAttributeNode("researchers")}),
|
@NamedAttributeNode(value = "users", subgraph = "users"), @NamedAttributeNode("organisations"), @NamedAttributeNode("researchers")
|
||||||
|
},
|
||||||
|
subgraphs = {
|
||||||
|
@NamedSubgraph(name = "users", attributeNodes = {@NamedAttributeNode("user")})
|
||||||
|
}
|
||||||
|
),
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "dmpRecentActivity",
|
name = "dmpRecentActivity",
|
||||||
attributeNodes = {
|
attributeNodes = {
|
||||||
|
@ -107,12 +112,8 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
/*@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
/*@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
||||||
@Column(name = "\"AssociatedDmps\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"AssociatedDmps\"", columnDefinition = "xml", nullable = true)
|
||||||
private String associatedDmps;*/
|
private String associatedDmps;*/
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "dmp")
|
||||||
@JoinTable(name = "\"DMPDatasetProfile\"",
|
private Set<DMPDatasetProfile> associatedDmps;
|
||||||
joinColumns = {@JoinColumn(name = "\"dmp\"", referencedColumnName = "\"ID\"")},
|
|
||||||
inverseJoinColumns = {@JoinColumn(name = "\"datasetprofile\"", referencedColumnName = "\"ID\"")}
|
|
||||||
)
|
|
||||||
private Set<DatasetProfile> associatedDmps;
|
|
||||||
|
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@ -181,8 +182,8 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date publishedAt;
|
private Date publishedAt;
|
||||||
|
|
||||||
@Column(name = "\"DOI\"")
|
@OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY)
|
||||||
private String doi;
|
private Set<EntityDoi> dois;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "\"Project\"")
|
@JoinColumn(name = "\"Project\"")
|
||||||
|
@ -269,10 +270,10 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
this.grant = grant;
|
this.grant = grant;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<DatasetProfile> getAssociatedDmps() {
|
public Set<DMPDatasetProfile> getAssociatedDmps() {
|
||||||
return associatedDmps;
|
return associatedDmps;
|
||||||
}
|
}
|
||||||
public void setAssociatedDmps(Set<DatasetProfile> associatedDmps) {
|
public void setAssociatedDmps(Set<DMPDatasetProfile> associatedDmps) {
|
||||||
this.associatedDmps = associatedDmps;
|
this.associatedDmps = associatedDmps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,12 +340,12 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
this.publishedAt = publishedAt;
|
this.publishedAt = publishedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDoi() {
|
public Set<EntityDoi> getDois() {
|
||||||
return doi;
|
return dois;
|
||||||
}
|
}
|
||||||
public void setDoi(String doi) {
|
public void setDois(Set<EntityDoi> dois) {
|
||||||
this.doi = doi;
|
this.dois = dois;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Project getProject() {
|
public Project getProject() {
|
||||||
return project;
|
return project;
|
||||||
|
@ -380,7 +381,7 @@ public class DMP implements DataEntity<DMP, UUID> {
|
||||||
if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedAt(new Date());
|
if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedAt(new Date());
|
||||||
if (entity.isPublic) this.setPublishedAt(new Date());
|
if (entity.isPublic) this.setPublishedAt(new Date());
|
||||||
if (entity.getUsers() != null) this.users = entity.getUsers();
|
if (entity.getUsers() != null) this.users = entity.getUsers();
|
||||||
if (entity.getDoi() != null && entity.getDoi().trim().isEmpty()) this.doi = entity.doi;
|
this.dois = entity.getDois();
|
||||||
this.extraProperties = entity.getExtraProperties();
|
this.extraProperties = entity.getExtraProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
package eu.eudat.data.entities;
|
||||||
|
|
||||||
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "\"DMPDatasetProfile\"")
|
||||||
|
public class DMPDatasetProfile implements DataEntity<DMPDatasetProfile, UUID> {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "\"dmp\"")
|
||||||
|
private DMP dmp;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "\"datasetprofile\"")
|
||||||
|
private DescriptionTemplate datasetprofile;
|
||||||
|
|
||||||
|
@Column(name = "\"data\"")
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DMP getDmp() {
|
||||||
|
return dmp;
|
||||||
|
}
|
||||||
|
public void setDmp(DMP dmp) {
|
||||||
|
this.dmp = dmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DescriptionTemplate getDatasetprofile() {
|
||||||
|
return datasetprofile;
|
||||||
|
}
|
||||||
|
public void setDatasetprofile(DescriptionTemplate datasetprofile) {
|
||||||
|
this.datasetprofile = datasetprofile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DMPDatasetProfile entity) {
|
||||||
|
this.dmp = entity.getDmp();
|
||||||
|
this.datasetprofile = entity.getDatasetprofile();
|
||||||
|
this.data = entity.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getKeys() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DMPDatasetProfile buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
|
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,14 +26,14 @@ public class DataRepository implements Serializable, DataEntity<DataRepository,
|
||||||
@Column(name = "\"Abbreviation\"")
|
@Column(name = "\"Abbreviation\"")
|
||||||
private String abbreviation;
|
private String abbreviation;
|
||||||
|
|
||||||
@Column(name = "\"Reference\"", nullable = false)
|
@Column(name = "\"Reference\"")
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
@Column(name = "\"Uri\"")
|
||||||
private String uri;
|
private String uri;
|
||||||
|
|
||||||
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"Definition\"", columnDefinition = "xml")
|
||||||
private String definition;
|
private String definition;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "dataRepository", cascade = CascadeType.ALL, orphanRemoval = true)
|
@OneToMany(mappedBy = "dataRepository", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
|
@ -42,14 +42,14 @@ public class DataRepository implements Serializable, DataEntity<DataRepository,
|
||||||
@Column(name = "\"Status\"", nullable = false)
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
private Short status;
|
private Short status;
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
@Column(name = "\"Created\"", nullable = false)
|
||||||
private Date created = null;
|
private Date created = null;
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
@Column(name = "\"Modified\"", nullable = false)
|
||||||
private Date modified = new Date();
|
private Date modified = new Date();
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "\"CreationUser\"", nullable = true)
|
@JoinColumn(name = "\"CreationUser\"")
|
||||||
private UserInfo creationUser;
|
private UserInfo creationUser;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,14 @@ import java.util.stream.Collectors;
|
||||||
@NamedEntityGraphs({
|
@NamedEntityGraphs({
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "datasetListingModel",
|
name = "datasetListingModel",
|
||||||
attributeNodes = {@NamedAttributeNode("services"), @NamedAttributeNode(value = "datasetDataRepositories", subgraph = "datasetDataRepositories"),
|
attributeNodes = {/*@NamedAttributeNode("services"), @NamedAttributeNode(value = "datasetDataRepositories", subgraph = "datasetDataRepositories"),
|
||||||
@NamedAttributeNode(value = "datasetExternalDatasets", subgraph = "datasetExternalDatasets"), @NamedAttributeNode("registries"),
|
@NamedAttributeNode(value = "datasetExternalDatasets", subgraph = "datasetExternalDatasets"), @NamedAttributeNode("registries"),*/
|
||||||
@NamedAttributeNode(value = "dmp", subgraph = "dmp"), @NamedAttributeNode("profile"), @NamedAttributeNode("creator")},
|
@NamedAttributeNode(value = "dmp", subgraph = "dmp"), @NamedAttributeNode(value = "profile", subgraph = "profile"), @NamedAttributeNode("creator")},
|
||||||
subgraphs = {
|
subgraphs = {
|
||||||
@NamedSubgraph(name = "dmp", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users"), @NamedAttributeNode("grant"), @NamedAttributeNode("organisations")}),
|
@NamedSubgraph(name = "dmp", attributeNodes = {@NamedAttributeNode("creator"), @NamedAttributeNode("users"), @NamedAttributeNode("grant"), @NamedAttributeNode("organisations")}),
|
||||||
@NamedSubgraph(name = "datasetDataRepositories", attributeNodes = {@NamedAttributeNode("dataRepository")}),
|
@NamedSubgraph(name = "datasetDataRepositories", attributeNodes = {@NamedAttributeNode("dataRepository")}),
|
||||||
@NamedSubgraph(name = "datasetExternalDatasets", attributeNodes = {@NamedAttributeNode("externalDataset")})
|
@NamedSubgraph(name = "datasetExternalDatasets", attributeNodes = {@NamedAttributeNode("externalDataset")}),
|
||||||
|
@NamedSubgraph(name = "profile", attributeNodes = {@NamedAttributeNode("label")})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
|
@ -91,7 +92,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
@Column(name = "\"Label\"", nullable = false)
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@ -99,20 +100,23 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
@JoinColumn(name = "\"DMP\"", nullable = false)
|
@JoinColumn(name = "\"DMP\"", nullable = false)
|
||||||
private DMP dmp;
|
private DMP dmp;
|
||||||
|
|
||||||
|
@Column(name = "\"DmpSectionIndex\"")
|
||||||
|
private Integer dmpSectionIndex;
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
@Column(name = "\"Uri\"")
|
||||||
private String uri;
|
private String uri;
|
||||||
|
|
||||||
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
||||||
@Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"Properties\"", columnDefinition = "xml")
|
||||||
private String properties;
|
private String properties;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
//@Cascade(value=org.hibernate.annotations.CascadeType.ALL)
|
//@Cascade(value=org.hibernate.annotations.CascadeType.ALL)
|
||||||
@JoinColumn(name = "\"Profile\"", nullable = true)
|
@JoinColumn(name = "\"Profile\"")
|
||||||
private DatasetProfile profile;
|
private DescriptionTemplate profile;
|
||||||
|
|
||||||
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
@Type(type = "eu.eudat.configurations.typedefinition.XMLType")
|
||||||
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"Reference\"", columnDefinition = "xml")
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
|
@ -135,16 +139,16 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
private Short status;
|
private Short status;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "\"Created\"")
|
@Column(name = "\"Created\"", nullable = false)
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date created = null;
|
private Date created = null;
|
||||||
|
|
||||||
@Column(name = "\"Modified\"")
|
@Column(name = "\"Modified\"", nullable = false)
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date modified = new Date();
|
private Date modified = new Date();
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "\"Creator\"", nullable = true)
|
@JoinColumn(name = "\"Creator\"")
|
||||||
private UserInfo creator;
|
private UserInfo creator;
|
||||||
|
|
||||||
@Column(name = "\"Description\"")
|
@Column(name = "\"Description\"")
|
||||||
|
@ -231,6 +235,12 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
this.dmp = dmp;
|
this.dmp = dmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getDmpSectionIndex() {
|
||||||
|
return dmpSectionIndex;
|
||||||
|
}
|
||||||
|
public void setDmpSectionIndex(Integer dmpSectionIndex) {
|
||||||
|
this.dmpSectionIndex = dmpSectionIndex;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUri() {
|
public String getUri() {
|
||||||
return uri;
|
return uri;
|
||||||
|
@ -248,10 +258,10 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DatasetProfile getProfile() {
|
public DescriptionTemplate getProfile() {
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
public void setProfile(DatasetProfile profile) {
|
public void setProfile(DescriptionTemplate profile) {
|
||||||
this.profile = profile;
|
this.profile = profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,6 +337,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
|
||||||
this.setRegistries(entity.getRegistries());
|
this.setRegistries(entity.getRegistries());
|
||||||
|
|
||||||
this.setDmp(entity.getDmp());
|
this.setDmp(entity.getDmp());
|
||||||
|
this.setDmpSectionIndex(entity.getDmpSectionIndex());
|
||||||
this.setStatus(entity.getStatus());
|
this.setStatus(entity.getStatus());
|
||||||
this.setProfile(entity.getProfile());
|
this.setProfile(entity.getProfile());
|
||||||
this.setModified(new Date());
|
this.setModified(new Date());
|
||||||
|
|
|
@ -14,8 +14,8 @@ import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "\"DatasetProfile\"")
|
@Table(name = "\"DescriptionTemplate\"")
|
||||||
public class DatasetProfile implements DataEntity<DatasetProfile,UUID>{
|
public class DescriptionTemplate implements DataEntity<DescriptionTemplate,UUID>{
|
||||||
|
|
||||||
public enum Status {
|
public enum Status {
|
||||||
SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99);
|
SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99);
|
||||||
|
@ -49,7 +49,7 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID>{
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
@Column(name = "\"Label\"", nullable = false)
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
|
||||||
|
@ -79,16 +79,21 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID>{
|
||||||
@Column(name = "\"Version\"", nullable = false)
|
@Column(name = "\"Version\"", nullable = false)
|
||||||
private Short version;
|
private Short version;
|
||||||
|
|
||||||
@ManyToMany(fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
@JoinTable(name = "\"DMPDatasetProfile\"",
|
private Set<DMP> dmps;
|
||||||
joinColumns = {@JoinColumn(name = "\"datasetprofile\"", referencedColumnName = "\"ID\"")},
|
|
||||||
inverseJoinColumns = {@JoinColumn(name = "\"dmp\"", referencedColumnName = "\"ID\"")}
|
|
||||||
)
|
|
||||||
private List<DMP> dmps;
|
|
||||||
|
|
||||||
@Column(name = "\"Language\"", nullable = false)
|
@Column(name = "\"Language\"", nullable = false)
|
||||||
private String language;
|
private String language;
|
||||||
|
|
||||||
|
@OneToOne(fetch = FetchType.EAGER)
|
||||||
|
@JoinColumn(name = "\"Type\"", nullable = false)
|
||||||
|
private DescriptionTemplateType type;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "descriptionTemplate", fetch = FetchType.LAZY)
|
||||||
|
private Set<UserDatasetProfile> users;
|
||||||
|
|
||||||
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "datasetprofile")
|
||||||
|
private Set<DMPDatasetProfile> associatedDmps;
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
|
@ -153,18 +158,31 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID>{
|
||||||
public String getLanguage() {
|
public String getLanguage() {
|
||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLanguage(String language) {
|
public void setLanguage(String language) {
|
||||||
this.language = language;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public DescriptionTemplateType getType() {
|
||||||
public String toString() {
|
return type;
|
||||||
return "DatasetProfileListingModel [id=" + id + ", label=" + label + ", dataset=" + dataset + ", definition=" + definition + ", version=" + version + ", language=" + language + "]";
|
}
|
||||||
|
public void setType(DescriptionTemplateType type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<UserDatasetProfile> getUsers() {
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
public void setUsers(Set<UserDatasetProfile> users) {
|
||||||
|
this.users = users;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(DatasetProfile entity) {
|
public String toString() {
|
||||||
|
return "DatasetProfileListingModel [id=" + id + ", label=" + label + ", dataset=" + dataset + ", definition=" + definition + ", version=" + version + ", language=" + language + ", type=" + type +"]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DescriptionTemplate entity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -173,7 +191,7 @@ public class DatasetProfile implements DataEntity<DatasetProfile,UUID>{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetProfile buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
public DescriptionTemplate buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
|
this.id = UUID.fromString((String) tuple.get(0).get(base.isEmpty() ? base + "." + "id" : "id"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package eu.eudat.data.entities;
|
||||||
|
|
||||||
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "\"DescriptionTemplateType\"")
|
||||||
|
public class DescriptionTemplateType implements DataEntity<DescriptionTemplateType, UUID> {
|
||||||
|
|
||||||
|
public enum Status {
|
||||||
|
SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99);
|
||||||
|
|
||||||
|
private short value;
|
||||||
|
|
||||||
|
private Status(short value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
public short getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Status fromInteger(int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0:
|
||||||
|
return SAVED;
|
||||||
|
case 1:
|
||||||
|
return FINALIZED;
|
||||||
|
case 99:
|
||||||
|
return DELETED;
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("Unsupported Description Template Type Status");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@Column(name = "\"Name\"", nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "\"Status\"", nullable = false)
|
||||||
|
private Short status;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Short getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setStatus(Short status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DescriptionTemplateType entity) {
|
||||||
|
this.name = entity.name;
|
||||||
|
this.status = entity.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getKeys() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DescriptionTemplateType buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
|
this.id = UUID.fromString((String) tuple.get(0).get(!base.isEmpty() ? base + "." + "id" : "id"));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
package eu.eudat.data.entities;
|
|
||||||
|
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
@Table(name = "\"DoiFunder\"")
|
|
||||||
public class DoiFunder implements DataEntity<DoiFunder, UUID> {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
private UUID id;
|
|
||||||
|
|
||||||
@Column(name = "name")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Column(name = "doi")
|
|
||||||
private String doi;
|
|
||||||
|
|
||||||
public UUID getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(UUID id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDoi() {
|
|
||||||
return doi;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoi(String doi) {
|
|
||||||
this.doi = doi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(DoiFunder entity) {
|
|
||||||
this.name = entity.name;
|
|
||||||
this.doi = entity.doi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UUID getKeys() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DoiFunder buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -10,8 +10,8 @@ import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "\"LoginConfirmationEmail\"")
|
@Table(name = "\"EmailConfirmation\"")
|
||||||
public class LoginConfirmationEmail implements DataEntity<LoginConfirmationEmail, UUID> {
|
public class EmailConfirmation implements DataEntity<EmailConfirmation, UUID> {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
|
@ -30,6 +30,9 @@ public class LoginConfirmationEmail implements DataEntity<LoginConfirmationEmail
|
||||||
|
|
||||||
@Column(name = "\"userId\"", nullable = false)
|
@Column(name = "\"userId\"", nullable = false)
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
|
|
||||||
|
@Column(name = "\"data\"")
|
||||||
|
private String data;
|
||||||
|
|
||||||
@Column(name = "\"expiresAt\"", nullable = false)
|
@Column(name = "\"expiresAt\"", nullable = false)
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
@ -77,9 +80,14 @@ public class LoginConfirmationEmail implements DataEntity<LoginConfirmationEmail
|
||||||
this.expiresAt = expiresAt;
|
this.expiresAt = expiresAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void update(LoginConfirmationEmail entity) {
|
public void update(EmailConfirmation entity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -88,7 +96,7 @@ public class LoginConfirmationEmail implements DataEntity<LoginConfirmationEmail
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoginConfirmationEmail buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
public EmailConfirmation buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package eu.eudat.data.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.converters.DateToUTCConverter;
|
||||||
|
import eu.eudat.data.entities.helpers.EntityBinder;
|
||||||
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "\"EntityDoi\"")
|
||||||
|
public class EntityDoi implements DataEntity<EntityDoi, UUID> {
|
||||||
|
public enum EntityType {
|
||||||
|
DMP
|
||||||
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType")
|
||||||
|
@Column(name = "\"EntityType\"", nullable = false)
|
||||||
|
private EntityType entityType;
|
||||||
|
|
||||||
|
@Column(name = "\"RepositoryId\"", nullable = false)
|
||||||
|
private String repositoryId;
|
||||||
|
|
||||||
|
@Column(name = "\"Doi\"", nullable = false)
|
||||||
|
private String doi;
|
||||||
|
|
||||||
|
@Column(name = "\"CreatedAt\"", nullable = false)
|
||||||
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
@Column(name = "\"UpdatedAt\"", nullable = false)
|
||||||
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
private Date updatedAt;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "\"EntityId\"", nullable = false)
|
||||||
|
private DMP entityId;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityType getEntityType() {
|
||||||
|
return entityType;
|
||||||
|
}
|
||||||
|
public void setEntityType(EntityType entityType) {
|
||||||
|
this.entityType = entityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRepositoryId() {
|
||||||
|
return repositoryId;
|
||||||
|
}
|
||||||
|
public void setRepositoryId(String repositoryId) {
|
||||||
|
this.repositoryId = repositoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDoi() {
|
||||||
|
return doi;
|
||||||
|
}
|
||||||
|
public void setDoi(String doi) {
|
||||||
|
this.doi = doi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
public void setCreatedAt(Date createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdatedAt() {
|
||||||
|
return updatedAt;
|
||||||
|
}
|
||||||
|
public void setUpdatedAt(Date updatedAt) {
|
||||||
|
this.updatedAt = updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DMP getEntityId() {
|
||||||
|
return entityId;
|
||||||
|
}
|
||||||
|
public void setEntityId(DMP entityId) {
|
||||||
|
this.entityId = entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(EntityDoi doi) {
|
||||||
|
this.entityType = doi.getEntityType();
|
||||||
|
this.repositoryId = doi.getRepositoryId();
|
||||||
|
this.doi = doi.getDoi();
|
||||||
|
this.createdAt = doi.getCreatedAt();
|
||||||
|
this.updatedAt = doi.getUpdatedAt();
|
||||||
|
this.entityId = doi.getEntityId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getKeys() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDoi buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
|
String currentBase = base.isEmpty() ? "" : base + ".";
|
||||||
|
if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id");
|
||||||
|
if (fields.contains(currentBase + "entityId"))
|
||||||
|
this.entityId = tuple.stream().map(x -> new DMP().buildFromTuple(Arrays.asList(x), fields , base.isEmpty() ? "entityId" : base + "." + "entityId")).collect(Collectors.toList()).get(0);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package eu.eudat.data.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.converters.DateToUTCConverter;
|
||||||
|
import eu.eudat.data.entities.helpers.EntityBinder;
|
||||||
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "\"FileUpload\"")
|
||||||
|
public class FileUpload implements DataEntity<FileUpload, UUID> {
|
||||||
|
public enum EntityType {
|
||||||
|
DATASET, DMP
|
||||||
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@Column(name = "\"Name\"", nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "\"FileType\"", nullable = false)
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
@Column(name = "\"EntityId\"", nullable = false)
|
||||||
|
private UUID entityId;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType")
|
||||||
|
@Column(name = "\"EntityType\"", nullable = false)
|
||||||
|
private EntityType entityType;
|
||||||
|
|
||||||
|
@Column(name = "\"CreatedAt\"", nullable = false)
|
||||||
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
@Column(name = "\"IsDeleted\"", nullable = false)
|
||||||
|
private Boolean isDeleted;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "\"Creator\"")
|
||||||
|
private UserInfo creator;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileType() {
|
||||||
|
return fileType;
|
||||||
|
}
|
||||||
|
public void setFileType(String fileType) {
|
||||||
|
this.fileType = fileType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getEntityId() {
|
||||||
|
return entityId;
|
||||||
|
}
|
||||||
|
public void setEntityId(UUID entityId) {
|
||||||
|
this.entityId = entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityType getEntityType() {
|
||||||
|
return entityType;
|
||||||
|
}
|
||||||
|
public void setEntityType(EntityType entityType) {
|
||||||
|
this.entityType = entityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
public void setCreatedAt(Date createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsDeleted() {
|
||||||
|
return isDeleted;
|
||||||
|
}
|
||||||
|
public void setIsDeleted(Boolean isDeleted) {
|
||||||
|
this.isDeleted = isDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfo getCreator() {
|
||||||
|
return creator;
|
||||||
|
}
|
||||||
|
public void setCreator(UserInfo creator) {
|
||||||
|
this.creator = creator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(FileUpload file) {
|
||||||
|
this.name = file.getName();
|
||||||
|
this.fileType = file.getFileType();
|
||||||
|
this.entityId = file.getEntityId();
|
||||||
|
this.entityType = file.getEntityType();
|
||||||
|
this.createdAt = file.getCreatedAt();
|
||||||
|
this.isDeleted = file.getIsDeleted();
|
||||||
|
this.creator = file.getCreator();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getKeys() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileUpload buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
|
String currentBase = base.isEmpty() ? "" : base + ".";
|
||||||
|
if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id");
|
||||||
|
this.creator = tuple.stream().map(x -> new UserInfo().buildFromTuple(tuple, fields , base.isEmpty() ? "creator" : base + "." + "creator")).collect(Collectors.toList()).get(0);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -106,11 +106,11 @@ public class Grant implements DataEntity<Grant, UUID> {
|
||||||
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
|
||||||
private String definition;
|
private String definition;
|
||||||
|
|
||||||
@Column(name = "\"StartDate\"", nullable = false)
|
@Column(name = "\"StartDate\"", nullable = true)
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date startdate = null;
|
private Date startdate = null;
|
||||||
|
|
||||||
@Column(name = "\"EndDate\"", nullable = false)
|
@Column(name = "\"EndDate\"", nullable = true)
|
||||||
@Convert(converter = DateToUTCConverter.class)
|
@Convert(converter = DateToUTCConverter.class)
|
||||||
private Date enddate = null;
|
private Date enddate = null;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class Researcher implements DataEntity<Researcher, UUID> {
|
||||||
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
@Column(name = "\"Label\"")
|
@Column(name = "\"Label\"", nullable = false, length = 250)
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
@Column(name = "\"Uri\"")
|
@Column(name = "\"Uri\"")
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package eu.eudat.data.entities;
|
||||||
|
|
||||||
|
import eu.eudat.data.entities.helpers.EntityBinder;
|
||||||
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "\"UserDatasetProfile\"")
|
||||||
|
public class UserDatasetProfile implements DataEntity<UserDatasetProfile, UUID> {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||||
|
@Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||||
|
private UUID id;
|
||||||
|
|
||||||
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "usr")
|
||||||
|
private UserInfo user;
|
||||||
|
|
||||||
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "\"descriptionTemplate\"")
|
||||||
|
private DescriptionTemplate descriptionTemplate;
|
||||||
|
|
||||||
|
@Column(name = "role")
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserInfo getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(UserInfo user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DescriptionTemplate getDatasetProfile() {
|
||||||
|
return descriptionTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatasetProfile(DescriptionTemplate descriptionTemplate) {
|
||||||
|
this.descriptionTemplate = descriptionTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(Integer role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(UserDatasetProfile entity) {
|
||||||
|
this.role = entity.getRole();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UUID getKeys() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDatasetProfile buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
|
||||||
|
String currentBase = base.isEmpty() ? "" : base + ".";
|
||||||
|
if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ import java.util.*;
|
||||||
@NamedEntityGraphs({
|
@NamedEntityGraphs({
|
||||||
@NamedEntityGraph(
|
@NamedEntityGraph(
|
||||||
name = "userInfo",
|
name = "userInfo",
|
||||||
attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials")}),
|
attributeNodes = {@NamedAttributeNode("userRoles"), @NamedAttributeNode("credentials"), @NamedAttributeNode("additionalinfo")}),
|
||||||
})
|
})
|
||||||
public class UserInfo implements DataEntity<UserInfo, UUID> {
|
public class UserInfo implements DataEntity<UserInfo, UUID> {
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "email", nullable = false)
|
@Column(name = "email")
|
||||||
private String email = null;
|
private String email = null;
|
||||||
|
|
||||||
@Column(name = "authorization_level", nullable = false)
|
@Column(name = "authorization_level", nullable = false)
|
||||||
|
@ -35,6 +35,9 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
|
||||||
@Column(name = "usertype", nullable = false)
|
@Column(name = "usertype", nullable = false)
|
||||||
private Short usertype; // 0 internal, 1 external
|
private Short usertype; // 0 internal, 1 external
|
||||||
|
|
||||||
|
@Column(name = "userstatus", nullable = false)
|
||||||
|
private Short userStatus; // 0 active, 1 inactive
|
||||||
|
|
||||||
@Column(name = "verified_email", nullable = true)
|
@Column(name = "verified_email", nullable = true)
|
||||||
private Boolean verified_email = null;
|
private Boolean verified_email = null;
|
||||||
|
|
||||||
|
@ -187,6 +190,14 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
|
||||||
this.notifications = notifications;
|
this.notifications = notifications;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Short getUserStatus() {
|
||||||
|
return userStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserStatus(Short userStatus) {
|
||||||
|
this.userStatus = userStatus;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(UserInfo entity) {
|
public void update(UserInfo entity) {
|
||||||
this.name = entity.getName();
|
this.name = entity.getName();
|
||||||
|
@ -194,6 +205,7 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
|
||||||
this.additionalinfo = entity.getAdditionalinfo();
|
this.additionalinfo = entity.getAdditionalinfo();
|
||||||
this.lastloggedin = entity.getLastloggedin();
|
this.lastloggedin = entity.getLastloggedin();
|
||||||
this.userRoles = entity.getUserRoles();
|
this.userRoles = entity.getUserRoles();
|
||||||
|
this.userStatus = entity.getUserStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,12 +3,14 @@ package eu.eudat.data.query.definition;
|
||||||
import eu.eudat.data.dao.criteria.Criteria;
|
import eu.eudat.data.dao.criteria.Criteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public abstract class Query<C extends Criteria<T>, T extends DataEntity> implements CriteriaQuery<C, T> {
|
public abstract class Query<C extends Criteria<T>, T extends DataEntity> implements CriteriaQuery<C, T> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Query.class);
|
private static final Logger logger = LoggerFactory.getLogger(Query.class);
|
||||||
private C criteria;
|
private C criteria;
|
||||||
|
@ApiModelProperty(value = "query", name = "query", dataType = "String", hidden = true)
|
||||||
private QueryableList<T> query;
|
private QueryableList<T> query;
|
||||||
|
|
||||||
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {
|
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {
|
||||||
|
|
|
@ -6,12 +6,16 @@ import eu.eudat.data.query.definition.helpers.ColumnOrderings;
|
||||||
import eu.eudat.data.query.definition.helpers.SelectionFields;
|
import eu.eudat.data.query.definition.helpers.SelectionFields;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
|
||||||
public abstract class TableQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Query<C, T> implements TableCriteriaQuery<C, T> {
|
public abstract class TableQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Query<C, T> implements TableCriteriaQuery<C, T> {
|
||||||
private ColumnOrderings orderings;
|
private ColumnOrderings orderings;
|
||||||
|
@ApiModelProperty(hidden = true)
|
||||||
private SelectionFields selection;
|
private SelectionFields selection;
|
||||||
|
@ApiModelProperty(value = "length", name = "length", dataType = "Integer", example = "2")
|
||||||
private Integer length;
|
private Integer length;
|
||||||
|
@ApiModelProperty(value = "offset", name = "offset", dataType = "Integer", example = "0")
|
||||||
private Integer offset;
|
private Integer offset;
|
||||||
|
|
||||||
public Integer getLength() {
|
public Integer getLength() {
|
||||||
|
|
|
@ -1,27 +1,30 @@
|
||||||
package eu.eudat.data.query.definition.helpers;
|
package eu.eudat.data.query.definition.helpers;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class ColumnOrderings {
|
public class ColumnOrderings {
|
||||||
|
|
||||||
private String[] fields;
|
@ApiModelProperty(value = "fields", name = "fields", dataType = "List<String>", example = "[]")
|
||||||
|
private List<String> fields;
|
||||||
|
|
||||||
public String[] getFields() {
|
public List<String> getFields() {
|
||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFields(String[] fields) {
|
public void setFields(List<String> fields) {
|
||||||
this.fields = fields;
|
this.fields = fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ordering[] getFieldOrderings() {
|
public List<Ordering> getFieldOrderings() {
|
||||||
List<Ordering> orderings = new LinkedList<>();
|
List<Ordering> orderings = new LinkedList<>();
|
||||||
for (String field : fields) {
|
for (String field : fields) {
|
||||||
orderings.add(this.orderingFromString(field));
|
orderings.add(this.orderingFromString(field));
|
||||||
}
|
}
|
||||||
return orderings.toArray(new Ordering[orderings.size()]);
|
return orderings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Ordering orderingFromString(String field) {
|
private Ordering orderingFromString(String field) {
|
||||||
|
@ -34,6 +37,10 @@ public class ColumnOrderings {
|
||||||
ordering.fieldName(ordering.getFieldName().replace("|count|", "")).columnType(Ordering.ColumnType.COUNT);
|
ordering.fieldName(ordering.getFieldName().replace("|count|", "")).columnType(Ordering.ColumnType.COUNT);
|
||||||
else if (ordering.getFieldName().contains("|join|"))
|
else if (ordering.getFieldName().contains("|join|"))
|
||||||
ordering.fieldName(ordering.getFieldName().replace("|join|", "")).columnType(Ordering.ColumnType.JOIN_COLUMN);
|
ordering.fieldName(ordering.getFieldName().replace("|join|", "")).columnType(Ordering.ColumnType.JOIN_COLUMN);
|
||||||
|
else if (ordering.getFieldName().equals("asc"))
|
||||||
|
ordering.fieldName("label").orderByType(Ordering.OrderByType.ASC);
|
||||||
|
else if (ordering.getFieldName().equals("desc"))
|
||||||
|
ordering.fieldName("label").orderByType(Ordering.OrderByType.DESC);
|
||||||
return ordering;
|
return ordering;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package eu.eudat.data.query.definition.helpers;
|
package eu.eudat.data.query.definition.helpers;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
public class SelectionFields {
|
public class SelectionFields {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "fields", name = "fields", dataType = "String[]", example = "[]")
|
||||||
private String[] fields;
|
private String[] fields;
|
||||||
|
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package eu.eudat.data.query.items.dmpblueprint;
|
||||||
|
|
||||||
|
import eu.eudat.data.dao.criteria.DataManagementPlanBlueprintCriteria;
|
||||||
|
import eu.eudat.data.entities.DMPProfile;
|
||||||
|
import eu.eudat.data.query.PaginationService;
|
||||||
|
import eu.eudat.data.query.definition.TableQuery;
|
||||||
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class DataManagementPlanBlueprintTableRequest extends TableQuery<DataManagementPlanBlueprintCriteria, DMPProfile, UUID> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DMPProfile> applyCriteria() {
|
||||||
|
QueryableList<DMPProfile> query = this.getQuery();
|
||||||
|
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
|
||||||
|
query.where((builder, root) -> builder.like(root.get("label"), "%" + this.getCriteria().getLike() + "%"));
|
||||||
|
if (this.getCriteria().getStatus() != null)
|
||||||
|
query.where((builder, root) -> builder.equal(root.get("status"), this.getCriteria().getStatus()));
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryableList<DMPProfile> applyPaging(QueryableList<DMPProfile> items) {
|
||||||
|
return PaginationService.applyPaging(items, this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,25 +1,24 @@
|
||||||
package eu.eudat.data.query.items.item.datasetprofile;
|
package eu.eudat.data.query.items.item.datasetprofile;
|
||||||
|
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
import eu.eudat.data.query.PaginationService;
|
import eu.eudat.data.query.PaginationService;
|
||||||
import eu.eudat.data.query.definition.Query;
|
|
||||||
import eu.eudat.data.query.definition.TableQuery;
|
import eu.eudat.data.query.definition.TableQuery;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DatasetProfileAutocompleteRequest extends TableQuery<DatasetProfileCriteria,DatasetProfile, UUID> {
|
public class DatasetProfileAutocompleteRequest extends TableQuery<DatasetProfileCriteria, DescriptionTemplate, UUID> {
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> applyCriteria() {
|
public QueryableList<DescriptionTemplate> applyCriteria() {
|
||||||
QueryableList<DatasetProfile> query = this.getQuery();
|
QueryableList<DescriptionTemplate> query = this.getQuery();
|
||||||
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
|
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
|
||||||
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"));
|
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> applyPaging(QueryableList<DatasetProfile> items) {
|
public QueryableList<DescriptionTemplate> applyPaging(QueryableList<DescriptionTemplate> items) {
|
||||||
return PaginationService.applyPaging(items, this);
|
return PaginationService.applyPaging(items, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
package eu.eudat.data.query.items.item.datasetprofile;
|
package eu.eudat.data.query.items.item.datasetprofile;
|
||||||
|
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileWizardCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileWizardCriteria;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
import eu.eudat.data.query.definition.Query;
|
import eu.eudat.data.query.definition.Query;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import java.util.UUID;
|
public class DatasetProfileWizardAutocompleteRequest extends Query<DatasetProfileWizardCriteria, DescriptionTemplate> {
|
||||||
|
|
||||||
public class DatasetProfileWizardAutocompleteRequest extends Query<DatasetProfileWizardCriteria,DatasetProfile> {
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> applyCriteria() {
|
public QueryableList<DescriptionTemplate> applyCriteria() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
package eu.eudat.data.query.items.table.datasetprofile;
|
package eu.eudat.data.query.items.table.datasetprofile;
|
||||||
|
|
||||||
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
import eu.eudat.data.dao.criteria.DatasetProfileCriteria;
|
||||||
import eu.eudat.data.entities.DatasetProfile;
|
import eu.eudat.data.entities.DescriptionTemplate;
|
||||||
import eu.eudat.data.query.definition.TableQuery;
|
import eu.eudat.data.query.definition.TableQuery;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DatasetProfileTableRequestItem extends TableQuery<DatasetProfileCriteria, DatasetProfile, UUID> {
|
public class DatasetProfileTableRequestItem extends TableQuery<DatasetProfileCriteria, DescriptionTemplate, UUID> {
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> applyCriteria() {
|
public QueryableList<DescriptionTemplate> applyCriteria() {
|
||||||
QueryableList<DatasetProfile> query = this.getQuery();
|
QueryableList<DescriptionTemplate> query = this.getQuery();
|
||||||
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
|
if (this.getCriteria().getLike() != null && !this.getCriteria().getLike().isEmpty())
|
||||||
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"));
|
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + this.getCriteria().getLike().toUpperCase() + "%"));
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryableList<DatasetProfile> applyPaging(QueryableList<DatasetProfile> items) {
|
public QueryableList<DescriptionTemplate> applyPaging(QueryableList<DescriptionTemplate> items) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,13 @@ import java.util.UUID;
|
||||||
|
|
||||||
public class DatasetProfileQuery {
|
public class DatasetProfileQuery {
|
||||||
|
|
||||||
|
private UserQuery userQuery;
|
||||||
|
|
||||||
|
public UserQuery getUserQuery() {
|
||||||
|
return userQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserQuery(UserQuery userQuery) {
|
||||||
|
this.userQuery = userQuery;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,13 @@ public class DatasetCriteria extends Criteria {
|
||||||
private List<UUID> collaborators;
|
private List<UUID> collaborators;
|
||||||
private Boolean allowAllVersions;
|
private Boolean allowAllVersions;
|
||||||
private List<String> organiztions;
|
private List<String> organiztions;
|
||||||
|
private Boolean hasTags;
|
||||||
private List<Tag> tags;
|
private List<Tag> tags;
|
||||||
private boolean isPublic;
|
private boolean isPublic;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
|
private int offset;
|
||||||
|
private int size;
|
||||||
|
private List<SortCriteria> sortCriteria;
|
||||||
|
|
||||||
public String getLike() {
|
public String getLike() {
|
||||||
return like;
|
return like;
|
||||||
|
@ -117,4 +121,36 @@ public class DatasetCriteria extends Criteria {
|
||||||
public void setGrantStatus(Short grantStatus) {
|
public void setGrantStatus(Short grantStatus) {
|
||||||
this.grantStatus = grantStatus;
|
this.grantStatus = grantStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(int offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(int size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SortCriteria> getSortCriteria() {
|
||||||
|
return sortCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSortCriteria(List<SortCriteria> sortCriteria) {
|
||||||
|
this.sortCriteria = sortCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getHasTags() {
|
||||||
|
return hasTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasTags(Boolean hasTags) {
|
||||||
|
this.hasTags = hasTags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,16 @@ public class DmpCriteria extends Criteria {
|
||||||
private List<UUID> templates;
|
private List<UUID> templates;
|
||||||
private List<UUID> grants;
|
private List<UUID> grants;
|
||||||
private List<UUID> collaborators;
|
private List<UUID> collaborators;
|
||||||
|
private List<Integer> roles;
|
||||||
private List<UUID> organizations;
|
private List<UUID> organizations;
|
||||||
private boolean isPublic;
|
private boolean isPublic;
|
||||||
private List<UUID> groupIds;
|
private List<UUID> groupIds;
|
||||||
private boolean allowAllVersions;
|
private boolean allowAllVersions;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
|
private int offset;
|
||||||
|
private Integer size;
|
||||||
|
private List<SortCriteria> sortCriteria;
|
||||||
|
|
||||||
|
|
||||||
public String getLike() {
|
public String getLike() {
|
||||||
return like;
|
return like;
|
||||||
|
@ -55,6 +60,14 @@ public class DmpCriteria extends Criteria {
|
||||||
this.collaborators = collaborators;
|
this.collaborators = collaborators;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getRoles() {
|
||||||
|
return roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoles(List<Integer> roles) {
|
||||||
|
this.roles = roles;
|
||||||
|
}
|
||||||
|
|
||||||
public List<UUID> getOrganizations() {
|
public List<UUID> getOrganizations() {
|
||||||
return organizations;
|
return organizations;
|
||||||
}
|
}
|
||||||
|
@ -94,4 +107,28 @@ public class DmpCriteria extends Criteria {
|
||||||
public void setGrantStatus(Short grantStatus) {
|
public void setGrantStatus(Short grantStatus) {
|
||||||
this.grantStatus = grantStatus;
|
this.grantStatus = grantStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(int offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(Integer size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SortCriteria> getSortCriteria() {
|
||||||
|
return sortCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSortCriteria(List<SortCriteria> sortCriteria) {
|
||||||
|
this.sortCriteria = sortCriteria;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package eu.eudat.elastic.criteria;
|
||||||
|
|
||||||
|
public class SortCriteria {
|
||||||
|
public enum OrderByType {
|
||||||
|
ASC, DESC
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ColumnType {
|
||||||
|
COUNT, COLUMN, JOIN_COLUMN
|
||||||
|
}
|
||||||
|
|
||||||
|
private String fieldName;
|
||||||
|
private OrderByType orderByType;
|
||||||
|
private ColumnType columnType;
|
||||||
|
|
||||||
|
public String getFieldName() {
|
||||||
|
return fieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFieldName(String fieldName) {
|
||||||
|
this.fieldName = fieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderByType getOrderByType() {
|
||||||
|
return orderByType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderByType(OrderByType orderByType) {
|
||||||
|
this.orderByType = orderByType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColumnType getColumnType() {
|
||||||
|
return columnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnType(ColumnType columnType) {
|
||||||
|
this.columnType = columnType;
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,11 +4,11 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class Collaborator implements ElasticEntity<Collaborator> {
|
public class Collaborator implements ElasticEntity<Collaborator> {
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
|
private int role;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -26,11 +26,20 @@ public class Collaborator implements ElasticEntity<Collaborator> {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRole() {
|
||||||
|
return role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRole(int role) {
|
||||||
|
this.role = role;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
builder.field("id", this.id);
|
builder.field("id", this.id);
|
||||||
builder.field("name", this.name);
|
builder.field("name", this.name);
|
||||||
|
builder.field("role", this.role);
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +48,7 @@ public class Collaborator implements ElasticEntity<Collaborator> {
|
||||||
public Collaborator fromElasticEntity(Map fields) {
|
public Collaborator fromElasticEntity(Map fields) {
|
||||||
this.id = (String) fields.get("id");
|
this.id = (String) fields.get("id");
|
||||||
this.name = (String) fields.get("name");
|
this.name = (String) fields.get("name");
|
||||||
|
this.role = (int) fields.get("role");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -59,6 +60,9 @@ public class Dataset implements ElasticEntity<Dataset> {
|
||||||
private Boolean isPublic;
|
private Boolean isPublic;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
private String formData;
|
private String formData;
|
||||||
|
private Date created;
|
||||||
|
private Date modified;
|
||||||
|
private Date finalizedAt;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -188,6 +192,30 @@ public class Dataset implements ElasticEntity<Dataset> {
|
||||||
this.formData = formData;
|
this.formData = formData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getModified() {
|
||||||
|
return modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedAt() {
|
||||||
|
return finalizedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinalizedAt(Date finalizedAt) {
|
||||||
|
this.finalizedAt = finalizedAt;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
|
@ -197,10 +225,15 @@ public class Dataset implements ElasticEntity<Dataset> {
|
||||||
builder.field("template", this.template.toString());
|
builder.field("template", this.template.toString());
|
||||||
builder.field("status", this.status.toString());
|
builder.field("status", this.status.toString());
|
||||||
builder.field("dmp", this.dmp.toString());
|
builder.field("dmp", this.dmp.toString());
|
||||||
|
builder.field("created", this.created);
|
||||||
|
builder.field("modified", this.modified);
|
||||||
|
builder.field("finalizedAt", this.finalizedAt);
|
||||||
if (this.group != null) {
|
if (this.group != null) {
|
||||||
builder.field("group", this.group.toString());
|
builder.field("group", this.group.toString());
|
||||||
}
|
}
|
||||||
builder.field("grant", this.grant.toString());
|
if (this.grant != null) {
|
||||||
|
builder.field("grant", this.grant.toString());
|
||||||
|
}
|
||||||
if (collaborators != null) {
|
if (collaborators != null) {
|
||||||
builder.startArray("collaborators");
|
builder.startArray("collaborators");
|
||||||
this.collaborators.forEach(x -> {
|
this.collaborators.forEach(x -> {
|
||||||
|
@ -252,32 +285,48 @@ public class Dataset implements ElasticEntity<Dataset> {
|
||||||
@Override
|
@Override
|
||||||
public Dataset fromElasticEntity(Map<String, Object> fields) {
|
public Dataset fromElasticEntity(Map<String, Object> fields) {
|
||||||
if (fields != null) {
|
if (fields != null) {
|
||||||
this.id = (String) fields.get("id");
|
if (fields.size() == 1) {
|
||||||
if (fields.get("tags") != null) {
|
if (fields.containsKey("id")) {
|
||||||
this.tags = ((List<HashMap>) fields.get("tags")).stream().map(hashMap -> new Tag().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
this.id = (String) fields.get("id");
|
||||||
|
} else if (fields.containsKey("tags")) {
|
||||||
|
this.tags = ((List<HashMap>) fields.get("tags")).stream().map(hashMap -> new Tag().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}else if (fields.size() > 1) {
|
||||||
|
this.id = (String) fields.get("id");
|
||||||
|
if (fields.get("tags") != null) {
|
||||||
|
this.tags = ((List<HashMap>) fields.get("tags")).stream().map(hashMap -> new Tag().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
this.label = (String) fields.get("label");
|
||||||
|
this.description = (String) fields.get("description");
|
||||||
|
this.template = UUID.fromString((String) fields.get("template"));
|
||||||
|
this.status = Short.valueOf((String) fields.get("status"));
|
||||||
|
this.dmp = UUID.fromString((String) fields.get("dmp"));
|
||||||
|
this.group = UUID.fromString((String) fields.get("group"));
|
||||||
|
if (fields.get("grant") != null) {
|
||||||
|
this.grant = UUID.fromString((String) fields.get("grant"));
|
||||||
|
}
|
||||||
|
if (fields.get("created") != null)
|
||||||
|
this.created = Date.from(Instant.parse((String) fields.get("created")));
|
||||||
|
if (fields.get("modified") != null)
|
||||||
|
this.modified = Date.from(Instant.parse((String) fields.get("modified")));
|
||||||
|
if (fields.get("finalizedAt") != null)
|
||||||
|
this.finalizedAt = Date.from(Instant.parse((String) fields.get("finalizedAt")));
|
||||||
|
if (fields.get("collaborators") != null) {
|
||||||
|
this.collaborators = ((List<HashMap>) fields.get("collaborators")).stream().map(hashMap -> new Collaborator().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
this.lastVersion = Boolean.parseBoolean((String) fields.get("lastVersion"));
|
||||||
|
this.lastPublicVersion = Boolean.parseBoolean((String) fields.get("lastPublicVersion"));
|
||||||
|
if (fields.get("organizations") != null) {
|
||||||
|
this.organizations = ((List<HashMap>) fields.get("organizations")).stream().map(hashMap -> new Organization().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (fields.get("public") != null) {
|
||||||
|
this.isPublic = Boolean.valueOf((String) fields.get("public"));
|
||||||
|
}
|
||||||
|
if (fields.get("grantStatus") != null) {
|
||||||
|
this.grantStatus = Short.valueOf((String) fields.get("grantStatus"));
|
||||||
|
}
|
||||||
|
this.formData = (String) fields.get("formData");
|
||||||
}
|
}
|
||||||
this.label = (String) fields.get("label");
|
|
||||||
this.description = (String) fields.get("description");
|
|
||||||
this.template = UUID.fromString((String) fields.get("template"));
|
|
||||||
this.status = Short.valueOf((String) fields.get("status"));
|
|
||||||
this.dmp = UUID.fromString((String) fields.get("dmp"));
|
|
||||||
this.group = UUID.fromString((String) fields.get("group"));
|
|
||||||
this.grant = UUID.fromString((String) fields.get("grant"));
|
|
||||||
if (fields.get("collaborators") != null) {
|
|
||||||
this.collaborators = ((List<HashMap>) fields.get("collaborators")).stream().map(hashMap -> new Collaborator().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
this.lastVersion = Boolean.parseBoolean((String) fields.get("lastVersion"));
|
|
||||||
this.lastPublicVersion = Boolean.parseBoolean((String) fields.get("lastPublicVersion"));
|
|
||||||
if (fields.get("organizations") != null) {
|
|
||||||
this.organizations = ((List<HashMap>) fields.get("organizations")).stream().map(hashMap -> new Organization().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
if (fields.get("public") != null) {
|
|
||||||
this.isPublic = Boolean.valueOf((String) fields.get("public"));
|
|
||||||
}
|
|
||||||
if (fields.get("grantStatus") != null) {
|
|
||||||
this.grantStatus = Short.valueOf((String) fields.get("grantStatus"));
|
|
||||||
}
|
|
||||||
this.formData = (String) fields.get("formData");
|
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
package eu.eudat.elastic.entities;
|
package eu.eudat.elastic.entities;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DatasetTempalate implements ElasticEntity<DatasetTempalate> {
|
public class DatasetTempalate implements ElasticEntity<DatasetTempalate> {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String name;
|
private String name;
|
||||||
|
private Map<String, Object> data;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -26,11 +30,25 @@ public class DatasetTempalate implements ElasticEntity<DatasetTempalate> {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(Map<String, Object> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
builder.field("id", this.id.toString());
|
builder.field("id", this.id.toString());
|
||||||
builder.field("name", this.name);
|
builder.field("name", this.name);
|
||||||
|
if(this.data != null) {
|
||||||
|
builder.field("data", new ObjectMapper().writeValueAsString(this.data));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
builder.field("data", "");
|
||||||
|
}
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +57,12 @@ public class DatasetTempalate implements ElasticEntity<DatasetTempalate> {
|
||||||
public DatasetTempalate fromElasticEntity(Map<String, Object> fields) {
|
public DatasetTempalate fromElasticEntity(Map<String, Object> fields) {
|
||||||
this.id = UUID.fromString((String) fields.get("id"));
|
this.id = UUID.fromString((String) fields.get("id"));
|
||||||
this.name = (String) fields.get("name");
|
this.name = (String) fields.get("name");
|
||||||
|
try {
|
||||||
|
this.data = new ObjectMapper().readValue((String) fields.get("data"), new TypeReference<Map<String, Object>>() {});
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
this.data = new HashMap<>();
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,8 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class Dmp implements ElasticEntity<Dmp> {
|
public class Dmp implements ElasticEntity<Dmp> {
|
||||||
|
@ -55,6 +53,11 @@ public class Dmp implements ElasticEntity<Dmp> {
|
||||||
private List<Dataset> datasets;
|
private List<Dataset> datasets;
|
||||||
private UUID grant;
|
private UUID grant;
|
||||||
private Short grantStatus;
|
private Short grantStatus;
|
||||||
|
private Date created;
|
||||||
|
private Date modified;
|
||||||
|
private Date finalizedAt;
|
||||||
|
private Date publishedAt;
|
||||||
|
private List<Doi> dois;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -168,6 +171,46 @@ public class Dmp implements ElasticEntity<Dmp> {
|
||||||
this.grantStatus = grantStatus;
|
this.grantStatus = grantStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(Date created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getModified() {
|
||||||
|
return modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModified(Date modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFinalizedAt() {
|
||||||
|
return finalizedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinalizedAt(Date finalizedAt) {
|
||||||
|
this.finalizedAt = finalizedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPublishedAt() {
|
||||||
|
return publishedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublishedAt(Date publishedAt) {
|
||||||
|
this.publishedAt = publishedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Doi> getDois() {
|
||||||
|
return dois;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDois(List<Doi> dois) {
|
||||||
|
this.dois = dois;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
||||||
builder.startObject();
|
builder.startObject();
|
||||||
|
@ -233,37 +276,74 @@ public class Dmp implements ElasticEntity<Dmp> {
|
||||||
builder.field(MapKey.GRANT.getName(), this.grant.toString());
|
builder.field(MapKey.GRANT.getName(), this.grant.toString());
|
||||||
}
|
}
|
||||||
builder.field(MapKey.GRANTSTATUS.getName(), this.grantStatus);
|
builder.field(MapKey.GRANTSTATUS.getName(), this.grantStatus);
|
||||||
|
builder.field(MapKey.CREATED.getName(), this.created);
|
||||||
|
builder.field(MapKey.MODIFIED.getName(), this.modified);
|
||||||
|
builder.field(MapKey.FINALIZEDAT.getName(), this.finalizedAt);
|
||||||
|
builder.field(MapKey.PUBLISHEDAT.getName(), this.publishedAt);
|
||||||
|
if (this.dois != null && !this.dois.isEmpty()) {
|
||||||
|
builder.startArray(MapKey.DOIS.getName());
|
||||||
|
this.dois.forEach(doi -> {
|
||||||
|
try {
|
||||||
|
doi.toElasticEntity(builder);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.endArray();
|
||||||
|
}
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dmp fromElasticEntity(Map<String, Object> fields) {
|
public Dmp fromElasticEntity(Map<String, Object> fields) {
|
||||||
|
if (fields == null || fields.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
this.id = UUID.fromString((String) fields.get(MapKey.ID.getName()));
|
this.id = UUID.fromString((String) fields.get(MapKey.ID.getName()));
|
||||||
this.label = (String) fields.get(MapKey.LABEL.getName());
|
if (fields.size() > 1) {
|
||||||
this.description = (String) fields.get(MapKey.DESCRIPTION.getName());
|
this.label = (String) fields.get(MapKey.LABEL.getName());
|
||||||
if (fields.get(MapKey.GROUPID.getName()) != null) {
|
this.description = (String) fields.get(MapKey.DESCRIPTION.getName());
|
||||||
this.groupId = UUID.fromString((String) fields.get(MapKey.GROUPID.getName()));
|
if (fields.get(MapKey.GROUPID.getName()) != null) {
|
||||||
}
|
this.groupId = UUID.fromString((String) fields.get(MapKey.GROUPID.getName()));
|
||||||
this.status = Short.valueOf(fields.get(MapKey.STATUS.getName()).toString());
|
}
|
||||||
if (fields.get(MapKey.TEMPLATES.getName()) != null) {
|
this.status = Short.valueOf(fields.get(MapKey.STATUS.getName()).toString());
|
||||||
this.templates = ((List<HashMap<String, Object>>) fields.get(MapKey.TEMPLATES.getName())).stream().map(hashMap -> new DatasetTempalate().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
if (fields.get(MapKey.TEMPLATES.getName()) != null) {
|
||||||
}
|
this.templates = ((List<HashMap<String, Object>>) fields.get(MapKey.TEMPLATES.getName())).stream().map(hashMap -> new DatasetTempalate().fromElasticEntity(hashMap)).collect(Collectors.toList());
|
||||||
if (fields.get(MapKey.COLLABORATORS.getName()) != null) {
|
}
|
||||||
this.collaborators = ((List<HashMap<String, Object>>) fields.get(MapKey.COLLABORATORS.getName())).stream().map(map -> new Collaborator().fromElasticEntity(map)).collect(Collectors.toList());
|
if (fields.get(MapKey.COLLABORATORS.getName()) != null) {
|
||||||
}
|
this.collaborators = ((List<HashMap<String, Object>>) fields.get(MapKey.COLLABORATORS.getName())).stream().map(map -> new Collaborator().fromElasticEntity(map)).collect(Collectors.toList());
|
||||||
if (fields.get(MapKey.ORGANIZATIONS.getName()) != null) {
|
}
|
||||||
this.organizations = ((List<HashMap<String, Object>>) fields.get(MapKey.ORGANIZATIONS.getName())).stream().map(map -> new Organization().fromElasticEntity(map)).collect(Collectors.toList());
|
if (fields.get(MapKey.ORGANIZATIONS.getName()) != null) {
|
||||||
}
|
this.organizations = ((List<HashMap<String, Object>>) fields.get(MapKey.ORGANIZATIONS.getName())).stream().map(map -> new Organization().fromElasticEntity(map)).collect(Collectors.toList());
|
||||||
this.lastVersion = (Boolean) fields.get(MapKey.LASTVERSION.getName());
|
}
|
||||||
this.lastPublicVersion = (Boolean) fields.get(MapKey.LASTPUBLICVERSION.getName());
|
this.lastVersion = (Boolean) fields.get(MapKey.LASTVERSION.getName());
|
||||||
this.isPublic = (Boolean) fields.get(MapKey.ISPUBLIC.getName());
|
this.lastPublicVersion = (Boolean) fields.get(MapKey.LASTPUBLICVERSION.getName());
|
||||||
if (fields.get(MapKey.DATASETS.getName()) != null) {
|
this.isPublic = (Boolean) fields.get(MapKey.ISPUBLIC.getName());
|
||||||
this.datasets = ((List<HashMap<String, Object>>) fields.get(MapKey.DATASETS.getName())).stream().map(map -> new Dataset().fromElasticEntity(map)).collect(Collectors.toList());
|
if (fields.get(MapKey.DATASETS.getName()) != null) {
|
||||||
}
|
this.datasets = ((List<HashMap<String, Object>>) fields.get(MapKey.DATASETS.getName())).stream().map(map -> new Dataset().fromElasticEntity(map)).collect(Collectors.toList());
|
||||||
this.grant = UUID.fromString((String) fields.get(MapKey.GRANT.getName()));
|
}
|
||||||
if (fields.get(MapKey.GRANTSTATUS.getName()) != null) {
|
if (fields.containsKey(MapKey.GRANT.getName()) && fields.get(MapKey.GRANT.getName()) != null) {
|
||||||
this.grantStatus = Short.valueOf(fields.get(MapKey.GRANTSTATUS.getName()).toString());
|
this.grant = UUID.fromString((String) fields.get(MapKey.GRANT.getName()));
|
||||||
|
}
|
||||||
|
if (fields.get(MapKey.GRANTSTATUS.getName()) != null) {
|
||||||
|
this.grantStatus = Short.valueOf(fields.get(MapKey.GRANTSTATUS.getName()).toString());
|
||||||
|
}
|
||||||
|
if (fields.containsKey(MapKey.CREATED.getName())) {
|
||||||
|
this.created = Date.from(Instant.parse(fields.get(MapKey.CREATED.getName()).toString()));
|
||||||
|
}
|
||||||
|
if (fields.containsKey(MapKey.MODIFIED.getName())) {
|
||||||
|
this.modified = Date.from(Instant.parse(fields.get(MapKey.MODIFIED.getName()).toString()));
|
||||||
|
}
|
||||||
|
if (fields.get(MapKey.FINALIZEDAT.getName()) != null) {
|
||||||
|
this.finalizedAt = Date.from(Instant.parse(fields.get(MapKey.FINALIZEDAT.getName()).toString()));
|
||||||
|
}
|
||||||
|
if (fields.get(MapKey.PUBLISHEDAT.getName()) != null) {
|
||||||
|
this.publishedAt = Date.from(Instant.parse(fields.get(MapKey.PUBLISHEDAT.getName()).toString()));
|
||||||
|
}
|
||||||
|
if (fields.get(MapKey.DOIS.getName()) != null) {
|
||||||
|
this.dois = ((List<HashMap<String, Object>>) fields.get(MapKey.DOIS.getName())).stream().map(map -> new Doi().fromElasticEntity(map)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +362,12 @@ public class Dmp implements ElasticEntity<Dmp> {
|
||||||
ISPUBLIC ("isPublic"),
|
ISPUBLIC ("isPublic"),
|
||||||
DATASETS ("datasets"),
|
DATASETS ("datasets"),
|
||||||
GRANT ("grant"),
|
GRANT ("grant"),
|
||||||
GRANTSTATUS ("grantStatus");
|
GRANTSTATUS ("grantStatus"),
|
||||||
|
CREATED ("created"),
|
||||||
|
MODIFIED ("modified"),
|
||||||
|
FINALIZEDAT ("finalizedAt"),
|
||||||
|
PUBLISHEDAT ("publishedAt"),
|
||||||
|
DOIS ("dois");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
package eu.eudat.elastic.entities;
|
||||||
|
|
||||||
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class Doi implements ElasticEntity<Doi>{
|
||||||
|
private UUID id;
|
||||||
|
private String repositoryId;
|
||||||
|
private String doi;
|
||||||
|
private UUID dmp;
|
||||||
|
|
||||||
|
public UUID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(UUID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRepositoryId() {
|
||||||
|
return repositoryId;
|
||||||
|
}
|
||||||
|
public void setRepositoryId(String repositoryId) {
|
||||||
|
this.repositoryId = repositoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDoi() {
|
||||||
|
return doi;
|
||||||
|
}
|
||||||
|
public void setDoi(String doi) {
|
||||||
|
this.doi = doi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID getDmp() {
|
||||||
|
return dmp;
|
||||||
|
}
|
||||||
|
public void setDmp(UUID dmp) {
|
||||||
|
this.dmp = dmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XContentBuilder toElasticEntity(XContentBuilder builder) throws IOException {
|
||||||
|
builder.startObject();
|
||||||
|
builder.field("id", this.id.toString());
|
||||||
|
builder.field("repositoryId", this.repositoryId);
|
||||||
|
builder.field("doi", this.doi);
|
||||||
|
builder.field("dmp", this.dmp.toString());
|
||||||
|
builder.endObject();
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Doi fromElasticEntity(Map<String, Object> fields) {
|
||||||
|
if (fields == null || fields.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
this.id = UUID.fromString((String) fields.get("id"));
|
||||||
|
this.repositoryId = (String) fields.get("repositoryId");
|
||||||
|
this.doi = (String) fields.get("doi");
|
||||||
|
this.dmp = UUID.fromString((String) fields.get("dmp"));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,8 +24,13 @@ import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters;
|
||||||
import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder;
|
import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder;
|
||||||
import org.elasticsearch.search.aggregations.bucket.nested.ParsedNested;
|
import org.elasticsearch.search.aggregations.bucket.nested.ParsedNested;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
|
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
||||||
|
import org.elasticsearch.search.sort.SortBuilder;
|
||||||
|
import org.elasticsearch.search.sort.SortBuilders;
|
||||||
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -37,10 +42,12 @@ import java.util.stream.Stream;
|
||||||
public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteria> {
|
public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteria> {
|
||||||
|
|
||||||
private final DmpRepository dmpRepository;
|
private final DmpRepository dmpRepository;
|
||||||
|
private final Environment environment;
|
||||||
|
|
||||||
public DatasetRepository(RestHighLevelClient client, DmpRepository dmpRepository) {
|
public DatasetRepository(RestHighLevelClient client, DmpRepository dmpRepository, Environment environment) {
|
||||||
super(client);
|
super(client);
|
||||||
this.dmpRepository = dmpRepository;
|
this.dmpRepository = dmpRepository;
|
||||||
|
this.environment = environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,24 +55,26 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
XContentBuilder builder = XContentFactory.jsonBuilder();
|
XContentBuilder builder = XContentFactory.jsonBuilder();
|
||||||
Dmp dmp = this.dmpRepository.findDocument(entity.getDmp().toString());
|
Dmp dmp = this.dmpRepository.findDocument(entity.getDmp().toString());
|
||||||
boolean found = false;
|
if (dmp != null) {
|
||||||
if (dmp.getDatasets() != null && !dmp.getDatasets().isEmpty()) {
|
boolean found = false;
|
||||||
for (int i = 0; i < dmp.getDatasets().size(); i++) {
|
if (dmp.getDatasets() != null && !dmp.getDatasets().isEmpty()) {
|
||||||
if (dmp.getDatasets().get(i).getId().equals(entity.getId())) {
|
for (int i = 0; i < dmp.getDatasets().size(); i++) {
|
||||||
dmp.getDatasets().set(i, entity);
|
if (dmp.getDatasets().get(i).getId().equals(entity.getId())) {
|
||||||
found = true;
|
dmp.getDatasets().set(i, entity);
|
||||||
break;
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!found) {
|
||||||
if (!found) {
|
if (dmp.getDatasets() == null) {
|
||||||
if (dmp.getDatasets() == null) {
|
dmp.setDatasets(new ArrayList<>());
|
||||||
dmp.setDatasets(new ArrayList<>());
|
}
|
||||||
|
dmp.getDatasets().add(entity);
|
||||||
}
|
}
|
||||||
dmp.getDatasets().add(entity);
|
IndexRequest request = new IndexRequest(this.environment.getProperty("elasticsearch.index")).id(dmp.getId().toString()).source(dmp.toElasticEntity(builder));//new IndexRequest("datasets", "doc", entity.getId()).source(entity.toElasticEntity(builder));
|
||||||
|
this.getClient().index(request, RequestOptions.DEFAULT);
|
||||||
}
|
}
|
||||||
IndexRequest request = new IndexRequest("dmps").id(dmp.getId().toString()).source(dmp.toElasticEntity(builder));//new IndexRequest("datasets", "doc", entity.getId()).source(entity.toElasticEntity(builder));
|
|
||||||
this.getClient().index(request, RequestOptions.DEFAULT);
|
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -74,7 +83,7 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
@Override
|
@Override
|
||||||
public Dataset findDocument(String id) throws IOException {
|
public Dataset findDocument(String id) throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
SearchRequest searchRequest = new SearchRequest("dmps");
|
SearchRequest searchRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().should(QueryBuilders.termQuery("datasets.id.keyword", id));
|
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().should(QueryBuilders.termQuery("datasets.id.keyword", id));
|
||||||
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery( "datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder());
|
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery( "datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder());
|
||||||
|
@ -95,7 +104,7 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
@Override
|
@Override
|
||||||
public List<Dataset> query(DatasetCriteria criteria) throws IOException {
|
public List<Dataset> query(DatasetCriteria criteria) throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
SearchRequest searchRequest = new SearchRequest("dmps");
|
SearchRequest searchRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
|
|
||||||
/*CountRequest countRequest = new CountRequest("dmps").routing("datasets").routing("id");
|
/*CountRequest countRequest = new CountRequest("dmps").routing("datasets").routing("id");
|
||||||
|
@ -103,7 +112,7 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
CountResponse countResponse = getClient().count(countRequest, RequestOptions.DEFAULT);
|
CountResponse countResponse = getClient().count(countRequest, RequestOptions.DEFAULT);
|
||||||
Long count = countResponse.getCount();*/
|
Long count = countResponse.getCount();*/
|
||||||
|
|
||||||
SearchRequest countRequest = new SearchRequest("dmps");
|
SearchRequest countRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
NestedAggregationBuilder nestedAggregationBuilder = AggregationBuilders.nested("by_dataset", "datasets");
|
NestedAggregationBuilder nestedAggregationBuilder = AggregationBuilders.nested("by_dataset", "datasets");
|
||||||
FiltersAggregationBuilder filtersAggregationBuilder = AggregationBuilders.filters("dataset_query", QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status.keyword", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList()))));
|
FiltersAggregationBuilder filtersAggregationBuilder = AggregationBuilders.filters("dataset_query", QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status.keyword", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList()))));
|
||||||
nestedAggregationBuilder.subAggregation(filtersAggregationBuilder);
|
nestedAggregationBuilder.subAggregation(filtersAggregationBuilder);
|
||||||
|
@ -116,70 +125,33 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
|
|
||||||
searchSourceBuilder.size(count.intValue());
|
searchSourceBuilder.size(count.intValue());
|
||||||
|
|
||||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList())));
|
List<SortBuilder> sortBuilders = new ArrayList<>();
|
||||||
if (criteria.isPublic()) {
|
BoolQueryBuilder boolQuery = createBoolQuery(criteria);
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.public", "true"));
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.status", Dataset.Status.FINALISED.getValue()));
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.lastPublicVersion", "true"));
|
if (criteria.getSortCriteria() != null && !criteria.getSortCriteria().isEmpty()) {
|
||||||
}
|
criteria.getSortCriteria().forEach(sortCriteria -> {
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) {
|
switch(sortCriteria.getColumnType()) {
|
||||||
boolQuery = boolQuery.should(QueryBuilders.queryStringQuery(criteria.getLike()).allowLeadingWildcard(true).fields(Stream.of(new Object[][]{
|
case COLUMN:
|
||||||
{"datasets.label", 1.0f},
|
sortBuilders.add(SortBuilders.fieldSort("datasets." + sortCriteria.getFieldName()).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
{"datasets.description", 1.0f},
|
break;
|
||||||
{"datasets.formData", 1.0f}
|
case JOIN_COLUMN:
|
||||||
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Float) data[1]))));
|
List<String> fields = Arrays.asList(sortCriteria.getFieldName().split(":"));
|
||||||
|
fields.stream().filter(name -> !name.startsWith("dmp")).forEach(field -> {
|
||||||
|
sortBuilders.add(SortBuilders.fieldSort(field).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (criteria.getDatasetTemplates() != null && criteria.getDatasetTemplates().size() > 0) {
|
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.tags"}, null)).setSize(this.environment.getProperty("elasticsearch.innerHitsSize", Integer.class)));
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.template", criteria.getDatasetTemplates().stream().map(UUID::toString).collect(Collectors.toList())));
|
searchSourceBuilder.query(nestedQueryBuilder)/*.from(criteria.getOffset())*/.fetchSource("datasets.tags", null);
|
||||||
}
|
/*if (criteria.getSize() > 0) {
|
||||||
|
searchSourceBuilder.size(criteria.getSize());
|
||||||
if (criteria.getStatus() != null) {
|
}*/
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.status", criteria.getStatus().toString()));
|
sortBuilders.forEach(searchSourceBuilder::sort);
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getDmps() != null && criteria.getDmps().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.dmp", criteria.getDmps().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getGroupIds() != null && criteria.getGroupIds().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.group", criteria.getGroupIds().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getGrants() != null && criteria.getGrants().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.grant", criteria.getGrants().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getGrantStatus() != null) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.grantStatus", criteria.getGrantStatus().toString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getCollaborators() != null && criteria.getCollaborators().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.collaborators.id", criteria.getCollaborators().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!criteria.isPublic()) {
|
|
||||||
if (criteria.getAllowAllVersions() != null && !criteria.getAllowAllVersions()) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.lastVersion", "true"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getOrganiztions() != null && criteria.getOrganiztions().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.organizations.id", criteria.getOrganiztions()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getTags() != null && criteria.getTags().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.tags.name", criteria.getTags().stream().map(Tag::getName).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (boolQuery.should().isEmpty() && boolQuery.mustNot().isEmpty()) {
|
|
||||||
boolQuery.should(QueryBuilders.matchAllQuery());
|
|
||||||
} else {
|
|
||||||
boolQuery.minimumShouldMatch(boolQuery.should().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.Avg).innerHit(new InnerHitBuilder());
|
|
||||||
searchSourceBuilder.query(nestedQueryBuilder);
|
|
||||||
searchRequest.source(searchSourceBuilder);
|
searchRequest.source(searchSourceBuilder);
|
||||||
SearchResponse response = this.getClient().search(searchRequest, RequestOptions.DEFAULT);
|
SearchResponse response = this.getClient().search(searchRequest, RequestOptions.DEFAULT);
|
||||||
return ((Stream<Dataset>)Arrays.stream(response.getHits().getHits())
|
return ((Stream<Dataset>)Arrays.stream(response.getHits().getHits())
|
||||||
|
@ -190,10 +162,172 @@ public class DatasetRepository extends ElasticRepository<Dataset, DatasetCriteri
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Dataset> queryIds(DatasetCriteria criteria) throws IOException {
|
||||||
|
if (this.getClient() != null) {
|
||||||
|
SearchRequest searchRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
|
|
||||||
|
/*CountRequest countRequest = new CountRequest("dmps").routing("datasets").routing("id");
|
||||||
|
countRequest.query(QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status.keyword", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList()))));
|
||||||
|
CountResponse countResponse = getClient().count(countRequest, RequestOptions.DEFAULT);
|
||||||
|
Long count = countResponse.getCount();*/
|
||||||
|
|
||||||
|
SearchRequest countRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
|
NestedAggregationBuilder nestedAggregationBuilder = AggregationBuilders.nested("by_dataset", "datasets");
|
||||||
|
FiltersAggregationBuilder filtersAggregationBuilder = AggregationBuilders.filters("dataset_query", QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status.keyword", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList()))));
|
||||||
|
nestedAggregationBuilder.subAggregation(filtersAggregationBuilder);
|
||||||
|
SearchSourceBuilder countSourceBuilder = new SearchSourceBuilder();
|
||||||
|
countSourceBuilder.aggregation(nestedAggregationBuilder);
|
||||||
|
countRequest.source(countSourceBuilder);
|
||||||
|
SearchResponse countResponse = getClient().search(countRequest, RequestOptions.DEFAULT);
|
||||||
|
Long count = ((ParsedFilters)((ParsedNested)countResponse.getAggregations().asMap().get("by_dataset")).getAggregations().get("dataset_query")).getBuckets().get(0).getDocCount();
|
||||||
|
|
||||||
|
|
||||||
|
searchSourceBuilder.size(count.intValue());
|
||||||
|
|
||||||
|
List<SortBuilder> sortBuilders = new ArrayList<>();
|
||||||
|
BoolQueryBuilder boolQuery = createBoolQuery(criteria);
|
||||||
|
|
||||||
|
|
||||||
|
if (criteria.getSortCriteria() != null && !criteria.getSortCriteria().isEmpty()) {
|
||||||
|
criteria.getSortCriteria().forEach(sortCriteria -> {
|
||||||
|
switch(sortCriteria.getColumnType()) {
|
||||||
|
case COLUMN:
|
||||||
|
sortBuilders.add(SortBuilders.fieldSort("datasets." + sortCriteria.getFieldName()).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
|
break;
|
||||||
|
case JOIN_COLUMN:
|
||||||
|
List<String> fields = Arrays.asList(sortCriteria.getFieldName().split(":"));
|
||||||
|
fields.stream().filter(name -> !name.startsWith("dmp")).forEach(field -> {
|
||||||
|
sortBuilders.add(SortBuilders.fieldSort(field).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.None).innerHit(new InnerHitBuilder().setFetchSourceContext(new FetchSourceContext(true, new String[]{"datasets.id"}, null)).setSize(this.environment.getProperty("elasticsearch.innerHitsSize", Integer.class)));
|
||||||
|
searchSourceBuilder.query(nestedQueryBuilder)/*.from(criteria.getOffset()).size(criteria.getSize())*/.fetchSource("datasets.id", null);
|
||||||
|
sortBuilders.forEach(searchSourceBuilder::sort);
|
||||||
|
searchRequest.source(searchSourceBuilder);
|
||||||
|
SearchResponse response = this.getClient().search(searchRequest, RequestOptions.DEFAULT);
|
||||||
|
return ((Stream<Dataset>)Arrays.stream(response.getHits().getHits())
|
||||||
|
.map(hit -> hit.getInnerHits().values()).flatMap(Collection::stream)
|
||||||
|
.map(SearchHits::getHits).flatMap(Arrays::stream)
|
||||||
|
.map(x -> new Dataset().fromElasticEntity(this.transformFromString(x.getSourceAsString(), Map.class)))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long count(DatasetCriteria criteria) throws IOException {
|
||||||
|
if (this.getClient() != null) {
|
||||||
|
//CountRequest countRequest = new CountRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
|
|
||||||
|
SearchRequest countRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
|
BoolQueryBuilder boolQuery = createBoolQuery(criteria);
|
||||||
|
NestedAggregationBuilder nestedAggregationBuilder = AggregationBuilders.nested("by_dataset", "datasets");
|
||||||
|
FiltersAggregationBuilder filtersAggregationBuilder = AggregationBuilders.filters("dataset_query", boolQuery);
|
||||||
|
nestedAggregationBuilder.subAggregation(filtersAggregationBuilder);
|
||||||
|
SearchSourceBuilder countSourceBuilder = new SearchSourceBuilder();
|
||||||
|
countSourceBuilder.aggregation(nestedAggregationBuilder);
|
||||||
|
countRequest.source(countSourceBuilder);
|
||||||
|
SearchResponse countResponse = getClient().search(countRequest, RequestOptions.DEFAULT);
|
||||||
|
return ((ParsedFilters)((ParsedNested)countResponse.getAggregations().asMap().get("by_dataset")).getAggregations().get("dataset_query")).getBuckets().get(0).getDocCount();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*NestedQueryBuilder nestedQueryBuilder = QueryBuilders.nestedQuery("datasets", boolQuery, ScoreMode.None).innerHit(new InnerHitBuilder());
|
||||||
|
countRequest.query(nestedQueryBuilder);
|
||||||
|
CountResponse response = this.getClient().count(countRequest, RequestOptions.DEFAULT);
|
||||||
|
return response.getCount();*/
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BoolQueryBuilder createBoolQuery(DatasetCriteria criteria) {
|
||||||
|
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery("datasets.status", Stream.of(Dataset.Status.DELETED.getValue(), Dataset.Status.CANCELED.getValue()).collect(Collectors.toList())));
|
||||||
|
if (criteria.isPublic()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.public", "true"));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.status", Dataset.Status.FINALISED.getValue()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.lastPublicVersion", "true"));
|
||||||
|
}
|
||||||
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.queryStringQuery(criteria.getLike()).allowLeadingWildcard(true).fields(Stream.of(new Object[][]{
|
||||||
|
{"datasets.label", 1.0f},
|
||||||
|
{"datasets.description", 1.0f},
|
||||||
|
{"datasets.formData", 1.0f}
|
||||||
|
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Float) data[1]))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getDatasetTemplates() != null && criteria.getDatasetTemplates().size() > 0) {
|
||||||
|
criteria.setDatasetTemplates(criteria.getDatasetTemplates().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.template", criteria.getDatasetTemplates().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getStatus() != null) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.status", criteria.getStatus().toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getDmps() != null && criteria.getDmps().size() > 0) {
|
||||||
|
criteria.setDmps(criteria.getDmps().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.dmp", criteria.getDmps().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGroupIds() != null && criteria.getGroupIds().size() > 0) {
|
||||||
|
criteria.setGroupIds(criteria.getGroupIds().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.group", criteria.getGroupIds().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGrants() != null && criteria.getGrants().size() > 0) {
|
||||||
|
criteria.setGrants(criteria.getGrants().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.grant", criteria.getGrants().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGrantStatus() != null) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.grantStatus", criteria.getGrantStatus().toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getCollaborators() != null && criteria.getCollaborators().size() > 0) {
|
||||||
|
criteria.setCollaborators(criteria.getCollaborators().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.collaborators.id.keyword", criteria.getCollaborators().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!criteria.isPublic()) {
|
||||||
|
if (criteria.getAllowAllVersions() != null && !criteria.getAllowAllVersions()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery("datasets.lastVersion", "true"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getOrganiztions() != null && criteria.getOrganiztions().size() > 0) {
|
||||||
|
criteria.setOrganiztions(criteria.getOrganiztions().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.organizations.id", criteria.getOrganiztions()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getTags() != null && criteria.getTags().size() > 0) {
|
||||||
|
criteria.setTags(criteria.getTags().stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery("datasets.tags.name", criteria.getTags().stream().map(Tag::getName).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getHasTags() != null) {
|
||||||
|
boolQuery = criteria.getHasTags() == true ? boolQuery.should(QueryBuilders.existsQuery("datasets.tags.id")) : boolQuery.mustNot(QueryBuilders.existsQuery("datasets.tags.id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (boolQuery.should().isEmpty() && boolQuery.mustNot().isEmpty()) {
|
||||||
|
boolQuery.should(QueryBuilders.matchAllQuery());
|
||||||
|
} else {
|
||||||
|
boolQuery.minimumShouldMatch(boolQuery.should().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return boolQuery;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean exists() throws IOException {
|
public boolean exists() throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
GetIndexRequest request = new GetIndexRequest("dmps");
|
GetIndexRequest request = new GetIndexRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
// request.indices("datasets");
|
// request.indices("datasets");
|
||||||
return this.getClient().indices().exists(request, RequestOptions.DEFAULT);
|
return this.getClient().indices().exists(request, RequestOptions.DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,13 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||||
|
import org.elasticsearch.search.sort.SortBuilder;
|
||||||
|
import org.elasticsearch.search.sort.SortBuilders;
|
||||||
|
import org.elasticsearch.search.sort.SortOrder;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -37,9 +41,12 @@ import java.util.stream.Stream;
|
||||||
public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DmpRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(DmpRepository.class);
|
||||||
|
|
||||||
|
private final Environment environment;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DmpRepository(RestHighLevelClient client) {
|
public DmpRepository(RestHighLevelClient client, Environment environment) {
|
||||||
super(client);
|
super(client);
|
||||||
|
this.environment = environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateMapping() throws IOException {
|
private void generateMapping() throws IOException {
|
||||||
|
@ -52,7 +59,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
PutMappingRequest putMappingRequest = new PutMappingRequest("dmps");
|
PutMappingRequest putMappingRequest = new PutMappingRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
putMappingRequest.source(builder);
|
putMappingRequest.source(builder);
|
||||||
this.getClient().indices().putMapping(putMappingRequest, RequestOptions.DEFAULT);
|
this.getClient().indices().putMapping(putMappingRequest, RequestOptions.DEFAULT);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +69,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
public Dmp createOrUpdate(Dmp entity) throws IOException {
|
public Dmp createOrUpdate(Dmp entity) throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
XContentBuilder builder = XContentFactory.jsonBuilder();
|
XContentBuilder builder = XContentFactory.jsonBuilder();
|
||||||
IndexRequest request = new IndexRequest("dmps").id(entity.getId().toString()).source(entity.toElasticEntity(builder));
|
IndexRequest request = new IndexRequest(this.environment.getProperty("elasticsearch.index")).id(entity.getId().toString()).source(entity.toElasticEntity(builder));
|
||||||
IndexResponse response = this.getClient().index(request, RequestOptions.DEFAULT);
|
IndexResponse response = this.getClient().index(request, RequestOptions.DEFAULT);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +79,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
@Override
|
@Override
|
||||||
public Dmp findDocument(String id) throws IOException {
|
public Dmp findDocument(String id) throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
GetRequest request = new GetRequest("dmps", id);
|
GetRequest request = new GetRequest(this.environment.getProperty("elasticsearch.index"), id);
|
||||||
GetResponse response = this.getClient().get(request, RequestOptions.DEFAULT);
|
GetResponse response = this.getClient().get(request, RequestOptions.DEFAULT);
|
||||||
return new Dmp().fromElasticEntity(response.getSourceAsMap());
|
return new Dmp().fromElasticEntity(response.getSourceAsMap());
|
||||||
}
|
}
|
||||||
|
@ -82,66 +89,40 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
@Override
|
@Override
|
||||||
public List<Dmp> query(DmpCriteria criteria) throws IOException {
|
public List<Dmp> query(DmpCriteria criteria) throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
SearchRequest searchRequest = new SearchRequest("dmps");
|
SearchRequest searchRequest = new SearchRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
||||||
|
|
||||||
CountRequest countRequest = new CountRequest("dmps");
|
CountRequest countRequest = new CountRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
countRequest.query(QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery(Dmp.MapKey.STATUS.getName(), Collections.singletonList(Dmp.DMPStatus.DELETED.getValue()))));
|
countRequest.query(QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery(Dmp.MapKey.STATUS.getName(), Collections.singletonList(Dmp.DMPStatus.DELETED.getValue()))));
|
||||||
CountResponse countResponse = getClient().count(countRequest, RequestOptions.DEFAULT);
|
CountResponse countResponse = getClient().count(countRequest, RequestOptions.DEFAULT);
|
||||||
Long count = countResponse.getCount();
|
Long count = countResponse.getCount();
|
||||||
|
|
||||||
searchSourceBuilder.size(count.intValue());
|
searchSourceBuilder.size(count.intValue());
|
||||||
|
|
||||||
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery(Dmp.MapKey.STATUS.getName(), Collections.singletonList(Dmp.DMPStatus.DELETED.getValue())));
|
List<SortBuilder> sortBuilders = new ArrayList<>();
|
||||||
if (criteria.isPublic()) {
|
BoolQueryBuilder boolQuery = createBoolQuery(criteria);
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.ISPUBLIC.getName(), true));
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.STATUS.getName(), Dmp.DMPStatus.FINALISED.getValue()));
|
|
||||||
}
|
|
||||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.queryStringQuery(criteria.getLike()).fields(Stream.of(new Object[][]{
|
|
||||||
{Dmp.MapKey.LABEL.getName(), 1.0f},
|
|
||||||
{Dmp.MapKey.DESCRIPTION.getName(), 1.0f}
|
|
||||||
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Float) data[1]))));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getTemplates() != null && criteria.getTemplates().size() > 0) {
|
if (criteria.getSortCriteria() != null && !criteria.getSortCriteria().isEmpty()) {
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.TEMPLATES.getName() + ".id.keyword", criteria.getTemplates().stream().map(UUID::toString).collect(Collectors.toList())));
|
criteria.getSortCriteria().forEach(sortCriteria -> {
|
||||||
}
|
switch(sortCriteria.getColumnType()) {
|
||||||
|
case COLUMN:
|
||||||
|
sortBuilders.add(SortBuilders.fieldSort(sortCriteria.getFieldName()).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
|
break;
|
||||||
|
case JOIN_COLUMN:
|
||||||
|
List<String> fields = Arrays.asList(sortCriteria.getFieldName().split(":"));
|
||||||
|
fields.forEach(field -> {
|
||||||
|
sortBuilders.add(SortBuilders.fieldSort(sortCriteria.getFieldName()).order(SortOrder.fromString(sortCriteria.getOrderByType().name())));
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (criteria.getStatus() != null) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.STATUS.getName(), criteria.getStatus().intValue()));
|
|
||||||
}
|
}
|
||||||
|
searchSourceBuilder.query(boolQuery).from(criteria.getOffset()).fetchSource("id", null);
|
||||||
if (criteria.getGroupIds() != null && criteria.getGroupIds().size() > 0) {
|
if (criteria.getSize() != null && criteria.getSize() > 0) {
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.GROUPID.getName(), criteria.getGroupIds().stream().map(UUID::toString).collect(Collectors.toList())));
|
searchSourceBuilder.size(criteria.getSize());
|
||||||
}
|
}
|
||||||
|
sortBuilders.forEach(searchSourceBuilder::sort);
|
||||||
if (criteria.getGrants() != null && criteria.getGrants().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.GRANT.getName() + ".keyword", criteria.getGrants().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getCollaborators() != null && criteria.getCollaborators().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.COLLABORATORS.getName() + ".keyword", criteria.getCollaborators().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!criteria.isAllowAllVersions()) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery(criteria.isPublic() ? Dmp.MapKey.LASTPUBLICVERSION.getName() : Dmp.MapKey.LASTVERSION.getName(), true));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getOrganizations() != null && criteria.getOrganizations().size() > 0) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.ORGANIZATIONS.getName() + ".id.keyword", criteria.getOrganizations().stream().map(UUID::toString).collect(Collectors.toList())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (criteria.getGrantStatus() != null) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.GRANTSTATUS.getName(), criteria.getGrantStatus()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (boolQuery.should().isEmpty() && boolQuery.mustNot().isEmpty()) {
|
|
||||||
boolQuery = boolQuery.should(QueryBuilders.matchAllQuery());
|
|
||||||
} else {
|
|
||||||
boolQuery.minimumShouldMatch(boolQuery.should().size());
|
|
||||||
}
|
|
||||||
searchSourceBuilder.query(boolQuery);
|
|
||||||
searchRequest.source(searchSourceBuilder);
|
searchRequest.source(searchSourceBuilder);
|
||||||
SearchResponse response = this.getClient().search(searchRequest, RequestOptions.DEFAULT);
|
SearchResponse response = this.getClient().search(searchRequest, RequestOptions.DEFAULT);
|
||||||
return Arrays.stream(response.getHits().getHits()).map(x -> new Dmp().fromElasticEntity((Map<String, Object>) this.transformFromString(x.getSourceAsString(), Map.class))).collect(Collectors.toList());
|
return Arrays.stream(response.getHits().getHits()).map(x -> new Dmp().fromElasticEntity((Map<String, Object>) this.transformFromString(x.getSourceAsString(), Map.class))).collect(Collectors.toList());
|
||||||
|
@ -149,10 +130,77 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long count(DmpCriteria criteria) throws IOException {
|
||||||
|
if (this.getClient() != null) {
|
||||||
|
CountRequest countRequest = new CountRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
|
|
||||||
|
BoolQueryBuilder boolQuery = createBoolQuery(criteria);
|
||||||
|
|
||||||
|
countRequest.query(boolQuery);
|
||||||
|
CountResponse response = this.getClient().count(countRequest, RequestOptions.DEFAULT);
|
||||||
|
return response.getCount();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BoolQueryBuilder createBoolQuery(DmpCriteria criteria) {
|
||||||
|
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().mustNot(QueryBuilders.termsQuery(Dmp.MapKey.STATUS.getName(), Collections.singletonList(Dmp.DMPStatus.DELETED.getValue())));
|
||||||
|
if (criteria.isPublic()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.ISPUBLIC.getName(), true));
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.STATUS.getName(), Dmp.DMPStatus.FINALISED.getValue()));
|
||||||
|
}
|
||||||
|
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.queryStringQuery(criteria.getLike()).fields(Stream.of(new Object[][]{
|
||||||
|
{Dmp.MapKey.LABEL.getName(), 1.0f},
|
||||||
|
{Dmp.MapKey.DESCRIPTION.getName(), 1.0f}
|
||||||
|
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Float) data[1]))));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getTemplates() != null && criteria.getTemplates().size() > 0) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.TEMPLATES.getName() + ".id.keyword", criteria.getTemplates().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getStatus() != null) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.STATUS.getName(), criteria.getStatus().intValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGroupIds() != null && criteria.getGroupIds().size() > 0) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.GROUPID.getName(), criteria.getGroupIds().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGrants() != null && criteria.getGrants().size() > 0) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.GRANT.getName() + ".keyword", criteria.getGrants().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getCollaborators() != null && criteria.getCollaborators().size() > 0) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.COLLABORATORS.getName() + ".id.keyword", criteria.getCollaborators().stream().filter(Objects::nonNull).map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!criteria.isAllowAllVersions()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery(criteria.isPublic() ? Dmp.MapKey.LASTPUBLICVERSION.getName() : Dmp.MapKey.LASTVERSION.getName(), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getOrganizations() != null && criteria.getOrganizations().size() > 0) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.ORGANIZATIONS.getName() + ".id.keyword", criteria.getOrganizations().stream().map(UUID::toString).collect(Collectors.toList())));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (criteria.getGrantStatus() != null) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.termQuery(Dmp.MapKey.GRANTSTATUS.getName(), criteria.getGrantStatus()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (boolQuery.should().isEmpty() && boolQuery.mustNot().isEmpty()) {
|
||||||
|
boolQuery = boolQuery.should(QueryBuilders.matchAllQuery());
|
||||||
|
} else {
|
||||||
|
boolQuery.minimumShouldMatch(boolQuery.should().size());
|
||||||
|
}
|
||||||
|
return boolQuery;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean createIndex() {
|
public boolean createIndex() {
|
||||||
try {
|
try {
|
||||||
if (!this.exists()) {
|
if (!this.exists()) {
|
||||||
CreateIndexRequest createIndexRequest = new CreateIndexRequest("dmps");
|
CreateIndexRequest createIndexRequest = new CreateIndexRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
this.getClient().indices().create(createIndexRequest, RequestOptions.DEFAULT);
|
this.getClient().indices().create(createIndexRequest, RequestOptions.DEFAULT);
|
||||||
this.generateMapping();
|
this.generateMapping();
|
||||||
}
|
}
|
||||||
|
@ -166,7 +214,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
@Override
|
@Override
|
||||||
public boolean exists() throws IOException {
|
public boolean exists() throws IOException {
|
||||||
if (this.getClient() != null) {
|
if (this.getClient() != null) {
|
||||||
GetIndexRequest request = new GetIndexRequest("dmps");
|
GetIndexRequest request = new GetIndexRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
return this.getClient().indices().exists(request, RequestOptions.DEFAULT);
|
return this.getClient().indices().exists(request, RequestOptions.DEFAULT);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -175,10 +223,10 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
|
||||||
@Override
|
@Override
|
||||||
public void clear() throws IOException {
|
public void clear() throws IOException {
|
||||||
if (exists()) {
|
if (exists()) {
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest("dmps");
|
DeleteByQueryRequest delete = new DeleteByQueryRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
delete.setQuery(QueryBuilders.matchAllQuery());
|
delete.setQuery(QueryBuilders.matchAllQuery());
|
||||||
this.getClient().deleteByQuery(delete, RequestOptions.DEFAULT);
|
this.getClient().deleteByQuery(delete, RequestOptions.DEFAULT);
|
||||||
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest("dmps");
|
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(this.environment.getProperty("elasticsearch.index"));
|
||||||
this.getClient().indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
|
this.getClient().indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ public abstract class ElasticRepository<T extends ElasticEntity,C extends Criter
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warn("Unable to connect to Elastic Services");
|
logger.warn("Unable to connect to Elastic Services");
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
this.client = null;
|
this.client = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ public interface Repository<ET extends ElasticEntity, C extends Criteria> {
|
||||||
|
|
||||||
List<ET> query(C criteria) throws ExecutionException, InterruptedException, IOException;
|
List<ET> query(C criteria) throws ExecutionException, InterruptedException, IOException;
|
||||||
|
|
||||||
|
Long count(C criteria) throws ExecutionException, InterruptedException, IOException;
|
||||||
|
|
||||||
boolean exists() throws IOException;
|
boolean exists() throws IOException;
|
||||||
|
|
||||||
void clear() throws IOException;
|
void clear() throws IOException;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.5.9.RELEASE</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -27,25 +27,27 @@
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
|
|
||||||
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
|
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
|
||||||
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
|
<org.springframework.version>5.3.8</org.springframework.version>
|
||||||
<!-- <org.springframeweu.eudat.logic.securityrity.version>3.2.10.RELEASE</org.springframeweu.eudat.logic.securityrity.version> -->
|
<!-- <org.springframeweu.eudat.logic.securityrity.version>3.2.10.RELEASE</org.springframeweu.eudat.logic.securityrity.version> -->
|
||||||
<org.springframework.security.version>4.2.3.RELEASE</org.springframework.security.version>
|
<org.springframework.security.version>5.3.10.RELEASE</org.springframework.security.version>
|
||||||
<com.sun.jersey.version>1.19.1</com.sun.jersey.version>
|
<!--<com.sun.jersey.version>1.19.1</com.sun.jersey.version>-->
|
||||||
|
<!--
|
||||||
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
|
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
|
||||||
<com.fasterxml.jackson>2.8.4</com.fasterxml.jackson>
|
-->
|
||||||
|
<!--<com.fasterxml.jackson>2.9.0</com.fasterxml.jackson>-->
|
||||||
|
|
||||||
<hibernate.version>5.2.11.Final</hibernate.version>
|
<hibernate.version>5.5.3.Final</hibernate.version>
|
||||||
|
|
||||||
<commons-codec.version>1.9</commons-codec.version>
|
<commons-codec.version>1.9</commons-codec.version>
|
||||||
<org.junit.version>4.11</org.junit.version>
|
<org.junit.version>4.11</org.junit.version>
|
||||||
<log4j.version>1.2.17</log4j.version>
|
<log4j.version>1.2.17</log4j.version>
|
||||||
<slf4j.version>1.7.12</slf4j.version>
|
<log4j2.version>2.15.0</log4j2.version>
|
||||||
<jetty.version>9.0.7.v20131107
|
<slf4j.version>1.7.15</slf4j.version>
|
||||||
</jetty.version> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
|
<!--<jetty.version>11.0.5
|
||||||
|
</jetty.version>--> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
|
||||||
<logback.version>1.2.3</logback.version>
|
<logback.version>1.2.3</logback.version>
|
||||||
<javax.inject.version>1</javax.inject.version>
|
<!-- <javax.inject.version>1</javax.inject.version>-->
|
||||||
<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>
|
<!--<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>-->
|
||||||
<docker.image.prefix>ikalyvas</docker.image.prefix>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -58,7 +60,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
<version>4.0.0.RELEASE</version>
|
<version>${org.springframework.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -69,7 +71,39 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.elasticsearch</groupId>
|
<groupId>org.elasticsearch</groupId>
|
||||||
<artifactId>elasticsearch</artifactId>
|
<artifactId>elasticsearch</artifactId>
|
||||||
<version>7.6.0</version>
|
<version>7.7.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpcore</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpcore-nio</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.5.12</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpcore-nio</artifactId>
|
||||||
|
<version>4.4.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpcore</artifactId>
|
||||||
|
<version>4.4.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -107,7 +141,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
<version>2.9.3</version>
|
<version>2.12.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,13 +149,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-core</artifactId>
|
<artifactId>jackson-core</artifactId>
|
||||||
<version>2.9.4</version>
|
<version>2.12.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.9.4</version>
|
<version>2.12.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- g/a spring -->
|
<!-- g/a spring -->
|
||||||
|
@ -139,13 +173,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi</artifactId>
|
<artifactId>poi</artifactId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
|
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
|
||||||
|
@ -154,6 +188,12 @@
|
||||||
<artifactId>fop</artifactId>
|
<artifactId>fop</artifactId>
|
||||||
<version>2.3</version>
|
<version>2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jsoup</groupId>
|
||||||
|
<artifactId>jsoup</artifactId>
|
||||||
|
<version>1.14.3</version>
|
||||||
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf -->
|
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.opensagres.xdocreport</groupId>
|
<groupId>fr.opensagres.xdocreport</groupId>
|
||||||
|
@ -179,10 +219,10 @@
|
||||||
<version>2.1</version>
|
<version>2.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-jpamodelgen</artifactId>
|
<artifactId>hibernate-jpamodelgen</artifactId>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.elasticsearch.client</groupId>
|
<groupId>org.elasticsearch.client</groupId>
|
||||||
|
@ -190,11 +230,11 @@
|
||||||
<version>7.6.0</version>
|
<version>7.6.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-to-slf4j</artifactId>
|
<artifactId>log4j-to-slf4j</artifactId>
|
||||||
<version>2.8.2</version>
|
<version>2.8.2</version>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
|
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -225,6 +265,55 @@
|
||||||
<version>1.3.1</version>
|
<version>1.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>2.0.1.Final</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- The client -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.prometheus</groupId>
|
||||||
|
<artifactId>simpleclient</artifactId>
|
||||||
|
<version>0.11.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Hotspot JVM metrics-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.prometheus</groupId>
|
||||||
|
<artifactId>simpleclient_hotspot</artifactId>
|
||||||
|
<version>0.11.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Exposition HTTPServer-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.prometheus</groupId>
|
||||||
|
<artifactId>simpleclient_httpserver</artifactId>
|
||||||
|
<version>0.11.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Pushgateway exposition-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.prometheus</groupId>
|
||||||
|
<artifactId>simpleclient_pushgateway</artifactId>
|
||||||
|
<version>0.11.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.micrometer</groupId>
|
||||||
|
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Micormeter core dependecy -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.micrometer</groupId>
|
||||||
|
<artifactId>micrometer-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
@ -238,6 +327,18 @@
|
||||||
<packaging.type>jar</packaging.type>
|
<packaging.type>jar</packaging.type>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>intellij-properties-launcher</id>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-loader</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>production</id>
|
<id>production</id>
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -4,8 +4,8 @@ import eu.eudat.queryable.jpa.predicates.*;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
import eu.eudat.queryable.types.SelectionField;
|
import eu.eudat.queryable.types.SelectionField;
|
||||||
|
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.criteria.Join;
|
||||||
import javax.persistence.criteria.Expression;
|
import javax.persistence.criteria.JoinType;
|
||||||
import javax.persistence.criteria.Subquery;
|
import javax.persistence.criteria.Subquery;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -44,6 +44,8 @@ public interface QueryableList<T extends DataEntity> {
|
||||||
|
|
||||||
QueryableList<T> orderBy(OrderByPredicate<T> predicate);
|
QueryableList<T> orderBy(OrderByPredicate<T> predicate);
|
||||||
|
|
||||||
|
QueryableList<T> groupBy(GroupByPredicate<T> predicate);
|
||||||
|
|
||||||
QueryableList<T> withHint(String hint);
|
QueryableList<T> withHint(String hint);
|
||||||
|
|
||||||
Long count();
|
Long count();
|
||||||
|
@ -67,4 +69,8 @@ public interface QueryableList<T extends DataEntity> {
|
||||||
<U extends Comparable> Subquery<U> subQueryMax(SinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass);
|
<U extends Comparable> Subquery<U> subQueryMax(SinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass);
|
||||||
|
|
||||||
<U extends Comparable> Subquery<U> subQueryMax(NestedQuerySinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass);
|
<U extends Comparable> Subquery<U> subQueryMax(NestedQuerySinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass);
|
||||||
|
|
||||||
|
Join getJoin(String field, JoinType type);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package eu.eudat.queryable.collector;
|
package eu.eudat.queryable.collector;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import javax.persistence.Tuple;
|
import javax.persistence.Tuple;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -9,9 +12,13 @@ import java.util.stream.Collectors;
|
||||||
public class Collector {
|
public class Collector {
|
||||||
|
|
||||||
public List<Map> buildFromTuple(List<Tuple> results, Map<Object, List<Tuple>> groupedResults, List<String> fields, String key) {
|
public List<Map> buildFromTuple(List<Tuple> results, Map<Object, List<Tuple>> groupedResults, List<String> fields, String key) {
|
||||||
return groupedResults.keySet().stream()
|
return results.stream().map(tuple -> {
|
||||||
|
Map<String, Object> parsedResult = new HashMap<>();
|
||||||
|
tuple.getElements().forEach(tupleElement -> parsedResult.put(tupleElement.getAlias(), tuple.get(tupleElement.getAlias())));
|
||||||
|
return parsedResult;
|
||||||
|
}).collect(Collectors.toList());/*groupedResults.keySet().stream()
|
||||||
.map(x -> buildOne(groupedResults.get(x), fields, key))
|
.map(x -> buildOne(groupedResults.get(x), fields, key))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map buildOne(List<Tuple> tuples, List<String> fields, String key) {
|
private Map buildOne(List<Tuple> tuples, List<String> fields, String key) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.eudat.queryable.jpa.hibernatequeryablelist;
|
package eu.eudat.queryable.jpa.hibernatequeryablelist;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.collector.Collector;
|
import eu.eudat.queryable.collector.Collector;
|
||||||
import eu.eudat.queryable.exceptions.NotSingleResultException;
|
import eu.eudat.queryable.exceptions.NotSingleResultException;
|
||||||
|
@ -33,6 +34,7 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
private List<NestedQuerySinglePredicate<T>> nestedPredicates = new LinkedList<>();
|
private List<NestedQuerySinglePredicate<T>> nestedPredicates = new LinkedList<>();
|
||||||
private boolean distinct = false;
|
private boolean distinct = false;
|
||||||
private List<OrderByPredicate<T>> orderings = new LinkedList<>();
|
private List<OrderByPredicate<T>> orderings = new LinkedList<>();
|
||||||
|
private List<GroupByPredicate<T>> groupings = new LinkedList<>();
|
||||||
private List<String> fields = new LinkedList<>();
|
private List<String> fields = new LinkedList<>();
|
||||||
private Integer length;
|
private Integer length;
|
||||||
private Integer offset;
|
private Integer offset;
|
||||||
|
@ -62,7 +64,7 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryableList<T> selectFields() {
|
private QueryableList<T> selectFields() {
|
||||||
List<Selection> rootFields = fields.stream().map(field -> this.convertFieldToPath(field)).filter(x -> x != null).collect(Collectors.toList());
|
List<Selection> rootFields = fields.stream().map(this::convertFieldToPath).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
this.query.select(this.manager.getCriteriaBuilder().tuple(rootFields.toArray(new Selection[rootFields.size()])));
|
this.query.select(this.manager.getCriteriaBuilder().tuple(rootFields.toArray(new Selection[rootFields.size()])));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
return join;
|
return join;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Join getJoin(String field, JoinType type) {
|
public Join getJoin(String field, JoinType type) {
|
||||||
if (this.joinsMap.containsKey(field)) return this.joinsMap.get(field);
|
if (this.joinsMap.containsKey(field)) return this.joinsMap.get(field);
|
||||||
Join join = this.root.join(field, type);
|
Join join = this.root.join(field, type);
|
||||||
this.joinsMap.put(field, join);
|
this.joinsMap.put(field, join);
|
||||||
|
@ -133,11 +135,11 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
}
|
}
|
||||||
|
|
||||||
public <R> List<R> select(SelectPredicate<T, R> predicate) {
|
public <R> List<R> select(SelectPredicate<T, R> predicate) {
|
||||||
return this.toList().stream().map(item -> predicate.applySelection(item)).collect(Collectors.toList());
|
return this.toList().stream().map(predicate::applySelection).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public <R> CompletableFuture<List<R>> selectAsync(SelectPredicate<T, R> predicate) {
|
public <R> CompletableFuture<List<R>> selectAsync(SelectPredicate<T, R> predicate) {
|
||||||
return this.toListAsync().thenApplyAsync(items -> items.stream().map(item -> predicate.applySelection(item)).collect(Collectors.toList()));
|
return this.toListAsync().thenApplyAsync(items -> items.stream().map(predicate::applySelection).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryableList<T> distinct() {
|
public QueryableList<T> distinct() {
|
||||||
|
@ -150,6 +152,11 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public QueryableList<T> groupBy(GroupByPredicate<T> predicate) {
|
||||||
|
this.groupings.add(predicate);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Long count() {
|
public Long count() {
|
||||||
CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder();
|
CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder();
|
||||||
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
|
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
|
||||||
|
@ -157,8 +164,16 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
|
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
|
||||||
else criteriaQuery.select(criteriaBuilder.count(this.root));
|
else criteriaQuery.select(criteriaBuilder.count(this.root));
|
||||||
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
||||||
|
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
|
||||||
//if (distinct) criteriaQuery.distinct(true);
|
//if (distinct) criteriaQuery.distinct(true);
|
||||||
return this.manager.createQuery(criteriaQuery).getSingleResult();
|
|
||||||
|
//GK: Group By special case. When group by is used, since it will result in a list of how many elements have the grouped field common
|
||||||
|
// then it will instead return the number of the distinct values of the grouped field
|
||||||
|
if (this.groupings.isEmpty()) {
|
||||||
|
return this.manager.createQuery(criteriaQuery).getSingleResult();
|
||||||
|
} else {
|
||||||
|
return (long) this.manager.createQuery(criteriaQuery).getResultList().size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
|
@ -169,8 +184,15 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
|
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
|
||||||
else criteriaQuery.select(criteriaBuilder.count(this.root));
|
else criteriaQuery.select(criteriaBuilder.count(this.root));
|
||||||
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
||||||
|
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
|
||||||
//if (distinct) criteriaQuery.distinct(true);
|
//if (distinct) criteriaQuery.distinct(true);
|
||||||
return CompletableFuture.supplyAsync(() -> this.manager.createQuery(criteriaQuery).getSingleResult());
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
if (this.groupings.isEmpty()) {
|
||||||
|
return this.manager.createQuery(criteriaQuery).getSingleResult();
|
||||||
|
} else {
|
||||||
|
return (long) this.manager.createQuery(criteriaQuery).getResultList().size();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,6 +227,14 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
return predicates.toArray(new Order[predicates.size()]);
|
return predicates.toArray(new Order[predicates.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Expression[] generateGroupPredicates(List<GroupByPredicate<T>> groupByPredicates, Root<T> root) {
|
||||||
|
List<Expression> predicates = new LinkedList<>();
|
||||||
|
for (GroupByPredicate<T> groupPredicate : groupByPredicates) {
|
||||||
|
predicates.add(groupPredicate.applyPredicate(this.manager.getCriteriaBuilder(), root));
|
||||||
|
}
|
||||||
|
return predicates.toArray(new Expression[predicates.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
public List<T> toList() {
|
public List<T> toList() {
|
||||||
CriteriaBuilder builder = this.manager.getCriteriaBuilder();
|
CriteriaBuilder builder = this.manager.getCriteriaBuilder();
|
||||||
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery();
|
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery();
|
||||||
|
@ -212,22 +242,20 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
this.root = this.query.from(this.tClass);
|
this.root = this.query.from(this.tClass);
|
||||||
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
||||||
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
|
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
|
||||||
|
if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root));
|
||||||
if (!this.fields.isEmpty()) this.selectFields();
|
if (!this.fields.isEmpty()) this.selectFields();
|
||||||
if (distinct) this.query.distinct(true);
|
if (distinct) this.query.distinct(true);
|
||||||
//if (!this.fields.isEmpty()) return this.toListWithFields();
|
//if (!this.fields.isEmpty()) this.query.multiselect(this.parseFields(this.fields));
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
if (!this.fields.isEmpty()) return this.toListWithFields().stream().map(m -> mapper.convertValue(m, this.tClass)).collect(Collectors.toList());
|
||||||
return this.toListWithOutFields();
|
return this.toListWithOutFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map> toListWithFields() {
|
public List<Map> toListWithFields() {
|
||||||
CriteriaBuilder builder = this.manager.getCriteriaBuilder();
|
TypedQuery<Tuple> typedQuery = this.manager.createQuery(this.query);
|
||||||
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery();
|
if (this.offset != null) typedQuery.setFirstResult(this.offset);
|
||||||
else this.query = builder.createQuery(this.tClass);
|
if (this.length != null) typedQuery.setMaxResults(this.length);
|
||||||
this.root = this.query.from(this.tClass);
|
List<Tuple> results = typedQuery.getResultList();
|
||||||
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
|
||||||
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
|
|
||||||
if (!this.fields.isEmpty()) this.selectFields();
|
|
||||||
if (distinct) this.query.distinct(true);
|
|
||||||
List<Tuple> results = this.manager.createQuery(query).getResultList();
|
|
||||||
Map<Object, List<Tuple>> groupedResults = results.stream()
|
Map<Object, List<Tuple>> groupedResults = results.stream()
|
||||||
.collect(Collectors.groupingBy(x -> x.get("id")));
|
.collect(Collectors.groupingBy(x -> x.get("id")));
|
||||||
return this.collector.buildFromTuple(results, groupedResults, this.fields, "id");
|
return this.collector.buildFromTuple(results, groupedResults, this.fields, "id");
|
||||||
|
@ -252,6 +280,7 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
this.root = this.query.from(this.tClass);
|
this.root = this.query.from(this.tClass);
|
||||||
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
|
||||||
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
|
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
|
||||||
|
if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root));
|
||||||
if (!this.fields.isEmpty()) this.selectFields();
|
if (!this.fields.isEmpty()) this.selectFields();
|
||||||
if (distinct) this.query.distinct(true);
|
if (distinct) this.query.distinct(true);
|
||||||
if (!this.fields.isEmpty()) return this.toListAsyncWithFields();
|
if (!this.fields.isEmpty()) return this.toListAsyncWithFields();
|
||||||
|
@ -356,6 +385,8 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
if (!this.orderings.isEmpty())
|
if (!this.orderings.isEmpty())
|
||||||
criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot));
|
criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot));
|
||||||
|
|
||||||
|
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
|
||||||
|
|
||||||
TypedQuery<T> typedQuery = this.manager.createQuery(criteriaQuery);
|
TypedQuery<T> typedQuery = this.manager.createQuery(criteriaQuery);
|
||||||
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
|
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
|
||||||
return typedQuery;
|
return typedQuery;
|
||||||
|
@ -466,4 +497,11 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
|
||||||
.createQuery(update)
|
.createQuery(update)
|
||||||
.executeUpdate();
|
.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Path[] parseFields(List<String> selectedFields) {
|
||||||
|
List<Path> paths = new ArrayList<>();
|
||||||
|
selectedFields.forEach(s -> paths.add(root.get(s)));
|
||||||
|
|
||||||
|
return paths.toArray(new Path[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package eu.eudat.queryable.jpa.predicates;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.Expression;
|
||||||
|
import javax.persistence.criteria.Root;
|
||||||
|
|
||||||
|
public interface GroupByPredicate<T> {
|
||||||
|
Expression<T> applyPredicate(CriteriaBuilder builder, Root<T> root);
|
||||||
|
|
||||||
|
}
|
|
@ -26,13 +26,16 @@
|
||||||
<artifactId>queryable</artifactId>
|
<artifactId>queryable</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.eudat</groupId>
|
<groupId>eu.eudat</groupId>
|
||||||
<artifactId>elastic</artifactId>
|
<artifactId>elastic</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>gr.cite.opendmp</groupId>
|
||||||
|
<artifactId>repositorydepositbase</artifactId>
|
||||||
|
<version>1.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -43,6 +46,10 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-mail</artifactId>
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
|
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||||
|
|
||||||
|
@ -50,44 +57,60 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
<version>2.9.0</version>
|
<version>2.12.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
|
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
|
||||||
<dependency>
|
<!--<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
<version>4.3.10.RELEASE</version>
|
<version>5.3.8</version>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
|
|
||||||
<!-- guava eu.eudat.cache -->
|
<!-- guava eu.eudat.cache -->
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>23.0</version>
|
<version>30.1.1-jre</version>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
|
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||||
|
<artifactId>caffeine</artifactId>
|
||||||
|
<version>2.9.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<version>4.12</version>
|
<version>5.7.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<version>9.1-901.jdbc4</version>
|
<version>42.2.22</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- facebook Login -->
|
<!-- facebook Login -->
|
||||||
|
@ -101,7 +124,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.social</groupId>
|
<groupId>org.springframework.social</groupId>
|
||||||
<artifactId>spring-social-linkedin</artifactId>
|
<artifactId>spring-social-linkedin</artifactId>
|
||||||
<version>1.0.0.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- tweeter login-->
|
<!-- tweeter login-->
|
||||||
|
@ -114,6 +137,66 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-core</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-saml-api</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-saml-impl</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-soap-api</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-xmlsec-api</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-security-api</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-security-impl</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>opensaml-profile-api</artifactId>
|
||||||
|
<version>${opensaml.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.opensaml</groupId>
|
||||||
|
<artifactId>xmltooling</artifactId>
|
||||||
|
<version>1.4.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.xml.soap</groupId>
|
||||||
|
<artifactId>jakarta.xml.soap-api</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.xml.messaging.saaj</groupId>
|
||||||
|
<artifactId>saaj-impl</artifactId>
|
||||||
|
<version>3.0.0-M2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -134,6 +217,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
|
@ -142,11 +226,46 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>1.5.9.RELEASE</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<mainClass>eu.eudat.EuDatApplication</mainClass>
|
||||||
|
<classpathPrefix>dependency-jars/</classpathPrefix>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-dependencies</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>
|
||||||
|
${project.build.directory}/dependency-jars/
|
||||||
|
</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<start-class>eu.eudat.EuDatApplication</start-class>
|
<start-class>eu.eudat.EuDatApplication</start-class>
|
||||||
|
<opensaml.version>4.0.1</opensaml.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
|
@ -5,10 +5,10 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication(scanBasePackages = {"eu.eudat", "eu.eudat.depositinterface"})
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
public class EuDatApplication extends SpringBootServletInitializer {
|
public class EuDatApplication extends SpringBootServletInitializer {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EuDatApplication.class);
|
private static final Logger logger = LoggerFactory.getLogger(EuDatApplication.class);
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.eudat.cache;
|
||||||
|
|
||||||
|
import eu.eudat.logic.proxy.config.ExternalUrlCriteria;
|
||||||
|
import org.springframework.cache.interceptor.KeyGenerator;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
public class ExternalUrlsKeyGenerator implements KeyGenerator {
|
||||||
|
@Override
|
||||||
|
public Object generate(Object o, Method method, Object... params) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append(o.getClass().getSimpleName()).append("_");
|
||||||
|
stringBuffer.append(method.getName()).append("_");
|
||||||
|
for (Object param: params) {
|
||||||
|
if (param instanceof ExternalUrlCriteria) {
|
||||||
|
ExternalUrlCriteria externalUrlCriteria = (ExternalUrlCriteria) param;
|
||||||
|
stringBuffer.append(externalUrlCriteria);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stringBuffer.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,13 @@
|
||||||
package eu.eudat.cache;
|
package eu.eudat.cache;
|
||||||
|
|
||||||
|
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.cache.CacheManager;
|
import org.springframework.cache.CacheManager;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.cache.guava.GuavaCache;
|
import org.springframework.cache.caffeine.CaffeineCache;
|
||||||
|
import org.springframework.cache.interceptor.KeyGenerator;
|
||||||
import org.springframework.cache.support.SimpleCacheManager;
|
import org.springframework.cache.support.SimpleCacheManager;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -29,22 +30,31 @@ public class ResponsesCache {
|
||||||
public CacheManager cacheManager() {
|
public CacheManager cacheManager() {
|
||||||
logger.info("Loading ResponsesCache...");
|
logger.info("Loading ResponsesCache...");
|
||||||
SimpleCacheManager simpleCacheManager = new SimpleCacheManager();
|
SimpleCacheManager simpleCacheManager = new SimpleCacheManager();
|
||||||
List<GuavaCache> caches = new ArrayList<GuavaCache>();
|
List<CaffeineCache> caches = new ArrayList<CaffeineCache>();
|
||||||
caches.add(new GuavaCache("repositories", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("repositories", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("grants", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("pubrepos", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("projects", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("journals", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("funders", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("taxonomies", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("organisations", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("publications", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("registries", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("grants", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("services", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("projects", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("tags", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("funders", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("researchers", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("organisations", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("externalDatasets", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("registries", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("currencies", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("services", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
caches.add(new GuavaCache("licenses", CacheBuilder.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
caches.add(new CaffeineCache("tags", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
|
caches.add(new CaffeineCache("researchers", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
|
caches.add(new CaffeineCache("externalDatasets", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
|
caches.add(new CaffeineCache("currencies", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
|
caches.add(new CaffeineCache("licenses", Caffeine.newBuilder().expireAfterAccess(HOW_MANY, TIME_UNIT).build()));
|
||||||
simpleCacheManager.setCaches(caches);
|
simpleCacheManager.setCaches(caches);
|
||||||
logger.info("OK");
|
logger.info("OK");
|
||||||
return simpleCacheManager;
|
return simpleCacheManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean(name = "externalUrlsKeyGenerator")
|
||||||
|
private KeyGenerator externalUrlsKeyGenerator() {
|
||||||
|
return new ExternalUrlsKeyGenerator();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package eu.eudat.configurations;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||||
import org.springframework.context.annotation.*;
|
import org.springframework.context.annotation.*;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue