Compare commits

...

687 Commits

Author SHA1 Message Date
Michele Artini 140e14e48d [maven-release-plugin] prepare for next development iteration 2024-05-17 10:18:09 +02:00
Michele Artini 180aedd918 [maven-release-plugin] prepare release dnet-applications-3.5.4 2024-05-17 10:18:06 +02:00
Michele Artini 8e82868559 Merge pull request 'communities-displayname-field' (#20) from communities-displayname-field into master
Reviewed-on: #20
2024-05-17 10:16:34 +02:00
Michele Artini 1415976a0f communities: display name and shortname 2024-05-13 10:42:52 +02:00
Michele Artini 40db13d562 new fields 2024-05-09 13:17:49 +02:00
Michele Artini 550baf79e4 community plan as enum 2024-05-09 10:11:50 +02:00
Michele Artini 3cbce1024c paging in suggestion api 2024-05-06 11:21:59 +02:00
Michele Artini 760791578b limits in application.properties 2024-05-03 13:55:29 +02:00
Michele Artini 19bc482244 added a default limit in suggestion pages 2024-05-03 12:23:43 +02:00
Michele Artini db18cb601c [maven-release-plugin] prepare for next development iteration 2024-04-04 11:33:49 +02:00
Michele Artini 4ea0d8e0f3 [maven-release-plugin] prepare release dnet-applications-3.5.3 2024-04-04 11:33:27 +02:00
Michele Artini d750fc7180 fixed a NPE 2024-04-04 11:31:30 +02:00
Michele Artini 90effab182 [maven-release-plugin] prepare for next development iteration 2024-03-27 14:10:29 +01:00
Michele Artini e023f3774e [maven-release-plugin] prepare release dnet-applications-3.5.2 2024-03-27 14:10:26 +01:00
Michele Artini 1975d26052 empty params in /context/iis/conf/* 2024-03-27 10:19:10 +01:00
Michele Artini 6620f8463b [maven-release-plugin] prepare for next development iteration 2024-03-22 08:17:29 +01:00
Michele Artini 675b233470 [maven-release-plugin] prepare release dnet-applications-3.5.1 2024-03-22 08:17:25 +01:00
Michele Artini d392f10e4b Merge pull request 'merged the sub classes in the main class' (#19) from dsm_aggregation_info_simplified_model into master
Reviewed-on: #19
2024-03-19 14:32:17 +01:00
Michele Artini ed73d524d8 merged the sub classes in the main class 2024-03-18 11:19:16 +01:00
Michele Artini d2da1a1270 [maven-release-plugin] prepare for next development iteration 2024-03-13 09:51:57 +01:00
Michele Artini cbe02e457c [maven-release-plugin] prepare release dnet-applications-3.5.0 2024-03-13 09:51:54 +01:00
Michele Artini 5a8e8f2ade Merge pull request 'task9462' (#18) from task9462 into master
Reviewed-on: #18
2024-03-13 09:22:51 +01:00
Michele Artini 7c672594c1 api descriptions 2024-02-28 15:02:26 +01:00
Michele Artini 07cd4dda85 simplified deprecated methods 2024-02-27 15:03:02 +01:00
Michele Artini 4c3a1af2d2 deprecation of contentproviders apis 2024-02-27 14:57:57 +01:00
Michele Artini 2887e1c9b1 new api to set deposit info 2024-02-27 12:05:20 +01:00
Michele Artini b79677475b deposition field management 2024-02-27 10:36:55 +01:00
Michele Artini a623c7be39 added fields deposit and message to community_datasources 2024-02-26 15:09:26 +01:00
Michele Artini a9458520e1 added aliases to Community APIs 2024-02-26 14:59:57 +01:00
Michele Artini 90bb2effc9 Merge pull request 'new_funders_api' (#17) from new_funders_api into master
Reviewed-on: #17
2024-02-22 11:23:32 +01:00
Michele Artini 55ca95a109 fixed a compatibility problem with postgres 9.3 2024-02-22 10:05:45 +01:00
Michele Artini 817864942d add a SQL GRANT 2024-02-20 09:37:20 +01:00
Michele Artini 383fc49908 SQLDISTINCT 2024-02-20 08:32:11 +01:00
Michele Artini e5a9ee0b21 refactoring using temp file 2024-02-19 16:06:34 +01:00
Michele Artini fc750633b9 aggregation dates 2024-02-19 12:37:50 +01:00
Michele Artini 3eed737bad pids 2024-02-19 10:57:39 +01:00
Michele Artini e5901a0181 new funder apis 2024-01-29 15:01:03 +01:00
Michele Artini b030f1a747 [maven-release-plugin] prepare for next development iteration 2024-01-08 08:41:28 +01:00
Michele Artini e5ed620707 [maven-release-plugin] prepare release dnet-applications-3.4.4 2024-01-08 08:40:56 +01:00
Michele Artini 8faf3ae71e log api by id 2023-12-14 14:18:34 +01:00
Michele Artini d7c220e88d content disposition: fixed filename 2023-12-14 13:56:01 +01:00
Michele Artini a88d0e59f6 add header: content disposition 2023-12-14 13:41:32 +01:00
Michele Artini a0e7425379 updated public logs api 2023-12-14 11:10:43 +01:00
Michele Artini e4cbfe863b api to export journal logs 2023-11-20 11:10:00 +01:00
Michele Artini 3638a0ea84 [maven-release-plugin] prepare for next development iteration 2023-11-06 11:18:37 +01:00
Michele Artini 31e0ed6e1c [maven-release-plugin] prepare release dnet-applications-3.4.3 2023-11-06 11:18:33 +01:00
Michele Artini e64da1e38d Merge pull request 'broker_feedbacks' (#16) from broker_feedbacks into master
Reviewed-on: #16
2023-11-06 11:15:08 +01:00
Michele Artini 94425e276d cleaning 2023-10-30 09:05:14 +01:00
Michele Artini b86a249da2 first implementation of the events feedback 2023-10-27 11:54:23 +02:00
Michele Artini 23995486be new branch for the implementation of the event feedbacks 2023-10-27 10:58:12 +02:00
Alessia Bardi 9404779389 disabled test that fails on jenkins but not on my machine for reasons I cannot explain 2023-10-24 12:31:16 +02:00
Alessia Bardi 185f1722ff Fixed annotations for tests 2023-10-24 11:42:50 +02:00
Michele Artini 500218ceda Merge pull request 'new_model_for_communities' (#15) from new_model_for_communities into master
Reviewed-on: #15
2023-10-24 08:12:25 +02:00
Michele Artini 4c6134bc83 Merge branch 'master' into new_model_for_communities 2023-10-24 08:08:24 +02:00
Alessia Bardi e3e08268f5 #9103: db_load_date available from the Info API 2023-10-20 16:40:45 +02:00
Michele Artini 7d4e8976e9 new fiedl availableSince 2023-10-18 14:22:24 +02:00
Michele Artini 2de5d6e7fb new apis for subcommunities 2023-10-18 12:05:56 +02:00
Michele Artini 05795a3604 mapping of new field 'browsable' 2023-10-18 10:52:19 +02:00
Michele Artini 32f09af2a1 use of field 'plan' 2023-10-18 10:23:22 +02:00
Michele Artini eeef1df437 updated model classes 2023-10-18 10:17:16 +02:00
Michele Artini b5ada60da3 new fields in the db: community.plan and community_subs.browsable 2023-10-18 10:04:10 +02:00
Michele Artini b3e3d676ba 404 errors in community and context API 2023-10-10 15:51:00 +02:00
Michele Artini a81f007dcb post api url 2023-10-09 14:51:51 +02:00
Michele Artini c5b23207b2 added field 'enabled' to community_datasources, fixed a migrated field 2023-10-09 12:12:07 +02:00
Michele Artini 89af989d1a Merge branch 'master' into new_model_for_communities 2023-10-09 09:34:14 +02:00
Michele Artini 80924b651c fixed response in context api 2023-10-06 10:15:58 +02:00
Claudio Atzori eece9b04f8 removed ehcache.xml 2023-10-05 15:49:36 +02:00
Claudio Atzori 00fa25cefb formatting 2023-10-05 14:44:36 +02:00
Michele Artini 6179426ca6 ehcache configuration 2023-10-05 14:43:44 +02:00
Michele Artini 807d2e493b add orderBy parameter in community projects api 2023-10-02 09:39:59 +02:00
Michele Artini d5fd29c3d0 new apis 2023-10-02 08:38:19 +02:00
Michele Artini e87267e9e5 new context api for IIS 2023-09-29 14:49:40 +02:00
Michele Artini a98c799c8b added new field: suggestedAcknowledgements 2023-09-29 12:43:03 +02:00
Michele Artini 15f0d8cea7 change type of the field 'params' 2023-09-29 09:57:40 +02:00
Michele Artini 970eff3926 moved claim and membership to parent class 2023-07-14 14:23:57 +02:00
Michele Artini 1a4dcddbe3 api params to filter projects 2023-07-12 11:16:00 +02:00
Michele Artini cda62bd5e4 method to delete a community 2023-07-12 09:49:08 +02:00
Michele Artini e618e2a733 errors in htp response 2023-07-11 14:11:09 +02:00
Michele Artini d8834eb84f remove 'members' from CommunityStatus 2023-07-11 13:44:38 +02:00
Michele Artini 096b229c5a add multiple propagation orgs (comma separeted) 2023-07-11 13:33:12 +02:00
Michele Artini 14e54a5140 new terms for CommunityStatus 2023-07-11 13:22:05 +02:00
Michele Artini 51cbe18abf moved context API controller in the original package 2023-07-11 07:52:00 +02:00
Michele Artini a8f3bb6961 api for adding a new community 2023-07-10 10:42:11 +02:00
Michele Artini 043cb4497a removed comments 2023-07-07 14:40:13 +02:00
Michele Artini 15118e2f18 nwo projects import 2023-07-07 11:53:25 +02:00
Michele Artini dde8e1c564 fixed a bug 2023-07-05 11:41:26 +02:00
Michele Artini 891b49a9d6 api for removeConstaint 2023-07-05 11:20:53 +02:00
Michele Artini aebac32457 param type 2023-07-05 10:56:11 +02:00
Michele Artini c40eeee1d1 param type 2023-07-05 10:49:07 +02:00
Michele Artini 7d91da1099 bug fix 2023-07-05 10:25:56 +02:00
Michele Artini 653e925cff refactoring 2023-07-04 11:36:44 +02:00
Michele Artini 09606452d4 Merge branch 'new_model_for_communities' of https://code-repo.d4science.org/D-Net/dnet-applications into new_model_for_communities 2023-07-03 14:21:03 +02:00
Michele Artini 31bc085093 date mamagement 2023-07-03 14:19:41 +02:00
Michele Artini 3b087ef7ed revert ot the properties 2023-07-03 14:02:16 +02:00
Michele Artini 0596a9666c claning 2023-07-03 13:54:39 +02:00
Michele Artini 3a340bd737 fixed invalid prefix 2023-07-03 12:37:03 +02:00
Michele Artini 6f873b1e45 importer 2023-07-03 12:15:37 +02:00
Michele Artini 60b7d82d47 bug fix 2023-06-30 11:27:14 +02:00
Michele Artini 29af123e06 bug fix 2023-06-30 10:55:48 +02:00
Michele Artini 95a522d8d0 logs and bug fix 2023-06-30 10:46:20 +02:00
Michele Artini 3ae2207d38 fixed a NPE and a serialization problem 2023-06-30 10:05:38 +02:00
Michele Artini 7a7d2f08ac new context apis 2023-06-29 14:56:31 +02:00
Michele Artini 18e553f3e7 tests 2023-06-29 10:39:53 +02:00
Michele Artini 5b4597a4ae tests 2023-06-28 15:37:01 +02:00
Michele Artini d9288c7657 package renaming 2023-06-28 15:28:12 +02:00
Michele Artini 375d6c2513 test 2023-06-28 15:24:18 +02:00
Michele Artini 8ac49d1dab importers 2023-06-28 14:23:56 +02:00
Michele Artini 340a577430 apis for propagationOrganizationCommunityMap 2023-06-28 12:29:59 +02:00
Michele Artini 835de9c1c6 mapping 2023-06-28 11:15:12 +02:00
Michele Artini b509e13560 subcommunities 2023-06-27 14:04:51 +02:00
Michele Artini de36ad03e6 subcommunities 2023-06-27 12:37:23 +02:00
Michele Artini 566e94d67b new mapping method 2023-06-27 09:55:39 +02:00
Michele Artini 81404e3ee9 cleaning 2023-06-26 15:06:28 +02:00
Michele Artini 1d199f008a cleaning 2023-06-26 15:02:07 +02:00
Michele Artini 174a0ea9f2 cleaning 2023-06-26 14:56:40 +02:00
Michele Artini 71ba41a94c new mapping method 2023-06-26 14:29:29 +02:00
Michele Artini f071321b3d cleaning 2023-06-26 10:28:29 +02:00
Michele Artini 5a874b2379 deprecated methods 2023-06-21 12:02:45 +02:00
Michele Artini 0e6de52307 classes for sub communities 2023-06-20 10:48:53 +02:00
Michele Artini f3ac95b54f pagination in community-projects api 2023-06-20 09:10:14 +02:00
Michele Artini 6e8f461bec mappings 2023-06-19 15:47:48 +02:00
Michele Artini 98249be293 community importer 2023-06-16 11:12:24 +02:00
Michele Artini 840e83aada use of localdatetime in deprecated classes 2023-06-16 09:30:50 +02:00
Michele Artini ce55185bcf mapping 2023-06-15 14:37:15 +02:00
Michele Artini 01cea6fe12 postgres indexes 2023-06-15 14:10:39 +02:00
Michele Artini fa5b0ef7c5 moved some classes 2023-06-15 11:37:01 +02:00
Michele Artini 3edd995e9d mapping functions 2023-06-15 11:27:59 +02:00
Michele Artini 9e2638c9e4 implementation of some internal methods 2023-06-15 10:30:23 +02:00
Michele Artini c622c4cd53 implementation of some internal methods 2023-06-15 10:18:18 +02:00
Michele Artini 71d3ed7cee renaming of some classes 2023-06-14 13:53:59 +02:00
Michele Artini 9ef99f4785 added 2 not null constraints 2023-06-14 11:23:04 +02:00
Michele Artini e604d406bd a comma 2023-06-14 11:20:28 +02:00
Michele Artini 552d8ae566 moved enums in a new package 2023-06-14 11:17:38 +02:00
Michele Artini f4c053c0e0 new fields 2023-06-14 11:14:24 +02:00
Michele Artini cb7f5eb52c deprecated previous core class 2023-06-12 14:47:27 +02:00
Michele Artini cdc8084cb6 community db classes 2023-06-12 14:30:42 +02:00
Michele Artini 827dec7a29 sql folder 2023-06-12 10:59:20 +02:00
Michele Artini f8b3643408 schema for community api 2023-06-09 15:31:30 +02:00
Miriam Baglioni cfd40e15c1 Merge branch 'master' of https://code-repo.d4science.org/D-Net/dnet-applications 2023-05-16 10:15:23 +02:00
Miriam Baglioni 2279f3df31 added error log 2023-05-16 10:15:12 +02:00
Michele Artini b64c5dadd7 [maven-release-plugin] prepare for next development iteration 2023-05-12 09:40:00 +02:00
Michele Artini 41aaa9a72b [maven-release-plugin] prepare release dnet-applications-3.4.2 2023-05-12 09:39:49 +02:00
Miriam Baglioni 17c1ad7de1 changed to make the API return 404 if the resource is not available 2023-05-10 17:44:19 +02:00
Miriam Baglioni f025c47214 Merge branch 'master' of https://code-repo.d4science.org/D-Net/dnet-applications 2023-05-02 14:49:38 +02:00
Miriam Baglioni 092927a933 avoid issue for empty string while trying to create selection constraints from string 2023-05-02 14:49:09 +02:00
Michele Artini 09437abee6 [maven-release-plugin] prepare for next development iteration 2023-05-02 13:40:41 +02:00
Michele Artini 740e6e68e4 [maven-release-plugin] prepare release dnet-applications-3.4.1 2023-05-02 13:40:38 +02:00
Miriam Baglioni 74af40afd0 avoid issue for empty string while trying to create selection constraints from string 2023-04-26 15:54:32 +02:00
Miriam Baglioni 96d253cfb0 changed to avoid problem with naming in the profile params 2023-04-21 15:10:22 +02:00
Michele Artini 48a6953af3 [maven-release-plugin] prepare for next development iteration 2023-04-14 08:24:16 +02:00
Michele Artini da011a9228 [maven-release-plugin] prepare release dnet-applications-3.4.0 2023-04-14 08:24:13 +02:00
Michele Artini dfca500b31 Merge pull request 'exporter-model-classes' (#14) from exporter-model-classes into master
Reviewed-on: #14
2023-04-12 12:02:59 +02:00
Michele Artini 34d0780545 Merge branch 'master' into exporter-model-classes 2023-04-12 12:02:27 +02:00
Michele Artini f74626b715 update a property 2023-04-12 12:00:57 +02:00
Michele Artini 785746a501 removed invali line 2023-04-12 10:36:44 +02:00
Michele Artini ca382e6b6c moved remaining classes 2023-04-03 12:22:22 +02:00
Michele Artini a04e719a57 moved some classes to new module 2023-04-03 08:33:39 +02:00
Michele Artini 57d5496855 moved some classes into the model module 2023-03-31 16:13:52 +02:00
Michele Artini ecb5ffca5a moved some classes into the model module 2023-03-31 14:53:52 +02:00
Michele Artini fabcbaf511 created common module 2023-03-31 09:41:44 +02:00
Miriam Baglioni f65a204f43 changed from sout to log.debug and adde comment to explain why the use of asCsv methos 2023-03-30 11:10:34 +02:00
Michele Artini 7dd9baf7d0 Merge pull request 'communityAPIExtention' (#10) from communityAPIExtention into master
Reviewed-on: #10
2023-02-06 13:26:06 +01:00
Michele Artini 3dc121045c api for wf history V2 2023-01-23 10:27:07 +01:00
Michele Artini ff313b5bd1 Merge pull request 'added license file' (#11) from license into master
Added Licence File
Reviewed-on: #11
2023-01-20 08:40:44 +01:00
Claudio Atzori bea45412c3 added license file 2023-01-19 14:37:02 +01:00
Sandro La Bruzzo bd18376339 [maven-release-plugin] prepare for next development iteration 2022-12-20 11:13:19 +01:00
Sandro La Bruzzo f47fbe9de9 [maven-release-plugin] prepare release dnet-applications-3.3.3 2022-12-20 11:13:14 +01:00
Sandro La Bruzzo c376ef9b6c implemented required param 2022-12-20 11:12:12 +01:00
Miriam Baglioni 36f858cd5b [Community API extention] merging with master 2022-12-19 12:45:50 +01:00
Miriam Baglioni 50b2468a13 [CommunityAPIextention]- 2022-12-19 12:45:13 +01:00
Michele Artini 39d335439f persistent orgs filter and creation using OpenaireIDs 2022-11-14 11:59:31 +01:00
Michele Artini 91d341c7be search using OpenAIRE ID 2022-11-09 14:29:42 +01:00
Michele Artini f4a803eab1 dsm api 2.0 2022-10-27 11:19:57 +02:00
Michele Artini 362ab547cb new dsm api for first collection date and registration date 2022-10-27 09:36:45 +02:00
Michele Artini 13e9821940 fixed a bug counting datasources 2022-10-21 15:30:59 +02:00
Michele Artini 92bd92f1b9 [maven-release-plugin] prepare for next development iteration 2022-10-21 09:40:40 +02:00
Michele Artini 7542dcc511 [maven-release-plugin] prepare release dnet-applications-3.3.2 2022-10-21 09:40:37 +02:00
Michele Artini 047ee7b89a invalid symbol 2022-10-19 14:10:25 +02:00
Michele Artini 5f4a8cd291 label 2022-10-19 10:17:58 +02:00
Michele Artini 963451dc67 Merge pull request 'orgs_with_dashboard' (#9) from orgs_with_dashboard into master
Reviewed-on: #9
2022-10-11 14:40:07 +02:00
Michele Artini 1ed57060e9 Merge branch 'master' into orgs_with_dashboard 2022-10-11 14:39:50 +02:00
Michele Artini 4573b41b30 ui 2022-10-11 14:37:02 +02:00
Michele Artini 96ec14722c some fixes 2022-10-11 12:36:02 +02:00
Michele Artini 7716f199ad fixed an if condition 2022-10-11 11:33:45 +02:00
Michele Artini c4c7179009 conflicts with a persistent org 2022-10-11 10:40:31 +02:00
Michele Artini bf11721159 some filter conditions 2022-10-10 11:20:27 +02:00
Michele Artini 7a2ce6b2ad multisearch for eoscdatatasourcetypes 2022-10-10 11:13:52 +02:00
Miriam Baglioni 2a937cc4ae [CommunityAPIExtention] added bulk deletion and addition for datasouces. Added the possibility to insert a pram in the cntext if it is not already present. Useful not to be forced to modify all the profiles by hand to insert new params for fos, sdg and advancedContraints 2022-09-27 16:06:31 +02:00
Michele Artini c990fc945b ui 2022-09-27 12:03:56 +02:00
Miriam Baglioni 3549fdebf9 [CommunityAPIExtention] fixed issues 2022-09-26 19:06:51 +02:00
Michele Artini 5523ab8657 updated views 2022-09-26 14:50:23 +02:00
Michele Artini 98b59cd0d5 ui 2022-09-26 14:16:22 +02:00
Miriam Baglioni e751759de9 [CommunityAPIExtention] adding FOS , SDG and advancedCriteria to the summary. Adding the possibility to add and remove list of projects from the profiles 2022-09-26 12:15:39 +02:00
Michele Artini 1ccb1c266f a control on the persistent orgs 2022-09-26 10:29:15 +02:00
Michele Artini 75d002c8ba form to add persintent organizations 2022-09-23 14:55:25 +02:00
Michele Artini 1271f9cf43 little changes 2022-09-23 08:22:00 +02:00
Michele Artini 02b74616b2 authentication details 2022-09-22 13:53:21 +02:00
Michele Artini a4a4586127 ui 2022-09-21 10:52:13 +02:00
Michele Artini 05b408f4af ui 2022-09-21 10:32:17 +02:00
Michele Artini 20f7a1da77 ui 2022-09-21 10:25:48 +02:00
Michele Artini e0143ab27e mail configuartion 2022-09-20 13:43:54 +02:00
Michele Artini ee8e84b316 new fields in authoeization request 2022-09-19 14:33:22 +02:00
Michele Artini 098537e067 new fields in users management page 2022-09-16 15:47:13 +02:00
Michele Artini 4c7f4ca4c7 common mail sender 2022-09-15 11:44:21 +02:00
Michele Artini 373275063a disabled deletion of merge rels 2022-09-15 09:47:38 +02:00
Michele Artini d5a754ffee exclusion of deduplicated ds 2022-09-13 08:07:52 +02:00
Michele Artini 8e7901afdd AGPL 3 licence 2022-09-09 14:06:31 +02:00
Michele Artini be85f682a0 swagger controller 2022-09-09 11:01:51 +02:00
Michele Artini c572334b91 [maven-release-plugin] prepare for next development iteration 2022-09-08 15:33:58 +02:00
Michele Artini 7355ca175d [maven-release-plugin] prepare release dnet-applications-3.3.1 2022-09-08 15:33:54 +02:00
Michele Artini 0a5c4a2826 use of deprecated field in a sql script 2022-09-08 15:32:10 +02:00
Michele Artini 6c3b7d6e7c override the generated url by swagger 2022-09-08 15:15:13 +02:00
Michele Artini 7a83fb8c67 [maven-release-plugin] prepare for next development iteration 2022-09-08 11:01:54 +02:00
Michele Artini faaf1a6755 [maven-release-plugin] prepare release 3.3.0 2022-09-08 11:01:51 +02:00
Michele Artini 236ac912c6 Merge pull request 'springdoc-openapi-ui' (#7) from springdoc-openapi-ui into master
Reviewed-on: #7
2022-09-08 10:40:34 +02:00
Michele Artini 1c29c9a8d4 dhp-schemas 2.14.0 2022-09-08 10:31:07 +02:00
Michele Artini 4b09f75930 Merge branch 'master' into springdoc-openapi-ui 2022-09-06 13:30:02 +02:00
Michele Artini d46f52aa5f fixed a problem with eoscType 2022-09-06 13:25:34 +02:00
Michele Artini b8ce011c20 version of dhp-schemas 2022-09-05 08:40:35 +02:00
Michele Artini 828488047a added @ConditionalOnProperty on swagger beans 2022-09-02 09:07:26 +02:00
Michele Artini 3b1d3d8d19 swagger: fixed basepath for apis 2022-09-01 09:04:31 +02:00
Michele Artini fd0eeb170b swagger: fixed basepath for apis 2022-09-01 08:57:26 +02:00
Michele Artini 9890f71491 cleaned empty @Schema 2022-08-31 14:34:52 +02:00
Enrico Ottonello 15558ff29a added oas ve annotations; added example values for scraping method 2022-08-31 14:06:10 +02:00
Sandro La Bruzzo 44e7aaa694 adapted ui to openapi ui 2022-08-31 11:11:14 +02:00
Michele Artini ebedff0955 swagger methods 2022-08-30 08:59:01 +02:00
Michele Artini 5aa2f013d4 fixed swagger urls 2022-08-26 09:39:45 +02:00
Michele Artini 2db58b9e04 partial migration to new openAPI 2022-08-22 13:41:38 +02:00
Michele Artini fb08b4a4c2 partial migration to new openAPI 2022-08-22 13:36:36 +02:00
Michele Artini c3d2187257 partial migration to new openAPI 2022-08-22 13:03:46 +02:00
Michele Artini 9b9d37624c partial migration to new openAPI 2022-08-19 15:21:40 +02:00
Michele Artini e037cd0b41 partial migration to new openAPI 2022-08-19 13:27:36 +02:00
Michele Artini 834c21ffc8 partial migration to new openAPI 2022-08-19 11:20:13 +02:00
Michele Artini fe3a9f7b4e new api to add ds and apis 2022-08-19 09:42:55 +02:00
Michele Artini ec666bf88e added failed wfs in history 2022-08-17 11:15:34 +02:00
Claudio Atzori db400dbfe0 added default value for the column dsm_services.eosc_type 2022-07-22 15:22:05 +02:00
Michele Artini 98d1e17761 use of typology as parameter of search methods 2022-07-15 07:50:59 +02:00
Michele Artini c948ed63f3 fixed a bug with _convert 2022-07-14 15:11:30 +02:00
Michele Artini b748d847bb add typology in api response 2022-07-11 13:59:25 +02:00
Enrico Ottonello 3f61e6fce2 Merge branch 'master' of code-repo.d4science.org:D-Net/dnet-applications 2022-06-24 11:52:31 +02:00
Enrico Ottonello a70a327281 added external output folder configuration 2022-06-24 11:52:13 +02:00
Sandro La Bruzzo 7511ef94c2 added redirect 2022-06-13 11:50:37 +02:00
Alessia Bardi 98df910e1c Support for Horizon Europe projects in DSpace/ePrints API 2022-06-08 16:27:05 +02:00
Michele Artini 55736c5c60 [maven-release-plugin] prepare for next development iteration 2022-06-08 14:31:39 +02:00
Michele Artini 181e5cfbc5 [maven-release-plugin] prepare release dnet-applications-3.2.8 2022-06-08 14:31:36 +02:00
Michele Artini dbec69c77a ticket #7353 2022-06-08 14:28:55 +02:00
Michele Artini 3440383904 Merge pull request 'bioschemas' (#6) from bioschemas into master
Reviewed-on: #6
2022-06-08 10:19:38 +02:00
Enrico Ottonello 9edc663c92 Merge branch 'master' of code-repo.d4science.org:D-Net/dnet-applications into bioschemas 2022-06-08 09:46:15 +02:00
Enrico Ottonello 5e8ecab58d package renaming 2022-06-08 09:44:39 +02:00
Enrico Ottonello 852ff05881 implemented syncronus scraping call handling 2022-06-07 15:12:46 +02:00
Enrico Ottonello 8a18fe11ec refactoring; webapp context set to bioschemas 2022-06-07 13:38:14 +02:00
Enrico Ottonello 079b2506e6 fixed dependencies declaration, configuration properties 2022-06-07 13:02:36 +02:00
Enrico Ottonello 7375534764 added app for bioschemas sources harvesting 2022-06-06 09:37:29 +02:00
Michele Artini 4d066e3d77 changed the filter on urls for swagger 2022-06-01 07:46:32 +02:00
Michele Artini 19010a9624 registrationdate in detailed response 2022-05-30 11:01:36 +02:00
Michele Artini 75a27e1fbd openaire greph node ids 2022-05-26 11:47:01 +02:00
Michele Artini 51be640db9 [maven-release-plugin] prepare for next development iteration 2022-05-13 11:49:07 +02:00
Michele Artini 5d9be72fe6 [maven-release-plugin] prepare release dnet-applications-3.2.7 2022-05-13 11:49:04 +02:00
Michele Artini b1f115dfc1 readded deprecated field (typology) in /ds/update 2022-05-13 11:47:11 +02:00
Michele Artini f113bcbfdd [maven-release-plugin] prepare for next development iteration 2022-05-09 15:31:50 +02:00
Michele Artini c86fc72253 [maven-release-plugin] prepare release dnet-applications-3.2.6 2022-05-09 15:31:45 +02:00
Michele Artini 62ff066a5d change reltype constants 2022-05-09 15:29:28 +02:00
Sandro La Bruzzo 762af8d0b1 removed parameter harvestedAfter 2022-05-03 15:34:17 +02:00
Michele Artini 3e405075c9 Merge pull request 'new-exporter' (#5) from new-exporter into master
Reviewed-on: #5
2022-04-22 10:27:22 +02:00
Michele Artini a15ececddd added field lastConsentTermsOfUseDate 2022-04-22 10:25:00 +02:00
Michele Artini 892963fb68 pom version 2022-04-20 12:11:09 +02:00
Michele Artini b47f14aa9b Merge branch 'master' into new-exporter 2022-04-20 12:08:44 +02:00
Michele Artini b5b130e0ab [maven-release-plugin] prepare for next development iteration 2022-04-20 10:05:27 +02:00
Michele Artini 6b109d3f15 [maven-release-plugin] prepare release dnet-applications-3.2.5 2022-04-20 10:05:24 +02:00
Michele Artini aa8c467253 changed default value (suggested) for added duplictes 2022-04-20 09:05:20 +02:00
Michele Artini 004cb02cec ui 2022-04-19 10:10:25 +02:00
Michele Artini 035d1da34f multiple selection 2022-04-19 09:47:20 +02:00
Michele Artini f143d1f0c9 importDedupEvents as SQL procedure 2022-04-13 14:45:56 +02:00
Michele Artini 2f36d8ff47 another fix for _typology_to_remove_ 2022-04-13 09:43:12 +02:00
Michele Artini 44e170946f readded typology field for compatibility 2022-04-12 13:05:57 +02:00
Michele Artini dcc5174f4d fixed an sql fix on import data 2022-04-11 10:32:06 +02:00
Michele Artini aa294bfc2d fixed an sql fix on import data 2022-04-08 14:59:33 +02:00
Michele Artini ee8ec5ecc9 new type 2022-04-07 13:29:10 +02:00
Michele Artini 7078467e97 added status field to response 2022-04-07 08:32:48 +02:00
Michele Artini a6709a3878 add PidSystemDbEntry 2022-04-07 08:05:39 +02:00
Michele Artini 9308ab35f0 fix merge 2022-03-29 12:22:54 +02:00
Sandro La Bruzzo d7824d5071 Merge pull request 'scholexplorer' (#4) from scholexplorer into master
Reviewed-on: #4
2022-03-29 12:14:41 +02:00
Sandro La Bruzzo c0277c4938 merged master 2022-03-29 12:13:33 +02:00
Michele Artini 3db226bea6 set of field eoscDatasourceType in getApis() 2022-03-25 14:42:47 +01:00
Michele Artini a6909dc253 fixed jpa query 2022-03-25 10:52:19 +01:00
Michele Artini 00ed2922da removed typology field 2022-03-24 12:26:14 +01:00
Michele Artini 485c865896 fixed swagger error 2022-03-23 09:58:02 +01:00
Michele Artini 6e653e1258 swagger home redirect 2022-03-23 08:49:13 +01:00
Michele Artini 1311afa993 swagger: removed duplicated group 2022-03-22 10:37:49 +01:00
Michele Artini 3b898f6a3e fixed some problem with EOSC model 2022-03-22 08:58:20 +01:00
Sandro La Bruzzo 7abf6af997 moved data model of API into dhp-schemas 2022-02-28 14:26:55 +01:00
Sandro La Bruzzo 786449a43c code refactor
properties changed
2022-02-28 11:27:07 +01:00
Michele Artini 90792c490c [maven-release-plugin] prepare for next development iteration 2022-02-23 14:39:11 +01:00
Michele Artini 31afa26b2c [maven-release-plugin] prepare release dnet-applications-3.2.4 2022-02-23 14:39:08 +01:00
Michele Artini f30eeac80a added pids for fulltext search 2022-02-23 13:05:25 +01:00
Michele Artini 5ea73251e3 remove invalid path 2022-02-23 12:01:44 +01:00
Michele Artini 13c4ef23b9 fixed a bug removing rels 2022-02-23 10:44:52 +01:00
Michele Artini e7625b44e0 added a DELETE query for concistency in importDedupEvents.sql 2022-02-18 09:56:00 +01:00
Michele Artini 41d4846027 claening 2022-02-15 08:50:59 +01:00
Sandro La Bruzzo d5a089869c implemented Scholix V1 APIs 2022-02-14 09:16:37 +01:00
Sandro La Bruzzo fc74c86ba9 Implemented LinkProvider aggregations 2022-02-09 11:33:09 +01:00
Sandro La Bruzzo b776a3c7cd Implemented ElasticSearch Connection Pool 2022-02-08 09:57:45 +01:00
Sandro La Bruzzo 68eed5d523 - Implemented Entity manager responsible for querying index
- Implemented mapping from Scholix model of index into ScholixV2
- Added more metrics
2022-02-07 16:36:26 +01:00
Michele Artini 37b662ac20 move vs dnet_services 2022-02-07 10:35:41 +01:00
Michele Artini 33bd9c396f move vs dnet_services 2022-02-07 10:33:09 +01:00
Michele Artini 9f2d5c6c24 cleaning 2022-02-07 10:09:18 +01:00
Michele Artini cf612424c9 remove of deprecated methods and repo profiles 2022-02-07 09:03:36 +01:00
Sandro La Bruzzo f505f379af implemented first test of connection to index elasticSearch 2022-02-04 15:52:49 +01:00
Michele Artini 98a33dd9d8 first import 2022-02-04 10:12:15 +01:00
Sandro La Bruzzo 04ea22b244 fixed pom deps 2022-02-02 14:55:09 +01:00
Sandro La Bruzzo 353258ad68 Implemented API interface of version1 and 2 2022-02-02 14:23:28 +01:00
Michele Artini 98b8c67f52 [maven-release-plugin] prepare for next development iteration 2022-02-02 11:49:24 +01:00
Michele Artini ff97a8c955 [maven-release-plugin] prepare release dnet-applications-3.2.3 2022-02-02 11:49:21 +01:00
Michele Artini ae7b483c90 clean cache button 2022-01-31 14:35:21 +01:00
Michele Artini 3a3f24135d fixed a bug in merge labels 2022-01-25 09:02:52 +01:00
Michele Artini 52a53e6484 removed kpi metrics from /metrics 2021-12-02 14:35:53 +01:00
Michele Artini 2f99954a4f [maven-release-plugin] prepare for next development iteration 2021-11-30 14:16:41 +01:00
Michele Artini 6f914d52b0 [maven-release-plugin] prepare release dnet-applications-3.2.2 2021-11-30 14:16:38 +01:00
Michele Artini ef4b379210 Merge pull request 'kpi_metrics_separated' (#3) from kpi_metrics_separated into master
Reviewed-on: #3
2021-11-30 14:10:36 +01:00
Michele Artini 5833884fb3 rename of a metric 2021-11-30 14:08:55 +01:00
Michele Artini 3e84eac3cb logf 2021-11-29 14:43:45 +01:00
Michele Artini e127a7e73c /kpis metrics endpoint 2021-11-29 13:37:27 +01:00
Michele Artini e0a3e6a14f first temptative 2021-11-26 16:31:31 +01:00
Michele Artini 6c06ad6b9a SupportPages 2021-11-19 12:14:42 +01:00
Michele Artini 01fd913c1d force is_similar to clone duplicate 2021-11-09 11:28:03 +01:00
Michele Artini 7ba3c61768 configuration paragraph in scala 2021-11-08 16:15:16 +01:00
Michele Artini 6ec96e2c82 ui (invalid records, zepplin non configured) 2021-11-03 12:26:59 +01:00
Michele Artini caeb3c8ddb migration to junit 5 2021-11-03 10:51:04 +01:00
Michele Artini e774487903 fixed zeppelin url and error messages 2021-11-02 14:21:24 +01:00
Michele Artini 5eb49d2b33 log levels 2021-11-02 12:03:04 +01:00
Michele Artini 60629198bd zeppelin: remove expired notes 2021-11-02 11:50:50 +01:00
Michele Artini a7f8f8f061 zeppelin button in inspector page 2021-11-02 11:50:17 +01:00
Michele Artini dd4c634295 fix property value 2021-11-02 09:43:52 +01:00
Michele Artini 7c75386488 zeppelin calls + list templates 2021-10-29 16:23:18 +02:00
Michele Artini b10bd1f385 zeppelin notes 2021-10-29 10:43:42 +02:00
Michele Artini 51bfb5866b edit relations 2021-10-21 11:54:57 +02:00
Michele Artini b736851035 [maven-release-plugin] prepare for next development iteration 2021-10-01 10:14:32 +02:00
Michele Artini a95f4944f7 [maven-release-plugin] prepare release dnet-applications-3.2.1 2021-10-01 10:14:29 +02:00
Michele Artini c1873f27fb import dedup events from UI 2021-09-30 09:16:06 +02:00
Michele Artini dc7dddfb37 check suggested countries 2021-09-29 16:05:16 +02:00
Michele Artini 6ee176ff89 css 2021-09-29 12:24:28 +02:00
Michele Artini e25e90819b status import page and system utilities 2021-09-29 12:06:17 +02:00
Michele Artini 654d3fc397 system configuration page: read-only mode, title, homepage message 2021-09-28 16:05:21 +02:00
Michele Artini 92ae3fb533 filter country 2021-09-28 11:25:38 +02:00
Michele Artini 0a5c711629 metric for lastUpdate 2021-08-02 09:36:02 +02:00
Michele Artini 91fccbae7f metrics cache 2021-07-30 16:17:20 +02:00
Michele Artini 53750ff818 new metrics 2021-07-30 14:12:09 +02:00
Michele Artini 853d4b66e5 removed invalid country UK (valid is GB) 2021-07-20 11:37:28 +02:00
Michele Artini 54445748c0 [maven-release-plugin] prepare for next development iteration 2021-07-13 08:50:57 +02:00
Michele Artini 7d22e788ab [maven-release-plugin] prepare release 3.2.0 2021-07-13 08:50:53 +02:00
Michele Artini df971ffe3c update prometheus and maven-model 2021-07-12 13:14:09 +02:00
Michele Artini 2d6452f3c0 update swagger, guava and commons-io 2021-07-12 12:40:10 +02:00
Michele Artini f95382ece9 update to angular 1.8.2 and bootstrap 5.6.0 2021-07-09 15:05:56 +02:00
Michele Artini 103092549d moved to common js libs 2021-07-07 15:32:23 +02:00
Michele Artini e8d27ba0ee moved to common js libs 2021-07-07 15:27:04 +02:00
Michele Artini e8b3094e53 update to angular 1.8.2 2021-07-07 11:57:50 +02:00
Michele Artini dd60114d10 update to bootstrap 4.6.0 2021-07-07 11:41:02 +02:00
Michele Artini 75615694da moved common static files in common module 2021-07-07 11:03:29 +02:00
Michele Artini 77b3750a3a hibernate version 2021-07-06 14:14:44 +02:00
Michele Artini 8c45ff2ef2 update of dependencies 2021-07-06 13:29:38 +02:00
Michele Artini 80d0aba5c3 substring in search queries 2021-07-01 11:13:09 +02:00
Michele Artini 878171b204 csv export of duplicates and suggested orgs 2021-07-01 10:51:55 +02:00
Michele Artini 3450f2764e order by in suggestion pages 2021-06-24 15:51:25 +02:00
Michele Artini 0f43e31025 dbmodel 2021-06-23 08:37:21 +02:00
Michele Artini cf638dbd16 query optimization 2021-06-22 12:57:52 +02:00
Michele Artini 5dcce6d148 sql performance: removed join with view 2021-06-22 11:50:08 +02:00
Michele Artini 7da6e755d7 new index for fulltext 2021-06-21 09:23:58 +02:00
Michele Artini 4e315b361f ui 2021-05-13 09:37:17 +02:00
Michele Artini 6354adb7a2 fixed problem with dhp-schemas 2021-05-13 09:01:43 +02:00
Michele Artini fab6eae732 minors 2021-05-13 08:30:03 +02:00
Michele Artini fea7c78695 info from effective-pom in /metrics 2021-05-11 12:28:20 +02:00
Michele Artini e360f29f8c import of dhp-schemas instead of dhp-common 2021-05-10 14:07:40 +02:00
Michele Artini fd092b17df [maven-release-plugin] prepare for next development iteration 2021-05-10 13:01:31 +02:00
Michele Artini fe5970e12e [maven-release-plugin] prepare release dnet-applications-3.1.8 2021-05-10 13:01:26 +02:00
Michele Artini bad8125d65 dependency dhp-common (release) 2021-05-10 10:50:59 +02:00
Michele Artini b36394b4d4 removed unused field 2021-05-10 09:17:41 +02:00
Michele Artini 4225f97c21 invalid sql comment 2021-05-07 08:05:33 +02:00
Michele Artini 17854b56d9 journal 2021-05-06 08:46:17 +02:00
Michele Artini 425bfe65dc ui 2021-05-06 08:25:35 +02:00
Michele Artini c2b7517b90 manual add duplicates (raw) 2021-05-05 15:12:53 +02:00
Michele Artini 8cbe97abfa readme 2021-04-27 10:26:40 +02:00
Michele Artini 9bfb0dbda2 sql import 2021-04-27 10:12:05 +02:00
Michele Artini 491b86ddd0 duplicate -> raw 2021-04-27 08:23:45 +02:00
Michele Artini ff49b22198 frames 2021-04-26 12:58:32 +02:00
Michele Artini d68424d584 scripts to generatte db model 2021-04-26 11:32:17 +02:00
Michele Artini 48e645f14a fixed sql import 2021-04-26 07:58:26 +02:00
Michele Artini 00139e31fe minor 2021-04-23 12:25:53 +02:00
Michele Artini cc6e65138e fixed a problem adding the same org as suplicate 2021-04-23 11:31:24 +02:00
Michele Artini 303e1433ac skip empty values importing urls and acronyms 2021-04-23 10:00:51 +02:00
Michele Artini bf28a0ba09 ui 2021-04-23 09:37:15 +02:00
Michele Artini a0da981c29 minor 2021-04-23 09:19:15 +02:00
Michele Artini 764c6a3ee2 api to obtain the status of the import 2021-04-22 15:42:35 +02:00
Michele Artini 5f1a46cc51 duplicates addition 2021-04-20 11:43:17 +02:00
Michele Artini e71bb3657a new root org for all suggested orgs 2021-04-19 16:00:29 +02:00
Michele Artini 85fa189f2f sql 2021-04-16 14:36:04 +02:00
Michele Artini 560cce5337 sql 2021-04-13 15:51:50 +02:00
Michele Artini c7a9e51bb8 ui 2021-04-13 14:45:27 +02:00
Michele Artini 2acb090bf4 ui 2021-04-13 14:31:00 +02:00
Michele Artini 07d10c3654 missing flags 2021-04-13 11:06:42 +02:00
Michele Artini 98892cdaf2 note ui 2021-04-09 16:50:26 +02:00
Michele Artini b357d25703 note and journal (ui) 2021-04-09 15:32:32 +02:00
Michele Artini 13fd72b25e note and journal (model and api) 2021-04-09 12:17:11 +02:00
Michele Artini 562e56be07 sql 2021-04-08 11:52:01 +02:00
Michele Artini 0f7b4c687f import of ec flags 2021-04-07 14:19:45 +02:00
Michele Artini 246c924749 ec flags 2021-04-07 09:36:14 +02:00
Michele Artini 370da2ae10 pids and ec flags visualization and 2021-04-06 17:45:26 +02:00
Michele Artini a34939d4b1 id with / 2021-03-31 12:04:10 +02:00
Michele Artini 4b2b759857 labels 2021-03-31 11:50:06 +02:00
Michele Artini fe88333c2a set rights to zeppelin note 2021-03-29 09:37:45 +02:00
Michele Artini 8efe0a669a sql to import missing id types 2021-03-25 09:31:35 +01:00
Michele Artini ef145531ed import of pids 2021-03-24 11:01:50 +01:00
Michele Artini 99ef6e5c1a moved on GitHub 2021-03-23 14:43:26 +01:00
Michele Artini e9a31f367a files as json arrays 2021-03-23 13:15:22 +01:00
Claudio Atzori de287679c8 added link to the broker API docs 2021-03-23 10:22:09 +01:00
Michele Artini fe47f6aba5 labels 2021-03-23 10:16:14 +01:00
Michele Artini 53dfb0e4d0 labels 2021-03-23 10:09:23 +01:00
Michele Artini ca23f2a4f3 labels 2021-03-23 09:58:37 +01:00
Michele Artini 6856a07ed5 gzip and interactive mode 2021-03-23 09:45:16 +01:00
Michele Artini 9bd0f1ae47 save files 2021-03-22 14:09:52 +01:00
Michele Artini b5ae4b92ab listSubscriptions 2021-03-22 11:24:35 +01:00
Michele Artini bb06882318 garr properties 2021-03-22 11:15:59 +01:00
Michele Artini bc7ceb823d params 2021-03-22 10:19:45 +01:00
Michele Artini f44042cf52 new broker api client application 2021-03-19 14:54:49 +01:00
Michele Artini aabe1dd6c7 fixed a javascript param 2021-03-16 09:46:05 +01:00
Michele Artini c6d06856d2 zeppelin 2021-03-11 12:44:25 +01:00
Michele Artini e4fea5585b Merge branch 'master' of code-repo.d4science.org:D-Net/dnet-applications 2021-03-04 15:33:51 +01:00
Michele Artini 112dd75f02 integration with zeppelin 2021-03-04 15:33:32 +01:00
Claudio Atzori dcaf1e16cf MDsM README.md 2021-03-03 16:32:08 +01:00
Michele Artini 66bde9453b readme 2021-03-02 10:45:13 +01:00
Michele Artini a8820b3edb logs 2021-02-23 16:51:07 +01:00
Michele Artini 2015ea5bd8 added host and basePath for swagger 2021-02-23 15:02:10 +01:00
Michele Artini bc49f6e280 inspector: max number of md records 2021-02-23 09:33:37 +01:00
Michele Artini 8b2efcf378 rrcovered a JS file and minors 2021-02-23 08:48:03 +01:00
Michele Artini 1004273907 md records inspector 2021-02-22 16:54:23 +01:00
Michele Artini e5f7b88ea5 added a parquet api 2021-02-19 15:52:14 +01:00
Michele Artini 43e0386b78 parquet clinet 2021-02-18 14:28:04 +01:00
Michele Artini 504d42e96c summary with total of events from ES and from DB 2021-02-17 12:19:20 +01:00
Michele Artini 1614002b5c tests 2021-02-10 15:31:34 +01:00
Michele Artini fbd8f30e05 relative urls 2021-02-10 12:34:21 +01:00
Michele Artini 5a485666cc Merge branch 'master' of code-repo.d4science.org:D-Net/dnet-applications 2021-02-08 14:35:53 +01:00
Michele Artini d7940441fe added dnet45 snapshot repo 2021-02-08 14:35:19 +01:00
Enrico Ottonello 0dbfc480c9 Merge branch 'master' of https://code-repo.d4science.org/D-Net/dnet-applications 2021-02-05 10:50:48 +01:00
Enrico Ottonello 7d46c74273 replaced version number of hadoop aggregator with the related constant from main pom.xml 2021-02-05 10:39:32 +01:00
Michele Artini 9ece63a0c9 fixed dependency to dhp-common 2021-02-05 08:44:22 +01:00
Michele Artini 8ffd0aacdd use of dhp-common version 1.2.4-branch_hadoop_aggregator-SNAPSHOT 2021-02-04 14:29:24 +01:00
Michele Artini da8aae12e5 logs 2021-02-02 08:15:06 +01:00
Michele Artini 897532c88d synchronized thread 2021-02-02 08:10:28 +01:00
Michele Artini a1006af44a method to fix inconsistencies 2021-02-01 16:40:54 +01:00
Michele Artini 3099a06e47 loga 2021-02-01 12:01:14 +01:00
Michele Artini 28788aba95 hdfs user 2021-01-29 15:45:20 +01:00
Michele Artini ed92f0a3dd method to return a version by id 2021-01-29 13:15:21 +01:00
Michele Artini 1fc1a3d69a added a log 2021-01-29 08:21:14 +01:00
Michele Artini 81bef1295d hdfsClient to delete mdstores and versions on hadoop 2021-01-28 15:55:22 +01:00
Michele Artini 05f5f35fa0 partial implementation of the new delete methods 2021-01-28 12:59:06 +01:00
Michele Artini 9b853732ce method /mdstores/info 2021-01-28 11:18:50 +01:00
Michele Artini 40c3ee37ef added creationDate and hdfsPath fields 2021-01-28 11:02:04 +01:00
Michele Artini 7b5d26ada1 refactoring 2021-01-27 12:17:38 +01:00
Michele Artini eefbaf0607 reset ReadCount 2021-01-26 13:34:39 +01:00
Michele Artini 216d9cf53c tests 2021-01-26 12:07:57 +01:00
Michele Artini b78eab271d tests 2021-01-26 11:42:32 +01:00
Michele Artini abc91beaf6 some refactoring 2021-01-25 16:40:35 +01:00
Michele Artini 7ac3d73299 swagger 2021-01-25 14:47:25 +01:00
Michele Artini 7848c5a52c added dhp-mdstore-manager 2021-01-25 14:16:37 +01:00
Michele Artini e4f6ba9708 country selection 2021-01-21 12:10:38 +01:00
Michele Artini 66e0238d73 update the modificationDate at the end 2021-01-18 16:00:14 +01:00
Michele Artini 9dd2a5f523 buttons form merge all 2021-01-18 15:45:10 +01:00
Michele Artini cfdfed43b1 buttons form merge all 2021-01-18 15:20:08 +01:00
Michele Artini 33697d60cf removed merge reltyes from metadata form 2021-01-18 12:03:09 +01:00
Michele Artini eb0a1a73c1 redirection after merge of conflicts 2021-01-18 11:53:32 +01:00
Michele Artini 81eba4249d filter only if dimension > 10 2021-01-18 11:03:33 +01:00
Michele Artini 94277982e0 fulltext indexing 2021-01-15 12:21:10 +01:00
Michele Artini ab1fc66bbd [maven-release-plugin] prepare for next development iteration 2021-01-15 10:51:48 +01:00
Michele Artini 19abb4fa1c [maven-release-plugin] prepare release dnet-applications-3.1.7 2021-01-15 10:51:45 +01:00
Michele Artini bdcf79bfc3 fixed a bug with gzipped files 2021-01-15 10:50:53 +01:00
Michele Artini 488f0c5f62 [maven-release-plugin] prepare for next development iteration 2021-01-14 12:55:06 +01:00
Michele Artini 14a3fb798c [maven-release-plugin] prepare release dnet-applications-3.1.6 2021-01-14 12:55:01 +01:00
Michele Artini 81627d3be9 Added eventId to ShortEventMessage 2021-01-14 12:54:16 +01:00
Michele Artini d7d72a3240 Merge branch 'master' of code-repo.d4science.org:D-Net/dnet-applications 2020-12-18 10:39:19 +01:00
Claudio Atzori 175884b3db removed script/property files; updated git ignores 2020-12-17 15:37:46 +01:00
Michele Artini 66afbbd19a [maven-release-plugin] prepare for next development iteration 2020-12-16 09:16:55 +01:00
Michele Artini a988fff3ad [maven-release-plugin] prepare for next development iteration 2020-12-16 09:16:55 +01:00
Michele Artini a755efce8d [maven-release-plugin] prepare release dnet-applications-3.1.5 2020-12-16 09:16:52 +01:00
Michele Artini 9d3dfeaa43 [maven-release-plugin] prepare release dnet-applications-3.1.5 2020-12-16 09:16:52 +01:00
Michele Artini 6480e07171 invalid char in template 2020-12-16 09:06:50 +01:00
Michele Artini 8dccf177cc invalid char in template 2020-12-16 09:06:50 +01:00
Michele Artini bf0a41bfba updated version 2020-12-11 16:00:28 +01:00
Michele Artini 408792995b updated version 2020-12-11 16:00:28 +01:00
Michele Artini 9c79faa83c broker email, /health and /metrics controllers 2020-12-11 13:50:35 +01:00
Michele Artini 90a2fecb88 broker email, /health and /metrics controllers 2020-12-11 13:50:35 +01:00
Michele Artini 836bb179f8 [maven-release-plugin] prepare for next development iteration 2020-12-07 15:11:24 +01:00
Michele Artini 13ee0c2d7a [maven-release-plugin] prepare for next development iteration 2020-12-07 15:11:24 +01:00
Michele Artini 4b3da42d45 [maven-release-plugin] prepare release dnet-applications-3.1.4 2020-12-07 15:11:20 +01:00
Michele Artini 7bb21bd7cf [maven-release-plugin] prepare release dnet-applications-3.1.4 2020-12-07 15:11:20 +01:00
Michele Artini 0e624e102c new public apis 2020-12-07 11:10:44 +01:00
Michele Artini 0f65824250 new public apis 2020-12-07 11:10:44 +01:00
Michele Artini aba94db0c8 override remote logout url 2020-12-02 16:10:23 +01:00
Michele Artini ad33d158bd override remote logout url 2020-12-02 16:10:23 +01:00
Michele Artini cfa85bc813 properties 2020-11-30 12:11:32 +01:00
Michele Artini 424727cd4e properties 2020-11-30 12:11:32 +01:00
Michele Artini 3ff5ef9bd6 simple authentication in DEV profile 2020-11-23 12:02:33 +01:00
Michele Artini 993916a378 simple authentication in DEV profile 2020-11-23 12:02:33 +01:00
Michele Artini 843fc1f93f Merge branch 'master' into openid-authentication 2020-11-23 10:41:33 +01:00
Michele Artini 3bd870e4e9 Merge branch 'master' into openid-authentication 2020-11-23 10:41:33 +01:00
Michele Artini fb280ff23d [maven-release-plugin] prepare for next development iteration 2020-11-18 10:54:16 +01:00
Michele Artini 8971e99d17 [maven-release-plugin] prepare for next development iteration 2020-11-18 10:54:16 +01:00
Michele Artini aa07e0bc95 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:54:11 +01:00
Michele Artini 2dbc3c4f89 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:54:11 +01:00
Michele Artini 3e352e9133 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:51:54 +01:00
Michele Artini 460ee55b27 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:51:54 +01:00
Michele Artini 15a54650a2 [maven-release-plugin] prepare for next development iteration 2020-11-18 10:50:12 +01:00
Michele Artini 940cbe58d5 [maven-release-plugin] prepare for next development iteration 2020-11-18 10:50:12 +01:00
Michele Artini 9ee19edf71 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:50:07 +01:00
Michele Artini 3ccf9edd41 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:50:07 +01:00
Michele Artini bfa7788883 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:47:48 +01:00
Michele Artini 4b03edd9fd [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:47:48 +01:00
Michele Artini 503b4ab896 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:47:29 +01:00
Michele Artini 5f325e01d8 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:47:29 +01:00
Michele Artini 724c1e68e7 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:46:49 +01:00
Michele Artini d4e5ee4787 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:46:49 +01:00
Michele Artini 0d392bb4c5 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:43:35 +01:00
Michele Artini 35b2975a7b [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 10:43:35 +01:00
Michele Artini 4ed770ce06 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:30:35 +01:00
Michele Artini 49d6ada8a8 [maven-release-plugin] rollback the release of dnet-applications-3.1.3 2020-11-18 10:30:35 +01:00
Michele Artini 2b1f0e2eaa [maven-release-plugin] prepare for next development iteration 2020-11-18 09:53:52 +01:00
Michele Artini 8770db3b82 [maven-release-plugin] prepare for next development iteration 2020-11-18 09:53:52 +01:00
Michele Artini 2e9f5d16b9 [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 09:53:47 +01:00
Michele Artini c741f0701a [maven-release-plugin] prepare release dnet-applications-3.1.3 2020-11-18 09:53:47 +01:00
Michele Artini 12ebae519a es urls 2020-11-18 09:53:02 +01:00
Michele Artini f9e274f553 es urls 2020-11-18 09:53:02 +01:00
Michele Artini ded23b75ad Merge remote-tracking branch 'origin/master' into openid-authentication 2020-11-16 11:02:23 +01:00
Michele Artini 3f2f52d2f7 Merge remote-tracking branch 'origin/master' into openid-authentication 2020-11-16 11:02:23 +01:00
Michele Artini 7145f7b2f2 maven repos 2020-11-16 10:59:16 +01:00
Michele Artini f83df90fd8 maven repos 2020-11-16 10:59:16 +01:00
Michele Artini a0c2d66360 labels 2020-11-13 10:08:14 +01:00
Michele Artini 06c5a269df labels 2020-11-13 10:08:14 +01:00
Michele Artini 2fa87bd99f labels 2020-11-13 09:41:08 +01:00
Michele Artini 30bbdcf7ee labels 2020-11-13 09:41:08 +01:00
Michele Artini 1b00ac2b4f user access dates 2020-11-12 15:47:41 +01:00
Michele Artini 86b0d50fe5 user access dates 2020-11-12 15:47:41 +01:00
Michele Artini e240af83fb advenced menu items 2020-11-12 11:44:46 +01:00
Michele Artini baa2272796 advenced menu items 2020-11-12 11:44:46 +01:00
Michele Artini 8df83c28ab [maven-release-plugin] prepare for next development iteration 2020-11-09 11:16:53 +01:00
Michele Artini f0e12f6256 [maven-release-plugin] prepare for next development iteration 2020-11-09 11:16:53 +01:00
Michele Artini 24ac207fa9 [maven-release-plugin] prepare release dnet-applications-3.1.2 2020-11-09 11:16:48 +01:00
Michele Artini a52bffd62d [maven-release-plugin] prepare release dnet-applications-3.1.2 2020-11-09 11:16:48 +01:00
Michele Artini baad77945f opendoarID api using hdfs 2020-11-09 10:38:18 +01:00
Michele Artini 61e50ddea5 opendoarID api using hdfs 2020-11-09 10:38:18 +01:00
Michele Artini e5394b008e redirect logout 2020-11-05 09:55:02 +01:00
Michele Artini d3967dc7b0 redirect logout 2020-11-05 09:55:02 +01:00
Michele Artini 94637fe6dd logout and homepage 2020-11-04 15:06:34 +01:00
Michele Artini 9daeb8bd11 logout and homepage 2020-11-04 15:06:34 +01:00
Michele Artini 6a5488811e urls with authorizations 2020-11-04 14:18:41 +01:00
Michele Artini 34b192851b urls with authorizations 2020-11-04 14:18:41 +01:00
Michele Artini 7d25ad2928 role remapping 2020-11-04 12:18:25 +01:00
Michele Artini 0d0dc484e8 role remapping 2020-11-04 12:18:25 +01:00
Michele Artini 45015dfe07 oauth2 first steps 2020-11-04 10:30:29 +01:00
Michele Artini 3b6239f84a oauth2 first steps 2020-11-04 10:30:29 +01:00
Michele Artini 96586f7b33 fix all differents only for all elements 2020-10-30 11:51:52 +01:00
Michele Artini 502f28dfd3 fix all differents only for all elements 2020-10-30 11:51:52 +01:00
Michele Artini e4e8afe9dd invalidate a group of conflicts 2020-10-30 10:05:23 +01:00
Michele Artini 8f5eacb409 invalidate a group of conflicts 2020-10-30 10:05:23 +01:00
Michele Artini a9d505bcee removed discarded and deleted statuses 2020-10-29 15:31:47 +01:00
Michele Artini b8113cf34b removed discarded and deleted statuses 2020-10-29 15:31:47 +01:00
Michele Artini 6df015b5e8 collectedFrom 2020-10-29 13:45:26 +01:00
Michele Artini 14f88c7fb1 collectedFrom 2020-10-29 13:45:26 +01:00
Michele Artini 8b27ab280b creted and modified by and 2020-10-29 13:32:09 +01:00
Michele Artini f6feef1942 creted and modified by and 2020-10-29 13:32:09 +01:00
Michele Artini 1bfeac01a1 conflicts 2020-10-29 13:18:11 +01:00
Michele Artini 02f7f674ce conflicts 2020-10-29 13:18:11 +01:00
Michele Artini 9bb4da72c4 ui 2020-10-28 09:48:46 +01:00
Michele Artini 0555abf02f ui 2020-10-28 09:48:46 +01:00
Michele Artini 1f5e812bfa ui 2020-10-27 11:51:15 +01:00
Michele Artini aea888b6b1 ui 2020-10-27 11:51:15 +01:00
Michele Artini b293654528 ui 2020-10-26 17:06:47 +01:00
Michele Artini 47429c4267 ui 2020-10-26 17:06:47 +01:00
Michele Artini 272182b923 ui 2020-10-26 15:30:56 +01:00
Michele Artini 91dcb0f55f ui 2020-10-26 15:30:56 +01:00
Michele Artini 95808ba909 Merge pull request 'national_admin_functions' (#1) from national_admin_functions into master 2020-10-26 08:32:18 +01:00
Michele Artini c96e71103a Merge pull request 'national_admin_functions' (#1) from national_admin_functions into master 2020-10-26 08:32:18 +01:00
Michele Artini 0d4f1d084d uis 2020-10-26 08:29:45 +01:00
Michele Artini bdae1ad93f uis 2020-10-26 08:29:45 +01:00
Michele Artini 1496464121 ajax call with spinner 2020-10-23 11:31:01 +02:00
Michele Artini 4c180e390c ajax call with spinner 2020-10-23 11:31:01 +02:00
Michele Artini 0f619a47d3 uis 2020-10-22 13:09:29 +02:00
Michele Artini 8a0093023a uis 2020-10-22 13:09:29 +02:00
Michele Artini aab245bd52 uis 2020-10-22 11:45:44 +02:00
Michele Artini b1fc833bb9 uis 2020-10-22 11:45:44 +02:00
Michele Artini 49702f19ed fix a jpa exception 2020-10-22 11:19:21 +02:00
Michele Artini 8f13725240 fix a jpa exception 2020-10-22 11:19:21 +02:00
Michele Artini d662e4c576 uis 2020-10-22 10:59:34 +02:00
Michele Artini 0923695d1a uis 2020-10-22 10:59:34 +02:00
Michele Artini 3881782019 manual add duplicate 2020-10-21 17:03:25 +02:00
Michele Artini 2a89146394 manual add duplicate 2020-10-21 17:03:25 +02:00
Michele Artini d76b9c97b5 simple search filtered using status field 2020-10-21 15:31:31 +02:00
Michele Artini c8f1e08b57 simple search filtered using status field 2020-10-21 15:31:31 +02:00
Michele Artini 035fa98228 approve and discard orgs 2020-10-21 12:27:14 +02:00
Michele Artini 90d7bba929 approve and discard orgs 2020-10-21 12:27:14 +02:00
Michele Artini b51f610ba0 fix a jpa exception 2020-10-21 09:49:11 +02:00
Michele Artini 637a683723 fix a jpa exception 2020-10-21 09:49:11 +02:00
Michele Artini e483021ab9 actions by role 2020-10-20 16:13:14 +02:00
Michele Artini be8cf2bafc actions by role 2020-10-20 16:13:14 +02:00
Michele Artini 33d9ae1470 some actions by role 2020-10-20 15:00:52 +02:00
Michele Artini c6d71a6d0d some actions by role 2020-10-20 15:00:52 +02:00
Michele Artini 9099e62b9b some actions by role 2020-10-20 12:03:23 +02:00
Michele Artini 1c136656e2 some actions by role 2020-10-20 12:03:23 +02:00
Michele Artini 8f30e4c8a5 save actions by role 2020-10-19 15:12:08 +02:00
Michele Artini c3af41743f save actions by role 2020-10-19 15:12:08 +02:00
Michele Artini cb03b3312d ui regactoring 2020-10-15 12:43:40 +02:00
Michele Artini 918f3d1f90 ui regactoring 2020-10-15 12:43:40 +02:00
Michele Artini d4cdf11384 ui regactoring 2020-10-15 12:31:11 +02:00
Michele Artini e46b860a43 ui regactoring 2020-10-15 12:31:11 +02:00
Michele Artini f3cec6ab87 sql for import dedup_events 2020-10-14 16:28:00 +02:00
Michele Artini ee70a5b8d6 sql for import dedup_events 2020-10-14 16:28:00 +02:00
Michele Artini aa24a5475d menu refactoring 2020-10-13 14:48:04 +02:00
Michele Artini d1b136e0e5 menu refactoring 2020-10-13 14:48:04 +02:00
Michele Artini 5a76d32f15 moved some fields from oa_duplicate to organizations 2020-10-09 16:00:12 +02:00
Michele Artini 4b8488efe1 moved some fields from oa_duplicate to organizations 2020-10-09 16:00:12 +02:00
Michele Artini 35609798b3 vocabulaies with name and value 2020-10-08 15:10:11 +02:00
Michele Artini ff33ec501f vocabulaies with name and value 2020-10-08 15:10:11 +02:00
Michele Artini 56f49fd787 fixed triggers 2020-10-07 17:04:29 +02:00
Michele Artini 4e7c5c78c1 fixed triggers 2020-10-07 17:04:29 +02:00
Michele Artini f025d61006 changed approved(boolean) to status(text) 2020-10-06 15:06:12 +02:00
Michele Artini 9458a1dc40 changed approved(boolean) to status(text) 2020-10-06 15:06:12 +02:00
Michele Artini bcc5a4aef0 pending orgs management 2020-10-05 12:16:49 +02:00
Michele Artini 5b10c7cbf4 pending orgs management 2020-10-05 12:16:49 +02:00
Michele Artini 8666648c46 added approved column to organizations table 2020-10-01 16:30:32 +02:00
Michele Artini 6b200d7a77 added approved column to organizations table 2020-10-01 16:30:32 +02:00
Michele Artini f1c39ee6df index for fulltext search 2020-10-01 11:33:14 +02:00
Michele Artini 94d298761a index for fulltext search 2020-10-01 11:33:14 +02:00
Michele Artini 9799ff3bda fix some ui bugs 2020-09-29 15:31:56 +02:00
Michele Artini 1ab33b1d2a fix some ui bugs 2020-09-29 15:31:56 +02:00
Michele Artini 7520fef31f fix creation of group ids 2020-09-29 11:48:45 +02:00
Michele Artini fad1180422 fix creation of group ids 2020-09-29 11:48:45 +02:00
Michele Artini 5c04deadd4 restricted access for simrels api 2020-09-29 11:34:31 +02:00
Michele Artini d0764262d6 restricted access for simrels api 2020-09-29 11:34:31 +02:00
Michele Artini 7465134e8b fixed a bug with hibernate and added api to import simrels 2020-09-28 16:53:20 +02:00
Michele Artini 15182276e9 fixed a bug with hibernate and added api to import simrels 2020-09-28 16:53:20 +02:00
Michele Artini a28a5284fd cleaning 2020-09-25 16:09:36 +02:00
Michele Artini a6618813d7 cleaning 2020-09-25 16:09:36 +02:00
Michele Artini 436dc04cd1 management of topic * from UI 2020-09-18 09:25:05 +02:00
Michele Artini ea7de2814c management of topic * from UI 2020-09-18 09:25:05 +02:00
Michele Artini abd7acf331 total topic counts in a sql table 2020-09-17 15:50:51 +02:00
Michele Artini a945eeed6a total topic counts in a sql table 2020-09-17 15:50:51 +02:00
Michele Artini 385e3dc871 [maven-release-plugin] prepare for next development iteration 2020-09-15 10:09:38 +02:00
Michele Artini 7a074c6b87 [maven-release-plugin] prepare for next development iteration 2020-09-15 10:09:38 +02:00
Michele Artini 537e3d08c2 [maven-release-plugin] prepare release dnet-applications-3.1.1 2020-09-15 10:09:34 +02:00
Michele Artini ad7b865dbc moved an api messsage in common module 2020-09-15 10:08:06 +02:00
Michele Artini eaa4f0e174 mail dispatchers 2020-09-11 12:05:11 +02:00
Michele Artini 436d129008 api to delete notifications by date 2020-09-09 15:32:58 +02:00
Michele Artini f37de4e86b public apis 2020-09-08 16:38:14 +02:00
Michele Artini 58da712318 sump notifications as file 2020-09-07 16:01:29 +02:00
Michele Artini e0a60c563c change packages 2020-09-04 14:33:19 +02:00
Michele Artini 8dc4077fd6 moved some classes in a common module 2020-08-28 09:40:04 +02:00
Michele Artini 853b1ada2b ssh tunnel 2020-08-21 14:53:39 +02:00
Michele Artini f1a8394775 new apis fro deletion of events 2020-08-20 15:02:30 +02:00
Michele Artini 9cc544d63e refactoring of some functionality for openaire 2020-08-20 10:56:23 +02:00
Michele Artini a8f796e1ed fix some bugs 2020-08-19 17:12:02 +02:00
Michele Artini 35a57d3153 fixed aggregations according to text/keyword type 2020-07-29 14:15:28 +02:00
Michele Artini c8b5ca96d2 fix hibernate, dependencies, empty query 2020-07-29 11:31:18 +02:00
Michele Artini 1e3654808a optimizations of es settings 2020-07-28 11:30:06 +02:00
Michele Artini ad4d4b28a2 timeout props 2020-07-27 15:49:29 +02:00
Michele Artini 652c4b9952 message for 0 suggestions 2020-07-27 14:46:22 +02:00
Michele Artini 07bf90df61 jaxb dependency 2020-07-27 11:18:21 +02:00
Michele Artini a169ad1620 conf 2020-07-27 10:07:07 +02:00
Michele Artini 02142f1d11 replaced h2 with potgres 2020-07-23 15:34:53 +02:00
Michele Artini b98ff0f497 ror import 2020-07-16 16:11:24 +02:00
Michele Artini 5f18425c66 script to import organizations from ROR 2020-07-15 15:52:58 +02:00
Michele Artini 25e57d5541 [maven-release-plugin] prepare for next development iteration 2020-07-14 10:39:08 +02:00
Michele Artini cf0843849a [maven-release-plugin] prepare release dnet-applications-3.1.0 2020-07-14 10:39:03 +02:00
Michele Artini 46e29de7bf multiple related datasources 2020-07-14 10:37:49 +02:00
Michele Artini f805fe10eb [maven-release-plugin] prepare for next development iteration 2020-07-13 10:47:40 +02:00
Michele Artini 15f7999a86 [maven-release-plugin] prepare release dnet-applications-3.0.0 2020-07-13 10:47:35 +02:00
Michele Artini 2da79a0c3e [maven-release-plugin] rollback the release of dnet-applications-3.0.0 2020-07-13 10:39:51 +02:00
Michele Artini 88bb069461 [maven-release-plugin] prepare release dnet-applications-3.0.0 2020-07-13 10:38:59 +02:00
Michele Artini dc15efe6b5 [maven-release-plugin] rollback the release of dnet-applications-3.0.0 2020-07-13 10:37:10 +02:00
Michele Artini e603ce3cb5 [maven-release-plugin] prepare for next development iteration 2020-07-13 10:35:17 +02:00
Michele Artini feca86dbf9 [maven-release-plugin] prepare release dnet-applications-3.0.0 2020-07-13 10:35:12 +02:00
Michele Artini 5cf1cf5e07 poms 2020-07-09 10:12:57 +02:00
Michele Artini cd822c17b4 Removed some unused classes 2020-07-09 09:44:55 +02:00
Michele Artini 845abc6c9c removed guava 2020-07-08 10:01:54 +02:00
Michele Artini 29a2f1577c imported module dnet-openaire-broker-common 2020-07-08 09:54:54 +02:00
Michele Artini f3b92a57f7 notifications scrolls 2020-07-07 12:09:03 +02:00
Michele Artini d9f0dde161 fixed npe 2020-07-06 11:48:36 +02:00
Michele Artini d1a4bd3668 added dnet-orgs-database-application 2020-07-03 12:09:22 +02:00
Michele Artini 6b32df9c7a authors 2020-07-03 11:39:42 +02:00
Michele Artini 95b8609188 uis 2020-07-03 10:36:40 +02:00
Michele Artini a0f77a8894 multi modules structure 2020-07-03 09:09:59 +02:00
947 changed files with 161492 additions and 7019 deletions

3
.gitignore vendored
View File

@ -5,7 +5,10 @@
*.iml
*.ipr
*.iws
*.java-version
*~
/**/*.sh
/**/my_application.properties
.vscode
.classpath
/**/.classpath

661
LICENSE Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,10 @@
{
"type_source": "SVN",
"goal": "package -U source:jar",
"url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet50/modules/dnet-bioschemas-api/trunk/",
"deploy_repository": "dnet5-snapshots",
"version": "5",
"mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it, enrico.ottonello@isti.cnr.it",
"deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet5-snapshots",
"name": "dnet-ariadneplus-graphdb-publisher"
}

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.5.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>bioschemas-api</artifactId>
<dependencies>
<dependency>
<groupId>hwu.elixir</groupId>
<artifactId>bmuse-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-rdfxml</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-model</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${bioschemas-commons-io-version}</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,8 @@
https://mobidb.org/sitemap2.xml.gz
scrape?datasourceKey=mobidb&sitemapUrl=https%3A%2F%2Fmobidb.org%2Fsitemap2.xml.gz
https://proteinensemble.org/sitemap2.xml.gz
scrape?datasourceKey=ped&sitemapUrl=https%3A%2F%2Fproteinensemble.org%2Fsitemap2.xml.gz
https://disprot.org/sitemap2.xml.gz
scrape?datasourceKey=disprot&sitemapUrl=https%3A%2F%2Fdisprot.org%2Fsitemap2.xml.gz

View File

@ -0,0 +1,14 @@
package eu.dnetlib.bioschemas.api;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
/**
* @author enrico.ottonello
*
*/
@Profile("garr")
@Configuration
public class AppConfigGarr {
}

View File

@ -0,0 +1,52 @@
package eu.dnetlib.bioschemas.api;
import io.swagger.v3.oas.models.tags.Tag;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import eu.dnetlib.common.app.AbstractDnetApp;
import java.util.Arrays;
import java.util.List;
@SpringBootApplication
@EnableCaching
@EnableScheduling
@ComponentScan(basePackages = "eu.dnetlib")
public class MainApplication extends AbstractDnetApp {
public static final String BIOSCHEMAS_APIS = "D-Net Bioschemas Service APIs";
public static void main(final String[] args) {
SpringApplication.run(MainApplication.class, args);
}
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group(BIOSCHEMAS_APIS)
.pathsToMatch("/api/**")
.build();
}
@Override
protected String swaggerTitle() {
return BIOSCHEMAS_APIS;
}
@Override
protected List<Tag> swaggerTags() {
return Arrays.asList(new Tag().name(BIOSCHEMAS_APIS).description(BIOSCHEMAS_APIS));
}
@Override
protected String swaggerDesc() {
return BIOSCHEMAS_APIS;
}
}

View File

@ -0,0 +1,206 @@
package eu.dnetlib.bioschemas.api;
import eu.dnetlib.bioschemas.api.crawl.CrawlRecord;
import eu.dnetlib.bioschemas.api.scraper.BMUSEScraper;
import eu.dnetlib.bioschemas.api.scraper.ScrapeState;
import eu.dnetlib.bioschemas.api.scraper.ScrapeThread;
import eu.dnetlib.bioschemas.api.utils.UrlParser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Properties;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Runs the scrape. Collect a list of URLs (in the form of CrawlRecords) to scrape.
*
*/
public class ServiceScrapeDriver {
private static final String propertiesFile = "application.properties";
private int waitTime = 1;
private int numberOfPagesToCrawlInALoop;
private int totalNumberOfPagesToCrawlInASession;
private String outputFolder;
private int pagesCounter = 0;
private int scrapeVersion = 1;
private String sitemapUrl;
private String sitemapURLKey;
private String maxScrapedPages;
private String outputFilename;
private static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private static final Log logger = LogFactory.getLog(ServiceScrapeDriver.class);
public ServiceScrapeDriver(String sitemapUrl, String sitemapURLKey, String maxScrapedPages, String outputFilename, String outputFolder) {
this.sitemapUrl = sitemapUrl;
this.sitemapURLKey = sitemapURLKey;
this.maxScrapedPages = maxScrapedPages;
this.outputFilename = outputFilename;
this.outputFolder = outputFolder;
}
/**
* Fires off threads
* Originally designed as a multi-threaded process; now reduced to a single thread as
* the selenium webdriver is too expensive to run multi-threaded. However, the threading
* as been left in situ in case it is useful in the future.
*
*/
public void runScrape() throws IOException {
processProperties();
String url = sitemapUrl.toLowerCase();
Elements urls = UrlParser.getSitemapList(getSitemapUrl(), getSitemapURLKey());
Stream<Element> urlStream = null;
if (Objects.nonNull(maxScrapedPages)) {
urlStream = urls.stream().limit(Long.parseLong(maxScrapedPages));
} else {
urlStream = urls.stream();
}
List<Element> sites = urlStream.collect(Collectors.toList());
logger.info("Pages available for scraping: " + sites.size());
List<CrawlRecord> pagesToPull = generatePagesToPull(sites);
if (pagesToPull.isEmpty()) {
logger.error("Cannot retrieve URLs");
throw new RuntimeException("No pages found from sitemap");
}
ScrapeState scrapeState = new ScrapeState(pagesToPull);
logger.info("STARTING CRAWL: " + formatter.format(new Date(System.currentTimeMillis())));
while (pagesCounter < totalNumberOfPagesToCrawlInASession) {
logger.debug(pagesCounter + " scraped of " + totalNumberOfPagesToCrawlInASession);
ScrapeThread scrape1 = new ScrapeThread(new BMUSEScraper(), scrapeState, waitTime, scrapeVersion);
scrape1.setName("S1");
scrape1.start();
long startTime = System.nanoTime();
try {
scrape1.join();
} catch (InterruptedException e) {
logger.error("Exception waiting on thread");
e.printStackTrace();
return;
}
if(!scrape1.isFileWritten()) {
logger.error("Could not write output file so shutting down!");
Date date = new Date(System.currentTimeMillis());
logger.info("ENDING CRAWL after failure at: " + formatter.format(date));
return;
}
logger.debug("Value of isFileWritten: " + scrape1.isFileWritten());
long endTime = System.nanoTime();
long timeElapsed = endTime - startTime;
logger.debug("Time in s to complete: " + timeElapsed / 1e+9);
pagesCounter += numberOfPagesToCrawlInALoop;
logger.debug("ENDED loop");
}
logger.info("ENDING CRAWL: " + formatter.format(new Date(System.currentTimeMillis())));
File output = new File(outputFolder.concat("/").concat(outputFilename));
if (output.exists()) {
output.delete();
output.createNewFile();
}
FileWriter fileWriter;
BufferedWriter bufferedWriter;
fileWriter = new FileWriter(output.getAbsoluteFile(), true); // true to append
bufferedWriter = new BufferedWriter(fileWriter);
List<CrawlRecord> processed = scrapeState.getPagesProcessed();
for (int i=0;i<processed.size();i++) {
try {
bufferedWriter.write(processed.get(i).getNquads());
bufferedWriter.newLine();
bufferedWriter.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
bufferedWriter.close();
logger.info(" Data stored into "+output.getAbsolutePath());
}
/**
* Get a list of URLs (in the form of CrawlRecords) that need to be scraped
*
* @return List of URLs to be scraped
* @see CrawlRecord
*/
private List<CrawlRecord> generatePagesToPull(List<Element> sites) {
List<CrawlRecord> crawls = sites
.stream()
.map(s -> {
CrawlRecord crawlRecord = new CrawlRecord(s.text());
String[] urlSplitted = crawlRecord.getUrl().split("/");
String name = urlSplitted[urlSplitted.length - 1];
crawlRecord.setName(name);
return crawlRecord;
})
.collect(Collectors.toList());
return crawls;
}
/**
* Updates properties based on properties file in src > main > resources
*
*/
private void processProperties() {
ClassLoader classLoader = ServiceScrapeDriver.class.getClassLoader();
InputStream is = classLoader.getResourceAsStream(propertiesFile);
if(is == null) {
logger.error(" Cannot find " + propertiesFile + " file");
throw new IllegalArgumentException(propertiesFile + "file is not found!");
}
Properties prop = new Properties();
try {
prop.load(is);
} catch (IOException e) {
logger.error(" Cannot load application.properties", e);
System.exit(0);
}
waitTime = Integer.parseInt(prop.getProperty("waitTime").trim());
logger.info(" waitTime: " + waitTime);
numberOfPagesToCrawlInALoop = Integer.parseInt(prop.getProperty("numberOfPagesToCrawlInALoop").trim());
logger.info(" numberOfPagesToCrawl: " + numberOfPagesToCrawlInALoop);
totalNumberOfPagesToCrawlInASession = Integer.parseInt(prop.getProperty("totalNumberOfPagesToCrawlInASession").trim());
logger.info(" totalNumberOfPagesToCrawlInASession: " + totalNumberOfPagesToCrawlInASession);
scrapeVersion = Integer.parseInt(prop.getProperty("scrapeVersion").trim());
logger.info(" scrapeVersion: " + scrapeVersion);
logger.info("\n\n\n");
}
public String getSitemapUrl() {
return sitemapUrl;
}
public String getSitemapURLKey() {
return sitemapURLKey;
}
private String getId(String pageUrl) {
String[] parts = pageUrl.split("/");
return parts[parts.length - 1];
}
}

View File

@ -0,0 +1,98 @@
package eu.dnetlib.bioschemas.api.controller;
import eu.dnetlib.bioschemas.api.MainApplication;
import eu.dnetlib.bioschemas.api.scraper.ScrapingExecution;
import eu.dnetlib.bioschemas.api.scraper.ScrapingExecutor;
import eu.dnetlib.bioschemas.api.utils.BioschemasException;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
/**
* @author enrico.ottonello
*
*/
@RestController
@RequestMapping("/api")
@Tag(name = MainApplication.BIOSCHEMAS_APIS)
public class BioschemasAPIController extends AbstractDnetController {
@Value("${outputFolder}")
private String outputFolder;
@Value("${outputDataPattern}")
private String outputDataPattern;
private static Logger logger = LoggerFactory.getLogger(BioschemasAPIController.class);
@Autowired
private ScrapingExecutor scrapingExecutor;
private static final Log log = LogFactory.getLog(BioschemasAPIController.class);
@Operation(summary = "start the scraping operation", description = "<H1>Working input values are in the following table</H1><BR><TABLE><TR><TH>datasourceKey</TH><TH>sitemapUrl</TH></TR><TR><TD>ped</TD><TD>https://proteinensemble.org/sitemap2.xml.gz</TD></TR><TR><TD>disprot</TD><TD>https://disprot.org/sitemap2.xml.gz</TD></TR><TR><TD>mobidb</TD><TD>https://mobidb.org/sitemap2.xml.gz</TD></TR></TABLE>")
@GetMapping("/startScraping")
public ScrapingExecution startScraping(@Parameter(name = "datasourceKey") @RequestParam final String datasourceKey,
@Parameter(name = "sitemapUrl") @RequestParam final String sitemapUrl,
final HttpServletRequest req) {
logger.info("<STARTSCRAPING> datasourceKey: "+datasourceKey+" sitemapUrl:"+sitemapUrl);
return scrapingExecutor.startScraping(datasourceKey, sitemapUrl, getOutputDataPattern(), req.getRemoteAddr(), getOutputFolder());
}
@Operation(summary = "check the status of last scraping operation")
@GetMapping("/startScraping/status")
public final ScrapingExecution statusScraping() {
return scrapingExecutor.getLastScrapingExecution();
}
@Operation(summary = "retrieve the nquads downloaded for one specific provider")
@RequestMapping(value = "/getNQuads", method = RequestMethod.GET)
public String getNQuads(@Parameter(name = "datasourceKey") @RequestParam final String datasourceKey, HttpServletResponse response) throws BioschemasException, IOException {
logger.info("<GETNQUADS> datasourceKey: "+datasourceKey);
LineIterator it = FileUtils.lineIterator(new File(getOutputFolder().concat("/").concat(datasourceKey).concat(getOutputDataPattern())), "UTF-8");
try {
while (it.hasNext()) {
String line = it.nextLine();
response.getOutputStream().write(line.getBytes(StandardCharsets.UTF_8));
response.getOutputStream().println();
}
} finally {
}
return "";
}
public String getOutputFolder() {
return outputFolder;
}
public String getOutputDataPattern() {
return outputDataPattern;
}
public void setOutputFolder(String outputFolder) {
this.outputFolder = outputFolder;
}
public void setOutputDataPattern(String outputDataPattern) {
this.outputDataPattern = outputDataPattern;
}
}

View File

@ -0,0 +1,17 @@
package eu.dnetlib.bioschemas.api.controller;
import eu.dnetlib.common.controller.AbstractDnetController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HomeController extends AbstractDnetController {
@GetMapping({
"/doc", "/swagger"
})
public String apiDoc() {
return "redirect:swagger-ui/index.html";
}
}

View File

@ -0,0 +1,136 @@
package eu.dnetlib.bioschemas.api.crawl;
import java.util.Date;
import hwu.elixir.utils.Validation;
/**
*
* Store the current status of a single URL in the scrape service.
*
*
*/
public class CrawlRecord {
private Long id;
private String context = "";
private String url;
private Date dateScraped;
private StatusOfScrape status;
private boolean beingScraped;
private String name;
private String nquads;
public CrawlRecord() {
status = StatusOfScrape.UNTRIED;
}
public CrawlRecord(String url) {
Validation validation = new Validation();
if(validation.validateURI(url)) {
this.url = url;
context = "";
status = StatusOfScrape.UNTRIED;
dateScraped = null;
} else {
throw new IllegalArgumentException(url +" is not a valid url");
}
this.setId(System.currentTimeMillis());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUrl() {
return url;
}
public Date getDateScraped() {
return dateScraped;
}
public void setDateScraped(Date dateScraped) {
this.dateScraped = dateScraped;
}
public StatusOfScrape getStatus() {
return status;
}
public void setStatus(StatusOfScrape status) {
this.status = status;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public boolean isBeingScraped() {
return beingScraped;
}
public void setBeingScraped(boolean beingScraped) {
this.beingScraped = beingScraped;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNquads() {
return nquads;
}
public void setNquads(String nquads) {
this.nquads = nquads;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof CrawlRecord))
return false;
CrawlRecord otherCrawl = (CrawlRecord) o;
if(this.url.equals(otherCrawl.getUrl())) {
return true;
}
return false;
}
@Override
public int hashCode() {
int result = getId() != null ? getId().hashCode() : 0;
result = 31 * result + (getUrl() != null ? getUrl().hashCode() : 0);
result = 31 * result + (getContext() != null ? getContext().hashCode() : 0);
result = 31 * result + (getDateScraped() != null ? getDateScraped().hashCode() : 0);
return result;
}
}

View File

@ -0,0 +1,19 @@
package eu.dnetlib.bioschemas.api.crawl;
/**
*
* {@link StatusOfScrape} describes the possible status levels the scrape for each URL/CrawlRecord.
*
* Each URL/CrawlRecord can have one of the following:
* DOES_NOT_EXIST = 404.
* HUMAN_INSPECTION = cannot parse for some reason; a human should see what is happening.
* UNTRIED = not scraped yet.
* FAILED = one failed attempt at scraping; will try again.
* GIVEN_UP = two failed attempts at scraping. Will not try again.
* SUCCESS = successfully scraped.
*
*/
public enum StatusOfScrape {
DOES_NOT_EXIST, HUMAN_INSPECTION, UNTRIED, FAILED, GIVEN_UP, SUCCESS;
}

View File

@ -0,0 +1,87 @@
package eu.dnetlib.bioschemas.api.scraper;
import hwu.elixir.scrape.exceptions.MissingMarkupException;
import hwu.elixir.scrape.scraper.ScraperFilteredCore;
import org.apache.any23.Any23;
import org.apache.any23.extractor.ExtractionException;
import org.apache.any23.source.DocumentSource;
import org.apache.any23.source.StringDocumentSource;
import org.apache.any23.writer.NTriplesWriter;
import org.apache.any23.writer.TripleHandler;
import org.apache.any23.writer.TripleHandlerException;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.Rio;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.StringWriter;
public class BMUSEScraper extends ScraperFilteredCore {
private static Logger logger = LoggerFactory.getLogger(BMUSEScraper.class);
public String getNQUADSFromUrl(String url, Boolean dynamic) throws Exception {
logger.debug(url + " > scraping");
url = fixURL(url);
String html = "";
// The dynamic boolean determines if the scraper should start using selenium or JSOUP to scrape the information
// (dynamic and static respectively)
if (dynamic) {
html = wrapHTMLExtraction(url);
} else {
html = wrapHTMLExtractionStatic(url);
}
if (html == null || html.contentEquals(""))
throw new Exception("empty html");
html = injectId(html, url);
logger.debug(url + " > html scraped from " + url);
DocumentSource source = new StringDocumentSource(html, url);
String n3 = html2Triples(source, url);
if (n3 == null) {
throw new MissingMarkupException(url);
}
logger.debug(url + " > processing triples");
IRI sourceIRI = SimpleValueFactory.getInstance().createIRI(source.getDocumentIRI());
Model updatedModel = updatedModel = processTriples(n3, sourceIRI, 0l);
if (updatedModel == null) {
throw new Exception("rdf model null");
}
logger.debug(url + " > generating nquads");
try (StringWriter jsonLDWriter = new StringWriter()) {
Rio.write(updatedModel, jsonLDWriter, RDFFormat.NQUADS);
logger.debug(url + " > nquads generated");
return jsonLDWriter.toString();
} catch (Exception e) {
throw e;
}
}
private String html2Triples(DocumentSource source, String url) throws Exception {
Any23 runner = new Any23();
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
TripleHandler handler = new NTriplesWriter(out);) {
runner.extract(source, handler);
return out.toString("UTF-8");
} catch (ExtractionException e) {
logger.error("Cannot extract triples", e);
} catch (IOException e1) {
logger.error(" IO error whilst extracting triples", e1);
} catch (TripleHandlerException e2) {
logger.error("TripleHanderException", e2);
}
return null;
}
}

View File

@ -0,0 +1,157 @@
package eu.dnetlib.bioschemas.api.scraper;
import eu.dnetlib.bioschemas.api.crawl.StatusOfScrape;
import eu.dnetlib.bioschemas.api.crawl.CrawlRecord;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
*/
public class ScrapeState {
private List<CrawlRecord> urlsToScrape = Collections.synchronizedList(new ArrayList<CrawlRecord>());
private List<CrawlRecord> urlsProcessed = Collections.synchronizedList(new ArrayList<CrawlRecord>()); // should this be a set?
private Map<String, Object> nquadsConcurrentHashMap = new ConcurrentHashMap<>();
/**
*
* @param pagesToBeScraped The list of sites to be scraped
* @see ScrapeThread
* @see CrawlRecord
*/
public ScrapeState(List<CrawlRecord> pagesToBeScraped) {
urlsToScrape.addAll(pagesToBeScraped);
}
/**
* Any pages/URLs left to scrape?
* @return True for yes & false for no
* @see CrawlRecord
*/
public synchronized boolean pagesLeftToScrape() {
return !urlsToScrape.isEmpty();
}
/**
* Returns the next URL/CrawlRecord to be scraped
*
* @return First page/URL that needs to be scraped next
* @see CrawlRecord
*/
public synchronized CrawlRecord getURLToProcess() {
if (urlsToScrape.isEmpty())
return null;
return urlsToScrape.remove(0);
}
/**
* Adds the given CrawlRecord to the list of CrawlRecords successfully scraped.
* Updates the status of the CrawlRecord to SUCCESS.
*
* @param url The latest URL/page that has been successfully scraped
* @see CrawlRecord
*/
public synchronized void addSuccessfulScrapedURL(CrawlRecord record) {
record.setStatus(StatusOfScrape.SUCCESS);
urlsProcessed.add(record);
}
/**
* Adds the given CrawlRecord to the list of CrawlRecords NOT successfully scraped.
* Updates the status of the CrawlRecord; if first failure the status is FAILED.
* If status is already FAILED it is changed to GIVEN_UP.
*
* If the status is FAILED, another try will be made in a future run.
*
*
* @param url The latest URL/page that has been unsuccessfully scraped
* @see CrawlRecord
*/
public synchronized void addFailedToScrapeURL(CrawlRecord record) {
if (record.getStatus().equals(StatusOfScrape.FAILED)) {
record.setStatus(StatusOfScrape.GIVEN_UP);
} else {
record.setStatus(StatusOfScrape.FAILED);
}
urlsProcessed.add(record);
}
/**
* Changes the status of the CrawlRecord to DOES_NOT_EXIST.
* As Selenium does not return the HTTP codes, it is questionable
* how useful this is.
*
*
* @param url The latest URL/page that has been 404'd
* @see CrawlRecord
*/
public synchronized void setStatusTo404(CrawlRecord record) {
record.setStatus(StatusOfScrape.DOES_NOT_EXIST);
urlsProcessed.add(record);
}
/**
*
* Changes the status of the CrawlRecord to HUMAN_INSPECTION.
* This captures the idea that the URLs may contain unexpected markup that needs a human to
* review and possibly update the scraper.
*
* @param url The latest URL/page that needs human inspection
* @see CrawlRecord
*/
public synchronized void setStatusToHumanInspection(CrawlRecord record) {
record.setStatus(StatusOfScrape.HUMAN_INSPECTION);
urlsProcessed.add(record);
}
/**
* Returns the number of URLs that are still to be scraped in this cycle.
* This does not return the number of URLs left to scrape in the DBMS, just in the current cycle.
*
* @return Number of URLs left to scrape in this cycle
* @see CrawlRecord
*/
public synchronized int getNumberPagesLeftToScrape() {
return urlsToScrape.size();
}
/**
* Gets the full list of URLs that have been processed in this cycle.
* This does not return the number of URLs that have been scraped in total across all cycles.
*
* @return
* @see CrawlRecord
*/
public synchronized List<CrawlRecord> getPagesProcessed() {
return urlsProcessed;
}
/**
* Gets the full list of URLs/CrawlRecords regardless of whether scraped or not in the current cycle.
*
* @return List of all CrawlRecords in this cycle.
* @see CrawlRecord
*/
public synchronized List<CrawlRecord> getPagesProcessedAndUnprocessed() {
List<CrawlRecord> urlsCombined = Collections.synchronizedList(new ArrayList<CrawlRecord>());
urlsCombined.addAll(urlsProcessed);
urlsCombined.addAll(urlsToScrape);
return urlsCombined;
}
public void addNquads(String key, String nquads) {
nquadsConcurrentHashMap.putIfAbsent(key, nquads);
}
public Map<String, Object> getNquadsConcurrentHashMap() {
return nquadsConcurrentHashMap;
}
}

View File

@ -0,0 +1,103 @@
package eu.dnetlib.bioschemas.api.scraper;
import eu.dnetlib.bioschemas.api.crawl.CrawlRecord;
import eu.dnetlib.bioschemas.api.utils.CompressorUtil;
import hwu.elixir.scrape.exceptions.CannotWriteException;
import hwu.elixir.scrape.exceptions.FourZeroFourException;
import hwu.elixir.scrape.exceptions.JsonLDInspectionException;
import hwu.elixir.scrape.exceptions.MissingMarkupException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
/**
*
* @see BMUSEScraper
* @see ScrapeState
*
*/
public class ScrapeThread extends Thread {
private ScrapeState scrapeState;
private BMUSEScraper process;
private int waitTime;
private boolean fileWritten = true;
private int scrapeVersion = 1;
private static Logger logger = LoggerFactory.getLogger(ScrapeThread.class);
/**
* Sets up a thread for actually scrapping.
*
* @param scraper Scraper that will actually do the scraping.
* @param scrapeState Object that maintains state across threads.
* @param waitTime How long (in seconds) thread should wait after scraping
* page before attempting new page.
* @param contextVersion The context URL used is 'https://bioschemas.org/crawl/CONTEXTVERSION/ID' Where ID is the id of the CrawlRecord pulled.
*
*/
public ScrapeThread(BMUSEScraper scraper, ScrapeState scrapeState, int waitTime, int contextVersion) {
this.scrapeState = scrapeState;
process = scraper;
this.waitTime = waitTime;
this.scrapeVersion = contextVersion;
}
@Override
/**
* Defines high-level process of scraping. Actual scraping done by an
* implementation of Scraper. If page scrape successful will add url to
* Scrape.sitesScraped
*
* @see Scraper
* @see SimpleScraper
*/
public void run() {
while (scrapeState.pagesLeftToScrape()) {
CrawlRecord record = scrapeState.getURLToProcess();
if (record == null)
break;
record.setContext("https://bioschemas.org/crawl/" + scrapeVersion +"/" + record.getId());
record.setDateScraped(new Date());
try {
String nquads = process.getNQUADSFromUrl(record.getUrl(), true);
logger.info("downloaded "+record.getUrl() + " leftToScrape:" + scrapeState.getNumberPagesLeftToScrape());
record.setNquads(CompressorUtil.compressValue(nquads));
if (!nquads.isEmpty()) {
scrapeState.addSuccessfulScrapedURL(record);
} else {
scrapeState.addFailedToScrapeURL(record);
}
} catch(FourZeroFourException fourZeroFourException) {
scrapeState.setStatusTo404(record);
fileWritten = false;
} catch (JsonLDInspectionException je) {
scrapeState.setStatusToHumanInspection(record);
fileWritten = false;
} catch (CannotWriteException cannotWrite) {
logger.error("Caught cannot read file, setting worked to false!");
fileWritten = false;
scrapeState.addFailedToScrapeURL(record);
return; // no point in continuing
} catch (MissingMarkupException e) {
logger.error("Cannot obtain markup from " + record.getUrl() +".");
fileWritten = false;
scrapeState.addFailedToScrapeURL(record);
} catch (Exception e) {
e.printStackTrace();
}
try {
ScrapeThread.sleep(100 * waitTime);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
process.shutdown();
}
public boolean isFileWritten() {
return fileWritten;
}
}

View File

@ -0,0 +1,99 @@
package eu.dnetlib.bioschemas.api.scraper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.Date;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
public class ScrapingExecution {
private String id;
private Long dateStart;
private Long dateEnd;
private ScrapingStatus status = ScrapingStatus.NOT_YET_STARTED;
private String message;
private static final Log log = LogFactory.getLog(ScrapingExecution.class);
public ScrapingExecution() {}
public ScrapingExecution(final String id, final Long dateStart, final Long dateEnd, final ScrapingStatus status, final String message) {
this.id = id;
this.dateStart = dateStart;
this.dateEnd = dateEnd;
this.status = status;
this.message = message;
}
public String getId() {
return id;
}
public void setId(final String id) {
this.id = id;
}
public Long getDateStart() {
return dateStart;
}
public void setDateStart(final Long dateStart) {
this.dateStart = dateStart;
}
public Long getDateEnd() {
return dateEnd;
}
public void setDateEnd(final Long dateEnd) {
this.dateEnd = dateEnd;
}
public ScrapingStatus getStatus() {
return status;
}
public void setStatus(final ScrapingStatus status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(final String message) {
this.message = message;
}
public void startNew(final String message) {
setId("scraping-" + UUID.randomUUID());
setDateStart(System.currentTimeMillis());
setDateEnd(null);
setStatus(ScrapingStatus.RUNNING);
setMessage(message);
log.info(message);
}
public void complete() {
setDateEnd(System.currentTimeMillis());
setStatus(ScrapingStatus.SUCCESS);
final long millis = getDateEnd() - getDateStart();
setMessage(String
.format("Scraping completed in %d min, %d sec", TimeUnit.MILLISECONDS.toMinutes(millis), TimeUnit.MILLISECONDS.toSeconds(millis) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))));
log.info(getMessage());
}
public void fail(final Throwable e) {
setDateEnd(new Date().getTime());
setStatus(ScrapingStatus.FAILED);
setMessage(e.getMessage());
log.error("Error scraping", e);
}
}

View File

@ -0,0 +1,40 @@
package eu.dnetlib.bioschemas.api.scraper;
import eu.dnetlib.bioschemas.api.ServiceScrapeDriver;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
@Component
public class ScrapingExecutor {
private final ScrapingExecution lastScrapingExecution = new ScrapingExecution();
public ScrapingExecution getLastScrapingExecution() {
return lastScrapingExecution;
}
public ScrapingExecution startScraping(final String datasourceKey, final String sitemapUrl, final String outputDataPattern, final String remoteAddr, final String outputFolder) {
synchronized (lastScrapingExecution) {
if (lastScrapingExecution.getStatus() != ScrapingStatus.RUNNING) {
lastScrapingExecution.startNew("Scraping for " + datasourceKey + " " + sitemapUrl + " - request from " + remoteAddr);
new Thread(() -> {
try {
String sitemapUrlKey = "loc";
String outputFilename = datasourceKey.concat(outputDataPattern);
ServiceScrapeDriver service = new ServiceScrapeDriver(sitemapUrl, sitemapUrlKey, null, outputFilename, outputFolder);
service.runScrape();
lastScrapingExecution.complete();
} catch (final Throwable e) {
lastScrapingExecution.fail(e);
}
}).start();
} else {
final long now = System.currentTimeMillis();
return new ScrapingExecution(null, now, now, ScrapingStatus.NOT_LAUNCHED, "An other scraping is running");
}
}
return lastScrapingExecution;
}
}

View File

@ -0,0 +1,9 @@
package eu.dnetlib.bioschemas.api.scraper;
public enum ScrapingStatus {
SUCCESS,
FAILED,
RUNNING,
NOT_LAUNCHED,
NOT_YET_STARTED
}

View File

@ -0,0 +1,71 @@
package eu.dnetlib.bioschemas.api.scraper;
import eu.dnetlib.bioschemas.api.crawl.StatusOfScrape;
import hwu.elixir.scrape.exceptions.*;
import hwu.elixir.scrape.scraper.ScraperFilteredCore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provides the
* actual scraping functionality.
*
* Scrapes a given URL, converts into NQuads and writes to a file (name derived
* from URL). If the file already exists it will be overwritten.
*
*
* @see ScraperFilteredCore
*
*/
public class ServiceScraper extends ScraperFilteredCore {
private static Logger logger = LoggerFactory.getLogger(ServiceScraper.class);
private StatusOfScrape status= null;
/**
* Orchestrates the process of scraping a site before converting the extracted
* triples to NQuads and writing to a file.
*
* @param url Site to be scraped
* @param contextCounter Number used to generate the named graph/context and
* the URLs used to replace blank nodes.
* @param outputFolderName Location to which the NQuads will be written
* @return True if success; false otherwise
* @throws FourZeroFourException
* @throws JsonLDInspectionException
* @throws CannotWriteException
* @throws MissingMarkupException
*
*/
public boolean scrape(String url, Long contextCounter, String outputFolderName, String fileName, StatusOfScrape status) throws FourZeroFourException, JsonLDInspectionException, CannotWriteException, MissingMarkupException {
this.status = status;
logger.info("scraping "+url + " to "+fileName);
return scrape(url, outputFolderName, fileName, contextCounter, true);
}
@Override
/* Now takes account of StateOfCrawl
*/
protected String wrapHTMLExtraction(String url) throws FourZeroFourException {
String html = "";
if (status.equals(StatusOfScrape.UNTRIED) || status.equals(StatusOfScrape.FAILED)) {
try {
html = getHtmlViaSelenium(url);
} catch (SeleniumException e) {
// try again
try {
html = getHtmlViaSelenium(url);
} catch (SeleniumException e2) {
return "";
}
}
} else {
return "";
}
return html;
}
}

View File

@ -0,0 +1,28 @@
package eu.dnetlib.bioschemas.api.utils;
/**
* @author enrico.ottonello
*
*/
public class BioschemasException extends Exception{
public BioschemasException() {
}
public BioschemasException(final String message) {
super(message);
}
public BioschemasException(final String message, final Throwable cause) {
super(message, cause);
}
public BioschemasException(final Throwable cause) {
super(cause);
}
public BioschemasException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@ -0,0 +1,34 @@
package eu.dnetlib.bioschemas.api.utils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class CompressorUtil {
public static String decompressValue(final String abstractCompressed) {
try {
byte[] byteArray = Base64.decodeBase64(abstractCompressed.getBytes());
GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(byteArray));
final StringWriter stringWriter = new StringWriter();
IOUtils.copy(gis, stringWriter);
return stringWriter.toString();
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
public static String compressValue(final String value) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip = new GZIPOutputStream(out);
gzip.write(value.getBytes());
gzip.close();
return java.util.Base64.getEncoder().encodeToString(out.toByteArray());
}
}

View File

@ -0,0 +1,64 @@
package eu.dnetlib.bioschemas.api.utils;
import hwu.elixir.utils.Helpers;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
public class UrlParser {
private static final Logger logger = LoggerFactory.getLogger(UrlParser.class.getName());
public static Elements getSitemapList(String url, String sitemapURLKey) throws IOException {
Document doc = new Document(url);
Document urlSitemapListsNested;
Elements elements = new Elements();
Elements sitemaps = new Elements();
boolean sitemapindex = false;
boolean urlset = false;
try {
int urlLength = url.length();
logger.info("parse sitemap list");
String sitemapExt = url.substring(urlLength - 3, urlLength);
if (sitemapExt.equalsIgnoreCase(".gz")) { // this checks only the extension at the ending
logger.info("compressed sitemap");
byte[] bytes = Jsoup.connect(url).ignoreContentType(true).execute().bodyAsBytes();
doc = Helpers.gzipFileDecompression(bytes);
} else {
doc = Jsoup.connect(url).maxBodySize(0).get();
}
} catch (IOException e) {
logger.error("Jsoup parsing exception: " + e.getMessage());
}
try {
elements = doc.select(sitemapURLKey);
// check the html if it is a sitemapindex or a urlset
sitemapindex = doc.outerHtml().contains("sitemapindex");
urlset = doc.outerHtml().contains("urlset");
} catch (NullPointerException e) {
logger.error(e.getMessage());
}
if (sitemapindex) {
// if sitemapindex get the loc of all the sitemaps
// added warning for sitemap index files
logger
.warn(
"please note this is a sitemapindex file which is not currently supported, please use the content (url) of the urlset instead");
sitemaps = doc.select(sitemapURLKey);
}
return elements;
}
}

View File

@ -0,0 +1,27 @@
server.servlet.context-path=/bioschemas-api
server.port=8281
server.public_url = http://localhost:8281/bioschemas-api
server.public_desc = API Base URL
spring.profiles.active=garr
logging.file.name = /var/log/bioschemas-api/bioschemas.log
maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/bioschemas-api/effective-pom.xml
spring.main.banner-mode = off
logging.level.root = INFO
management.endpoints.web.exposure.include = prometheus,health
management.endpoints.web.base-path = /
management.endpoints.web.path-mapping.prometheus = metrics
management.endpoints.web.path-mapping.health = health
waitTime=5
outputFolder=/data/bioschemas-harvest
outputDataPattern=_base64_gzipped_nquads.txt
numberOfPagesToCrawlInALoop=8
totalNumberOfPagesToCrawlInASession=32
scrapeVersion=1

View File

@ -4,8 +4,8 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.1.1</version>
<relativePath>../</relativePath>
<version>3.5.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -18,14 +18,6 @@
<dependencies>
<!-- Mail -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<!-- Openaire -->
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
@ -33,16 +25,42 @@
<version>${project.version}</version>
</dependency>
<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -1,12 +1,52 @@
package eu.dnetlib.broker;
import java.util.ArrayList;
import java.util.List;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import eu.dnetlib.common.app.AbstractDnetApp;
import io.swagger.v3.oas.models.tags.Tag;
@SpringBootApplication
public class LiteratureBrokerServiceApplication {
public class LiteratureBrokerServiceApplication extends AbstractDnetApp {
public static final String TAG_EVENTS = "Events";
public static final String TAG_SUBSCRIPTIONS = "Subscriptions";
public static final String TAG_NOTIFICATIONS = "Notifications";
public static final String TAG_TOPIC_TYPES = "Topic Types";
public static final String TAG_OPENAIRE = "OpenAIRE";
public static final String TAG_MATCHING = "Subscription-Event Matching";
public static void main(final String[] args) {
SpringApplication.run(LiteratureBrokerServiceApplication.class, args);
}
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("Broker APIs")
.pathsToMatch("/api/**")
.build();
}
@Override
protected String swaggerTitle() {
return "OpenAIRE Broker API";
}
@Override
protected List<Tag> swaggerTags() {
final List<Tag> tags = new ArrayList<>();
tags.add(new Tag().name(TAG_EVENTS).description("Events management"));
tags.add(new Tag().name(TAG_SUBSCRIPTIONS).description("Subscriptions management"));
tags.add(new Tag().name(TAG_NOTIFICATIONS).description("Notifications management"));
tags.add(new Tag().name(TAG_TOPIC_TYPES).description("Topic types management"));
tags.add(new Tag().name(TAG_OPENAIRE).description("OpenAIRE use case"));
return tags;
}
}

View File

@ -1,13 +1,10 @@
package eu.dnetlib.broker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.client.RestClients;
@ -19,74 +16,30 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.common.elasticsearch.Notification;
import eu.dnetlib.broker.common.properties.ElasticSearchProperties;
import io.prometheus.client.exporter.MetricsServlet;
import io.prometheus.client.hotspot.DefaultExports;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Tag;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
@EnableCaching
@EnableScheduling
@EnableTransactionManagement
@EnableElasticsearchRepositories(basePackageClasses = {
Event.class, Notification.class
})
@ComponentScan(basePackages = "eu.dnetlib")
public class LiteratureBrokerServiceConfiguration extends AbstractElasticsearchConfiguration {
private static final Log log = LogFactory.getLog(LiteratureBrokerServiceConfiguration.class);
@Autowired
private ElasticSearchProperties elasticSearchProperties;
public static final String TAG_EVENTS = "Events";
public static final String TAG_SUBSCRIPTIONS = "Subscriptions";
public static final String TAG_NOTIFICATIONS = "Notifications";
public static final String TAG_TOPIC_TYPES = "Topic Types";
public static final String TAG_OPENAIRE = "OpenAIRE";
public static final String TAG_MATCHING = "Subscription-Event Matching";
@Override
@Bean
public RestHighLevelClient elasticsearchClient() {
final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo(elasticSearchProperties.getClusterNodes())
.connectedTo(elasticSearchProperties.getClusterNodes().split(","))
.withConnectTimeout(elasticSearchProperties.getConnectionTimeout())
.withSocketTimeout(elasticSearchProperties.getSocketTimeout())
.build();
return RestClients.create(clientConfiguration).rest();
}
@Bean
public static Docket newSwaggerDocket() {
log.info("Initializing SWAGGER...");
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(p -> p.startsWith("/api/"))
.build()
.tags(new Tag(TAG_EVENTS, "Events management"), new Tag(TAG_SUBSCRIPTIONS, "Subscriptions management"), new Tag(TAG_NOTIFICATIONS,
"Notifications management"), new Tag(TAG_TOPIC_TYPES, "Topic types management"), new Tag(TAG_OPENAIRE, "OpenAIRE use case"))
.apiInfo(new ApiInfo(
"Literature Broker Service",
"APIs documentation",
"1.1",
"urn:tos",
ApiInfo.DEFAULT_CONTACT,
"Apache 2.0",
"http://www.apache.org/licenses/LICENSE-2.0"));
}
@Bean
@ConditionalOnMissingBean(name = "prometheusMetricsServletRegistrationBean")
ServletRegistrationBean<MetricsServlet> prometheusMetricsServletRegistrationBean(@Value("${prometheus.metrics.path:/metrics}") final String metricsPath) {
DefaultExports.initialize();
return new ServletRegistrationBean<>(new MetricsServlet(), metricsPath);
}
}

View File

@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.common.elasticsearch.EventRepository;
import eu.dnetlib.broker.common.elasticsearch.NotificationRepository;
import eu.dnetlib.broker.common.stats.OpenaireDsStatRepository;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import eu.dnetlib.broker.common.topics.TopicTypeRepository;
import eu.dnetlib.broker.controllers.objects.BufferStatus;
@ -25,10 +25,11 @@ import eu.dnetlib.broker.events.output.NotificationDispatcher;
import eu.dnetlib.broker.utils.LbsQueue;
import eu.dnetlib.broker.utils.QueueManager;
import eu.dnetlib.broker.utils.ThreadManager;
import eu.dnetlib.common.controller.AbstractDnetController;
@RestController
@RequestMapping("/ajax")
public class AjaxController extends AbstractLbsController {
public class AjaxController extends AbstractDnetController {
@Autowired
private EventRepository eventRepository;
@ -54,6 +55,9 @@ public class AjaxController extends AbstractLbsController {
@Autowired
private ThreadManager threadManager;
@Autowired
private OpenaireDsStatRepository openaireDsStatRepository;
@Value("${lbs.elastic.homepage}")
private String elasticSearchUiUrl;
@ -92,9 +96,10 @@ public class AjaxController extends AbstractLbsController {
currentStatus.setDispatchers(dispatchers);
currentStatus.setThreads(threads);
currentStatus.getTotals().put("topics", topicTypeRepo.count());
currentStatus.getTotals().put("events", eventRepository.count());
currentStatus.getTotals().put("events_es", eventRepository.count());
currentStatus.getTotals().put("events_db", openaireDsStatRepository.totalEvents());
currentStatus.getTotals().put("subscriptions", subscriptionRepo.count());
currentStatus.getTotals().put("notifications", notificationRepository.count());
currentStatus.getTotals().put("notifications_es", notificationRepository.count());
return currentStatus;
}

View File

@ -8,6 +8,6 @@ public class ApiDocController {
@GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" })
public String apiDoc() {
return "redirect:swagger-ui.html";
return "redirect:swagger-ui/index.html";
}
}

View File

@ -23,23 +23,23 @@ import org.springframework.web.bind.annotation.RestController;
import com.google.common.collect.Lists;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.LiteratureBrokerServiceApplication;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.common.elasticsearch.EventRepository;
import eu.dnetlib.broker.common.elasticsearch.EventStatsManager;
import eu.dnetlib.broker.common.elasticsearch.EventStatsManager.BrowseEntry;
import eu.dnetlib.broker.common.subscriptions.Subscription;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@RestController
@RequestMapping("/api/events")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_EVENTS)
public class EventsController extends AbstractLbsController {
@Tag(name = LiteratureBrokerServiceApplication.TAG_EVENTS)
public class EventsController extends AbstractDnetController {
private static final Log log = LogFactory.getLog(EventsController.class);
private static final Log log = LogFactory.getLog(AbstractDnetController.class);
@Autowired
private EventRepository eventRepository;
@ -50,25 +50,25 @@ public class EventsController extends AbstractLbsController {
@Autowired
private EventStatsManager eventStatsManager;
@ApiOperation("Return an event by ID")
@Operation(summary = "Return an event by ID")
@GetMapping("/{id}")
public Event getEvent(@PathVariable final String id) {
return eventRepository.findById(id).get();
}
@ApiOperation("Delete an event by ID")
@Operation(summary = "Delete an event by ID")
@DeleteMapping("/{id}")
public void deleteEvent(@PathVariable final String id) {
eventRepository.deleteById(id);
}
@ApiOperation("Save an event by ID")
@Operation(summary = "Save an event by ID")
@PostMapping("/{id}")
public Event saveEvent(@RequestBody final Event event) {
return eventRepository.save(event);
}
@ApiOperation("Return a page of events")
@Operation(summary = "Return a page of events")
@GetMapping("/list/{page}/{pageSize}")
public List<Event> events(
@PathVariable final int page,
@ -76,7 +76,7 @@ public class EventsController extends AbstractLbsController {
return Lists.newArrayList(eventRepository.findAll(PageRequest.of(page, pageSize)));
}
@ApiOperation("Return a page of events by topic")
@Operation(summary = "Return a page of events by topic")
@GetMapping("/byTopic/{page}/{pageSize}")
public List<Event> eventsByTopic(
@PathVariable final int page,
@ -85,7 +85,7 @@ public class EventsController extends AbstractLbsController {
return Lists.newArrayList(eventRepository.findByTopic(topic, PageRequest.of(page, pageSize)));
}
@ApiOperation("Delete all the events")
@Operation(summary = "Delete all the events")
@DeleteMapping("/all")
public Map<String, Object> clearEvents() {
eventRepository.deleteAll();
@ -94,13 +94,13 @@ public class EventsController extends AbstractLbsController {
return res;
}
@ApiOperation("Delete the expired events")
@Operation(summary = "Delete the expired events")
@DeleteMapping("/expired")
public Map<String, Object> deleteExpiredEvents() {
return deleteEventsByExpiryDate(0, new Date().getTime());
}
@ApiOperation("Delete the events with the creationDate in a range")
@Operation(summary = "Delete the events with the creationDate in a range")
@DeleteMapping("/byCreationDate/{from}/{to}")
public Map<String, Long> deleteEventsByCreationDate(@PathVariable final long from, @PathVariable final long to) {
final Map<String, Long> res = new HashMap<>();
@ -113,7 +113,7 @@ public class EventsController extends AbstractLbsController {
return res;
}
@ApiOperation("Delete the events with the expiryDate in a range")
@Operation(summary = "Delete the events with the expiryDate in a range")
@DeleteMapping("/byExpiryDate/{from}/{to}")
public Map<String, Object> deleteEventsByExpiryDate(@PathVariable final long from, @PathVariable final long to) {
new Thread(() -> {
@ -128,13 +128,13 @@ public class EventsController extends AbstractLbsController {
return res;
}
@ApiOperation("Return the topics of the indexed events (all)")
@Operation(summary = "Return the topics of the indexed events (all)")
@GetMapping("/topics/all")
public List<BrowseEntry> browseTopics() {
return eventStatsManager.browseTopics();
}
@ApiOperation("Return the topics of the indexed events (only with subscriptions)")
@Operation(summary = "Return the topics of the indexed events (only with subscriptions)")
@GetMapping("/topics/withSubscriptions")
public List<BrowseEntry> browseTopicsWithSubscriptions() {

View File

@ -14,48 +14,47 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.common.elasticsearch.Notification;
import eu.dnetlib.broker.common.elasticsearch.NotificationRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@RestController
@RequestMapping("/api/notifications")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_NOTIFICATIONS)
public class NotificationsController extends AbstractLbsController {
@Tag(name = "LiteratureBrokerServiceApplication.TAG_NOTIFICATIONS")
public class NotificationsController extends AbstractDnetController {
private static final Log log = LogFactory.getLog(NotificationsController.class);
@Autowired
private NotificationRepository notificationRepository;
@ApiOperation("Return a notification by ID")
@Operation(summary = "Return a notification by ID")
@GetMapping("/{id}")
public Notification getNotification(@PathVariable final String id) {
return notificationRepository.findById(id).get();
}
@ApiOperation("Delete a notification by ID")
@Operation(summary = "Delete a notification by ID")
@DeleteMapping("/{id}")
public void deleteNotification(@PathVariable final String id) {
notificationRepository.deleteById(id);
}
@ApiOperation("Save a notification by ID")
@Operation(summary = "Save a notification by ID")
@PostMapping("/{id}")
public Notification saveNotification(@RequestBody final Notification notification) {
return notificationRepository.save(notification);
}
@ApiOperation("Delete all notifications")
@Operation(summary = "Delete all notifications")
@DeleteMapping("")
public void deleteAllNotifications() {
notificationRepository.deleteAll();
}
@ApiOperation("Delete the notifications with the date in a range")
@Operation(summary = "Delete the notifications with the date in a range")
@DeleteMapping("/byDate/{from}/{to}")
public Map<String, Object> deleteNotificationsByDate(@PathVariable final long from, @PathVariable final long to) {
new Thread(() -> {

View File

@ -11,19 +11,19 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.LiteratureBrokerServiceApplication;
import eu.dnetlib.broker.common.subscriptions.Subscription;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import eu.dnetlib.broker.matchers.SubscriptionEventMatcher;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@Profile("!openaire")
@RestController
@RequestMapping("/api/matching")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_MATCHING)
public class StartMatchingController extends AbstractLbsController {
@Tag(name = LiteratureBrokerServiceApplication.TAG_MATCHING)
public class StartMatchingController extends AbstractDnetController {
@Autowired
private SubscriptionRepository subscriptionRepo;
@ -31,7 +31,7 @@ public class StartMatchingController extends AbstractLbsController {
@Autowired(required = false)
private SubscriptionEventMatcher subscriptionEventMatcher;
@ApiOperation("Launch the thread that produces new notifications")
@Operation(summary = "Launch the thread that produces new notifications")
@GetMapping("/start")
public List<String> startMatching() {
if (subscriptionEventMatcher != null) {
@ -42,7 +42,7 @@ public class StartMatchingController extends AbstractLbsController {
}
}
@ApiOperation("Launch the thread that produces new notifications by subscriptuion id")
@Operation(summary = "Launch the thread that produces new notifications by subscriptuion id")
@GetMapping("/start/{subscriptionId}")
public List<String> startMatching(@PathVariable final String subscriptionId) {
final Optional<Subscription> s = subscriptionRepo.findById(subscriptionId);

View File

@ -21,21 +21,21 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.LiteratureBrokerServiceApplication;
import eu.dnetlib.broker.common.elasticsearch.NotificationRepository;
import eu.dnetlib.broker.common.subscriptions.MapCondition;
import eu.dnetlib.broker.common.subscriptions.NotificationFrequency;
import eu.dnetlib.broker.common.subscriptions.NotificationMode;
import eu.dnetlib.broker.common.subscriptions.Subscription;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@RestController
@RequestMapping("/api/subscriptions")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_SUBSCRIPTIONS)
public class SubscriptionsController extends AbstractLbsController {
@Tag(name = LiteratureBrokerServiceApplication.TAG_SUBSCRIPTIONS)
public class SubscriptionsController extends AbstractDnetController {
@Autowired
private SubscriptionRepository subscriptionRepo;
@ -43,7 +43,7 @@ public class SubscriptionsController extends AbstractLbsController {
@Autowired
private NotificationRepository notificationRepo;
public static final Predicate<String> verifyTopic = Pattern.compile("^[a-zA-Z0-9._-]+(\\/[a-zA-Z0-9._-]+)+$").asPredicate();
public static final Predicate<String> verifyTopic = Pattern.compile("^([a-zA-Z0-9._-]+(\\/[a-zA-Z0-9._-]+)+)|\\*$").asPredicate();
public static final Predicate<String> verifyEmail = email -> {
try {
new InternetAddress(email).validate();
@ -53,26 +53,26 @@ public class SubscriptionsController extends AbstractLbsController {
}
};
@ApiOperation("Return the list of subscriptions")
@Operation(summary = "Return the list of subscriptions")
@GetMapping("")
public Iterable<Subscription> listSubscriptions() {
return subscriptionRepo.findAll();
}
@ApiOperation("Return a subscription by ID")
@Operation(summary = "Return a subscription by ID")
@GetMapping("/{id}")
public Subscription getSubscription(@PathVariable final String id) {
return subscriptionRepo.findById(id).get();
}
@ApiOperation("Delete a subscription by ID and its notifications")
@Operation(summary = "Delete a subscription by ID and its notifications")
@DeleteMapping("/{id}")
public void deleteSubscription(@PathVariable final String id) {
subscriptionRepo.deleteById(id);
notificationRepo.deleteBySubscriptionId(id);
}
@ApiOperation("Perform a new subscription")
@Operation(summary = "Perform a new subscription")
@PostMapping("")
public Subscription registerSubscription(@RequestBody final InSubscription inSub) {
final Subscription sub = inSub.asSubscription();
@ -80,7 +80,7 @@ public class SubscriptionsController extends AbstractLbsController {
return sub;
}
@ApiOperation("Delete all subscriptions and notifications")
@Operation(summary = "Delete all subscriptions and notifications")
@DeleteMapping("")
public Map<String, Object> clearSubscriptions() {
final Map<String, Object> res = new HashMap<>();
@ -90,7 +90,7 @@ public class SubscriptionsController extends AbstractLbsController {
return res;
}
@ApiOperation("Reset the last notification date")
@Operation(summary = "Reset the last notification date")
@DeleteMapping("/{id}/date")
public void deleteNotificationDate(@PathVariable final String id) {
final Subscription s = subscriptionRepo.findById(id).get();
@ -98,7 +98,7 @@ public class SubscriptionsController extends AbstractLbsController {
subscriptionRepo.save(s);
}
@ApiOperation("Reset all the last notification dates")
@Operation(summary = "Reset all the last notification dates")
@GetMapping("/resetLastNotificationDates")
public void deleteAllNotificationDates() {
for (final Subscription s : subscriptionRepo.findAll()) {

View File

@ -18,17 +18,17 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.LiteratureBrokerServiceApplication;
import eu.dnetlib.broker.common.topics.TopicType;
import eu.dnetlib.broker.common.topics.TopicTypeRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@RestController
@RequestMapping("/api/topic-types")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_TOPIC_TYPES)
public class TopicsController extends AbstractLbsController {
@Tag(name = LiteratureBrokerServiceApplication.TAG_TOPIC_TYPES)
public class TopicsController extends AbstractDnetController {
@Autowired
private TopicTypeRepository topicTypeRepo;
@ -36,13 +36,13 @@ public class TopicsController extends AbstractLbsController {
private final Predicate<String> verifyExpression =
Pattern.compile("^([a-zA-Z0-9._-]+|<[a-zA-Z0-9._-]+>)(\\/([a-zA-Z0-9._-]+|<[a-zA-Z0-9._-]+>))+$").asPredicate();
@ApiOperation("Return the list of topic types")
@Operation(summary = "Return the list of topic types")
@GetMapping("")
public Iterable<TopicType> listTopicTypes() {
return topicTypeRepo.findAll();
}
@ApiOperation("Register a new topic type")
@Operation(summary = "Register a new topic type")
@PostMapping("/add")
public TopicType registerTopicType(@RequestParam final String name,
@RequestParam final String expression,
@ -61,20 +61,20 @@ public class TopicsController extends AbstractLbsController {
return type;
}
@ApiOperation("Return a topic type by ID")
@Operation(summary = "Return a topic type by ID")
@GetMapping("/{id}")
public TopicType getTopicType(@PathVariable final String id) {
return topicTypeRepo.findById(id).get();
}
@ApiOperation("Delete a topic type by ID")
@Operation(summary = "Delete a topic type by ID")
@DeleteMapping("/{id}")
public List<String> deleteTopicType(@PathVariable final String id) {
topicTypeRepo.deleteById(id);
return Arrays.asList("Done.");
}
@ApiOperation("Delete all topic types")
@Operation(summary = "Delete all topic types")
@DeleteMapping("")
public Map<String, Object> clearTopicTypes() {
final Map<String, Object> res = new HashMap<>();

View File

@ -44,6 +44,15 @@ public class EmailDispatcher extends AbstractNotificationDispatcher<Message> {
@Value("${lbs.mail.message.template}")
private Resource emailTemplate;
@Value("${lbs.mail.message.template.dashboard.baseUrl}")
private String dashboardBaseUrl;
@Value("${lbs.mail.message.template.dashboard.helpdesk}")
private String helpdesk;
@Value("${lbs.mail.message.template.publicApi}")
private String publicApi;
public static final int MAX_NUMBER_OF_EVENTS = 20;
private static final Log log = LogFactory.getLog(EmailDispatcher.class);
@ -75,12 +84,15 @@ public class EmailDispatcher extends AbstractNotificationDispatcher<Message> {
return prepareMimeMessage(subscription, content);
}
private String generateMailContent(final Subscription subscription, final Map<String, Object> params, final Event... events) throws IOException {
protected String generateMailContent(final Subscription subscription, final Map<String, Object> params, final Event... events) throws IOException {
final StringTemplate st = new StringTemplate(IOUtils.toString(emailTemplate.getInputStream(), StandardCharsets.UTF_8));
st.setAttribute("sub", subscription);
st.setAttribute("total", events.length);
st.setAttribute("max", MAX_NUMBER_OF_EVENTS);
st.setAttribute("dashboardBaseUrl", dashboardBaseUrl.trim());
st.setAttribute("publicApi", publicApi.trim());
st.setAttribute("helpdesk", helpdesk.trim());
if (events.length > MAX_NUMBER_OF_EVENTS) {
st.setAttribute("events", Arrays.copyOfRange(events, 0, MAX_NUMBER_OF_EVENTS));
@ -154,4 +166,36 @@ public class EmailDispatcher extends AbstractNotificationDispatcher<Message> {
return NotificationMode.EMAIL;
}
protected Resource getEmailTemplate() {
return emailTemplate;
}
protected void setEmailTemplate(final Resource emailTemplate) {
this.emailTemplate = emailTemplate;
}
protected String getDashboardBaseUrl() {
return dashboardBaseUrl;
}
protected void setDashboardBaseUrl(final String dashboardBaseUrl) {
this.dashboardBaseUrl = dashboardBaseUrl;
}
protected String getHelpdesk() {
return helpdesk;
}
protected void setHelpdesk(final String helpdesk) {
this.helpdesk = helpdesk;
}
protected String getPublicApi() {
return publicApi;
}
protected void setPublicApi(final String publicApi) {
this.publicApi = publicApi;
}
}

View File

@ -8,7 +8,7 @@ import org.apache.commons.lang3.math.NumberUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.Operator;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.search.MatchQuery.ZeroTermsQuery;
import org.elasticsearch.index.search.MatchQueryParser.ZeroTermsQuery;
import eu.dnetlib.broker.common.utils.DateParser;

View File

@ -10,12 +10,16 @@ import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.NestedQueryBuilder;
import org.elasticsearch.index.query.Operator;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
@ -31,6 +35,8 @@ import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -39,8 +45,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.broker.LiteratureBrokerServiceConfiguration;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.LiteratureBrokerServiceApplication;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.common.elasticsearch.Notification;
import eu.dnetlib.broker.common.elasticsearch.NotificationRepository;
@ -50,14 +55,15 @@ import eu.dnetlib.broker.common.subscriptions.Subscription;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import eu.dnetlib.broker.events.output.DispatcherManager;
import eu.dnetlib.broker.objects.OaBrokerEventPayload;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@Profile("openaire")
@RestController
@RequestMapping("/api/openaireBroker")
@Api(tags = LiteratureBrokerServiceConfiguration.TAG_OPENAIRE)
public class OpenaireBrokerController extends AbstractLbsController {
@Tag(name = LiteratureBrokerServiceApplication.TAG_OPENAIRE)
public class OpenaireBrokerController extends AbstractDnetController {
@Autowired
private ElasticsearchOperations esOperations;
@ -74,12 +80,18 @@ public class OpenaireBrokerController extends AbstractLbsController {
@Autowired
private DispatcherManager dispatcher;
@Autowired
private JdbcTemplate jdbcTemplate;
private static final Log log = LogFactory.getLog(OpenaireBrokerController.class);
@ApiOperation("Return the datasources having events")
@Operation(summary = "Return the datasources having events")
@GetMapping("/datasources")
public List<BrowseEntry> findDatasourcesWithEvents() {
public List<BrowseEntry> findDatasourcesWithEvents(@RequestParam(defaultValue = "false", required = false) final boolean useIndex) {
return useIndex ? findDatasourcesWithEventsUsingIndex() : findDatasourcesWithEventsUsingDb();
}
private List<BrowseEntry> findDatasourcesWithEventsUsingIndex() {
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.matchAllQuery())
.withSearchType(SearchType.DEFAULT)
@ -100,10 +112,25 @@ public class OpenaireBrokerController extends AbstractLbsController {
.collect(Collectors.toList());
}
@ApiOperation("Return the topics of the events of a datasource")
@GetMapping("/topicsForDatasource")
public List<BrowseEntry> findTopicsForDatasource(@RequestParam final String ds) {
private List<BrowseEntry> findDatasourcesWithEventsUsingDb() {
try {
final String sql = IOUtils.toString(getClass().getResourceAsStream("/sql/datasourceTopics.sql"));
final RowMapper<BrowseEntry> mapper = (rs, rowNum) -> new BrowseEntry(rs.getString("name"), rs.getLong("size"));
return jdbcTemplate.query(sql, mapper);
} catch (final Exception e) {
log.error("Error executing query", e);
return new ArrayList<>();
}
}
@Operation(summary = "Return the topics of the events of a datasource")
@GetMapping("/topicsForDatasource")
public List<BrowseEntry> findTopicsForDatasource(@RequestParam final String ds,
@RequestParam(defaultValue = "false", required = false) final boolean useIndex) {
return useIndex ? findTopicsForDatasourceUsingIndex(ds) : findTopicsForDatasourceUsingDb(ds);
}
private List<BrowseEntry> findTopicsForDatasourceUsingIndex(final String ds) {
final String term = "topic.keyword";
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
@ -122,14 +149,32 @@ public class OpenaireBrokerController extends AbstractLbsController {
.collect(Collectors.toList());
}
@ApiOperation("Return a page of events of a datasource (by topic)")
private List<BrowseEntry> findTopicsForDatasourceUsingDb(final String ds) {
try {
final String sql = IOUtils.toString(getClass().getResourceAsStream("/sql/datasourceTopicsDetailed.sql"));
final RowMapper<BrowseEntry> mapper = (rs, rowNum) -> new BrowseEntry(rs.getString("topic"), rs.getLong("size"));
return jdbcTemplate.query(sql, new Object[] {
ds
}, mapper);
} catch (final Exception e) {
log.error("Error executing query", e);
return new ArrayList<>();
}
}
@Operation(summary = "Return a page of events of a datasource (by topic)")
@GetMapping("/events/{nPage}/{size}")
public EventsPage showEvents(@RequestParam final String ds, @RequestParam final String topic, @PathVariable final int nPage, @PathVariable final int size) {
final NestedQueryBuilder nestedQuery = QueryBuilders.nestedQuery("map", QueryBuilders.matchQuery("map.targetDatasourceName", ds), ScoreMode.None);
final QueryBuilder q = StringUtils.isNotBlank(topic) && !topic.equals("*") ? QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("topic", topic).operator(Operator.AND))
.must(nestedQuery) : nestedQuery;
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("topic", topic).operator(Operator.AND))
.must(QueryBuilders.nestedQuery("map", QueryBuilders.matchQuery("map.targetDatasourceName", ds), ScoreMode.None)))
.withQuery(q)
.withSearchType(SearchType.DEFAULT)
.withFields("payload")
.withPageable(PageRequest.of(nPage, size))
@ -146,7 +191,7 @@ public class OpenaireBrokerController extends AbstractLbsController {
return new EventsPage(ds, topic, nPage, overrideGetTotalPage(page, size), page.getTotalHits(), list);
}
@ApiOperation("Return a page of events of a datasource (by query)")
@Operation(summary = "Return a page of events of a datasource (by query)")
@PostMapping("/events/{nPage}/{size}")
public EventsPage advancedShowEvents(@PathVariable final int nPage, @PathVariable final int size, @RequestBody final AdvQueryObject qObj) {
@ -158,10 +203,14 @@ public class OpenaireBrokerController extends AbstractLbsController {
ElasticSearchQueryUtils.addMapConditionForTrust(mapQuery, "map.trust", qObj.getTrust());
ElasticSearchQueryUtils.addMapConditionForDates(mapQuery, "map.targetDateofacceptance", qObj.getDates());
final NestedQueryBuilder nestedQuery = QueryBuilders.nestedQuery("map", mapQuery, ScoreMode.None);
final QueryBuilder q = StringUtils.isNotBlank(qObj.getTopic()) && !qObj.getTopic().equals("*") ? QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("topic", qObj.getTopic()).operator(Operator.AND))
.must(nestedQuery) : nestedQuery;
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.boolQuery()
.must(QueryBuilders.matchQuery("topic", qObj.getTopic()).operator(Operator.AND))
.must(QueryBuilders.nestedQuery("map", mapQuery, ScoreMode.None)))
.withQuery(q)
.withSearchType(SearchType.DEFAULT)
.withFields("payload")
.withPageable(PageRequest.of(nPage, size))
@ -178,7 +227,7 @@ public class OpenaireBrokerController extends AbstractLbsController {
return new EventsPage(qObj.getDatasource(), qObj.getTopic(), nPage, overrideGetTotalPage(page, size), page.getTotalHits(), list);
}
@ApiOperation("Perform a subscription")
@Operation(summary = "Perform a subscription")
@PostMapping("/subscribe")
public Subscription registerSubscription(@RequestBody final OpenaireSubscription oSub) {
final Subscription sub = oSub.asSubscription();
@ -188,16 +237,17 @@ public class OpenaireBrokerController extends AbstractLbsController {
return sub;
}
@ApiOperation("Return the subscriptions of an user (by email)")
@Operation(summary = "Return the subscriptions of an user (by email and datasource (optional))")
@GetMapping("/subscriptions")
public Map<String, List<SimpleSubscriptionDesc>> subscriptions(@RequestParam final String email) {
public Map<String, List<SimpleSubscriptionDesc>> subscriptions(@RequestParam final String email, @RequestParam(required = false) final String ds) {
final Iterable<Subscription> iter = subscriptionRepo.findBySubscriber(email);
return StreamSupport.stream(iter.spliterator(), false)
.map(this::subscriptionDesc)
.filter(s -> StringUtils.isBlank(ds) || StringUtils.equalsIgnoreCase(s.getDatasource(), ds))
.collect(Collectors.groupingBy(SimpleSubscriptionDesc::getDatasource));
}
@ApiOperation("Return a page of notifications")
@Operation(summary = "Return a page of notifications")
@GetMapping("/notifications/{subscrId}/{nPage}/{size}")
public EventsPage notifications(@PathVariable final String subscrId, @PathVariable final int nPage, @PathVariable final int size) {
@ -229,13 +279,26 @@ public class OpenaireBrokerController extends AbstractLbsController {
}
@ApiOperation("Send notifications")
@Operation(summary = "Send notifications")
@GetMapping("/notifications/send/{date}")
private List<String> sendMailForNotifications(@PathVariable final long date) {
new Thread(() -> innerSendMailForNotifications(date)).start();
return Arrays.asList("Sending ...");
}
@Operation(summary = "Update stats")
@GetMapping("/stats/update")
private List<String> updateStats() {
new Thread(() -> {
try {
jdbcTemplate.update(IOUtils.toString(getClass().getResourceAsStream("/sql/updateStats.sql")));
} catch (final Exception e) {
log.error("Error updating stats", e);
}
}).start();
return Arrays.asList("Sending ...");
}
private void innerSendMailForNotifications(final long date) {
for (final Subscription s : subscriptionRepo.findAll()) {
@ -243,6 +306,7 @@ public class OpenaireBrokerController extends AbstractLbsController {
if (count > 0) {
final Map<String, Object> params = new HashMap<>();
params.put("oa_notifications_total", count);
params.put("oa_datasource", extractDatasource(s));
dispatcher.sendNotification(s, params);
}
@ -264,7 +328,7 @@ public class OpenaireBrokerController extends AbstractLbsController {
.filter(l -> !l.isEmpty())
.map(l -> l.get(0).getValue())
.findFirst()
.get();
.orElse("");
}
private long overrideGetTotalPage(final SearchHits<?> page, final int size) {

View File

@ -1,9 +1,19 @@
spring.profiles.active = dev,openaire
server.public_url =
server.public_desc = API Base URL
#logging.level.root=DEBUG
spring.datasource.url=jdbc:postgresql://localhost:5432/dnet_broker
spring.datasource.username=
maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/dhp-broker-application/effective-pom.xml
management.endpoints.web.exposure.include = prometheus,health
management.endpoints.web.base-path = /
management.endpoints.web.path-mapping.prometheus = metrics
management.endpoints.web.path-mapping.health = health
spring.datasource.url=jdbc:postgresql://localhost:5432/oa_broker
spring.datasource.username=oa_broker
spring.datasource.password=
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
@ -33,13 +43,16 @@ lbs.elastic.eventsIndexName = oa_events_beta
lbs.elastic.notificationsIndexName = oa_notifications_beta
lbs.mail.from = notifications-noreply@openaire.eu
lbs.mail.fromName = Literature Broker Service
lbs.mail.cc = michele.artini@isti.cnr.it
lbs.mail.fromName = OpenAIRE Broker Service
lbs.mail.cc =
lbs.mail.smtpHost = smtp.isti.cnr.it
lbs.mail.smtpPort = 587
lbs.mail.smtpUser = smtp-dnet
lbs.mail.smtpPassword = hhr*7932
lbs.mail.message.template = classpath:/templates/dhp_openaire_mail.st
lbs.mail.message.template.dashboard.baseUrl = https://provide.openaire.eu/content/notifications/
lbs.mail.message.template.dashboard.helpdesk = https://www.openaire.eu/helpdesk
lbs.mail.message.template.publicApi = https://api.openaire.eu/broker
lbs.queues.maxReturnedValues = 1000
@ -47,8 +60,6 @@ lbs.task.deleteOldEvents.cron = 0 0 4 1/1 * ?
lbs.task.deleteOldNotifications.cron = 0 0 5 1/1 * ?
lbs.task.subscriptionEventsMatcher.cron = 0 0 6 1/1 * ?
spring.data.elasticsearch.cluster-name = ${lbs.elastic.clusterName}
spring.data.elasticsearch.cluster-nodes = ${lbs.elastic.clusterNodes}

View File

@ -18,11 +18,17 @@ CREATE TABLE topic_types (
regex text UNIQUE NOT NULL
);
-- curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=targetDatasourceName"
CREATE TABLE oa_datasource_stats (
id text NOT NULL,
name text NOT NULL,
type text NOT NULL,
topic text NOT NULL,
size bigint NOT NULL,
PRIMARY KEY (id, topic)
);
INSERT INTO public.topic_types (id, name, expression, map_keys, producer_id, regex) VALUES ('tt-a739fa2b-fde0-4eb2-bcee-6e7f277347db', 'ENRICH', 'ENRICH/<cond>/<field>', 'targetDatasourceName', 'OpenAIRE', '^ENRICH\/[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$');
-- curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH_WITH_SUBFIELD&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E%2F%3Csubfield%3E&producerId=OpenAIRE&mapKeys=targetDatasourceName"
INSERT INTO public.topic_types (id, name, expression, map_keys, producer_id, regex) VALUES ('tt-93be0404-e7fb-43bb-9a0a-d317f418ed6d', 'ENRICH_WITH_SUBFIELD', 'ENRICH/<cond>/<field>/<subfield>', 'targetDatasourceName', 'OpenAIRE', '^ENRICH\/[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$');
-- curl "http://localhost:8080/api/topic-types/add" -d "name=ADD&expression=ADD%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=targetDatasourceName"
INSERT INTO public.topic_types (id, name, expression, map_keys, producer_id, regex) VALUES ('tt-80978da9-1859-47aa-9897-0a0c372365a1', 'ADD', 'ADD/<field>', 'targetDatasourceName', 'OpenAIRE', '^ADD\/[a-zA-Z0-9._-]+$');
INSERT INTO public.topic_types (id, name, expression, map_keys, producer_id, regex) VALUES ('tt-75e4b98f-17b8-4c2a-b3c6-d0ad7dfb4d51', '*', '*', 'targetDatasourceName', 'OpenAIRE', '^\*$');

View File

@ -0,0 +1 @@
select (array_agg(name))[1] as name, sum(size) as size from oa_datasource_stats group by lower(name) order by sum(size) desc;

View File

@ -0,0 +1,7 @@
select
topic as topic,
sum(size) as size
from oa_datasource_stats
where lower(name) = lower(?)
group by topic
order by sum(size) desc;

View File

@ -0,0 +1,5 @@
begin;
delete from oa_datasource_stats;
insert into oa_datasource_stats (id, name, type, topic, size) select id, name, type, topic, size from oa_datasource_stats_temp;
drop table oa_datasource_stats_temp;
commit;

File diff suppressed because one or more lines are too long

View File

@ -1,83 +1,58 @@
<h3>Registered Events - topic <span style="font-family: monospace;">{{topic}}</span></h3>
<form style="margin-top:40px;">
<div class="row">
<div class="col-xs-12 col-md-4">
<input type="text" class="form-control" ng-model="searchFilter" placeholder="Filter..."/>
</div>
<div class="col-xs-12 col-md-4">
<ul class="pager">
<li class="disabled" ng-if="page <= 0">
<a href="javascript:void(0)">&larr; Prev</a>
</li>
<li ng-if="page > 0">
<a href="#/events/{{(page*1) - 1}}/{{pageSize}}/{{topic}}">&larr; Prev</a>
</li>
<li class="disabled" ng-if="list.length < pageSize">
<a href="javascript:void(0)">Next &rarr;</a>
</li>
<li ng-if="list.length == pageSize">
<a href="#/events/{{(page*1) + 1}}/{{pageSize}}/{{topic}}">Next &rarr;</a>
</li>
</ul>
</div>
<div class="col-xs-12 col-md-4 text-right">
<a href="#/events" class="btn btn-primary">
<span class="glyphicon glyphicon-chevron-left"></span>
back
</a>
<button class="btn btn-default" ng-click="refresh()">
<span class="glyphicon glyphicon-refresh"></span>
refresh
</button>
</div>
<div class="row mt-4">
<div class="col-xs-12 col-md-4">
<input type="text" class="form-control" ng-model="searchFilter" placeholder="Filter..."/>
</div>
</form>
<div class="col-xs-12 col-md-4 text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="page <= 0" disabled="disabled">&larr; Prev</button>
<a class="btn btn-sm btn-outline-primary" href="#!/events/{{(page*1) - 1}}/{{pageSize}}/{{topic}}" ng-if="page > 0">&larr; Prev</a>
<button class="btn btn-sm btn-outline-primary" ng-if="list.length < pageSize" disabled="disabled">Next &rarr;</button>
<a class="btn btn-sm btn-outline-primary" href="#!/events/{{(page*1) + 1}}/{{pageSize}}/{{topic}}" ng-if="list.length == pageSize">Next &rarr;</a>
</div>
<div class="col-xs-12 col-md-4 text-right">
<a href="#!/events" class="btn btn-sm btn-secondary">
<i class="fas fa-chevron-left"></i>
back
</a>
<button class="btn btn-sm btn-primary" ng-click="refresh()">
<i class="fas fa-redo"></i> refresh
</button>
</div>
</div>
<p>
<table class="table table-striped table-condensed" style="font-size: 12px">
<thead>
<tr>
<th>ID</th>
<th>Producer</th>
<th class="text-center">Creation date</th>
<th class="text-center">Expiry date</th>
<th>Payload</th>
<th>Map</th>
</tr>
</thead>
<tbody>
<tr ng-if="list.length == 0">
<td colspan="6" class="text-center text-muted">No events</td>
</tr>
<tr ng-repeat="s in list | filter: searchFilter">
<th style="font-family: monospace;">{{s.eventId}}</th>
<td style="font-family: monospace;">{{s.producerId}}</td>
<td class="text-center">{{s.creationDate | date:'yyyy-MM-dd HH:mm'}}</td>
<td class="text-center">{{s.expiryDate ? (s.expiryDate | date:'yyyy-MM-dd HH:mm') : 'never'}}</td>
<td>{{s.payload}}</td>
<td style="white-space: pre; font-size: 12px; font-family: monospace;">{{s.map | json}}</td>
</tr>
</tbody>
</table>
</p>
<nav>
<ul class="pager">
<li class="disabled" ng-if="page <= 0">
<a href="javascript:void(0)">&larr; Prev</a>
</li>
<li ng-if="page > 0">
<a href="#/events/{{(page*1) - 1}}/{{pageSize}}/{{topic}}">&larr; Prev</a>
</li>
<table class="table table-striped table-sm small mt-4">
<thead>
<tr>
<th>ID</th>
<th>Producer</th>
<th class="text-center">Creation date</th>
<th class="text-center">Expiry date</th>
<th>Payload</th>
<th>Map</th>
</tr>
</thead>
<tbody>
<tr ng-if="list.length == 0">
<td colspan="6" class="text-center text-muted">No events</td>
</tr>
<tr ng-repeat="s in list | filter: searchFilter">
<th style="font-family: monospace;">{{s.eventId}}</th>
<td style="font-family: monospace;">{{s.producerId}}</td>
<td class="text-center">{{s.creationDate | date:'yyyy-MM-dd HH:mm'}}</td>
<td class="text-center">{{s.expiryDate ? (s.expiryDate | date:'yyyy-MM-dd HH:mm') : 'never'}}</td>
<td>{{s.payload}}</td>
<td style="white-space: pre; font-size: 12px; font-family: monospace;">{{s.map | json}}</td>
</tr>
</tbody>
</table>
<li class="disabled" ng-if="list.length < pageSize">
<a href="javascript:void(0)">Next &rarr;</a>
</li>
<li ng-if="list.length == pageSize">
<a href="#/events/{{(page*1) + 1}}/{{pageSize}}/{{topic}}">Next &rarr;</a>
</li>
</ul>
</nav>
<div class="text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="page <= 0" disabled="disabled">&larr; Prev</button>
<a class="btn btn-sm btn-outline-primary" href="#!/events/{{(page*1) - 1}}/{{pageSize}}/{{topic}}" ng-if="page > 0">&larr; Prev</a>
<button class="btn btn-sm btn-outline-primary" ng-if="list.length < pageSize" disabled="disabled">Next &rarr;</button>
<a class="btn btn-sm btn-outline-primary" href="#!/events/{{(page*1) + 1}}/{{pageSize}}/{{topic}}" ng-if="list.length == pageSize">Next &rarr;</a>
</div>

View File

@ -1,44 +1,39 @@
<h3>Registered events (elasticsearch)</h3>
<div class="row" style="margin-top:24px;">
<div class="col-xs-12 col-md-6 col-lg-3">
<input type="text" class="form-control" ng-model="searchFilter.value" placeholder="Filter..."/>
</div>
<div class="col-xs-13 col-md-6 col-lg-9 text-right">
<div class="row mt-4">
<div class="col-xs-12 col-md-8">
<form class="form-inline">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="onlyWithSubscriptions" ng-change="reloadWithCondition()" /> only with registered subscriptions
</label>
<input type="text" class="form-control mr-2" ng-model="searchFilter.value" placeholder="Filter..."/>
<div class="form-check">
<input type="checkbox" ng-model="onlyWithSubscriptions" ng-change="reloadWithCondition()" />
<label>only with registered subscriptions</label>
</div>
<button class="btn btn-default" ng-click="refresh()">
<span class="glyphicon glyphicon-refresh"></span>
refresh
</button>
</form>
</div>
<div class="col-xs-12 col-md-4">
<button class="btn btn-sm btn-primary float-right" ng-click="refresh()">
<i class="fas fa-redo"></i> refresh
</button>
</div>
</div>
<p>
<table class="table table-striped table-condensed" style="font-size: 12px">
<thead>
<tr>
<th>Topic</th>
<th class="text-right">Size</th>
</tr>
</thead>
<tbody>
<tr ng-if="list.length == 0">
<td class="text-center text-muted" colspan="2">
No events
</td>
</tr>
<tr ng-repeat="s in list | filter: searchFilter">
<td style="font-family: monospace">
<a href="#/events/0/50/{{s.value}}">{{s.value}}</a>
</td>
<td class="text-right">{{s.count}}</td>
</tr>
</tbody>
</table>
</p>
<table class="table table-striped table-sm small mt-4">
<thead>
<tr>
<th>Topic</th>
<th class="text-right">Size</th>
</tr>
</thead>
<tbody>
<tr ng-if="list.length == 0">
<td class="text-center text-muted" colspan="2">No events</td>
</tr>
<tr ng-repeat="s in list | filter: searchFilter">
<td style="font-family: monospace">
<a href="#!/events/0/50/{{s.value}}">{{s.value}}</a>
</td>
<td class="text-right">{{s.count}}</td>
</tr>
</tbody>
</table>

View File

@ -1,17 +1,15 @@
<h3>Subscriptions (Postgres database)</h3>
<form class="form-inline text-right" style="margin-top:40px; margin-bottom:20px">
<button class="btn btn-primary" data-target="#addSubscriptionModal" data-toggle="modal" ng-click="resetFormFields()">
<span class="glyphicon glyphicon-plus"></span>
add
<form class="form-inline float-right">
<button class="btn btn-sm btn-success mr-2" data-target="#addSubscriptionModal" data-toggle="modal" ng-click="resetFormFields()">
<i class="fas fa-plus"></i> add
</button>
<button class="btn btn-default" ng-click="refresh()">
<span class="glyphicon glyphicon-refresh"></span>
refresh
<button class="btn btn-sm btn-primary" ng-click="refresh()">
<i class="fas fa-redo"></i> refresh
</button>
</form>
<table class="table table-striped" style="margin-top:20px; font-size: 12px">
<h3>Subscriptions (Postgres database)</h3>
<table class="table table-sm table-striped small mt-4">
<thead>
<tr>
<th class="col-xs-2">ID</th>
@ -34,7 +32,7 @@
<td>{{s.subscriber}}</td>
<td>{{s.creationDate | date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{s.topic}}</td>
<td style="font-size: 12px; font-family: monospace;">
<td style="font-family: monospace;">
<ul>
<li ng-repeat="c in s.conditionsAsList">
<b>{{c.field}}</b>
@ -59,7 +57,7 @@
match
</button>
<button type="button" class="btn btn-sm btn-danger" ng-click="remove(s.subscriptionId)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</td>
</tr>
@ -67,23 +65,23 @@
</table>
<div id="addSubscriptionModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg"">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add subscription</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Add subscription</h4>
</div>
<div class="modal-body">
<form name="newSubscriptionForm" class="form-horizontal">
<div class="form-group" ng-class="{'has-error' : !subscriber, 'has-success' : subscriber }">
<form name="newSubscriptionForm">
<div class="form-group row" ng-class="{'text-danger' : !subscriber, 'text-success' : subscriber }">
<label class="control-label col-sm-4">Subscriber</label>
<div class="col-sm-8">
<input type="email" class="form-control" placeholder="email" required="required" ng-model="subscriber"/>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : !frequency, 'has-success' : frequency }">
<div class="form-group row" ng-class="{'text-danger' : !frequency, 'text-success' : frequency }">
<label class="control-label col-sm-4">Notification frequency</label>
<div class="col-sm-8">
<select class="form-control" ng-model="frequency" required="required">
@ -95,7 +93,7 @@
</select>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : !mode, 'has-success' : mode }">
<div class="form-group row" ng-class="{'text-danger' : !mode, 'text-success' : mode }">
<label class="control-label col-sm-4">Notification mode</label>
<div class="col-sm-8">
<select class="form-control" ng-model="mode" required="required">
@ -104,33 +102,33 @@
</select>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : !topicType, 'has-success' : topicType }">
<div class="form-group row" ng-class="{'text-danger' : !topicType, 'text-success' : topicType }">
<label class="control-label col-sm-4">Topic name</label>
<div class="col-sm-8">
<select class="form-control" ng-options="topic.name for topic in availableTopics" ng-model="topicType" ng-change="onSelectTopicType(topicType)" required="required"></select>
</div>
</div>
<div class="form-group" ng-repeat="t in topicParts" ng-if="t.variable" ng-class="{'has-error' : !t.value, 'has-success' : t.value}">
<div class="form-group row" ng-repeat="t in topicParts" ng-if="t.variable" ng-class="{'text-danger' : !t.value, 'text-success' : t.value}">
<label class="control-label col-sm-4" style="font-family: monospace;">{{t.name}}</label>
<div class="col-sm-8">
<input type="text" class="form-control" required="required" ng-model="t.value" ng-pattern="/^[a-zA-Z0-9._-]+$/" ng-change="updateTopic()"/>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Topic expression</label>
<p class="form-control-static col-sm-8">{{topic ? topic : 'missing'}}</p>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Conditions (on map values)</label>
<div class="col-sm-8">
<table class="table table-condensed">
<table class="table table-sm table-borderless small">
<tbody ng-repeat="tc in topicConditions" style="border: 2px solid #ddd;">
<tr ng-class="{'has-error' : !tc.field, 'has-success' : tc.field }">
<tr ng-class="{'text-danger' : !tc.field, 'text-success' : tc.field }">
<td class="col-xs-1" rowspan="{{tc.listParams.length + 4}}">
<button type="button" class="btn btn-sm btn-danger" ng-click="removeCondition($index)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</td>
<th class="col-xs-2 control-label">Field</th>
@ -138,7 +136,7 @@
<input type="text" class="form-control" required="required" ng-model="tc.field" required="required" />
</td>
</tr>
<tr ng-class="{'has-error' : !tc.fieldType, 'has-success' : tc.fieldType }">
<tr ng-class="{'text-danger' : !tc.fieldType, 'text-success' : tc.fieldType }">
<th class="control-label">Field type</th>
<td colspan="3">
<select class="form-control" ng-model="tc.fieldType" required="required">
@ -155,7 +153,7 @@
</select>
</td>
</tr>
<tr ng-class="{'has-error' : !tc.operator, 'has-success' : tc.operator }">
<tr ng-class="{'text-danger' : !tc.operator, 'text-success' : tc.operator }">
<th class="control-label">Operator</th>
<td colspan="3">
<select class="form-control" ng-model="tc.operator" required="required">
@ -167,29 +165,29 @@
</td>
</tr>
<tr ng-class="{'has-error' : !(p.value || p.otherValue), 'has-success' : p.value || p.otherValue}" ng-if="$parent.tc.operator == 'RANGE'" ng-repeat="p in tc.listParams">
<tr ng-class="{'text-danger' : !(p.value || p.otherValue), 'text-success' : p.value || p.otherValue}" ng-if="$parent.tc.operator == 'RANGE'" ng-repeat="p in tc.listParams">
<th class="control-label" rowspan="{{$parent.tc.listParams.length}}" ng-if="$first">Range</th>
<td><input type="text" class="form-control" ng-model="p.value" /></td>
<td><input type="text" class="form-control" ng-model="p.otherValue" /></td>
<td>
<button type="button" class="btn btn-sm btn-danger" ng-click="$parent.tc.listParams.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</td>
</tr>
<tr ng-class="{'has-error' : !p.value, 'has-success' : p.value }" ng-if="$parent.tc.operator != 'RANGE'" ng-repeat="p in tc.listParams">
<tr ng-class="{'text-danger' : !p.value, 'text-success' : p.value }" ng-if="$parent.tc.operator != 'RANGE'" ng-repeat="p in tc.listParams">
<th class="control-label" rowspan="{{$parent.tc.listParams.length + 1}}" ng-if="$first">Values</th>
<td colspan="2"><input type="text" class="form-control" ng-model="p.value" /></td>
<td>
<button type="button" class="btn btn-sm btn-danger" ng-click="$parent.tc.listParams.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</td>
</tr>
<tr>
<td colspan="3">
<button type="button" class="btn btn-sm btn-success" ng-click="tc.listParams.push({ 'value' : '', 'otherValue': '' })">
<span class="glyphicon glyphicon-plus"></span> add
<i class="fas fa-plus"></i> add
</button>
</td>
</tr>
@ -198,7 +196,7 @@
<tr>
<td colspan="5">
<button type="button" class="btn btn-sm btn-success" ng-click="addCondition()">
<span class="glyphicon glyphicon-plus"></span>
<i class="fas fa-plus"></i>
add condition
</button>
</td>
@ -211,7 +209,7 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" data-dismiss="modal" ng-disabled="newSubscriptionForm.$invalid" ng-click="add(subscriber, topic, frequency, mode, topicConditions)">Add</button>
</div>
</div>

View File

@ -1,10 +1,7 @@
<form class="form-inline text-right">
<a class="btn btn-warning" data-target="#adminOperationModal" data-toggle="modal">administration</a>
<button class="btn btn-default" ng-click="refresh()">
<span class="glyphicon glyphicon-refresh"></span>
refresh
<form class="form-inline float-right">
<a class="btn btn-sm btn-warning mr-2" data-target="#adminOperationModal" data-toggle="modal">administration</a>
<button class="btn btn-sm btn-primary" ng-click="refresh()">
<i class="fas fa-redo"></i> refresh
</button>
</form>
@ -12,9 +9,9 @@
<legend>General</legend>
<div class="row">
<div class="col-xs-12 col-md-6 col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">Totals</div>
<table class="table">
<div class="card card-default">
<div class="card-header text-white bg-primary text-center">Totals</div>
<table class="table table-sm small">
<tr>
<th class="col-xs-6">n. subscriptions</th>
<td class="col-xs-6 text-right">
@ -22,9 +19,15 @@
</td>
</tr>
<tr>
<th class="col-xs-6">n. events</th>
<th class="col-xs-6">n. events (total)</th>
<td class="col-xs-6 text-right">
{{summary.totals.events}}
{{summary.totals.events_db}}
</td>
</tr>
<tr>
<th class="col-xs-6">n. events (on ES)</th>
<td class="col-xs-6 text-right">
{{summary.totals.events_es}}
</td>
</tr>
<tr>
@ -36,7 +39,7 @@
<tr>
<th class="col-xs-6">n. notifications</th>
<td class="col-xs-6 text-right">
{{summary.totals.notifications}}
{{summary.totals.notifications_es}}
</td>
</tr>
</table>
@ -50,9 +53,9 @@
<div class="row">
<div class="col-xs-12 col-md-12 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">Buffers</div>
<table class="table">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Buffers</div>
<table class="table table-sm small">
<thead>
<tr>
<th class="col-xs-4 text-right"></th>
@ -76,9 +79,9 @@
</div>
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">Notification dispatchers</div>
<table class="table">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Notification dispatchers</div>
<table class="table table-sm small">
<thead>
<tr>
<th></th>
@ -98,14 +101,14 @@
</div>
<div class="col-xs-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">Threads</div>
<table class="table">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Threads</div>
<table class="table table-sm small">
<tbody>
<tr ng-repeat="t in summary.threads">
<th ng-class="{'text-muted' : !t.alive }">{{t.name}}</th>
<td class="text-right">
<span class="label label-success" ng-class="{'label-success' : t.alive, 'label-danger': !t.alive}">{{t.state}}</span>
<span class="badge badge-success" ng-class="{'badge-success' : t.alive, 'badge-danger': !t.alive}">{{t.state}}</span>
</td>
</tr>
</tbody>
@ -121,10 +124,10 @@
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">Elasticsearch</div>
<table class="table">
<div class="col-xs-12 col-md-6 col-lg-4">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Elasticsearch</div>
<table class="table table-sm small">
<tr>
<th class="col-xs-4">cluster nodes</th>
<td class="col-xs-8" colspan="3">{{summary.elasticSearch.clusterNodes}}</td>
@ -146,13 +149,11 @@
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">Postgres database</div>
<table class="table">
<div class="col-xs-12 col-md-6 col-lg-4">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Postgres database</div>
<table class="table table-sm small">
<tr>
<th class="col-xs-4">path</th>
<td class="col-xs-8">{{summary.db.url}}</td>
@ -161,10 +162,10 @@
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">Email dispatcher</div>
<table class="table">
<div class="col-xs-12 col-md-6 col-lg-4">
<div class="card mb-2">
<div class="card-header text-white bg-primary text-center">Email dispatcher</div>
<table class="table table-sm small">
<tr>
<th class="col-xs-2" rowspan="2">smtp</th>
<th class="col-xs-2">host</th>
@ -199,15 +200,14 @@
</fieldset>
<div id="adminOperationModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg"">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Admin operations</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Admin operations</h4>
</div>
<div class="modal-body">
<table class="table table-bordered">
@ -217,7 +217,7 @@
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>

View File

@ -1,17 +1,15 @@
<form class="form-inline float-right">
<button class="btn btn-sm btn-success mr-2" data-target="#addTopicTypeModal" data-toggle="modal" ng-click="resetFormFields()">
<i class="fas fa-plus"></i> add
</button>
<button class="btn btn-sm btn-primary" ng-click="refresh()">
<i class="fas fa-redo"></i> refresh
</button>
</form>
<h3>Topic typologies</h3>
<form class="form-inline text-right" style="margin-top:40px; margin-bottom:20px">
<button class="btn btn-primary" data-target="#addTopicTypeModal" data-toggle="modal" ng-click="resetFormFields()">
<span class="glyphicon glyphicon-plus"></span>
add
</button>
<button class="btn btn-default" ng-click="refresh()">
<span class="glyphicon glyphicon-refresh"></span>
refresh
</button>
</form>
<table class="table table-striped" style="margin-top:20px; font-size: 12px">
<table class="table table-sm table-striped small mt-4">
<thead>
<tr>
<th class="col-xs-2">ID</th>
@ -38,22 +36,22 @@
</table>
<div id="addTopicTypeModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg"">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add topic typology</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Add topic typology</h4>
</div>
<div class="modal-body">
<form name="newTopicTypeForm">
<div class="form-group" ng-class="{'has-error' : !topicName, 'has-success' : topicName}">
<label class="control-label">Name</label>
<div class="form-group">
<label class="control-label" ng-class="{'text-danger' : !topicName, 'text-success' : topicName}">Name</label>
<input type="text" class="form-control" placeholder="name" required="required" ng-model="topicName" />
</div>
<div class="form-group" ng-class="{'has-warning' : !topicProducerId, 'has-success' : topicProducerId}">
<label class="control-label">Producer ID</label>
<div class="form-group">
<label class="control-label" ng-class="{'text-warning' : !topicProducerId, 'text-success' : topicProducerId}">Producer ID</label>
<input type="text" class="form-control" placeholder="producer" ng-model="topicProducerId" />
</div>
<div class="form-group">
@ -70,10 +68,10 @@
<td rowspan="2" class="text-center" style="width: 80px;">
<div class="btn-group">
<button class="btn btn-sm btn-danger" ng-click="segments.splice(-1,1); updateTopicExpression()" ng-disabled="segments.length < 3">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
<button class="btn btn-sm btn-success" ng-click="segments.push({}); updateTopicExpression()" ng-disabled="segments.length > 5">
<span class="glyphicon glyphicon-plus"></span>
<i class="fas fa-plus"></i>
</button>
</div>
</td>
@ -92,15 +90,15 @@
</tr>
</table>
</div>
<div class="form-group" ng-class="{'has-warning' : topicMapKeys.length == 0, 'has-success' : topicMapKeys.length > 0}">
<label class="control-label">Required map fields (comma separated)</label>
<div class="form-group">
<label class="control-label" ng-class="{'text-warning' : topicMapKeys.length == 0, 'text-success' : topicMapKeys.length > 0}">Required map fields (comma separated)</label>
<input type="text" class="form-control" ng-model="topicMapKeys" ng-list="," ng-trim="true"></input>
<span class="label label-default" ng-repeat="k in topicMapKeys track by $index" style="margin-left: 4px;">{{k}}</span>
<span class="badge badge-primary" ng-repeat="k in topicMapKeys track by $index" style="margin-left: 4px;">{{k}}</span>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" data-dismiss="modal" ng-disabled="newTopicTypeForm.$invalid" ng-click="add(topicName, topicProducerId, topicExpression, topicMapKeys)">Add</button>
</div>
</div>

View File

@ -3,42 +3,46 @@
<head>
<title>Literature Broker Service</title>
<link rel="stylesheet" href="./css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/bootstrap-theme.min.css" />
<script src="./js/jquery-1.12.3.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/angular.min.js"></script>
<script src="./js/angular-route.min.js"></script>
<script src="./js/lbs-ui.js"></script>
<link rel="stylesheet" href="./common/css/bootstrap.cerulean.min.css" />
<link rel="stylesheet" href="./common/css/fontawesome-all.min.css" />
</head>
<body ng-app="lbs">
<nav class="navbar navbar-default" ng-controller="moduleMenuCtrl">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Literature Broker Service</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li ng-class="{active : isActive('^\/summary')}"><a href="#/summary">Summary</a></li>
<li ng-class="{active : isActive('^\/topics')}"><a href="#/topics">Topics</a></li>
<li ng-class="{active : isActive('^\/subscriptions')}"><a href="#/subscriptions">Subscriptions</a></li>
<li ng-class="{active : isActive('^\/events')}"><a href="#/events/all">Events</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Tools <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{{t.url}}" target="_blank" ng-repeat="t in tools">{{t.name}}</a></li>
<li><a href="/swagger-ui.html" target="_blank">API documentation</a></li>
</ul>
</li>
</ul>
</div>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="moduleMenuCtrl">
<a class="navbar-brand" href="#">Literature Broker Service</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMenu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarMenu">
<ul class="navbar-nav mr-auto">
<li class="nav-item" ng-class="{active : isActive('^\/summary')}"><a class="nav-link" href="#!/summary">Summary</a></li>
<li class="nav-item" ng-class="{active : isActive('^\/topics')}"><a class="nav-link" href="#!/topics">Topics</a></li>
<li class="nav-item" ng-class="{active : isActive('^\/subscriptions')}"><a class="nav-link" href="#!/subscriptions">Subscriptions</a></li>
<li class="nav-item" ng-class="{active : isActive('^\/events')}"><a class="nav-link" href="#!/events/all">Events</a></li>
</ul>
<ul class="navbar-nav navbar-right">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">Tools <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="{{t.url}}" target="_blank" ng-repeat="t in tools">{{t.name}}</a>
<a class="dropdown-item" href="/apidoc" target="_blank">API documentation</a>
</div>
</li>
</ul>
</div>
</nav>
<div ng-view style="margin: 20px;"></div>
</body>
<script src="./common/js/jquery.min.js"></script>
<script src="./common/js/popper.min.js"></script>
<script src="./common/js/bootstrap.min.js"></script>
<script src="./common/js/angular.min.js"></script>
<script src="./common/js/angular-route.min.js"></script>
<script src="./js/lbs-ui.js"></script>
</html>

View File

@ -1,15 +0,0 @@
/*
AngularJS v1.5.5
(c) 2010-2016 Google, Inc. http://angularjs.org
License: MIT
*/
(function(C,d){'use strict';function z(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,y){function k(){n&&(g.cancel(n),n=null);l&&(l.$destroy(),l=null);m&&(n=g.leave(m),n.then(function(){n=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),f=r.current;m=y(b,function(b){g.enter(b,null,m||c).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||h()});k()});l=f.scope=b;l.$emit("$viewContentLoaded");
l.$eval(u)}else k()}var l,m,n,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,h,g){return{restrict:"ECA",priority:-400,link:function(a,c){var b=g.current,f=b.locals;c.html(f.$template);var y=d(c.contents());if(b.controller){f.$scope=a;var k=h(b.controller,f);b.controllerAs&&(a[b.controllerAs]=k);c.data("$ngControllerController",k);c.children().data("$ngControllerController",k)}a[b.resolveAs||"$resolve"]=f;y(a)}}}var w=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,
c){return d.extend(Object.create(a),c)}function h(a,d){var b=d.caseInsensitiveMatch,f={originalPath:a,regexp:a},g=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g,function(a,d,b,c){a="?"===c||"*?"===c?"?":null;c="*"===c||"*?"===c?"*":null;g.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=new RegExp("^"+a+"$",b?"i":"");return f}var g={};this.when=function(a,c){var b=
d.copy(c);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=d.extend(b,a&&h(a,b));if(a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[f]=d.extend({redirectTo:a},h(f,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest",
"$sce",function(a,c,b,f,h,k,x){function l(b){var e=s.current;(w=(p=n())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!u)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function m(){var v=s.current,e=p;if(w)v.params=e.params,d.copy(v.params,b),a.$broadcast("$routeUpdate",v);else if(e||v)u=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?c.path(t(e.redirectTo,e.params)).search(e.params).replace():c.url(e.redirectTo(e.pathParams,
c.path(),c.search())).replace()),f.when(e).then(function(){if(e){var a=d.extend({},e.resolve),b,c;d.forEach(a,function(b,e){a[e]=d.isString(b)?h.get(b):h.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(c=e.templateUrl)&&(d.isFunction(c)&&(c=c(e.params)),d.isDefined(c)&&(e.loadedTemplateUrl=x.valueOf(c),b=k(c)));d.isDefined(b)&&(a.$template=b);return f.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",
e,v))},function(b){e==s.current&&a.$broadcast("$routeChangeError",e,v,b)})}function n(){var a,b;d.forEach(g,function(f,g){var q;if(q=!b){var h=c.path();q=f.keys;var l={};if(f.regexp)if(h=f.regexp.exec(h)){for(var k=1,n=h.length;k<n;++k){var m=q[k-1],p=h[k];m&&p&&(l[m.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(f,{params:d.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var c=[];d.forEach((a||"").split(":"),function(a,
d){if(0===d)c.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];c.push(b[g]);c.push(f[2]||"");delete b[g]}});return c.join("")}var u=!1,p,w,s={routes:g,reload:function(){u=!0;var b={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;u=!1}};a.$evalAsync(function(){l(b);b.defaultPrevented||m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),c.path(t(this.current.$$route.originalPath,a)),c.search(a);else throw B("norout");
}};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]}),B=d.$$minErr("ngRoute");w.provider("$routeParams",function(){this.$get=function(){return{}}});w.directive("ngView",z);w.directive("ngView",A);z.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
//# sourceMappingURL=angular-route.min.js.map

View File

@ -1,314 +0,0 @@
/*
AngularJS v1.5.5
(c) 2010-2016 Google, Inc. http://angularjs.org
License: MIT
*/
(function(v){'use strict';function O(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.5/"+(a?a+"/":"")+b;for(b=1;b<arguments.length;b++){d=d+(1==b?"?":"&")+"p"+(b-1)+"=";var c=encodeURIComponent,e;e=arguments[b];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;d+=c(e)}return Error(d)}}function ya(a){if(null==a||Va(a))return!1;if(K(a)||F(a)||B&&a instanceof B)return!0;
var b="length"in Object(a)&&a.length;return Q(b)&&(0<=b&&(b-1 in a||a instanceof Array)||"function"==typeof a.item)}function q(a,b,d){var c,e;if(a)if(E(a))for(c in a)"prototype"==c||"length"==c||"name"==c||a.hasOwnProperty&&!a.hasOwnProperty(c)||b.call(d,a[c],c,a);else if(K(a)||ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==q)a.forEach(b,d,a);else if(oc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&
b.call(d,a[c],c,a);else for(c in a)ua.call(a,c)&&b.call(d,a[c],c,a);return a}function pc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function qc(a){return function(b,d){a(d,b)}}function Xd(){return++nb}function Nb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(G(g)||E(g))for(var h=Object.keys(g),k=0,l=h.length;k<l;k++){var n=h[k],m=g[n];d&&G(m)?fa(m)?a[n]=new Date(m.valueOf()):Wa(m)?a[n]=new RegExp(m):m.nodeName?a[n]=m.cloneNode(!0):
Ob(m)?a[n]=m.clone():(G(a[n])||(a[n]=K(m)?[]:{}),Nb(a[n],[m],!0)):a[n]=m}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function R(a){return Nb(a,za.call(arguments,1),!1)}function Yd(a){return Nb(a,za.call(arguments,1),!0)}function X(a){return parseInt(a,10)}function Pb(a,b){return R(Object.create(a),b)}function C(){}function Xa(a){return a}function da(a){return function(){return a}}function rc(a){return E(a.toString)&&a.toString!==ma}function y(a){return"undefined"===typeof a}function x(a){return"undefined"!==
typeof a}function G(a){return null!==a&&"object"===typeof a}function oc(a){return null!==a&&"object"===typeof a&&!sc(a)}function F(a){return"string"===typeof a}function Q(a){return"number"===typeof a}function fa(a){return"[object Date]"===ma.call(a)}function E(a){return"function"===typeof a}function Wa(a){return"[object RegExp]"===ma.call(a)}function Va(a){return a&&a.window===a}function Ya(a){return a&&a.$evalAsync&&a.$watch}function Da(a){return"boolean"===typeof a}function Zd(a){return a&&Q(a.length)&&
$d.test(ma.call(a))}function Ob(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ae(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function va(a){return P(a.nodeName||a[0]&&a[0].nodeName)}function Za(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function qa(a,b){function d(a,b){var d=b.$$hashKey,e;if(K(a)){e=0;for(var f=a.length;e<f;e++)b.push(c(a[e]))}else if(oc(a))for(e in a)b[e]=c(a[e]);else if(a&&"function"===typeof a.hasOwnProperty)for(e in a)a.hasOwnProperty(e)&&
(b[e]=c(a[e]));else for(e in a)ua.call(a,e)&&(b[e]=c(a[e]));d?b.$$hashKey=d:delete b.$$hashKey;return b}function c(a){if(!G(a))return a;var b=f.indexOf(a);if(-1!==b)return g[b];if(Va(a)||Ya(a))throw Aa("cpws");var b=!1,c=e(a);void 0===c&&(c=K(a)?[]:Object.create(sc(a)),b=!0);f.push(a);g.push(c);return b?d(a,c):c}function e(a){switch(ma.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(c(a.buffer));
case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(E(a.cloneNode))return a.cloneNode(!0)}var f=[],
g=[];if(b){if(Zd(b)||"[object ArrayBuffer]"===ma.call(b))throw Aa("cpta");if(a===b)throw Aa("cpi");K(b)?b.length=0:q(b,function(a,d){"$$hashKey"!==d&&delete b[d]});f.push(a);g.push(b);return d(a,b)}return c(a)}function ha(a,b){if(K(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(G(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function pa(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d==typeof b&&
"object"==d)if(K(a)){if(!K(b))return!1;if((d=a.length)==b.length){for(c=0;c<d;c++)if(!pa(a[c],b[c]))return!1;return!0}}else{if(fa(a))return fa(b)?pa(a.getTime(),b.getTime()):!1;if(Wa(a))return Wa(b)?a.toString()==b.toString():!1;if(Ya(a)||Ya(b)||Va(a)||Va(b)||K(b)||fa(b)||Wa(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!E(a[c])){if(!pa(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&x(b[c])&&!E(b[c]))return!1;return!0}return!1}function $a(a,b,d){return a.concat(za.call(b,
d))}function tc(a,b){var d=2<arguments.length?za.call(arguments,2):[];return!E(b)||b instanceof RegExp?b:d.length?function(){return arguments.length?b.apply(a,$a(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function be(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:Va(b)?d="$WINDOW":b&&v.document===b?d="$DOCUMENT":Ya(b)&&(d="$SCOPE");return d}function ab(a,b){if(!y(a))return Q(b)||(b=b?2:null),JSON.stringify(a,be,
b)}function uc(a){return F(a)?JSON.parse(a):a}function vc(a,b){a=a.replace(ce,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+a)/6E4;return isNaN(d)?b:d}function Qb(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=vc(b,c);d*=b-c;a=new Date(a.getTime());a.setMinutes(a.getMinutes()+d);return a}function wa(a){a=B(a).clone();try{a.empty()}catch(b){}var d=B("<div>").append(a).html();try{return a[0].nodeType===Ma?P(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+P(b)})}catch(c){return P(d)}}
function wc(a){try{return decodeURIComponent(a)}catch(b){}}function xc(a){var b={};q((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,ua.call(b,e)?K(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Rb(a){var b=[];q(a,function(a,c){K(a)?q(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}
function ob(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function de(a,b){var d,c,e=Na.length;for(c=0;c<e;++c)if(d=Na[c]+b,F(d=a.getAttribute(d)))return d;return null}function ee(a,b){var d,c,e={};q(Na,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});
q(Na,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});d&&(e.strictDi=null!==de(d,"strict-di"),b(d,c?[c]:[],e))}function yc(a,b,d){G(d)||(d={});d=R({strictDi:!1},d);var c=function(){a=B(a);if(a.injector()){var c=a[0]===v.document?"document":wa(a);throw Aa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);
b.unshift("ng");c=bb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;v&&e.test(v.name)&&(d.debugInfoEnabled=!0,v.name=v.name.replace(e,""));if(v&&!f.test(v.name))return c();v.name=v.name.replace(f,"");ea.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};E(ea.resumeDeferredBootstrap)&&ea.resumeDeferredBootstrap()}function fe(){v.name=
"NG_ENABLE_DEBUG_INFO!"+v.name;v.location.reload()}function ge(a){a=ea.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(he,function(a,c){return(c?b:"")+a.toLowerCase()})}function ie(){var a;if(!Ac){var b=pb();(Z=y(b)?v.jQuery:b?v[b]:void 0)&&Z.fn.on?(B=Z,R(Z.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),a=Z.cleanData,Z.cleanData=function(b){for(var c,
e=0,f;null!=(f=b[e]);e++)(c=Z._data(f,"events"))&&c.$destroy&&Z(f).triggerHandler("$destroy");a(b)}):B=U;ea.element=B;Ac=!0}}function qb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Pa(a,b,d){d&&K(a)&&(a=a[a.length-1]);qb(E(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Qa(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c=
b[g],a&&(a=(e=a)[c]);return!d&&E(a)?tc(e,a):a}function rb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=B(za.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function je(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=O("$injector"),c=O("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||O;return b(a,"module",function(){var a={};return function(f,g,h){if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&
(a[f]=null);return b(a,f,function(){function a(b,d,e,f){f||(f=c);return function(){f[e||"push"]([b,d,arguments]);return M}}function b(a,d){return function(b,e){e&&E(e)&&(e.$$moduleName=f);c.push([a,d,arguments]);return M}}if(!g)throw d("nomod",f);var c=[],e=[],r=[],N=a("$injector","invoke","push",e),M={_invokeQueue:c,_configBlocks:e,_runBlocks:r,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide",
"constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:N,run:function(a){r.push(a);return this}};h&&N(h);return M})}})}function ke(a){R(a,{bootstrap:yc,copy:qa,extend:R,merge:Yd,equals:pa,element:B,forEach:q,injector:bb,noop:C,bind:tc,toJson:ab,fromJson:uc,identity:Xa,isUndefined:y,
isDefined:x,isString:F,isFunction:E,isObject:G,isNumber:Q,isElement:Ob,isArray:K,version:le,isDate:fa,lowercase:P,uppercase:sb,callbacks:{counter:0},getTestability:ge,$$minErr:O,$$csp:Ea,reloadWithDebugInfo:fe});Sb=je(v);Sb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:me});a.provider("$compile",Cc).directive({a:ne,input:Dc,textarea:Dc,form:oe,script:pe,select:qe,style:re,option:se,ngBind:te,ngBindHtml:ue,ngBindTemplate:ve,ngClass:we,ngClassEven:xe,ngClassOdd:ye,ngCloak:ze,ngController:Ae,
ngForm:Be,ngHide:Ce,ngIf:De,ngInclude:Ee,ngInit:Fe,ngNonBindable:Ge,ngPluralize:He,ngRepeat:Ie,ngShow:Je,ngStyle:Ke,ngSwitch:Le,ngSwitchWhen:Me,ngSwitchDefault:Ne,ngOptions:Oe,ngTransclude:Pe,ngModel:Qe,ngList:Re,ngChange:Se,pattern:Ec,ngPattern:Ec,required:Fc,ngRequired:Fc,minlength:Gc,ngMinlength:Gc,maxlength:Hc,ngMaxlength:Hc,ngValue:Te,ngModelOptions:Ue}).directive({ngInclude:Ve}).directive(tb).directive(Ic);a.provider({$anchorScroll:We,$animate:Xe,$animateCss:Ye,$$animateJs:Ze,$$animateQueue:$e,
$$AnimateRunner:af,$$animateAsyncRun:bf,$browser:cf,$cacheFactory:df,$controller:ef,$document:ff,$exceptionHandler:gf,$filter:Jc,$$forceReflow:hf,$interpolate:jf,$interval:kf,$http:lf,$httpParamSerializer:mf,$httpParamSerializerJQLike:nf,$httpBackend:of,$xhrFactory:pf,$location:qf,$log:rf,$parse:sf,$rootScope:tf,$q:uf,$$q:vf,$sce:wf,$sceDelegate:xf,$sniffer:yf,$templateCache:zf,$templateRequest:Af,$$testability:Bf,$timeout:Cf,$window:Df,$$rAF:Ef,$$jqLite:Ff,$$HashMap:Gf,$$cookieReader:Hf})}])}function cb(a){return a.replace(If,
function(a,d,c,e){return e?c.toUpperCase():c}).replace(Jf,"Moz$1")}function Kc(a){a=a.nodeType;return 1===a||!a||9===a}function Lc(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(Tb.test(a)){d=d||e.appendChild(b.createElement("div"));c=(Kf.exec(a)||["",""])[1].toLowerCase();c=ia[c]||ia._default;d.innerHTML=c[1]+a.replace(Lf,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=$a(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});
return e}function Mc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;F(a)&&(a=V(a),b=!0);if(!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new U(a)}if(b){b=v.document;var d;a=(d=Mf.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Nc(this,a)}function Vb(a){return a.cloneNode(!0)}function ub(a,b){b||db(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c<e;c++)db(d[c])}function Oc(a,
b,d,c){if(x(c))throw Ub("offargs");var e=(c=vb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];x(d)&&Za(c||[],d);x(d)&&c&&0<c.length||(a.removeEventListener(b,f,!1),delete e[b])};q(b.split(" "),function(a){g(a);wb[a]&&g(wb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f,!1),delete e[b]}function db(a,b){var d=a.ng339,c=d&&eb[d];c&&(b?delete c.data[b]:(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),Oc(a)),delete eb[d],a.ng339=void 0))}function vb(a,b){var d=
a.ng339,d=d&&eb[d];b&&!d&&(a.ng339=d=++Nf,d=eb[d]={events:{},data:{},handle:void 0});return d}function Wb(a,b,d){if(Kc(a)){var c=x(d),e=!c&&b&&!G(b),f=!b;a=(a=vb(a,!e))&&a.data;if(c)a[b]=d;else{if(f)return a;if(e)return a&&a[b];R(a,b)}}}function xb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function yb(a,b){b&&a.setAttribute&&q(b.split(" "),function(b){a.setAttribute("class",V((" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
" ").replace(" "+V(b)+" "," ")))})}function zb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");q(b.split(" "),function(a){a=V(a);-1===d.indexOf(" "+a+" ")&&(d+=a+" ")});a.setAttribute("class",V(d))}}function Nc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function Pc(a,b){return Ab(a,"$"+(b||"ngController")+"Controller")}function Ab(a,
b,d){9==a.nodeType&&(a=a.documentElement);for(b=K(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(x(d=B.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function Qc(a){for(ub(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Bb(a,b){b||ub(a);var d=a.parentNode;d&&d.removeChild(a)}function Of(a,b){b=b||v;if("complete"===b.document.readyState)b.setTimeout(a);else B(b).on("load",a)}function Rc(a,b){var d=Cb[b.toLowerCase()];return d&&Sc[va(a)]&&d}function Pf(a,b){var d=function(c,
d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(y(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var k=f.specialHandlerWrapper||Qf;1<g&&(f=ha(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||k(a,c,f[l])}};d.elem=
a;return d}function Qf(a,b,d){d.call(a,b)}function Rf(a,b,d){var c=b.relatedTarget;c&&(c===a||Sf.call(a,c))||d.call(a,b)}function Ff(){this.$get=function(){return R(U,{hasClass:function(a,b){a.attr&&(a=a[0]);return xb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return zb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return yb(a,b)}})}}function Fa(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"==d||"object"==d&&null!==a?a.$$hashKey=
d+":"+(b||Xd)():d+":"+a}function Ra(a,b){if(b){var d=0;this.nextUid=function(){return++d}}q(a,this.put,this)}function Tc(a){a=Function.prototype.toString.call(a).replace(Tf,"");return a.match(Uf)||a.match(Vf)}function Wf(a){return(a=Tc(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function bb(a,b){function d(a){return function(b,c){if(G(b))q(b,qc(a));else return a(b,c)}}function c(a,b){Qa(a,"service");if(E(b)||K(b))b=r.instantiate(b);if(!b.$get)throw Ga("pget",a);return m[a+"Provider"]=
b}function e(a,b){return function(){var c=w.invoke(b,this);if(y(c))throw Ga("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){qb(y(a)||K(a),"modulesToLoad","not an array");var b=[],c;q(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{F(a)?(c=Sb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):E(a)?b.push(r.invoke(a)):K(a)?b.push(r.invoke(a)):
Pa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ga("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e)}catch(f){throw a[b]===k&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=bb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];
if("string"!==typeof l)throw Ga("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);K(a)&&(a=a[a.length-1]);d=11>=Ca?!1:"function"===typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a));return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=K(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,
a))},get:d,annotate:bb.$$annotate,has:function(b){return m.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],n=new Ra([],!0),m={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,da(b),!1)}),constant:d(function(a,b){Qa(a,"constant");m[a]=b;N[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=w.invoke(d,c);return w.invoke(b,null,
{$delegate:a})}}}},r=m.$injector=h(m,function(a,b){ea.isString(b)&&l.push(b);throw Ga("unpr",l.join(" <- "));}),N={},M=h(N,function(a,b){var c=r.get(a+"Provider",b);return w.invoke(c.$get,c,void 0,a)}),w=M;m.$injectorProvider={$get:da(M)};var p=g(a),w=M.get("$injector");w.strictDi=b;q(p,function(a){a&&w.invoke(a)});return w}function We(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,
function(a){if("a"===va(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;E(c)?c=c():Ob(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):Q(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===
b&&""===a||Of(function(){c.$evalAsync(g)})});return g}]}function fb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;K(a)&&(a=a.join(" "));K(b)&&(b=b.join(" "));return a+" "+b}function Xf(a){F(a)&&(a=a.split(" "));var b=T();q(a,function(a){a.length&&(b[a]=!0)});return b}function Ha(a){return G(a)?a:{}}function Yf(a,b,d,c){function e(a){try{a.apply(null,za.call(arguments,1))}finally{if(M--,0===M)for(;w.length;)try{w.pop()()}catch(b){d.error(b)}}}function f(){u=null;g();h()}function g(){p=I();
p=y(p)?null:p;pa(p,L)&&(p=L);L=p}function h(){if(t!==k.url()||H!==p)t=k.url(),H=p,q(J,function(a){a(k.url(),p)})}var k=this,l=a.location,n=a.history,m=a.setTimeout,r=a.clearTimeout,N={};k.isMock=!1;var M=0,w=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){M++};k.notifyWhenNoOutstandingRequests=function(a){0===M?a():w.push(a)};var p,H,t=l.href,z=b.find("base"),u=null,I=c.history?function(){try{return n.state}catch(a){}}:C;g();H=p;k.url=function(b,d,e){y(e)&&(e=null);l!==
a.location&&(l=a.location);n!==a.history&&(n=a.history);if(b){var f=H===e;if(t===b&&(!c.history||f))return k;var h=t&&Ia(t)===Ia(b);t=b;H=e;if(!c.history||h&&f){if(!h||u)u=b;d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b;l.href!==b&&(u=b)}else n[d?"replaceState":"pushState"](e,"",b),g(),H=p;return k}return u||l.href.replace(/%27/g,"'")};k.state=function(){return p};var J=[],D=!1,L=null;k.onUrlChange=function(b){if(!D){if(c.history)B(a).on("popstate",f);B(a).on("hashchange",
f);D=!0}J.push(b);return b};k.$$applicationDestroyed=function(){B(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=z.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};k.defer=function(a,b){var c;M++;c=m(function(){delete N[c];e(a)},b||0);N[c]=!0;return c};k.defer.cancel=function(a){return N[a]?(delete N[a],r(a),e(C),!0):!1}}function cf(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Yf(a,c,b,d)}]}function df(){this.$get=
function(){function a(a,c){function e(a){a!=m&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw O("$cacheFactory")("iid",a);var g=0,h=R({},c,{id:a}),k=T(),l=c&&c.capacity||Number.MAX_VALUE,n=T(),m=null,r=null;return b[a]={put:function(a,b){if(!y(b)){if(l<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in k||g++;k[a]=b;g>l&&this.remove(r.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return k[a]},
remove:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;b==m&&(m=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}a in k&&(delete k[a],g--)},removeAll:function(){k=T();g=0;n=T();m=r=null},destroy:function(){n=h=k=null;delete b[a]},info:function(){return R({},h,{size:g})}}}var b={};a.info=function(){var a={};q(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function zf(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Cc(a,b){function d(a,
b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,e=T();q(a,function(a,f){if(a in n)e[f]=n[a];else{var g=a.match(d);if(!g)throw ga("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(n[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==P(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,g=/(([\w\-]+)(?:\:([^;]+))?;?)/,
h=ae("ngSrc,ngSrcset,src,srcset"),k=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,l=/^(on[a-z]+|formaction)$/,n=T();this.directive=function M(b,d){Qa(b,"directive");F(b)?(c(b),qb(d,"directiveFactory"),e.hasOwnProperty(b)||(e[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];q(e[b],function(e,f){try{var g=a.invoke(e);E(g)?g={compile:da(g)}:!g.compile&&g.link&&(g.compile=da(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||b;g.require=g.require||g.controller&&g.name;g.restrict=
g.restrict||"EA";g.$$moduleName=e.$$moduleName;d.push(g)}catch(h){c(h)}});return d}])),e[b].push(d)):q(b,qc(M));return this};this.component=function(a,b){function c(a){function e(b){return E(b)||K(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Uc(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
require:b.require};q(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}var d=b.controller||function(){};q(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,E(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return x(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var m=!0;this.debugInfoEnabled=
function(a){return x(a)?(m=a,this):m};var r=10;this.onChangesTtl=function(a){return arguments.length?(r=a,this):r};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(a,b,c,n,t,z,u,I,J,D){function L(){try{if(!--qa)throw Z=void 0,ga("infchng",r);u.$apply(function(){for(var a=0,b=Z.length;a<b;++a)Z[a]();Z=void 0})}finally{qa++}}function S(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<
e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function $(a,b,c){na.innerHTML="<span "+b+">";b=na.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function A(a,b){try{a.addClass(b)}catch(c){}}function ba(a,b,c,d,e){a instanceof B||(a=B(a));for(var f=/\S+/,g=0,h=a.length;g<h;g++){var k=a[g];k.nodeType===Ma&&k.nodeValue.match(f)&&Mc(k,a[g]=v.document.createElement("span"))}var l=s(a,b,a,c,d,e);ba.$$addScopeClass(a);var m=null;return function(b,
c,d){qb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var f=d.parentBoundTranscludeFn,g=d.transcludeControllers;d=d.futureParentElement;f&&f.$$boundTransclude&&(f=f.$$boundTransclude);m||(m=(d=d&&d[0])?"foreignobject"!==va(d)&&ma.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==m?B(ca(m,B("<div>").append(a).html())):c?Oa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);ba.$$addScopeInfo(d,b);c&&c(d,b);l&&l(b,d,d,f);return d}}function s(a,b,c,d,e,f){function g(a,
c,d,e){var f,k,l,m,n,t,p;if(r)for(p=Array(c.length),m=0;m<h.length;m+=3)f=h[m],p[f]=c[f];else p=c;m=0;for(n=h.length;m<n;)k=p[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),ba.$$addScopeInfo(B(k),l)):l=a,t=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,t)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k,l,m,n,r,t=0;t<a.length;t++){k=new S;l=x(a[t],[],k,0===t?d:void 0,e);(f=l.length?Ba(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&ba.$$addScopeClass(k.$$element);
k=f&&f.terminal||!(m=a[t].childNodes)||!m.length?null:s(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,r=r||f;f=null}return n?g:null}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function x(a,b,c,d,e){var h=c.$attr,k;switch(a.nodeType){case 1:la(b,
xa(va(a)),"E",d,e);for(var l,m,n,t=a.attributes,r=0,p=t&&t.length;r<p;r++){var I=!1,D=!1;l=t[r];k=l.name;m=V(l.value);l=xa(k);if(n=ya.test(l))k=k.replace(Vc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});(l=l.match(Aa))&&Q(l[1])&&(I=k,D=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=xa(k.toLowerCase());h[l]=k;if(n||!c.hasOwnProperty(l))c[l]=m,Rc(a,l)&&(c[l]=!0);fa(a,b,m,l,n);la(b,l,"A",d,e,I,D)}a=a.className;G(a)&&(a=a.animVal);if(F(a)&&""!==a)for(;k=g.exec(a);)l=xa(k[2]),
la(b,l,"C",d,e)&&(c[l]=V(k[3])),a=a.substr(k.index+k[0].length);break;case Ma:if(11===Ca)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Ma;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);X(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=xa(k[1]),la(b,l,"M",d,e)&&(c[l]=V(k[2]))}catch(J){}}b.sort(Y);return b}function Wc(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&
e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=Wc(e[0],b,c);return a(d,e,f,g,h)}}function Yb(a,b,c,d,e,f){var g;return a?ba(b,c,d,e,f):function(){g||(g=ba(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function Ba(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=A.require;a.directiveName=M;if(D===A||A.$$isolateScope)a=ha(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));
b.require=A.require;b.directiveName=M;if(D===A||A.$$isolateScope)b=ha(b,{isolateScope:!0});k.push(b)}}function n(a,c,e,f,g){function l(a,b,c,d){var e;Ya(a)||(d=c,c=b,b=a,a=void 0);H&&(e=u);c||(c=H?z.parent():z);if(d){var f=g.$$slots[d];if(f)return f(a,b,e,c,$);if(y(f))throw ga("noslot",d,wa(z));}else return g(a,b,e,c,$)}var m,t,p,A,w,u,L,z;b===e?(f=d,z=d.$$element):(z=B(e),f=new S(z,d));w=c;D?A=c.$new(!0):r&&(w=c.$parent);g&&(L=l,L.$$boundTransclude=g,L.isSlotFilled=function(a){return!!g.$$slots[a]});
I&&(u=O(z,f,L,I,A,c,D));D&&(ba.$$addScopeInfo(z,A,!0,!(J&&(J===D||J===D.$$originalDirective))),ba.$$addScopeClass(z,!0),A.$$isolateBindings=D.$$isolateBindings,t=ia(c,f,A,A.$$isolateBindings,D),t.removeWatches&&A.$on("$destroy",t.removeWatches));for(m in u){t=I[m];p=u[m];var Xb=t.$$bindings.bindToController;p.bindingInfo=p.identifier&&Xb?ia(w,f,p.instance,Xb,t):{};var M=p();M!==p.instance&&(p.instance=M,z.data("$"+t.name+"Controller",M),p.bindingInfo.removeWatches&&p.bindingInfo.removeWatches(),p.bindingInfo=
ia(w,f,p.instance,Xb,t))}q(I,function(a,b){var c=a.require;a.bindToController&&!K(c)&&G(c)&&R(u[b].instance,gb(b,c,z,u))});q(u,function(a){var b=a.instance;E(b.$onChanges)&&b.$onChanges(a.bindingInfo.initialChanges);E(b.$onInit)&&b.$onInit();E(b.$onDestroy)&&w.$on("$destroy",function(){b.$onDestroy()})});m=0;for(t=h.length;m<t;m++)p=h[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);var $=c;D&&(D.template||null===D.templateUrl)&&($=A);a&&a($,e.childNodes,void 0,g);for(m=
k.length-1;0<=m;m--)p=k[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);q(u,function(a){a=a.instance;E(a.$postLink)&&a.$postLink()})}l=l||{};for(var t=-Number.MAX_VALUE,r=l.newScopeDirective,I=l.controllerDirectives,D=l.newIsolateScopeDirective,J=l.templateDirective,w=l.nonTlbTranscludeDirective,u=!1,L=!1,H=l.hasElementTranscludeDirective,z=d.$$element=B(b),A,M,$,s=e,Sa,ka=!1,C=!1,v,F=0,Ba=a.length;F<Ba;F++){A=a[F];var P=A.$$start,Q=A.$$end;P&&(z=Wc(b,P,Q));$=void 0;
if(t>A.priority)break;if(v=A.scope)A.templateUrl||(G(v)?(W("new/isolated scope",D||r,A,z),D=A):W("new/isolated scope",D,A,z)),r=r||A;M=A.name;if(!ka&&(A.replace&&(A.templateUrl||A.template)||A.transclude&&!A.$$tlb)){for(v=F+1;ka=a[v++];)if(ka.transclude&&!ka.$$tlb||ka.replace&&(ka.templateUrl||ka.template)){C=!0;break}ka=!0}!A.templateUrl&&A.controller&&(v=A.controller,I=I||T(),W("'"+M+"' controller",I[M],A,z),I[M]=A);if(v=A.transclude)if(u=!0,A.$$tlb||(W("transclusion",w,A,z),w=A),"element"==v)H=
!0,t=A.priority,$=z,z=d.$$element=B(ba.$$createComment(M,d[M])),b=z[0],da(f,za.call($,0),b),$[0].$$parentNode=$[0].parentNode,s=Yb(C,$,e,t,g&&g.name,{nonTlbTranscludeDirective:w});else{var la=T();$=B(Vb(b)).contents();if(G(v)){$=[];var Y=T(),X=T();q(v,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Y[a]=b;la[b]=null;X[b]=c});q(z.contents(),function(a){var b=Y[xa(va(a))];b?(X[b]=!0,la[b]=la[b]||[],la[b].push(a)):$.push(a)});q(X,function(a,b){if(!a)throw ga("reqslot",b);});for(var Z in la)la[Z]&&
(la[Z]=Yb(C,la[Z],e))}z.empty();s=Yb(C,$,e,void 0,void 0,{needsNewScope:A.$$isolateScope||A.$$newScope});s.$$slots=la}if(A.template)if(L=!0,W("template",J,A,z),J=A,v=E(A.template)?A.template(z,d):A.template,v=ta(v),A.replace){g=A;$=Tb.test(v)?Yc(ca(A.templateNamespace,V(v))):[];b=$[0];if(1!=$.length||1!==b.nodeType)throw ga("tplrt",M,"");da(f,z,b);Ba={$attr:{}};v=x(b,[],Ba);var ea=a.splice(F+1,a.length-(F+1));(D||r)&&Zc(v,D,r);a=a.concat(v).concat(ea);U(d,Ba);Ba=a.length}else z.html(v);if(A.templateUrl)L=
!0,W("template",J,A,z),J=A,A.replace&&(g=A),n=aa(a.splice(F,a.length-F),z,d,f,u&&s,h,k,{controllerDirectives:I,newScopeDirective:r!==A&&r,newIsolateScopeDirective:D,templateDirective:J,nonTlbTranscludeDirective:w}),Ba=a.length;else if(A.compile)try{Sa=A.compile(z,d,s),E(Sa)?m(null,Sa,P,Q):Sa&&m(Sa.pre,Sa.post,P,Q)}catch(fa){c(fa,wa(z))}A.terminal&&(n.terminal=!0,t=Math.max(t,A.priority))}n.scope=r&&!0===r.scope;n.transcludeOnThisElement=u;n.templateOnThisElement=L;n.transclude=s;l.hasElementTranscludeDirective=
H;return n}function gb(a,b,c,d){var e;if(F(b)){var f=b.match(k);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ga("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=gb(a,b[g],c,d);else G(b)&&(e={},q(b,function(b,f){e[f]=gb(a,b,c,d)}));return e||null}function O(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,
$element:a,$attrs:b,$transclude:c},n=l.controller;"@"==n&&(n=b[l.name]);m=z(n,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function Zc(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=Pb(a[d],{$$isolateScope:b,$$newScope:c})}function la(b,f,g,h,k,l,m){if(f===k)return null;k=null;if(e.hasOwnProperty(f)){var n;f=a.get(f+"Directive");for(var t=0,r=f.length;t<r;t++)try{if(n=f[t],(y(h)||h>n.priority)&&-1!=n.restrict.indexOf(g)){l&&(n=Pb(n,{$$start:l,$$end:m}));if(!n.$$bindings){var I=
n,D=n,A=n.name,J={isolateScope:null,bindToController:null};G(D.scope)&&(!0===D.bindToController?(J.bindToController=d(D.scope,A,!0),J.isolateScope={}):J.isolateScope=d(D.scope,A,!1));G(D.bindToController)&&(J.bindToController=d(D.bindToController,A,!0));if(G(J.bindToController)){var w=D.controller,z=D.controllerAs;if(!w)throw ga("noctrl",A);if(!Uc(w,z))throw ga("noident",A);}var u=I.$$bindings=J;G(u.isolateScope)&&(n.$$isolateBindings=u.isolateScope)}b.push(n);k=n}}catch(L){c(L)}}return k}function Q(b){if(e.hasOwnProperty(b))for(var c=
a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function U(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,f){"class"==f?(A(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function aa(a,b,c,d,e,f,
g,h){var k=[],l,m,t=b[0],p=a.shift(),r=Pb(p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),I=E(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,D=p.templateNamespace;b.empty();n(I).then(function(n){var J,w;n=ta(n);if(p.replace){n=Tb.test(n)?Yc(ca(D,V(n))):[];J=n[0];if(1!=n.length||1!==J.nodeType)throw ga("tplrt",p.name,I);n={$attr:{}};da(d,b,J);var z=x(J,[],n);G(p.scope)&&Zc(z,!0);a=z.concat(a);U(c,n)}else J=t,b.html(n);a.unshift(r);l=Ba(a,J,c,e,b,p,f,g,h);q(d,function(a,c){a==
J&&(d[c]=b[0])});for(m=s(b[0].childNodes,e);k.length;){n=k.shift();w=k.shift();var u=k.shift(),L=k.shift(),z=b[0];if(!n.$$destroyed){if(w!==t){var S=w.className;h.hasElementTranscludeDirective&&p.replace||(z=Vb(J));da(u,B(w),z);A(B(z),S)}w=l.transcludeOnThisElement?ka(n,l.transclude,L):L;l(m,n,z,d,w)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(l.transcludeOnThisElement&&(a=ka(b,l.transclude,e)),l(m,b,c,d,a)))}}function Y(a,b){var c=b.priority-a.priority;return 0!==
c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function W(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ga("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,wa(d));}function X(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&ba.$$addBindingClass(a);return function(a,c){var e=c.parent();b||ba.$$addBindingClass(e);ba.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ca(a,b){a=
P(a||"html");switch(a){case "svg":case "math":var c=v.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function ea(a,b){if("srcdoc"==b)return I.HTML;var c=va(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return I.RESOURCE_URL}function fa(a,c,d,e,f){var g=ea(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===va(a))throw ga("selmulti",wa(a));c.push({priority:100,compile:function(){return{pre:function(a,
c,h){c=h.$$observers||(h.$$observers=T());if(l.test(e))throw ga("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function da(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=
c);break}f&&f.replaceChild(c,d);a=v.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);B.hasData(d)&&(B.data(c,B.data(d)),B(d).off("$destroy"));B.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function ha(a,b){return R(function(){return a.apply(null,arguments)},a,b)}function ja(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,wa(d))}}function ia(a,c,d,e,f){function g(b,c,e){E(d.$onChanges)&&c!==e&&(Z||(a.$$postDigest(L),Z=[]),m||(m={},Z.push(h)),m[b]&&
(e=m[b].previousValue),m[b]=new Db(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;q(e,function(e,h){var m=e.attrName,n=e.optional,p,r,I,D;switch(e.mode){case "@":n||ua.call(c,m)||(d[h]=c[m]=void 0);c.$observe(m,function(a){if(F(a)||Da(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;p=c[m];F(p)?d[h]=b(p)(a):Da(p)&&(d[h]=p);l[h]=new Db(Zb,d[h]);break;case "=":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);D=r.literal?pa:function(a,b){return a===b||a!==a&&b!==b};
I=r.assign||function(){p=d[h]=r(a);throw ga("nonassign",c[m],m,f.name);};p=d[h]=r(a);n=function(b){D(b,d[h])||(D(b,p)?I(a,b=d[h]):d[h]=b);return p=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(t(c[m],n),null,r.literal);k.push(n);break;case "<":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);d[h]=r(a);l[h]=new Db(Zb,d[h]);n=a.$watch(r,function(a,b){a===b&&(b=d[h]);g(h,a,b);d[h]=a},r.literal);k.push(n);break;case "&":r=c.hasOwnProperty(m)?t(c[m]):C;if(r===
C&&n)break;d[h]=function(b){return r(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var oa=/^\w/,na=v.document.createElement("div"),qa=r,Z;S.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&J.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&J.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=$c(a,b);c&&c.length&&J.addClass(this.$$element,c);(c=$c(b,a))&&c.length&&J.removeClass(this.$$element,
c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=ad[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=zc(a,"-"));f=va(this.$$element);if("a"===f&&("href"===a||"xlinkHref"===a)||"img"===f&&"src"===a)this[a]=b=D(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=V(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var m=2*l,f=f+D(V(g[m]),!0),f=
f+(" "+V(g[m+1]));g=V(g[2*l]).split(/\s/);f+=D(V(g[0]),!0);2===g.length&&(f+=" "+V(g[1]));this[a]=b=f}!1!==d&&(null===b||y(b)?this.$$element.removeAttr(e):oa.test(e)?this.$$element.attr(e,b):$(this.$$element[0],e,b));(a=this.$$observers)&&q(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);u.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||y(c[a])||b(c[a])});return function(){Za(e,b)}}};var ra=b.startSymbol(),
sa=b.endSymbol(),ta="{{"==ra&&"}}"==sa?Xa:function(a){return a.replace(/\{\{/g,ra).replace(/}}/g,sa)},ya=/^ngAttr[A-Z]/,Aa=/^(.+)Start$/;ba.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:C;ba.$$addBindingClass=m?function(a){A(a,"ng-binding")}:C;ba.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:C;ba.$$addScopeClass=m?function(a,b){A(a,b?"ng-isolate-scope":"ng-scope")}:C;ba.$$createComment=
function(a,b){var c="";m&&(c=" "+(a||"")+": "+(b||"")+" ");return v.document.createComment(c)};return ba}]}function Db(a,b){this.previousValue=a;this.currentValue=b}function xa(a){return cb(a.replace(Vc,""))}function $c(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],h=0;h<e.length;h++)if(g==e[h])continue a;d+=(0<d.length?" ":"")+g}return d}function Yc(a){a=B(a);var b=a.length;if(1>=b)return a;for(;b--;)8===a[b].nodeType&&Zf.call(a,b,1);return a}function Uc(a,
b){if(b&&F(b))return b;if(F(a)){var d=bd.exec(a);if(d)return d[3]}}function ef(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,c){Qa(b,"controller");G(b)?R(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!G(a.$scope))throw O("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,n,m;h=!0===h;k&&F(k)&&(m=k);if(F(f)){k=f.match(bd);if(!k)throw $f("ctrlfmt",f);n=k[1];m=
m||k[3];f=a.hasOwnProperty(n)?a[n]:Bc(g.$scope,n,!0)||(b?Bc(c,n,!0):void 0);Pa(f,n,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),m&&e(g,m,l,n||f.name),R(function(){var a=d.invoke(f,l,g,n);a!==l&&(G(a)||E(a))&&(l=a,m&&e(g,m,l,n||f.name));return l},{instance:l,identifier:m});l=d.instantiate(f,g,n);m&&e(g,m,l,n||f.name);return l}}]}function ff(){this.$get=["$window",function(a){return B(a.document)}]}function gf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,
arguments)}}]}function $b(a){return G(a)?fa(a)?a.toISOString():ab(a):a}function mf(){this.$get=function(){return function(a){if(!a)return"";var b=[];pc(a,function(a,c){null===a||y(a)||(K(a)?q(a,function(a){b.push(ja(c)+"="+ja($b(a)))}):b.push(ja(c)+"="+ja($b(a))))});return b.join("&")}}}function nf(){this.$get=function(){return function(a){function b(a,e,f){null===a||y(a)||(K(a)?q(a,function(a,c){b(a,e+"["+(G(a)?c:"")+"]")}):G(a)&&!fa(a)?pc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+
"="+ja($b(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function ac(a,b){if(F(a)){var d=a.replace(ag,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(cd))||(c=(c=d.match(bg))&&cg[c[0]].test(d));c&&(a=uc(d))}}return a}function dd(a){var b=T(),d;F(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=P(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):G(a)&&q(a,function(a,d){var f=P(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function ed(a){var b;
return function(d){b||(b=dd(a));return d?(d=b[P(d)],void 0===d&&(d=null),d):b}}function fd(a,b,d,c){if(E(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function lf(){var a=this.defaults={transformResponse:[ac],transformRequest:[function(a){return G(a)&&"[object File]"!==ma.call(a)&&"[object Blob]"!==ma.call(a)&&"[object FormData]"!==ma.call(a)?ab(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ha(bc),put:ha(bc),patch:ha(bc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return x(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function n(b){function c(a){var b=R({},a);b.data=fd(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};q(a,function(a,
e){E(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!G(b))throw O("$http")("badreq",b);if(!F(b.url))throw O("$http")("badreq",b.url);var f=R({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=R({},b.headers),f,g,h,c=R({},c.common,c[P(b.method)]);a:for(f in c){g=P(f);for(h in d)if(P(h)===g)continue a;d[f]=c[f]}return e(d,ha(b))}(b);f.method=sb(f.method);f.paramSerializer=F(f.paramSerializer)?
l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=fd(b.data,ed(d),void 0,b.transformRequest);y(e)&&q(d,function(a,b){"content-type"===P(b)&&delete d[b]});y(b.withCredentials)&&!y(a.withCredentials)&&(b.withCredentials=a.withCredentials);return m(b,e).then(c,c)},void 0],h=k.when(f);for(q(M,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var n=g.shift(),
h=h.then(b,n)}d?(h.success=function(a){Pa(a,"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Pa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=gd("success"),h.error=gd("error"));return h}function m(c,d){function g(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function l(a,c,d,e){function f(){m(c,a,d,e)}L&&(200<=a&&300>a?L.put(A,[a,c,dd(d),
e]):L.remove(A));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function m(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:ed(d),config:c,statusText:e})}function u(a){m(a.data,a.status,ha(a.headers()),a.statusText)}function I(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var J=k.defer(),D=J.promise,L,S,M=c.headers,A=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);D.then(I,I);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&
"JSONP"!==c.method||(L=G(c.cache)?c.cache:G(a.cache)?a.cache:N);L&&(S=L.get(A),x(S)?S&&E(S.then)?S.then(u,u):K(S)?m(S[1],S[0],ha(S[2]),S[3]):m(S,200,{},"OK"):L.put(A,D));y(S)&&((S=hd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(M[c.xsrfHeaderName||a.xsrfHeaderName]=S),e(c.method,A,d,l,M,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return D}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var N=g("$http");a.paramSerializer=
F(a.paramSerializer)?l.get(a.paramSerializer):a.paramSerializer;var M=[];q(c,function(a){M.unshift(F(a)?l.get(a):l.invoke(a))});n.pendingRequests=[];(function(a){q(arguments,function(a){n[a]=function(b,c){return n(R({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){n[a]=function(b,c,d){return n(R({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function pf(){this.$get=function(){return function(){return new v.XMLHttpRequest}}}
function of(){this.$get=["$browser","$window","$document","$xhrFactory",function(a,b,d,c){return dg(a,c,a.defer,b.angular.callbacks,d[0])}]}function dg(a,b,d,c,e){function f(a,b,d){var f=e.createElement("script"),n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var g=-1,N="unknown";a&&("load"!==a.type||c[b].called||(a={type:"error"}),N=a.type,g="error"===a.type?404:200);d&&d(g,N)};f.addEventListener("load",
n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,h,k,l,n,m,r,N,M,w){function p(){z&&z();u&&u.abort()}function H(b,c,e,f,g){x(J)&&d.cancel(J);z=u=null;b(c,e,f,g);a.$$completeOutstandingRequest(C)}a.$$incOutstandingRequestCount();h=h||a.url();if("jsonp"==P(e)){var t="_"+(c.counter++).toString(36);c[t]=function(a){c[t].data=a;c[t].called=!0};var z=f(h.replace("JSON_CALLBACK","angular.callbacks."+t),t,function(a,b){H(l,a,c[t].data,"",b);c[t]=C})}else{var u=b(e,h);
u.open(e,h,!0);q(n,function(a,b){x(a)&&u.setRequestHeader(b,a)});u.onload=function(){var a=u.statusText||"",b="response"in u?u.response:u.responseText,c=1223===u.status?204:u.status;0===c&&(c=b?200:"file"==ra(h).protocol?404:0);H(l,c,b,u.getAllResponseHeaders(),a)};e=function(){H(l,-1,null,null,"")};u.onerror=e;u.onabort=e;q(M,function(a,b){u.addEventListener(b,a)});q(w,function(a,b){u.upload.addEventListener(b,a)});r&&(u.withCredentials=!0);if(N)try{u.responseType=N}catch(I){if("json"!==N)throw I;
}u.send(y(k)?null:k)}if(0<m)var J=d(p,m);else m&&E(m.then)&&m.then(p)}}function jf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(r,b)}function h(a,b,c,d){var e;return e=a.$watch(function(a){e();return d(a)},b,c)}function k(f,k,m,r){function H(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);
var d;if(r&&!x(a))d=a;else if(null==a)d="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=ab(a)}d=a}return d}catch(g){c(Ja.interr(f,g))}}if(!f.length||-1===f.indexOf(a)){var t;k||(k=g(f),t=da(k),t.exp=f,t.expressions=[],t.$$watchDelegate=h);return t}r=!!r;var z,u,I=0,J=[],D=[];t=f.length;for(var L=[],S=[];I<t;)if(-1!=(z=f.indexOf(a,I))&&-1!=(u=f.indexOf(b,z+l)))I!==z&&L.push(g(f.substring(I,z))),I=f.substring(z+l,u),J.push(I),D.push(d(I,H)),I=u+n,S.push(L.length),L.push("");
else{I!==t&&L.push(g(f.substring(I)));break}m&&1<L.length&&Ja.throwNoconcat(f);if(!k||J.length){var q=function(a){for(var b=0,c=J.length;b<c;b++){if(r&&y(a[b]))return;L[S[b]]=a[b]}return L.join("")};return R(function(a){var b=0,d=J.length,e=Array(d);try{for(;b<d;b++)e[b]=D[b](a);return q(e)}catch(g){c(Ja.interr(f,g))}},{exp:f,expressions:J,$$watchDelegate:function(a,b){var c;return a.$watchGroup(D,function(d,e){var f=q(d);E(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,n=b.length,m=new RegExp(a.replace(/./g,
f),"g"),r=new RegExp(b.replace(/./g,f),"g");k.startSymbol=function(){return a};k.endSymbol=function(){return b};return k}]}function kf(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,k,l,n){function m(){r?f.apply(null,N):f(p)}var r=4<arguments.length,N=r?za.call(arguments,4):[],q=b.setInterval,w=b.clearInterval,p=0,H=x(n)&&!n,t=(H?c:d).defer(),z=t.promise;l=x(l)?l:0;z.$$intervalId=q(function(){H?e.defer(m):a.$evalAsync(m);t.notify(p++);0<l&&p>=l&&(t.resolve(p),
w(z.$$intervalId),delete g[z.$$intervalId]);H||a.$apply()},k);g[z.$$intervalId]=t;return z}var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function cc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=ob(a[b]);return a.join("/")}function id(a,b){var d=ra(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=X(d.port)||eg[d.protocol]||null}function jd(a,b){var d="/"!==a.charAt(0);
d&&(a="/"+a);var c=ra(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function na(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function hb(a){return a.replace(/(#.+)|#$/,"$1")}function dc(a,b,d){this.$$html5=!0;d=d||"";id(a,this);this.$$parse=function(a){var d=na(b,
a);if(!F(d))throw Eb("ipthprfx",a,b);jd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Rb(this.$$search),d=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;x(f=na(a,c))?(g=f,g=x(f=na(d,f))?b+(na("/",f)||f):a+g):x(f=na(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function ec(a,b,d){id(a,this);
this.$$parse=function(c){var e=na(a,c)||na(b,c),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(a=c,this.replace())):(f=na(d,e),y(f)&&(f=e));jd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=
function(b,d){return Ia(a)==Ia(b)?(this.$$parse(b),!0):!1}}function kd(a,b,d){this.$$html5=!0;ec.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Ia(c)?f=c:(g=na(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Fb(a){return function(){return this[a]}}function ld(a,
b){return function(d){if(y(d))return this[a];this[a]=b(d);this.$$compose();return this}}function qf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return x(b)?(a=b,this):a};this.html5Mode=function(a){return Da(a)?(b.enabled=a,this):G(a)?(Da(a.enabled)&&(b.enabled=a.enabled),Da(a.requireBase)&&(b.requireBase=a.requireBase),Da(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,
c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,n;n=c.baseHref();var m=c.url(),r;if(b.enabled){if(!n&&b.requireBase)throw Eb("nobase");r=m.substring(0,m.indexOf("/",m.indexOf("//")+2))+(n||"/");n=e.history?dc:kd}else r=Ia(m),n=ec;var N=r.substr(0,Ia(r).lastIndexOf("/")+1);l=new n(r,N,"#"+a);l.$$parseLinkUrl(m,m);l.$$state=c.state();
var q=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=B(a.target);"a"!==va(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");G(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=ra(h.animVal).href);q.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=
!0))}});hb(l.absUrl())!=hb(m)&&c.url(l.absUrl(),!0);var w=!0;c.onUrlChange(function(a,b){y(na(N,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=hb(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(w=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=hb(c.url()),b=hb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(w||
m)w=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))});l.$$replace=!1});return l}]}function rf(){var a=!0,b=this;this.debugEnabled=function(b){return x(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&
(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||C;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];q(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Ta(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===
a||"__proto__"===a)throw ca("isecfld",b);return a}function fg(a){return a+""}function sa(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a.window===a)throw ca("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ca("isecdom",b);if(a===Object)throw ca("isecobj",b);}return a}function md(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a===gg||a===hg||a===ig)throw ca("isecff",b);}}function Gb(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||
a==={}.constructor||a===[].constructor||a===Function.constructor))throw ca("isecaf",b);}function jg(a,b){return"undefined"!==typeof a?a:b}function nd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function aa(a,b){var d,c;switch(a.type){case s.Program:d=!0;q(a.body,function(a){aa(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:aa(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;
break;case s.BinaryExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:aa(a.test,b);aa(a.alternate,b);aa(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=
!1;a.toWatch=[a];break;case s.MemberExpression:aa(a.object,b);a.computed&&aa(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];q(a.arguments,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;
a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];q(a.elements,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];q(a.properties,function(a){aa(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1;a.toWatch=[];break;case s.LocalsExpression:a.constant=!1,a.toWatch=[]}}function od(a){if(1==a.length){a=a[0].expression;
var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function pd(a){return a.type===s.Identifier||a.type===s.MemberExpression}function qd(a){if(1===a.body.length&&pd(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function sd(a,
b){this.astBuilder=a;this.$filter=b}function td(a,b){this.astBuilder=a;this.$filter=b}function Hb(a){return"constructor"==a}function fc(a){return E(a.valueOf)?a.valueOf():kg.call(a)}function sf(){var a=T(),b=T(),d={"true":!0,"false":!1,"null":null,undefined:void 0},c,e;this.addLiteral=function(a,b){d[a]=b};this.setIdentifierFns=function(a,b){c=a;e=b;return this};this.$get=["$filter",function(f){function g(c,d,e){var g,k,D;e=e||H;switch(typeof c){case "string":D=c=c.trim();var q=e?b:a;g=q[D];if(!g){":"===
c.charAt(0)&&":"===c.charAt(1)&&(k=!0,c=c.substring(2));g=e?p:w;var S=new gc(g);g=(new hc(S,f,g)).parse(c);g.constant?g.$$watchDelegate=r:k?g.$$watchDelegate=g.literal?m:n:g.inputs&&(g.$$watchDelegate=l);e&&(g=h(g));q[D]=g}return N(g,d);case "function":return N(c,d);default:return N(C,d)}}function h(a){function b(c,d,e,f){var g=H;H=!0;try{return a(c,d,e,f)}finally{H=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=h(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&
c<a.inputs.length;++c)a.inputs[c]=h(a.inputs[c]);b.inputs=a.inputs;return b}function k(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function l(a,b,c,d,e){var f=d.inputs,g;if(1===f.length){var h=k,f=f[0];return a.$watch(function(a){var b=f(a);k(b,h)||(g=d(a,void 0,void 0,[b]),h=b&&fc(b));return g},b,c,e)}for(var l=[],m=[],n=0,r=f.length;n<r;n++)l[n]=k,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var h=f[c](a);
if(b||(b=!k(h,l[c])))m[c]=h,l[c]=h&&fc(h)}b&&(g=d(a,void 0,void 0,m));return g},b,c,e)}function n(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;E(b)&&b.apply(this,arguments);x(a)&&d.$$postDigest(function(){x(f)&&e()})},c)}function m(a,b,c,d){function e(a){var b=!0;q(a,function(a){x(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;E(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function r(a,b,c,d){var e;
return e=a.$watch(function(a){e();return d(a)},b,c)}function N(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,c=c!==m&&c!==n?function(c,e,f,g){f=d&&g?g[0]:a(c,e,f,g);return b(f,c,e)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return x(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==l?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=l,d=!a.inputs,c.inputs=a.inputs?a.inputs:[a]);return c}var M=Ea().noUnsafeEval,w={csp:M,expensiveChecks:!1,literals:qa(d),isIdentifierStart:E(c)&&c,
isIdentifierContinue:E(e)&&e},p={csp:M,expensiveChecks:!0,literals:qa(d),isIdentifierStart:E(c)&&c,isIdentifierContinue:E(e)&&e},H=!1;g.$$runningExpensiveChecks=function(){return H};return g}]}function uf(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return ud(function(b){a.$evalAsync(b)},b)}]}function vf(){this.$get=["$browser","$exceptionHandler",function(a,b){return ud(function(b){a.defer(b)},b)}]}function ud(a,b){function d(){this.$$state={status:0}}function c(a,b){return function(c){b.call(a,
c)}}function e(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,a(function(){var a,d,e;e=c.pending;c.processScheduled=!1;c.pending=void 0;for(var f=0,g=e.length;f<g;++f){d=e[f][0];a=e[f][c.status];try{E(a)?d.resolve(a(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),b(h)}}}))}function f(){this.promise=new d}var g=O("$q",TypeError);R(d.prototype,{then:function(a,b,c){if(y(a)&&y(b)&&y(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
a,b,c]);0<this.$$state.status&&e(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});R(f.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(a){function d(a){k||(k=!0,h.$$resolve(a))}function f(a){k||(k=!0,h.$$reject(a))}var g,h=this,k=!1;try{if(G(a)||E(a))g=a&&a.then;E(g)?
(this.promise.$$state.status=-1,g.call(a,d,f,c(this,this.notify))):(this.promise.$$state.value=a,this.promise.$$state.status=1,e(this.promise.$$state))}catch(l){f(l),b(l)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;e(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;f<g;f++){e=d[f][0];
a=d[f][3];try{e.notify(E(a)?a(c):c)}catch(h){b(h)}}})}});var h=function(a,b){var c=new f;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{E(c)&&(d=c())}catch(e){return h(e,!1)}return d&&E(d.then)?d.then(function(){return h(a,b)},function(a){return h(a,!1)}):h(a,b)},l=function(a,b,c,d){var e=new f;e.resolve(a);return e.promise.then(b,c,d)},n=function(a){if(!E(a))throw g("norslvr",a);var b=new f;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};n.prototype=
d.prototype;n.defer=function(){var a=new f;a.resolve=c(a,a.resolve);a.reject=c(a,a.reject);a.notify=c(a,a.notify);return a};n.reject=function(a){var b=new f;b.reject(a);return b.promise};n.when=l;n.resolve=l;n.all=function(a){var b=new f,c=0,d=K(a)?[]:{};q(a,function(a,e){c++;l(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return n}function Ef(){this.$get=["$window","$timeout",function(a,
b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function tf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=
null}b.prototype=a;return b}var b=10,d=O("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,h){function k(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=
this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function m(a){if(H.$$phase)throw d("inprog",H.$$phase);H.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function N(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function w(){for(;u.length;)try{u.shift()()}catch(a){f(a)}e=
null}function p(){null===e&&(e=h.defer(function(){H.$apply(w)}))}n.prototype={constructor:n,$new:function(b,c){var d;c=c||this;b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,d,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,
a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||a,eq:!!d};c=null;E(b)||(l.fn=C);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=Za(k,l)&&r(h,-1);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});q(a,function(a,
b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!y(e)){if(G(e))if(ya(e))for(f!==m&&(f=m,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==r&&(f=r={},t=0,l++);a=0;for(b in e)ua.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>
a)for(b in l++,f)ua.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,n=g(a,c),m=[],r={},p=!0,t=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,h,d);if(k)if(G(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ua.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,k,l,n,r,p,q,N=b,u,x=[],y,v;m("$digest");h.$$checkUrlChange();this===H&&null!==e&&(h.defer.cancel(e),w());c=null;do{q=!1;
for(u=this;t.length;){try{v=t.shift(),v.scope.$eval(v.expression,v.locals)}catch(C){f(C)}c=null}a:do{if(r=u.$$watchers)for(p=r.length;p--;)try{if(a=r[p])if(n=a.get,(g=n(u))!==(k=a.last)&&!(a.eq?pa(g,k):"number"===typeof g&&"number"===typeof k&&isNaN(g)&&isNaN(k)))q=!0,c=a,a.last=a.eq?qa(g,null):g,l=a.fn,l(g,k===s?g:k,u),5>N&&(y=4-N,x[y]||(x[y]=[]),x[y].push({msg:E(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}));else if(a===c){q=!1;break a}}catch(F){f(F)}if(!(r=u.$$watchersCount&&
u.$$childHead||u!==this&&u.$$nextSibling))for(;u!==this&&!(r=u.$$nextSibling);)u=u.$parent}while(u=r);if((q||t.length)&&!N--)throw H.$$phase=null,d("infdig",b,x);}while(q||t.length);for(H.$$phase=null;z.length;)try{z.shift()()}catch(B){f(B)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===H&&h.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)N(this,this.$$listenerCount[b],b);a&&a.$$childHead==
this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=C;this.$on=this.$watch=this.$watchGroup=function(){return C};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){H.$$phase||
t.length||h.defer(function(){t.length&&H.$digest()});t.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){z.push(a)},$apply:function(a){try{m("$apply");try{return this.$eval(a)}finally{H.$$phase=null}}catch(b){f(b)}finally{try{H.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&u.push(b);a=g(a);p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=
0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,N(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=$a([h],arguments,1),l,n;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(m){f(m)}else d.splice(l,1),l--,n--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);
h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=$a([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=
null;return e}};var H=new n,t=H.$$asyncQueue=[],z=H.$$postDigestQueue=[],u=H.$$applyAsyncQueue=[];return H}]}function me(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return x(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f;f=ra(d).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function lg(a){if("self"===a)return a;
if(F(a)){if(-1<a.indexOf("***"))throw ta("iwcard",a);a=vd(a).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+a+"$")}if(Wa(a))return new RegExp("^"+a.source+"$");throw ta("imatcher");}function wd(a){var b=[];x(a)&&q(a,function(a){b.push(lg(a))});return b}function xf(){this.SCE_CONTEXTS=oa;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=wd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=wd(a));return b};this.$get=["$injector",
function(d){function c(a,b){return"self"===a?hd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw ta("unsafe");};d.has("$sanitize")&&(f=d.get("$sanitize"));var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=
e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw ta("icontext",a,b);if(null===b||y(b)||""===b)return b;if("string"!==typeof b)throw ta("itype",a);return new c(b)},getTrusted:function(d,e){if(null===e||y(e)||""===e)return e;var g=h.hasOwnProperty(d)?h[d]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(d===oa.RESOURCE_URL){var g=ra(e.toString()),m,r,q=!1;m=0;for(r=a.length;m<r;m++)if(c(a[m],g)){q=!0;break}if(q)for(m=0,r=b.length;m<r;m++)if(c(b[m],
g)){q=!1;break}if(q)return e;throw ta("insecurl",e.toString());}if(d===oa.HTML)return f(e);throw ta("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function wf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw ta("iequirks");var c=ha(oa);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},
c.valueOf=Xa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;q(oa,function(a,b){var d=P(b);c[cb("parse_as_"+d)]=function(b){return e(a,b)};c[cb("get_trusted_"+d)]=function(b){return f(a,b)};c[cb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function yf(){this.$get=["$window","$document",function(a,b){var d={},c=!(a.chrome&&a.chrome.app&&a.chrome.app.runtime)&&a.history&&a.history.pushState,
e=X((/android (\d+)/.exec(P((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h,k=/^(Moz|webkit|ms)(?=[A-Z])/,l=g.body&&g.body.style,n=!1,m=!1;if(l){for(var r in l)if(n=k.exec(r)){h=n[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");n=!!("transition"in l||h+"Transition"in l);m=!!("animation"in l||h+"Animation"in l);!e||n&&m||(n=F(l.webkitTransition),m=F(l.webkitAnimation))}return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===
a&&11>=Ca)return!1;if(y(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:h,transitions:n,animations:m,android:e}}]}function Af(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++;F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;K(k)?k=k.filter(function(a){return a!==ac}):k===ac&&(k=null);return d.get(g,
R({cache:b,transformResponse:k},a))["finally"](function(){f.totalPendingRequests--}).then(function(a){b.put(g,a.data);return a.data},function(a){if(!h)throw mg("tpload",g,a.status,a.statusText);return c.reject(a)})}f.totalPendingRequests=0;return f}]}function Bf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=ea.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+
vd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(d?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function Cf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",
function(a,b,d,c,e){function f(f,k,l){E(f)||(l=k,k=f,f=C);var n=za.call(arguments,3),m=x(l)&&!l,r=(m?c:d).defer(),q=r.promise,s;s=b.defer(function(){try{r.resolve(f.apply(null,n))}catch(b){r.reject(b),e(b)}finally{delete g[q.$$timeoutId]}m||a.$apply()},k);q.$$timeoutId=s;g[s]=r;return q}var g={};f.cancel=function(a){return a&&a.$$timeoutId in g?(g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1};return f}]}function ra(a){Ca&&(Y.setAttribute("href",a),a=
Y.href);Y.setAttribute("href",a);return{href:Y.href,protocol:Y.protocol?Y.protocol.replace(/:$/,""):"",host:Y.host,search:Y.search?Y.search.replace(/^\?/,""):"",hash:Y.hash?Y.hash.replace(/^#/,""):"",hostname:Y.hostname,port:Y.port,pathname:"/"===Y.pathname.charAt(0)?Y.pathname:"/"+Y.pathname}}function hd(a){a=F(a)?ra(a):a;return a.protocol===xd.protocol&&a.host===xd.host}function Df(){this.$get=da(v)}function yd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},
c={},e="";return function(){var a,g,h,k,l;a=d.cookie||"";if(a!==e)for(e=a,a=e.split("; "),c={},h=0;h<a.length;h++)g=a[h],k=g.indexOf("="),0<k&&(l=b(g.substring(0,k)),y(c[l])&&(c[l]=b(g.substring(k+1))));return c}}function Hf(){this.$get=yd}function Jc(a){function b(d,c){if(G(d)){var e={};q(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",zd);b("date",Ad);b("filter",ng);
b("json",og);b("limitTo",pg);b("lowercase",qg);b("number",Bd);b("orderBy",Cd);b("uppercase",rg)}function ng(){return function(a,b,d){if(!ya(a)){if(null==a)return a;throw O("filter")("notarray",a);}var c;switch(ic(b)){case "function":break;case "boolean":case "null":case "number":case "string":c=!0;case "object":b=sg(b,d,c);break;default:return a}return Array.prototype.filter.call(a,b)}}function sg(a,b,d){var c=G(a)&&"$"in a;!0===b?b=pa:E(b)||(b=function(a,b){if(y(a))return!1;if(null===a||null===b)return a===
b;if(G(b)||G(a)&&!rc(a))return!1;a=P(""+a);b=P(""+b);return-1!==a.indexOf(b)});return function(e){return c&&!G(e)?Ka(e,a.$,b,!1):Ka(e,a,b,d)}}function Ka(a,b,d,c,e){var f=ic(a),g=ic(b);if("string"===g&&"!"===b.charAt(0))return!Ka(a,b.substring(1),d,c);if(K(a))return a.some(function(a){return Ka(a,b,d,c)});switch(f){case "object":var h;if(c){for(h in a)if("$"!==h.charAt(0)&&Ka(a[h],b,d,!0))return!0;return e?!1:Ka(a,b,d,!1)}if("object"===g){for(h in b)if(e=b[h],!E(e)&&!y(e)&&(f="$"===h,!Ka(f?a:a[h],
e,d,f,f)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function ic(a){return null===a?"null":typeof a}function zd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){y(c)&&(c=b.CURRENCY_SYM);y(e)&&(e=b.PATTERNS[1].maxFrac);return null==a?a:Dd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(/\u00A4/g,c)}}function Bd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Dd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function tg(a){var b=0,d,c,e,f,g;-1<
(c=a.indexOf(Ed))&&(a=a.replace(Ed,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==jc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==jc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Fd&&(d=d.splice(0,Fd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function ug(a,b,d,c){var e=a.d,f=e.length-a.i;b=y(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=
Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Dd(a,b,d,c,e){if(!F(a)&&!Q(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,h=Math.abs(a)+"",k="";if(f)k="\u221e";else{g=tg(h);ug(g,e,b.minFrac,b.maxFrac);k=g.d;h=g.i;e=g.e;f=[];for(g=k.reduce(function(a,
b){return a&&!b},!0);0>h;)k.unshift(0),h++;0<h?f=k.splice(h):(f=k,k=[0]);h=[];for(k.length>=b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ib(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=jc+a;d&&(a=a.substr(a.length-b));return e+a}function W(a,b,d,c,e){d=
d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12==d&&(f=12);return Ib(f,b,c,e)}}function ib(a,b,d){return function(c,e){var f=c["get"+a](),g=sb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Gd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Hd(a){return function(b){var d=Gd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ib(b,a)}}function kc(a,b){return 0>=a.getFullYear()?
b.ERAS[0]:b.ERAS[1]}function Ad(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=X(b[9]+b[10]),g=X(b[9]+b[11]));h.call(a,X(b[1]),X(b[2])-1,X(b[3]));f=X(b[4]||0)-f;g=X(b[5]||0)-g;h=X(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=
[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;F(c)&&(c=vg.test(c)?X(c):b(c));Q(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=wg.exec(d))?(h=$a(h,l,1),d=h.pop()):(h.push(d),d=null);var n=c.getTimezoneOffset();f&&(n=vc(f,n),c=Qb(c,f,!0));q(h,function(b){k=xg[b];g+=k?k(c,a.DATETIME_FORMATS,n):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function og(){return function(a,b){y(b)&&(b=2);return ab(a,b)}}function pg(){return function(a,b,d){b=Infinity===
Math.abs(Number(b))?Number(b):X(b);if(isNaN(b))return a;Q(a)&&(a=a.toString());if(!K(a)&&!F(a))return a;d=!d||isNaN(d)?0:X(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)}}function Cd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Xa;if(E(b))h=b;else if(F(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h,
descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!ya(a))throw O("orderBy")("notarray",a);K(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}},descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===
c)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),d(e)))break a;if(rc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],q=0;c.type===f.type?c.value!==f.value&&(q=c.value<f.value?-1:1):q=c.type<f.type?-1:1;if(c=q*g[d].descending)break}return c});return a=a.map(function(a){return a.value})}}function La(a){E(a)&&(a={link:a});a.restrict=a.restrict||"AC";return da(a)}function Id(a,
b,d,c,e){var f=this,g=[];f.$error={};f.$$success={};f.$pending=void 0;f.$name=e(b.name||b.ngForm||"")(d);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Jb;f.$rollbackViewValue=function(){q(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){q(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Qa(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a);a.$$parentForm=f};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];
f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];q(f.$pending,function(b,c){f.$setValidity(c,null,a)});q(f.$error,function(b,c){f.$setValidity(c,null,a)});q(f.$$success,function(b,c){f.$setValidity(c,null,a)});Za(g,a);a.$$parentForm=Jb};Jd({ctrl:this,$element:a,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Za(d,c),0===d.length&&delete a[b])},$animate:c});f.$setDirty=function(){c.removeClass(a,Ua);
c.addClass(a,Kb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){c.setClass(a,Ua,Kb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;q(g,function(a){a.$setPristine()})};f.$setUntouched=function(){q(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){c.addClass(a,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function lc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function jb(a,b,d,c,e,f){var g=P(b[0].type);
if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0});b.on("compositionend",function(){h=!1;l()})}var k,l=function(a){k&&(f.defer.cancel(k),k=null);if(!h){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<
b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",n)}b.on("change",l);if(Kd[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Lb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(F(d)){'"'==d.charAt(0)&&
'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(yg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(a,b,d,c){return function(e,f,g,h,k,l,n){function m(a){return a&&
!(a.getTime&&a.getTime()!==a.getTime())}function r(a){return x(a)&&!fa(a)?d(a)||void 0:a}Ld(e,f,g,h);jb(e,f,g,h,k,l);var q=h&&h.$options&&h.$options.timezone,s;h.$$parserName=a;h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a))return a=d(a,s),q&&(a=Qb(a,q)),a});h.$formatters.push(function(a){if(a&&!fa(a))throw lb("datefmt",a);if(m(a))return(s=a)&&q&&(s=Qb(s,q,!0)),n("date")(a,c,q);s=null;return""});if(x(g.min)||g.ngMin){var w;h.$validators.min=function(a){return!m(a)||y(w)||d(a)>=
w};g.$observe("min",function(a){w=r(a);h.$validate()})}if(x(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!m(a)||y(p)||d(a)<=p};g.$observe("max",function(a){p=r(a);h.$validate()})}}}function Ld(a,b,d,c){(c.$$hasNativeValidators=G(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function Md(a,b,d,c,e){if(x(c)){a=a(c);if(!a.constant)throw lb("constexpr",d,c);return a(b)}return e}function mc(a,b){a="ngClass"+a;return["$animate",
function(d){function c(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return K(a)?(q(a,function(a){b=b.concat(e(a))}),b):F(a)?a.split(" "):G(a)?(q(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function k(a){a=l(a,1);h.$addClass(a)}function l(a,b){var c=g.data("$classCounts")||T(),d=[];q(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",
c);return d.join(" ")}function n(a,b){var e=c(b,a),f=c(a,b),e=l(e,1),f=l(f,-1);e&&e.length&&d.addClass(g,e);f&&f.length&&d.removeClass(g,f)}function m(a){if(!0===b||f.$index%2===b){var c=e(a||[]);if(!r)k(c);else if(!pa(a,r)){var d=e(r);n(d,c)}}r=K(a)?a.map(function(a){return ha(a)}):ha(a)}var r;f.$watch(h[a],m,!0);h.$observe("class",function(b){m(f.$eval(h[a]))});"ngClass"!==a&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var m=e(f.$eval(h[a]));g===b?k(m):(g=l(m,-1),h.$removeClass(g))}})}}}]}
function Jd(a){function b(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function d(a,c){a=a?"-"+zc(a,"-"):"";b(mb+a,!0===c);b(Nd+a,!1===c)}var c=a.ctrl,e=a.$element,f={},g=a.set,h=a.unset,k=a.$animate;f[Nd]=!(f[mb]=e.hasClass(mb));c.$setValidity=function(a,e,f){y(e)?(c.$pending||(c.$pending={}),g(c.$pending,a,f)):(c.$pending&&h(c.$pending,a,f),Od(c.$pending)&&(c.$pending=void 0));Da(e)?e?(h(c.$error,a,f),g(c.$$success,a,f)):(g(c.$error,a,f),h(c.$$success,a,f)):(h(c.$error,
a,f),h(c.$$success,a,f));c.$pending?(b(Pd,!0),c.$valid=c.$invalid=void 0,d("",null)):(b(Pd,!1),c.$valid=Od(c.$error),c.$invalid=!c.$valid,d("",c.$valid));e=c.$pending&&c.$pending[a]?void 0:c.$error[a]?!1:c.$$success[a]?!0:null;d(a,e);c.$$parentForm.$setValidity(a,e,c)}}function Od(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var zg=/^\/(.+)\/([a-z]*)$/,ua=Object.prototype.hasOwnProperty,P=function(a){return F(a)?a.toLowerCase():a},sb=function(a){return F(a)?a.toUpperCase():a},Ca,
B,Z,za=[].slice,Zf=[].splice,Ag=[].push,ma=Object.prototype.toString,sc=Object.getPrototypeOf,Aa=O("ng"),ea=v.angular||(v.angular={}),Sb,nb=0;Ca=v.document.documentMode;C.$inject=[];Xa.$inject=[];var K=Array.isArray,$d=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,V=function(a){return F(a)?a.trim():a},vd=function(a){return a.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ea=function(){if(!x(Ea.rules)){var a=v.document.querySelector("[ng-csp]")||
v.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ea.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ea;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ea.rules},pb=function(){if(x(pb.name_))return pb.name_;var a,b,d=Na.length,c,e;for(b=0;b<d;++b)if(c=Na[b],a=v.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+
"jq");break}return pb.name_=e},ce=/:/g,Na=["ng-","data-ng-","ng:","x-ng-"],he=/[A-Z]/g,Ac=!1,Ma=3,le={full:"1.5.5",major:1,minor:5,dot:5,codeName:"material-conspiration"};U.expando="ng339";var eb=U.cache={},Nf=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var If=/([\:\-\_]+(.))/g,Jf=/^moz([A-Z])/,wb={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=O("jqLite"),Mf=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Kf=/<([\w:-]+)/,Lf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
ia={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option;ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead;ia.th=ia.td;var Sf=v.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Oa=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===
v.document.readyState?v.setTimeout(b):(this.on("DOMContentLoaded",b),U(v).on("load",b))},toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?B(this[a]):B(this[this.length+a])},length:0,push:Ag,sort:[].sort,splice:[].splice},Cb={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Cb[P(a)]=a});var Sc={};q("input select option textarea button form details".split(" "),function(a){Sc[a]=!0});var ad={ngMinlength:"minlength",
ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};q({data:Wb,removeData:db,hasData:function(a){for(var b in eb[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)db(a[b])}},function(a,b){U[b]=a});q({data:Wb,inheritedData:Ab,scope:function(a){return B.data(a,"$scope")||Ab(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return B.data(a,"$isolateScope")||B.data(a,"$isolateScopeNoTemplate")},controller:Pc,injector:function(a){return Ab(a,
"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:xb,css:function(a,b,d){b=cb(b);if(x(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Ma&&2!==c&&8!==c)if(c=P(b),Cb[c])if(x(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||C).specified?c:void 0;else if(x(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?void 0:a},prop:function(a,b,d){if(x(d))a[b]=
d;else return a[b]},text:function(){function a(a,d){if(y(d)){var c=a.nodeType;return 1===c||c===Ma?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(y(b)){if(a.multiple&&"select"===va(a)){var d=[];q(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(y(b))return a.innerHTML;ub(a,!0);a.innerHTML=b},empty:Qc},function(a,b){U.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Qc&&y(2==a.length&&
a!==xb&&a!==Pc?b:c)){if(G(b)){for(e=0;e<g;e++)if(a===Wb)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=y(e)?Math.min(g,1):g;for(f=0;f<g;f++){var h=a(this[f],b,c);e=e?e+h:h}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});q({removeData:db,on:function(a,b,d,c){if(x(c))throw Ub("onargs");if(Kc(a)){c=vb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=Pf(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,h=function(b,c,g){var h=e[b];h||(h=e[b]=[],h.specialHandlerWrapper=
c,"$destroy"===b||g||a.addEventListener(b,f,!1));h.push(d)};g--;)b=c[g],wb[b]?(h(wb[b],Rf),h(b,void 0,!0)):h(b)}},off:Oc,one:function(a,b,d){a=B(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;ub(a);q(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];q(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,
b){var d=a.nodeType;if(1===d||11===d){b=new U(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;q(new U(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){Mc(a,B(b).eq(0).clone()[0])},remove:Bb,detach:function(a){Bb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;b=new U(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,b,d){b&&q(b.split(" "),
function(b){var e=d;y(e)&&(e=!xb(a,b));(e?zb:yb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Vb,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=vb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:C,type:f,target:a},b.type&&(c=R(c,b)),b=ha(g),e=d?[c].concat(d):[c],q(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,h=this.length;g<h;g++)y(f)?(f=a(this[g],b,c,e),x(f)&&(f=B(f))):Nc(f,a(this[g],b,c,e));return x(f)?f:this};U.prototype.bind=U.prototype.on;U.prototype.unbind=U.prototype.off});Ra.prototype={put:function(a,
b){this[Fa(a,this.nextUid)]=b},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var b=this[a=Fa(a,this.nextUid)];delete this[a];return b}};var Gf=[function(){this.$get=[function(){return Ra}]}],Uf=/^([^\(]+?)=>/,Vf=/^[^\(]*\(\s*([^\)]*)\)/m,Bg=/,/,Cg=/^\s*(_?)(\S+?)\1\s*$/,Tf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=O("$injector");bb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw F(d)&&d||(d=a.name||Wf(a)),Ga("strictdi",d);
b=Tc(a);q(b[1].split(Bg),function(a){a.replace(Cg,function(a,b,d){c.push(d)})})}a.$inject=c}}else K(a)?(b=a.length-1,Pa(a[b],"fn"),c=a.slice(0,b)):Pa(a,"fn",!0);return c};var Qd=O("$animate"),Ze=function(){this.$get=C},$e=function(){var a=new Ra,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=F(b)?b.split(" "):K(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=Xf(b.attr("class")),e="",f="";q(c,
function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&zb(a,e);f&&yb(a,f)});a.remove(b)}});b.length=0}return{enabled:C,on:C,off:C,pin:C,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Xe=["$provide",function(a){var b=this;this.$$registeredAnimations=
Object.create(null);this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Qd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e;a.factory(e,c)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Qd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h<d.length;h++){var k=
d[h];if(1===k.nodeType){h=k;break a}}h=void 0}!h||h.parentNode||h.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"enter",Ha(h))},move:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"move",Ha(h))},leave:function(b,c){return a.push(b,"leave",Ha(c),function(){b.remove()})},addClass:function(b,
c,g){g=Ha(g);g.addClass=fb(g.addclass,c);return a.push(b,"addClass",g)},removeClass:function(b,c,g){g=Ha(g);g.removeClass=fb(g.removeClass,c);return a.push(b,"removeClass",g)},setClass:function(b,c,g,h){h=Ha(h);h.addClass=fb(h.addClass,c);h.removeClass=fb(h.removeClass,g);return a.push(b,"setClass",h)},animate:function(b,c,g,h,k){k=Ha(k);k.from=k.from?R(k.from,c):c;k.to=k.to?R(k.to,g):g;k.tempClasses=fb(k.tempClasses,h||"ng-inline-animate");return a.push(b,"animate",k)}}}]}],bf=function(){this.$get=
["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},af=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){var d=c[0];d&&d.hidden?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);
else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;q(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:C,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},
"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=
0,this._state=2)}};return f}]},Ye=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);h||k.complete();h=!0});return k}var g=e||{};g.$$prepared||(g=qa(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var h,k=new d;return{start:f,end:f}}}]},ga=O("$compile"),Zb=new function(){};
Cc.$inject=["$provide","$$sanitizeUriProvider"];Db.prototype.isFirstChange=function(){return this.previousValue===Zb};var Vc=/^((?:x|data)[\:\-_])/i,$f=O("$controller"),bd=/^(\S+)(\s+as\s+([\w$]+))?$/,hf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof B&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},cd="application/json",bc={"Content-Type":cd+";charset=utf-8"},bg=/^\[|^\{(?!\{)/,cg={"[":/]$/,"{":/}$/},ag=/^\)\]\}',?\n/,Dg=O("$http"),gd=function(a){return function(){throw Dg("legacy",
a);}},Ja=ea.$interpolateMinErr=O("$interpolate");Ja.throwNoconcat=function(a){throw Ja("noconcat",a);};Ja.interr=function(a,b){return Ja("interr",a,b.toString())};var Eg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,eg={http:80,https:443,ftp:21},Eb=O("$location"),Fg={$$html5:!1,$$replace:!1,absUrl:Fb("$$absUrl"),url:function(a){if(y(a))return this.$$url;var b=Eg.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Fb("$$protocol"),
host:Fb("$$host"),port:Fb("$$port"),path:ld("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(F(a)||Q(a))a=a.toString(),this.$$search=xc(a);else if(G(a))a=qa(a,{}),q(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw Eb("isrcharg");break;default:y(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:ld("$$hash",function(a){return null!==
a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};q([kd,ec,dc],function(a){a.prototype=Object.create(Fg);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Eb("nostate");this.$$state=y(b)?null:b;return this}});var ca=O("$parse"),gg=Function.prototype.call,hg=Function.prototype.apply,ig=Function.prototype.bind,Mb=T();q("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var Gg={n:"\n",f:"\f",r:"\r",
t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;
else{var b=a+this.peek(),d=b+this.peek(2),c=Mb[b],e=Mb[d];Mb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||
"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,
b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=x(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ca("lexerr",
a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=P(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"==d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},
readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||
this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=Gg[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var s=function(a,b){this.lexer=a;this.options=b};s.Program="Program";s.ExpressionStatement="ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";
s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.LocalsExpression="LocalsExpression";s.NGValueParameter="NGValueParameter";s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);
a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},
assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=qa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:s.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,
callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==
this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},
object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw ca("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===
this.tokens.length)throw ca("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?
(this.tokens.shift(),a):!1},selfReferential:{"this":{type:s.ThisExpression},$locals:{type:s.LocalsExpression}}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};aa(c,d.$filter);var e="",f;this.stage="assign";if(f=qd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=od(c.body);
d.stage="inputs";q(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext",
"ifDefined","plus","text",e))(this.$filter,Ta,sa,md,fg,Gb,jg,nd,a);this.state=this.stage=void 0;e.literal=rd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;q(this.state.filters,
function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,n;c=c||C;if(!f&&x(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:q(a.body,function(b,c){k.recurse(b.expression,
void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:n=this.escape(a.value);this.assign(b,n);c(n);break;case s.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});n=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,n);c(n);break;case s.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});n="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,
0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,n);c(n);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ta(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Hb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),n=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,n),d&&(d.computed=!0,d.name=h);else{Ta(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),
k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));n=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Hb(a.property.name))n=k.ensureSafeObject(n);k.assign(b,n);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),n=h+"("+l.join(",")+")",k.assign(b,n),c(b)):(h=k.nextId(),g={},l=
[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);q(a.arguments,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),n=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):n=h+"("+l.join(",")+")";n=k.ensureSafeObject(n);k.assign(b,n)},function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!pd(a.left))throw ca("lval");
this.recurse(a.left,void 0,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);n=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,n);c(b||n)})},1);break;case s.ArrayExpression:l=[];q(a.elements,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(a)})});n="["+l.join(",")+"]";this.assign(b,n);c(n);break;case s.ObjectExpression:l=[];q(a.properties,function(a){k.recurse(a.value,
k.nextId(),void 0,function(b){l.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});n="{"+l.join(",")+"}";this.assign(b,n);c(n);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.LocalsExpression:this.assign(b,"l");c("l");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,
"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+
"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/[$_a-zA-Z][$_a-zA-Z0-9]*/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),
";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=
this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(Q(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,
b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;aa(c,d.$filter);var e,f;if(e=qd(c))f=this.recurse(e);e=od(c.body);var g;e&&(g=[],q(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];q(c.body,function(a){h.push(d.recurse(a.expression))});e=0===c.body.length?C:1===
c.body.length?h[0]:function(a,b){var c;q(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=rd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Ta(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Hb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Ta(a.property.name,f.expression),
e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var m=[],r=0;r<g.length;++r)m.push(g[r](a,c,d,f));a=e.apply(void 0,m,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,
c,d,n){var m=e(a,c,d,n),r;if(null!=m.value){sa(m.context,f.expression);md(m.value,f.expression);r=[];for(var q=0;q<g.length;++q)r.push(sa(g[q](a,c,d,n),f.expression));r=sa(m.value.apply(m.context,r),f.expression)}return b?{value:r}:r};case s.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,g,n){var m=c(a,d,g,n);a=e(a,d,g,n);sa(m.value,f.expression);Gb(m.context);m.context[m.name]=a;return b?{value:a}:a};case s.ArrayExpression:return g=[],q(a.elements,function(a){g.push(f.recurse(a))}),
function(a,c,d,e){for(var f=[],r=0;r<g.length;++r)f.push(g[r](a,c,d,e));return b?{value:f}:f};case s.ObjectExpression:return g=[],q(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},r=0;r<g.length;++r)f[g[r].key]=g[r].value(a,c,d,e);return b?{value:f}:f};case s.ThisExpression:return function(a){return b?{value:a}:a};case s.LocalsExpression:return function(a,c){return b?{value:c}:c};case s.NGValueParameter:return function(a,
c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?-d:0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);h=nd(h,c);return d?{value:h}:h}},"binary-":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);
h=(x(h)?h:0)-(x(c)?c:0);return d?{value:h}:h}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,
e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,
g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,
name:void 0,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f=g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:void 0;b&&sa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),n,m;null!=l&&(n=b(f,g,h,k),n+="",Ta(n,e),c&&1!==c&&(Gb(l),l&&!l[n]&&(l[n]={})),m=l[n],sa(m,e));return d?{context:l,name:n,value:m}:m}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&(Gb(g),
g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:void 0;(d||Hb(b))&&sa(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var hc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(a,d);this.astCompiler=d.csp?new td(this.ast,b):new sd(this.ast,b)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var kg=Object.prototype.valueOf,ta=O("$sce"),oa={HTML:"html",CSS:"css",
URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},mg=O("$compile"),Y=v.document.createElement("a"),xd=ra(v.location.href);yd.$inject=["$document"];Jc.$inject=["$provide"];var Fd=22,Ed=".",jc="0";zd.$inject=["$locale"];Bd.$inject=["$locale"];var xg={yyyy:W("FullYear",4,0,!1,!0),yy:W("FullYear",2,0,!0,!0),y:W("FullYear",1,0,!1,!0),MMMM:ib("Month"),MMM:ib("Month",!0),MM:W("Month",2,1),M:W("Month",1,1),LLLL:ib("Month",!1,!0),dd:W("Date",2),d:W("Date",1),HH:W("Hours",2),H:W("Hours",1),hh:W("Hours",2,-12),
h:W("Hours",1,-12),mm:W("Minutes",2),m:W("Minutes",1),ss:W("Seconds",2),s:W("Seconds",1),sss:W("Milliseconds",3),EEEE:ib("Day"),EEE:ib("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ib(Math[0<a?"floor":"ceil"](a/60),2)+Ib(Math.abs(a%60),2))},ww:Hd(2),w:Hd(1),G:kc,GG:kc,GGG:kc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},wg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
vg=/^\-?\d+$/;Ad.$inject=["$locale"];var qg=da(P),rg=da(sb);Cd.$inject=["$parse"];var ne=da({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ma.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),tb={};q(Cb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=xa("ng-"+b),e=d;"checked"===a&&(e=function(a,
b,e){e.ngModel!==e[c]&&d(a,b,e)});tb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(ad,function(a,b){tb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(zg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=xa("ng-"+a);tb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===
ma.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Jb={$addControl:C,$$renameControl:function(a,b){a.$name=b},$removeControl:C,$setValidity:C,$setDirty:C,$setPristine:C,$setSubmitted:C};Id.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Rd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||C}return{name:"form",
restrict:a?"EAC":"E",require:["form","^^?form"],controller:Id,compile:function(d,f){d.addClass(Ua).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var m=f[0];if(!("action"in e)){var r=function(b){a.$apply(function(){m.$commitViewValue();m.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",r,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",r,!1)},0,!1)})}(f[1]||m.$$parentForm).$addControl(m);var q=g?c(m.$name):C;g&&
(q(a,m),e.$observe(g,function(b){m.$name!==b&&(q(a,void 0),m.$$parentForm.$$renameControl(m,b),q=c(m.$name),q(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);q(a,void 0);R(m,Jb)})}}}}}]},oe=Rd(),Be=Rd(!0),yg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,Hg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ig=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
Jg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Sd=/^(\d{4,})-(\d{2})-(\d{2})$/,Td=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,nc=/^(\d{4,})-W(\d\d)$/,Ud=/^(\d{4,})-(\d\d)$/,Vd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Kd=T();q(["date","datetime-local","month","time","week"],function(a){Kd[a]=!0});var Wd={text:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c)},date:kb("date",Sd,Lb(Sd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Td,Lb(Td,"yyyy MM dd HH mm ss sss".split(" ")),
"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Vd,Lb(Vd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",nc,function(a,b){if(fa(a))return a;if(F(a)){nc.lastIndex=0;var d=nc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Gd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:kb("month",Ud,Lb(Ud,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Ld(a,b,d,c);jb(a,b,d,c,e,f);c.$$parserName=
"number";c.$parsers.push(function(a){if(c.$isEmpty(a))return null;if(Jg.test(a))return parseFloat(a)});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!Q(a))throw lb("numfmt",a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||y(g)||a>=g};d.$observe("min",function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));g=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}if(x(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||y(h)||a<=h};d.$observe("max",
function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));h=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}},url:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Hg.test(d)}},email:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},radio:function(a,b,d,c){y(d.name)&&b.attr("name",++nb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,
a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Md(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Md(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return pa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:C,button:C,submit:C,reset:C,
file:C},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Wd[P(g.type)]||Wd.text)(e,f,g,h[0],b,a,d,c)}}}}],Kg=/^(true|false|\d+)$/,Te=function(){return{restrict:"A",priority:100,compile:function(a,b){return Kg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},te=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);
return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=y(a)?"":a})}}}}],ve=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=y(a)?"":a})}}}}],ue=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=
b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Se=da({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),we=mc("",!0),ye=mc("Odd",0),xe=mc("Even",1),ze=La({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ae=[function(){return{restrict:"A",scope:!0,controller:"@",
priority:500}}],Ic={},Lg={blur:!0,focus:!0};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Lg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var De=["$animate","$compile",function(a,
b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=rb(h.clone),a.leave(l).then(function(){l=null}),h=null))})}}}],Ee=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,
transclude:"element",controller:ea.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,n,m,r){var q=0,s,w,p,y=function(){w&&(w.remove(),w=null);s&&(s.$destroy(),s=null);p&&(d.leave(p).then(function(){w=null}),w=p,p=null)};c.$watch(f,function(f){var n=function(){!x(h)||h&&!c.$eval(h)||b()},u=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&u===q){var b=c.$new();m.template=a;a=r(b,function(a){y();d.enter(a,null,e).then(n)});s=b;p=a;s.$emit("$includeContentLoaded",
f);c.$eval(g)}},function(){c.$$destroyed||u!==q||(y(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(y(),m.template=null)})}}}}],Ve=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ma.call(d[0]).match(/SVG/)?(d.empty(),a(Lc(e.template,v.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Fe=La({priority:450,compile:function(){return{pre:function(a,
b,d){a.$eval(d.ngInit)}}}}),Re=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!y(a)){var b=[];a&&q(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){if(K(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Nd="ng-invalid",Ua="ng-pristine",Kb="ng-dirty",Pd="ng-pending",lb=O("ngModel"),Mg=["$scope",
"$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=l(d.name||"",!1)(a);
this.$$parentForm=Jb;var n=e(d.ngModel),m=n.assign,r=n,s=m,v=null,w,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");r=function(a){var c=n(a);E(c)&&(c=b(a));return c};s=function(a,b){E(n(a))?f(a,{$$$p:b}):m(a,b)}}else if(!n.assign)throw lb("nonassign",d.ngModel,wa(c));};this.$render=C;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),
f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var H=0;Jd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;f.removeClass(c,Kb);f.addClass(c,Ua)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;f.removeClass(c,Ua);f.addClass(c,Kb);p.$$parentForm.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};
this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(v);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!Q(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:void 0,p.$modelValue!==c&&p.$$writeModelToScope())})}};
this.$$runValidators=function(a,b,c){function d(){var c=!0;q(p.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(q(p.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!E(h.then))throw lb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},C):g(!0)}function f(a,b){h===H&&p.$setValidity(a,b)}function g(a){h===H&&c(a)}H++;var h=
H;(function(){var a=p.$$parserName||"parse";if(y(w))f(a,null);else return w||(q(p.$validators,function(a,b){f(b,null)}),q(p.$asyncValidators,function(a,b){f(b,null)})),f(a,w),w;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(v);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;
if(w=y(b)?void 0:!0)for(var c=0;c<p.$parsers.length;c++)if(b=p.$parsers[c](b),y(b)){w=!1;break}Q(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=r(a));var d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=b;e&&(p.$modelValue=b,p.$modelValue!==d&&p.$$writeModelToScope());p.$$runValidators(b,p.$$lastCommittedViewValue,function(a){e||(p.$modelValue=a?b:void 0,p.$modelValue!==d&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,p.$modelValue);q(p.$viewChangeListeners,
function(a){try{a()}catch(c){b(c)}})};this.$setViewValue=function(a,b){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(b)};this.$$debounceViewValueCommit=function(b){var c=0,d=p.$options;d&&x(d.debounce)&&(d=d.debounce,Q(d)?c=d:Q(d[b])?c=d[b]:Q(d["default"])&&(c=d["default"]));g.cancel(v);c?v=g(function(){p.$commitViewValue()},c):h.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var b=r(a);if(b!==p.$modelValue&&(p.$modelValue===
p.$modelValue||b===b)){p.$modelValue=p.$$rawModelValue=b;w=void 0;for(var c=p.$formatters,d=c.length,e=b;d--;)e=c[d](e);p.$viewValue!==e&&(p.$$updateEmptyClasses(e),p.$viewValue=p.$$lastCommittedViewValue=e,p.$render(),p.$$runValidators(b,e,C))}return b})}],Qe=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Mg,priority:1,compile:function(b){b.addClass(Ua).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||
g.$$parentForm;g.$$setOptions(f[2]&&f[2].$options);b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){var g=f[0];if(g.$options&&g.$options.updateOn)c.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(g.$setTouched):b.$apply(g.$setTouched))})}}}}}],Ng=/(\s+|^)default(\s+|$)/,Ue=function(){return{restrict:"A",
controller:["$scope","$attrs",function(a,b){var d=this;this.$options=qa(a.$eval(b.ngModelOptions));x(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=V(this.$options.updateOn.replace(Ng,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ge=La({terminal:!0,priority:1E3}),Og=O("ngOptions"),Pg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
Oe=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!q&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var m=a.match(Pg);if(!m)throw Og("iexp",a,wa(b));var r=m[5]||m[7],q=m[6];a=/ as /.test(m[0])&&m[1];var s=m[9];b=d(m[2]?m[1]:r);var w=a&&d(a)||b,p=s&&d(s),v=s?function(a,b){return p(c,b)}:function(a){return Fa(a)},
t=function(a,b){return v(a,L(a,b))},z=d(m[2]||m[1]),u=d(m[3]||""),y=d(m[4]||""),x=d(m[8]),D={},L=q?function(a,b){D[q]=b;D[r]=a;return D}:function(a){D[r]=a;return D};return{trackBy:s,getTrackByValue:t,getWatchables:d(x,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var h=a===d?g:d[g],l=a[h],h=L(l,h),l=v(l,h);b.push(l);if(m[2]||m[1])l=z(c,h),b.push(l);m[4]&&(h=y(c,h),b.push(h))}return b}),getOptions:function(){for(var a=[],b={},d=x(c)||[],g=f(d),h=g.length,m=0;m<h;m++){var p=d===
g?m:g[m],q=L(d[p],p),r=w(c,q),p=v(r,q),D=z(c,q),N=u(c,q),q=y(c,q),r=new e(p,r,D,N,q);a.push(r);b[p]=r}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[t(a)]},getViewValueFromOption:function(a){return s?ea.copy(a.viewValue):a.viewValue}}}}}var e=v.document.createElement("option"),f=v.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=C},post:function(d,h,k,l){function n(a,b){a.element=
b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);a.value!==b.value&&(b.value=a.selectValue)}function m(){var a=u&&r.readValue();if(u)for(var b=u.items.length-1;0<=b;b--){var c=u.items[b];c.group?Bb(c.element.parentNode):Bb(c.element)}u=I.getOptions();var d={};t&&h.prepend(w);u.items.forEach(function(a){var b;if(x(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),E.appendChild(b),b.label=a.group,d[a.group]=b);var c=e.cloneNode(!1)}else b=E,c=e.cloneNode(!1);b.appendChild(c);
n(a,c)});h[0].appendChild(E);s.$render();s.$isEmpty(a)||(b=r.readValue(),(I.trackBy||v?pa(a,b):a===b)||(s.$setViewValue(b),s.$render()))}var r=l[0],s=l[1],v=k.multiple,w;l=0;for(var p=h.children(),y=p.length;l<y;l++)if(""===p[l].value){w=p.eq(l);break}var t=!!w,z=B(e.cloneNode(!1));z.val("?");var u,I=c(k.ngOptions,h,d),E=b[0].createDocumentFragment();v?(s.$isEmpty=function(a){return!a||0===a.length},r.writeValue=function(a){u.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){if(a=
u.getOptionFromViewValue(a))a.element.selected=!0})},r.readValue=function(){var a=h.val()||[],b=[];q(a,function(a){(a=u.selectValueMap[a])&&!a.disabled&&b.push(u.getViewValueFromOption(a))});return b},I.trackBy&&d.$watchCollection(function(){if(K(s.$viewValue))return s.$viewValue.map(function(a){return I.getTrackByValue(a)})},function(){s.$render()})):(r.writeValue=function(a){var b=u.getOptionFromViewValue(a);b?(h[0].value!==b.selectValue&&(z.remove(),t||w.remove(),h[0].value=b.selectValue,b.element.selected=
!0),b.element.setAttribute("selected","selected")):null===a||t?(z.remove(),t||h.prepend(w),h.val(""),w.prop("selected",!0),w.attr("selected",!0)):(t||w.remove(),h.prepend(z),h.val("?"),z.prop("selected",!0),z.attr("selected",!0))},r.readValue=function(){var a=u.selectValueMap[h.val()];return a&&!a.disabled?(t||w.remove(),z.remove(),u.getViewValueFromOption(a)):null},I.trackBy&&d.$watch(function(){return I.getTrackByValue(s.$viewValue)},function(){s.$render()}));t?(w.remove(),a(w)(d),w.removeClass("ng-scope")):
w=B(e.cloneNode(!1));h.empty();m();d.$watchCollection(I.getWatchables,m)}}}}],He=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,h){function k(a){g.text(a||"")}var l=h.count,n=h.$attr.when&&g.attr(h.$attr.when),m=h.offset||0,r=f.$eval(n)||{},s={},v=b.startSymbol(),w=b.endSymbol(),p=v+l+"-"+m+w,x=ea.noop,t;q(h,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+P(c[2]),r[c]=g.attr(h.$attr[b]))});q(r,function(a,d){s[d]=b(a.replace(c,p))});f.$watch(l,
function(b){var c=parseFloat(b),e=isNaN(c);e||c in r||(c=a.pluralCat(c-m));c===t||e&&Q(t)&&isNaN(t)||(x(),e=s[c],y(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+n),x=C,k()):x=f.$watch(e,k),t=c)})}}}],Ie=["$parse","$animate","$compile",function(a,b,d){var c=O("ngRepeat"),e=function(a,b,c,d,e,n,m){a[c]=d;e&&(a[e]=n);a.$index=b;a.$first=0===b;a.$last=b===m-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,
terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=d.$$createComment("end ngRepeat",h),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!l)throw c("iexp",h);var n=l[1],m=l[2],r=l[3],s=l[4],l=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!l)throw c("iidexp",n);var v=l[3]||l[1],w=l[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw c("badident",
r);var p,y,t,z,u={$id:Fa};s?p=a(s):(t=function(a,b){return Fa(b)},z=function(a){return a});return function(a,d,f,g,l){p&&(y=function(b,c,d){w&&(u[w]=b);u[v]=c;u.$index=d;return p(a,u)});var n=T();a.$watchCollection(m,function(f){var g,m,p=d[0],s,u=T(),x,D,E,C,F,B,G;r&&(a[r]=f);if(ya(f))F=f,m=y||t;else for(G in m=y||z,F=[],f)ua.call(f,G)&&"$"!==G.charAt(0)&&F.push(G);x=F.length;G=Array(x);for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],C=m(D,E,g),n[C])B=n[C],delete n[C],u[C]=B,G[g]=B;else{if(u[C])throw q(G,
function(a){a&&a.scope&&(n[a.id]=a)}),c("dupes",h,C,E);G[g]={id:C,scope:void 0,clone:void 0};u[C]=!0}for(s in n){B=n[s];C=rb(B.clone);b.leave(C);if(C[0].parentNode)for(g=0,m=C.length;g<m;g++)C[g].$$NG_REMOVED=!0;B.scope.$destroy()}for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],B=G[g],B.scope){s=p;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);B.clone[0]!=s&&b.move(rb(B.clone),null,p);p=B.clone[B.clone.length-1];e(B.scope,g,v,E,w,D,x)}else l(function(a,c){B.scope=c;var d=k.cloneNode(!1);a[a.length++]=d;b.enter(a,
null,p);p=d;B.clone=a;u[B.id]=B;e(B.scope,g,v,E,w,D,x)});n=u})}}}}],Je=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ce=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ke=La(function(a,b,d){a.$watch(d.ngStyle,function(a,
d){d&&a!==d&&q(d,function(a,c){b.css(c,"")});a&&b.css(a)},!0)}),Le=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],h=[],k=[],l=[],n=function(a,b){return function(){a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=k.length;d<e;++d)a.cancel(k[d]);d=k.length=0;for(e=l.length;d<e;++d){var s=rb(h[d].clone);l[d].$destroy();(k[d]=a.leave(s)).then(n(k,d))}h.length=0;l.length=0;(g=f.cases["!"+
c]||f.cases["?"])&&q(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Me=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["!"+d.ngSwitchWhen]=c.cases["!"+d.ngSwitchWhen]||[];c.cases["!"+d.ngSwitchWhen].push({transclude:e,element:b})}}),Ne=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),Qg=O("ngTransclude"),Pe=La({restrict:"EAC",link:function(a,b,d,c,e){d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");if(!e)throw Qg("orphan",wa(b));e(function(a){a.length&&(b.empty(),b.append(a))},null,d.ngTransclude||d.ngTranscludeSlot)}}),pe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"==d.type&&a.put(d.id,b[0].text)}}}],Rg={$setViewValue:C,$render:C},
Sg=["$element","$scope",function(a,b){var d=this,c=new Ra;d.ngModelCtrl=Rg;d.unknownOption=B(v.document.createElement("option"));d.renderUnknownOption=function(b){b="? "+Fa(b)+" ?";d.unknownOption.val(b);a.prepend(d.unknownOption);a.val(b)};b.$on("$destroy",function(){d.renderUnknownOption=C});d.removeUnknownOption=function(){d.unknownOption.parent()&&d.unknownOption.remove()};d.readValue=function(){d.removeUnknownOption();return a.val()};d.writeValue=function(b){d.hasOption(b)?(d.removeUnknownOption(),
a.val(b),""===b&&d.emptyOption.prop("selected",!0)):null==b&&d.emptyOption?(d.removeUnknownOption(),a.val("")):d.renderUnknownOption(b)};d.addOption=function(a,b){if(8!==b[0].nodeType){Qa(a,'"option value"');""===a&&(d.emptyOption=b);var g=c.get(a)||0;c.put(a,g+1);d.ngModelCtrl.$render();b[0].hasAttribute("selected")&&(b[0].selected=!0)}};d.removeOption=function(a){var b=c.get(a);b&&(1===b?(c.remove(a),""===a&&(d.emptyOption=void 0)):c.put(a,b-1))};d.hasOption=function(a){return!!c.get(a)};d.registerOption=
function(a,b,c,h,k){if(h){var l;c.$observe("value",function(a){x(l)&&d.removeOption(l);l=a;d.addOption(a,b)})}else k?a.$watch(k,function(a,e){c.$set("value",a);e!==a&&d.removeOption(e);d.addOption(a,b)}):d.addOption(c.value,b);b.on("$destroy",function(){d.removeOption(c.value);d.ngModelCtrl.$render()})}}],qe=function(){return{restrict:"E",require:["select","?ngModel"],controller:Sg,priority:1,link:{pre:function(a,b,d,c){var e=c[1];if(e){var f=c[0];f.ngModelCtrl=e;b.on("change",function(){a.$apply(function(){e.$setViewValue(f.readValue())})});
if(d.multiple){f.readValue=function(){var a=[];q(b.find("option"),function(b){b.selected&&a.push(b.value)});return a};f.writeValue=function(a){var c=new Ra(a);q(b.find("option"),function(a){a.selected=x(c.get(a.value))})};var g,h=NaN;a.$watch(function(){h!==e.$viewValue||pa(g,e.$viewValue)||(g=ha(e.$viewValue),e.$render());h=e.$viewValue});e.$isEmpty=function(a){return!a||0===a.length}}}},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},se=["$interpolate",
function(a){return{restrict:"E",priority:100,compile:function(b,d){if(x(d.value))var c=a(d.value,!0);else{var e=a(b.text(),!0);e||d.$set("value",b.text())}return function(a,b,d){var k=b.parent();(k=k.data("$selectController")||k.parent().data("$selectController"))&&k.registerOption(a,b,d,c,e)}}}}],re=da({restrict:"E",terminal:!1}),Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required=function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",
function(){c.$validate()}))}}},Ec=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){F(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw O("ngPattern")("noregexp",f,a,wa(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||y(e)||e.test(b)}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=
X(a);e=isNaN(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=X(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};v.angular.bootstrap?v.console&&console.log("WARNING: Tried to load angular more than once."):(ie(),ke(ea),ea.module("ngLocale",[],["$provide",function(a){function b(a){a+=
"";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),
WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,
c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),B(v.document).ready(function(){ee(v.document,yc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,9 +17,9 @@ lbsModule.controller('moduleMenuCtrl', function ($scope, $http, $location) {
$scope.tools = [];
$http.get('ajax/externalTools').success(function(data) {
$scope.tools = data;
}).error(function() {
$http.get('ajax/externalTools').then(function(res) {
$scope.tools = res.data;
}, function(res) {
alert("error");
});
@ -97,17 +97,17 @@ lbsControllers.controller('lbsSummaryCtrl', function ($scope, $http, $sce, $loca
$scope.summary = {};
$scope.refresh = function() {
$http.get('ajax/summary').success(function(data) {
$scope.summary = data;
}).error(function() {
$http.get('ajax/summary').then(function(res) {
$scope.summary = res.data;
}, function() {
alert("error");
});
};
$scope.resetCounters = function() {
$http.get('ajax/resetCounters').success(function(data) {
$scope.summary = data;
}).error(function() {
$http.get('ajax/resetCounters').then(function(res) {
$scope.summary = res.data;
}, function() {
alert("error");
});
};
@ -128,16 +128,16 @@ lbsControllers.controller('lbsSubscriptionsCtrl', function ($scope, $http, $sce,
$scope.topicConditions = [];
$scope.topicRegex = '';
$http.get('api/topic-types').success(function(data) {
$scope.availableTopics = data;
}).error(function() {
$http.get('api/topic-types').then(function(res) {
$scope.availableTopics = res.data;
}, function() {
alert("error");
});
$scope.refresh = function() {
$http.get('api/subscriptions').success(function(data) {
$scope.list = data;
}).error(function() {
$http.get('api/subscriptions').then(function(res) {
$scope.list = res.data;
}, function(res) {
alert("error");
});
};
@ -206,26 +206,26 @@ lbsControllers.controller('lbsSubscriptionsCtrl', function ($scope, $http, $sce,
'frequency' : frequency,
'mode' : mode,
'conditions' : conditions
}).success(function(data) {
$scope.list.push(data);
}).error(function() {
}).then(function(res) {
$scope.list.push(res.data);
}, function(res) {
alert("error");
});
};
$scope.startMatching = function(id) {
$http.get('api/matching/start/' + id).success(function(data) {
$http.get('api/matching/start/' + id).then(function(res) {
alert("Matching in queue");
}).error(function() {
}, function(res) {
alert("Error: The functionality could be disabled in current configuration profile !");
});
};
$scope.resetNotificationDate = function(id) {
if (confirm("Are you sure ?")) {
$http.delete('api/subscriptions/' + id + '/date').success(function(data) {
$http.delete('api/subscriptions/' + id + '/date').then(function(res) {
$scope.refresh();
}).error(function() {
}, function(res) {
alert("error");
});
}
@ -233,9 +233,9 @@ lbsControllers.controller('lbsSubscriptionsCtrl', function ($scope, $http, $sce,
$scope.remove = function(id) {
if (confirm("Are you sure ?")) {
$http.delete('api/subscriptions/' + id).success(function(data) {
$http.delete('api/subscriptions/' + id).then(function(res) {
$scope.refresh();
}).error(function() {
}, function(res) {
alert("error");
});
}
@ -251,9 +251,9 @@ lbsControllers.controller('lbsTopicsCtrl', function ($scope, $http, $sce, $locat
$scope.segments = [];
$scope.refresh = function() {
$http.get('api/topic-types').success(function(data) {
$scope.list = data;
}).error(function() {
$http.get('api/topic-types').then(function(res) {
$scope.list = res.data;
}, function(res) {
alert("error");
});
};
@ -294,9 +294,9 @@ lbsControllers.controller('lbsTopicsCtrl', function ($scope, $http, $sce, $locat
'expression' : expression,
'producerId' : producerId,
'mapKeys' : mapKeys.join()
})).success(function(data) {
$scope.list.push(data);
}).error(function() {
})).then(function(res) {
$scope.list.push(res.data);
}, function(res) {
alert("error");
});
};
@ -320,9 +320,9 @@ lbsControllers.controller('lbsFilterEventsCtrl', function ($scope, $http, $sce,
$scope.refresh = function() {
var url = $scope.onlyWithSubscriptions ? "api/events/topics/withSubscriptions" : "api/events/topics/all";
$http.get(url).success(function(data) {
$scope.list = data;
}).error(function() {
$http.get(url).then(function(res) {
$scope.list = res.data;
}, function(res) {
alert("error");
});
};
@ -339,9 +339,9 @@ lbsControllers.controller('lbsEventsByTopicCtrl', function ($scope, $http, $sce,
$scope.topic = $routeParams.topic;
$scope.refresh = function() {
$http.get('api/events/byTopic/' + $scope.page + '/' + $scope.pageSize + '?topic=' + $scope.topic).success(function(data) {
$scope.list = data;
}).error(function() {
$http.get('api/events/byTopic/' + $scope.page + '/' + $scope.pageSize + '?topic=' + $scope.topic).then(function(res) {
$scope.list = res.data;
}, function(res) {
alert("error");
});
};

View File

@ -1,7 +1,7 @@
<div class="well col-xs-12 col-md-8 col-lg-6" ng-hide="eventsPage">
<div class="col-xs-12 col-md-8 col-lg-6" ng-hide="eventsPage">
<input type="text" class="form-control" placeholder="filter..." ng-model="filterDatasource" />
<table class="table table-condensed table-striped">
<table class="table table-sm table-striped small small mt-4">
<thead>
<tr>
<th>Datasource</th>
@ -19,13 +19,13 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{dsName}}</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">{{dsName}}</h4>
</div>
<div class="modal-body">
<table class="table">
<table class="table table-sm small ">
<thead>
<tr>
<th>Topic</th>
@ -38,17 +38,17 @@
<td class="text-right">{{t.size}}</td>
</tr>
<tr>
<th>Total</th>
<th><a href="javascript:void(0)" ng-click="gotoEventsPage(dsName, '*')" data-dismiss="modal">Total</a></th>
<th class="text-right">{{calculateTotal(topics)}}</th>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<back-top><span class="glyphicon glyphicon-chevron-up"></span> top</back-top>
<back-top><i class="fas fa-chevron-up"></i> top</back-top>

View File

@ -2,48 +2,49 @@
<html>
<head>
<title>OpenAIRE - Literature Broker Service</title>
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link rel="stylesheet" href="../css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="../common/css/bootstrap.cerulean.min.css" />
<link rel="stylesheet" href="../common/css/fontawesome-all.min.css" />
<link rel="stylesheet" href="../css/angular-backtop.css" />
<link rel="stylesheet" href="../css/rzslider.min.css" />
<script src="../js/jquery-1.12.3.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/angular.min.js"></script>
<script src="../js/angular-route.min.js"></script>
<script src="../js/angular-backtop.min.js"></script>
<script src="../js/angular-local-storage.min.js"></script>
<script src="../js/angular-base64.min.js"></script>
<script src="../js/rzslider.min.js"></script>
<script src="openaire-lbs-ui.js"></script>
</head>
<body ng-app="openaireBroker">
<nav class="navbar navbar-default" ng-controller="moduleMenuCtrl">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">OpenAIRE Literature Broker Service</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li ng-class="{active : isActive('^\/datasources')}"><a href="#/datasources">Potential events</a></li>
<li ng-class="{active : isActive('^\/subscriptions')}"><a href="#/subscriptions">My subscriptions</a></li>
</ul>
<ul class="nav navbar-nav navbar-right" ng-if="isLogged()">
<li class="dropdown">
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown"><b>User: </b>{{getUser()}}</a>
<ul class="dropdown-menu">
<li><a href="javascript:void(0)" ng-click="logout()">Logout</a></li>
</ul>
</li>
</ul>
</div>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="moduleMenuCtrl">
<a class="navbar-brand" href="#">OpenAIRE Literature Broker Service</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarMenu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarMenu" ng-if="isLogged()">
<ul class="navbar-nav mr-auto">
<li class="nav-item" ng-class="{active : isActive('^\/datasources')}"><a class="nav-link" href="#!/datasources">Potential events</a></li>
<li class="nav-item" ng-class="{active : isActive('^\/subscriptions')}"><a class="nav-link" href="#!/subscriptions">My subscriptions</a></li>
</ul>
<ul class="navbar-nav navbar-right">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown"><b>User: </b>{{getUser()}}</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="javascript:void(0)" ng-click="logout()">Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<div ng-view style="margin: 20px;"></div>
</body>
<script src="../common/js/jquery.min.js"></script>
<script src="../common/js/popper.min.js"></script>
<script src="../common/js/bootstrap.min.js"></script>
<script src="../common/js/angular.min.js"></script>
<script src="../common/js/angular-route.min.js"></script>
<script src="../js/angular-backtop.min.js"></script>
<script src="../js/angular-local-storage.min.js"></script>
<script src="../js/angular-base64.min.js"></script>
<script src="../js/rzslider.min.js"></script>
<script src="openaire-lbs-ui.js"></script>
</html>

View File

@ -1,5 +1,5 @@
<div class="col-xs-12" ng-show="page">
<p>
<p class="small">
<b>Datasource:</b> {{page.datasource}}<br />
<b>Topic:</b> {{page.topic}}<br />
<b>Total:</b> {{page.total}}<br />
@ -11,22 +11,19 @@
</p>
<div ng-if="page.values.length > 0">
<ul class="pager">
<li class="disabled" ng-if="page.currPage <= 0"><a href="javascript:void(0)">&larr; Prev</a></li>
<li ng-if="page.currPage > 0"><a href="javascript:void(0)" ng-click="gotoPage(page.currPage - 1)">&larr; Prev</a></li>
<li class="disabled" ng-if="page.totalPages <= page.currPage + 1"><a href="javascript:void(0)">Next &rarr;</a></li>
<li ng-if="page.currPage + 1 < page.totalPages"><a href="javascript:void(0)" ng-click="gotoPage(page.currPage + 1)">Next &rarr;</a></li>
</ul>
<div class="well" ng-repeat="val in page.values">
<p class="text-right"><span class="label label-primary"><b>Trust:</b> {{val.trust}}</span></p>
<table class="table table-striped">
<div class="text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage <= 0" disabled="disabled">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage > 0" ng-click="gotoPage(page.currPage - 1)">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.totalPages <= page.currPage + 1" disabled="disabled">Next &rarr;</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage + 1 < page.totalPages" ng-click="gotoPage(page.currPage + 1)">Next &rarr;</button>
</div>
<div ng-repeat="val in page.values">
<p class="text-right"><span class="badge badge-primary"><b>Trust:</b> {{val.trust}}</span></p>
<table class="table table-sm table-striped small">
<tr>
<th class="col-xs-4 col-md-3 col-lg-2">ID</th>
<td class="col-xs-8 col-md-9 col-lg-10">
{{val.result.openaireId}}
</td>
<th style="width: 200px">ID</th>
<td>{{val.result.openaireId}}</td>
</tr>
<tr>
<th>Title(s)</th>
@ -41,16 +38,16 @@
<th>Type</th>
<td>{{val.result.typology}}</td>
</tr>
<tr ng-class="{'success' : val.highlight.creators && val.highlight.creators.length > 0}">
<th>Author(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.creators && val.highlight.creators.length > 0}">Author(s)</th>
<td>
<span ng-repeat="a in val.result.creators track by $index">
<br ng-if="$index > 0"/>
{{a.fullname}}<span ng-if="a.orcid"> (ORCID: {{a.orcid}})</span>
</span>
<span ng-if="val.highlight.creators && isAuthorHighlighted(a, val.highlight.creators)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -60,16 +57,16 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.pids && val.highlight.pids.length > 0}">
<th>PID(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.pids && val.highlight.pids.length > 0}">PID(s)</th>
<td>
<span ng-repeat="pid in val.result.pids">
<br ng-if="$index > 0"/>
{{pid.value}} <b>({{pid.type}})</b>
<span ng-if="val.highlight.pids && isPidHighlighted(pid, val.highlight.pids)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -80,14 +77,14 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.abstracts && val.highlight.abstracts.length > 0}">
<th>Abstract(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.abstracts && val.highlight.abstracts.length > 0}">Abstract(s)</th>
<td>
<span ng-repeat="d in val.result.abstracts track by $index">
<br ng-if="$index > 0"/>
{{d}}
</span>
<span class="pull-right" ng-if="val.highlight.abstracts">
<span class="float-right" ng-if="val.highlight.abstracts">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -95,15 +92,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.subjects && val.highlight.subjects.length > 0}">
<th>Subject(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.subjects && val.highlight.subjects.length > 0}">Subject(s)</th>
<td>
<span ng-repeat="s in val.result.subjects track by $index">
<br ng-if="$index > 0"/>
{{s.value}}<b ng-if="s.type"> ({{s.type}})</b>
<span ng-if="val.highlight.subjects && isSubjectHighlighted(s, val.highlight.subjects)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -113,11 +110,11 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.publicationdate }">
<th>Publication date</th>
<tr>
<th ng-class="{'text-success' : val.highlight.publicationdate }">Publication date</th>
<td>
{{val.result.publicationdate}}
<span class="pull-right" ng-if="val.highlight.publicationdate">
<span class="float-right" ng-if="val.highlight.publicationdate">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -125,15 +122,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.instances && val.highlight.instances.length > 0}">
<th>Rights</th>
<tr>
<th ng-class="{'text-success' : val.highlight.instances && val.highlight.instances.length > 0}">Rights</th>
<td>
<span ng-repeat="i in val.result.instances">
<br ng-if="$index > 0"/>
{{i.license}} <b>({{i.hostedby}})</b>
<span ng-if="val.highlight.instances && isInstanceHighlighted(i, val.highlight.instances)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -145,15 +142,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.projects && val.highlight.projects.length > 0}">
<th>Related project(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.projects && val.highlight.projects.length > 0}">Related project(s)</th>
<td>
<span ng-repeat="p in val.result.projects">
<br ng-if="$index > 0"/>
{{p.title}}
<span ng-if="val.highlight.projects && isProjectHighlighted(p, val.highlight.projects)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -172,15 +169,15 @@
</tr>
<!-- DATASETS, PUBLICATIONS AND SOFTWARES -->
<tr ng-class="{'success' : val.highlight.datasets && val.highlight.datasets.length > 0}">
<th>Related dataset(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.datasets && val.highlight.datasets.length > 0}">Related dataset(s)</th>
<td>
<span ng-repeat="d in val.result.datasets">
<br ng-if="$index > 0"/>
{{d.title}}
<span ng-if="val.highlight.datasets && isDatasetHighlighted(d, val.highlight.datasets)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -194,15 +191,15 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.publications && val.highlight.publications.length > 0}">
<th>Related publications(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.publications && val.highlight.publications.length > 0}">Related publications(s)</th>
<td>
<span ng-repeat="p in val.result.publications">
<br ng-if="$index > 0"/>
{{p.title}}
<span ng-if="val.highlight.publications && isRelatedPublicationHighlighted(p, val.highlight.publications)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -216,15 +213,15 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.softwares && val.highlight.softwares.length > 0}">
<th>Related softwares(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.softwares && val.highlight.softwares.length > 0}">Related softwares(s)</th>
<td>
<span ng-repeat="sw in val.result.softwares">
<br ng-if="$index > 0"/>
{{sw}}
<span ng-if="val.highlight.softwares && isSoftwareHighlighted(sw, val.highlight.softwares)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -241,13 +238,13 @@
</table>
</div>
<ul class="pager">
<li class="disabled" ng-if="page.currPage <= 0"><a href="javascript:void(0)">&larr; Prev</a></li>
<li ng-if="page.currPage > 0"><a href="javascript:void(0)" ng-click="gotoPage(page.currPage - 1)">&larr; Prev</a></li>
<li class="disabled" ng-if="page.totalPages <= page.currPage + 1"><a href="javascript:void(0)">Next &rarr;</a></li>
<li ng-if="page.currPage + 1 < page.totalPages"><a href="javascript:void(0)" ng-click="gotoPage(page.currPage + 1)">Next &rarr;</a></li>
</ul>
<div class="text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage <= 0" disabled="disabled">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage > 0" ng-click="gotoPage(page.currPage - 1)">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.totalPages <= page.currPage + 1" disabled="disabled">Next &rarr;</button>
<button class="btn btn-sm btn-outline-primary" ng-if="page.currPage + 1 < page.totalPages" ng-click="gotoPage(page.currPage + 1)">Next &rarr;</button>
</div>
</div>
</div>
<back-top><span class="glyphicon glyphicon-chevron-up"></span> top</back-top>
<back-top><i class="fas fa-chevron-up"></i> top</back-top>

View File

@ -105,9 +105,9 @@ openaireBrokerControllers.controller('datasourcesCtrl', function ($scope, $http,
$scope.refresh = function() {
$scope.datasources = [];
$http.get('../api/openaireBroker/datasources').success(function(data) {
$scope.datasources = data;
}).error(function() {
$http.get('../api/openaireBroker/datasources').then(function(res) {
$scope.datasources = res.data;
}, function(res) {
alert("error");
});
};
@ -117,9 +117,9 @@ openaireBrokerControllers.controller('datasourcesCtrl', function ($scope, $http,
$scope.dsName = dsName;
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
$http.get('../api/openaireBroker/topicsForDatasource?ds=' + encodeURIComponent(dsName)).success(function(data) {
$scope.topics = data;
}).error(function() {
$http.get('../api/openaireBroker/topicsForDatasource?ds=' + encodeURIComponent(dsName)).then(function(res) {
$scope.topics = res.data;
}, function(res) {
alert("error");
});
}
@ -159,9 +159,9 @@ openaireBrokerControllers.controller('queryCtrl', function ($scope, $http, $sce,
$scope.refresh = function() {
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
$http.post('../api/openaireBroker/events/' + $scope.page + '/20', $scope.query).success(function(data) {
$scope.eventsPage = data;
}).error(function() {
$http.post('../api/openaireBroker/events/' + $scope.page + '/20', $scope.query).then(function(res) {
$scope.eventsPage = res.data;
}, function(res) {
alert("error");
});
}
@ -305,9 +305,9 @@ openaireBrokerControllers.controller('queryCtrl', function ($scope, $http, $sce,
$scope.createSubscription = function() {
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
$http.post('../api/openaireBroker/subscribe', $scope.subscription).success(function(data) {
alert("New registered subscription, ID: " + data.subscriptionId);
}).error(function() {
$http.post('../api/openaireBroker/subscribe', $scope.subscription).then(function(res) {
alert("New registered subscription, ID: " + res.data.subscriptionId);
}, function(res) {
alert("error");
});
}
@ -323,9 +323,9 @@ openaireBrokerControllers.controller('subscriptionsCtrl', function ($scope, $htt
}
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
$http.get('../api/openaireBroker/subscriptions?email=' + encodeURIComponent(loginService.getUser())).success(function(data) {
$scope.subscriptions = data;
}).error(function() {
$http.get('../api/openaireBroker/subscriptions?email=' + encodeURIComponent(loginService.getUser())).then(function(res) {
$scope.subscriptions = res.data;
}, function(res) {
alert("error");
});
});
@ -337,9 +337,9 @@ openaireBrokerControllers.controller('notificationsCtrl', function ($scope, $htt
$scope.subscrId = $routeParams.subscrId;
$scope.refresh = function() {
$http.get('../api/openaireBroker/notifications/' + $scope.subscrId + "/" + $scope.nPage + '/20').success(function(data) {
$scope.page = data;
}).error(function() {
$http.get('../api/openaireBroker/notifications/' + $scope.subscrId + "/" + $scope.nPage + '/20').then(function(res) {
$scope.page = res.data;
}, function(res) {
alert("error");
});
}

View File

@ -1,5 +1,5 @@
<div class="col-xs-12" ng-show="eventsPage">
<p>
<p class="small">
<b>Datasource:</b> {{eventsPage.datasource}}<br />
<b>Topic:</b> {{eventsPage.topic}}<br />
<b>Total:</b> {{eventsPage.total}}<br />
@ -13,21 +13,20 @@
</p>
<div ng-if="eventsPage.values.length > 0">
<ul class="pager">
<li class="disabled" ng-if="eventsPage.currPage <= 0"><a href="javascript:void(0)">&larr; Prev</a></li>
<li ng-if="eventsPage.currPage > 0"><a href="javascript:void(0)" ng-click="gotoPage(eventsPage.currPage - 1)">&larr; Prev</a></li>
<li class="disabled" ng-if="eventsPage.totalPages <= eventsPage.currPage + 1"><a href="javascript:void(0)">Next &rarr;</a></li>
<li ng-if="eventsPage.currPage + 1 < eventsPage.totalPages"><a href="javascript:void(0)" ng-click="gotoPage(eventsPage.currPage + 1)">Next &rarr;</a></li>
</ul>
<div class="well" ng-repeat="val in eventsPage.values">
<p class="text-right"><span class="label label-primary"><b>Trust:</b> {{val.trust}}</span></p>
<table class="table table-striped">
<div class="text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage <= 0" disabled="disabled">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage > 0" ng-click="gotoPage(eventsPage.currPage - 1)">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.totalPages <= eventsPage.currPage + 1" disabled="disabled">Next &rarr;</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage + 1 < eventsPage.totalPages" ng-click="gotoPage(eventsPage.currPage + 1)">Next &rarr;</button>
</div>
<div ng-repeat="val in eventsPage.values">
<p class="text-right"><span class="badge badge-primary"><b>Trust:</b> {{val.trust}}</span></p>
<table class="table table-sm table-striped small">
<tr>
<th class="col-xs-4 col-md-3 col-lg-2">ID</th>
<td class="col-xs-8 col-md-9 col-lg-10">
{{val.result.openaireId}}
</td>
<th style="width: 200px">ID</th>
<td>{{val.result.openaireId}}</td>
</tr>
<tr>
<th>Title(s)</th>
@ -42,15 +41,15 @@
<th>Type</th>
<td>{{val.result.typology}}</td>
</tr>
<tr ng-class="{'success' : val.highlight.creators && val.highlight.creators.length > 0}">
<th>Author(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.creators && val.highlight.creators.length > 0}">Author(s)</th>
<td>
<span ng-repeat="a in val.result.creators track by $index">
<br ng-if="$index > 0"/>
{{a.fullname}}<span ng-if="a.orcid"> (ORCID: {{a.orcid}})</span>
<span ng-if="val.highlight.creators && isAuthorHighlighted(a, val.highlight.creators)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -60,16 +59,16 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.pids && val.highlight.pids.length > 0}">
<th>PID(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.pids && val.highlight.pids.length > 0}">PID(s)</th>
<td>
<span ng-repeat="pid in val.result.pids">
<br ng-if="$index > 0"/>
{{pid.value}} <b>({{pid.type}})</b>
<span ng-if="val.highlight.pids && isPidHighlighted(pid, val.highlight.pids)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -77,17 +76,16 @@
</span>
</span>
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.abstracts && val.highlight.abstracts.length > 0}">
<th>Abstract(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.abstracts && val.highlight.abstracts.length > 0}">Abstract(s)</th>
<td>
<span ng-repeat="d in val.result.abstracts track by $index">
<br ng-if="$index > 0"/>
{{d}}
</span>
<span class="pull-right" ng-if="val.highlight.abstracts && val.highlight.abstracts.length > 0">
<span class="float-right" ng-if="val.highlight.abstracts && val.highlight.abstracts.length > 0">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -95,15 +93,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.subjects && val.highlight.subjects.length > 0}">
<th>Subject(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.subjects && val.highlight.subjects.length > 0}">Subject(s)</th>
<td>
<span ng-repeat="s in val.result.subjects track by $index">
<br ng-if="$index > 0"/>
{{s.value}}<b ng-if="s.type"> ({{s.type}})</b>
<span ng-if="val.highlight.subjects && isSubjectHighlighted(s, val.highlight.subjects)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -113,11 +111,11 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.publicationdate }">
<th>Publication date</th>
<tr>
<th ng-class="{'text-success' : val.highlight.publicationdate }">Publication date</th>
<td>
{{val.result.publicationdate}}
<span class="pull-right" ng-if="val.highlight.publicationdate">
<span class="float-right" ng-if="val.highlight.publicationdate">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -125,15 +123,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.instances && val.highlight.instances.length > 0}">
<th>Rights</th>
<tr>
<th ng-class="{'text-success' : val.highlight.instances && val.highlight.instances.length > 0}">Rights</th>
<td>
<span ng-repeat="i in val.result.instances">
<br ng-if="$index > 0"/>
{{i.license}} <b>({{i.hostedby}})</b>
<span ng-if="val.highlight.instances && isInstanceHighlighted(i, val.highlight.instances)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -145,15 +143,15 @@
</span>
</td>
</tr>
<tr ng-class="{'success' : val.highlight.projects && val.highlight.projects.length > 0}">
<th>Related project(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.projects && val.highlight.projects.length > 0}">Related project(s)</th>
<td>
<span ng-repeat="p in val.result.projects">
<br ng-if="$index > 0"/>
{{p.title}}
<span ng-if="val.highlight.projects && isProjectHighlighted(p, val.highlight.projects)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -170,19 +168,17 @@
</span>
</td>
</tr>
<!-- DATASETS, PUBLICATIONS AND SOFTWARES -->
<tr ng-class="{'success' : val.highlight.datasets && val.highlight.datasets.length > 0}">
<th>Related dataset(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.datasets && val.highlight.datasets.length > 0}">Related dataset(s)</th>
<td>
<span ng-repeat="d in val.result.datasets">
<br ng-if="$index > 0"/>
{{d.title}}
<span ng-if="val.highlight.datasets && isDatasetHighlighted(d, val.highlight.datasets)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -196,15 +192,15 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.publications && val.highlight.publications.length > 0}">
<th>Related publications(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.publications && val.highlight.publications.length > 0}">Related publications(s)</th>
<td>
<span ng-repeat="p in val.result.publications">
<br ng-if="$index > 0"/>
{{p.title}}
<span ng-if="val.highlight.publications && isRelatedPublicationHighlighted(p, val.highlight.publications)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -218,15 +214,15 @@
</td>
</tr>
<tr ng-class="{'success' : val.highlight.softwares && val.highlight.softwares.length > 0}">
<th>Related softwares(s)</th>
<tr>
<th ng-class="{'text-success' : val.highlight.softwares && val.highlight.softwares.length > 0}">Related softwares(s)</th>
<td>
<span ng-repeat="sw in val.result.softwares">
<br ng-if="$index > 0"/>
{{sw}}
<span ng-if="val.highlight.softwares && isSoftwareHighlighted(sw, val.highlight.softwares)">
<span class="label label-success">added</span>
<span class="pull-right">
<span class="badge badge-success">added</span>
<span class="float-right">
<b>from: </b>
<a href="{{val.provenance.url}}" target="_blank" ng-if="val.provenance.url">{{val.provenance.repositoryName}}</a>
<span ng-if="!val.provenance.url">{{val.provenance.repositoryName}}</span>
@ -239,17 +235,16 @@
</span>
</td>
</tr>
</table>
</div>
<ul class="pager">
<li class="disabled" ng-if="eventsPage.currPage <= 0"><a href="javascript:void(0)">&larr; Prev</a></li>
<li ng-if="eventsPage.currPage > 0"><a href="javascript:void(0)" ng-click="gotoPage(eventsPage.currPage - 1)">&larr; Prev</a></li>
<li class="disabled" ng-if="eventsPage.totalPages <= eventsPage.currPage + 1"><a href="javascript:void(0)">Next &rarr;</a></li>
<li ng-if="eventsPage.currPage + 1 < eventsPage.totalPages"><a href="javascript:void(0)" ng-click="gotoPage(eventsPage.currPage + 1)">Next &rarr;</a></li>
</ul>
<div class="text-center">
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage <= 0" disabled="disabled">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage > 0" ng-click="gotoPage(eventsPage.currPage - 1)">&larr; Prev</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.totalPages <= eventsPage.currPage + 1" disabled="disabled">Next &rarr;</button>
<button class="btn btn-sm btn-outline-primary" ng-if="eventsPage.currPage + 1 < eventsPage.totalPages" ng-click="gotoPage(eventsPage.currPage + 1)">Next &rarr;</button>
</div>
</div>
</div>
@ -257,26 +252,26 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Advanced search</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Advanced search</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<form>
<div class="form-group row">
<label class="control-label col-sm-4">Datasource</label>
<div class="col-sm-8">
<p class="form-control-static">{{eventsPage.datasource}}</p>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Topic</label>
<div class="col-sm-8">
<p class="form-control-static">{{eventsPage.topic}}</p>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Trust</label>
<div class="col-sm-8">
<rzslider
@ -285,49 +280,49 @@
rz-slider-options="{floor: 0, ceil: 1, step: 0.01, precision: 2, hideLimitLabels: true}"></rzslider>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Title(s)</label>
<div class="col-sm-8">
<div class="input-group" ng-repeat="t in tempQuery.titles track by $index" style="margin-bottom: 4px;">
<input type="text" class="form-control input-sm" ng-model="tempQuery.titles[$index]" />
<span class="input-group-btn">
<button class="btn btn-sm btn-danger" ng-click="tempQuery.titles.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</span>
</div>
<button class="btn btn-sm btn-primary" ng-click="tempQuery.titles.push('')">add</button>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Author(s)</label>
<div class="col-sm-8">
<div class="input-group" ng-repeat="aut in tempQuery.authors track by $index" style="margin-bottom: 4px;">
<input type="text" class="form-control input-sm" ng-model="tempQuery.authors[$index]" />
<span class="input-group-btn">
<button class="btn btn-sm btn-danger" ng-click="tempQuery.authors.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</span>
</div>
<button class="btn btn-sm btn-primary" ng-click="tempQuery.authors.push('')">add</button>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Subject(s)</label>
<div class="col-sm-8">
<div class="input-group" ng-repeat="s in tempQuery.subjects track by $index" style="margin-bottom: 4px;">
<input type="text" class="form-control input-sm" ng-model="tempQuery.subjects[$index]" />
<span class="input-group-btn">
<button class="btn btn-sm btn-danger" ng-click="tempQuery.subjects.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</span>
</div>
<button class="btn btn-sm btn-primary" ng-click="tempQuery.subjects.push('')">add</button>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-4">Date(s)</label>
<div class="col-sm-8">
<div class="input-group" ng-repeat="s in tempQuery.dates track by $index" style="margin-bottom: 4px;">
@ -337,7 +332,7 @@
<input type="text" class="form-control input-sm" ng-model="tempQuery.dates[$index].max" placeholder="yyyy-MM-dd" />
<span class="input-group-btn">
<button class="btn btn-sm btn-danger" ng-click="tempQuery.dates.splice($index, 1)">
<span class="glyphicon glyphicon-minus"></span>
<i class="fas fa-minus"></i>
</button>
</span>
</div>
@ -347,7 +342,7 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="gotoEventsPageAdv(tempQuery)">Update</button>
</div>
</div>
@ -358,23 +353,23 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Create subscription</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Create subscription</h4>
</div>
<div class="modal-body">
<form name="newSubscriptionForm" class="form-horizontal">
<div class="form-group" ng-class="{'has-error' : !subscription.subscriber, 'has-success' : subscription.subscriber }">
<div class="modal-body small">
<form name="newSubscriptionForm">
<div class="form-group row" ng-class="{'text-danger' : !subscription.subscriber, 'text-success' : subscription.subscriber }">
<label class="control-label col-sm-3">Email</label>
<div class="col-sm-9">
<p class="form-control-static">{{subscription.subscriber}}</p>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : !subscription.frequency, 'has-success' : subscription.frequency }">
<div class="form-group row" ng-class="{'text-danger' : !subscription.frequency, 'text-success' : subscription.frequency }">
<label class="control-label col-sm-3">Frequency</label>
<div class="col-sm-9">
<select class="form-control" ng-model="subscription.frequency" required="required">
<select class="form-control form-control-sm" ng-model="subscription.frequency" required="required">
<option>never</option>
<option>daily</option>
<option>weekly</option>
@ -383,16 +378,16 @@
</select>
</div>
</div>
<div class="form-group" ng-class="{'has-error' : !subscription.mode, 'has-success' : subscription.mode }">
<div class="form-group row" ng-class="{'text-danger' : !subscription.mode, 'text-success' : subscription.mode }">
<label class="control-label col-sm-3">Mode</label>
<div class="col-sm-9">
<select class="form-control" ng-model="subscription.mode" required="required">
<select class="form-control form-control-sm" ng-model="subscription.mode" required="required">
<option>MOCK</option>
<option>EMAIL</option>
</select>
</div>
</div>
<div class="form-group">
<div class="form-group row">
<label class="control-label col-sm-3">Query</label>
<div class="col-sm-9">
<pre>{{subscription.query | json: 4}}</pre>
@ -401,11 +396,11 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-disabled="newSubscriptionForm.$invalid" ng-click="createSubscription()">Save</button>
</div>
</div>
</div>
</div>
<back-top><span class="glyphicon glyphicon-chevron-up"></span> top</back-top>
<back-top><i class="fas fa-chevron-up"></i> top</back-top>

View File

@ -1,11 +1,11 @@
<div class="well col-xs-12 col-md-offset-3 col-md-6 col-lg-offset-4 col-lg-4" ng-if="isEmpty()">
<div class="col-xs-12 col-md-offset-3 col-md-6 col-lg-offset-4 col-lg-4" ng-if="isEmpty()">
No subscriptions
</div>
<div class="row" ng-repeat="(ds, list) in subscriptions">
<div class="well col-xs-12 col-md-8 col-lg-6">
<table class="table table-condensed table-striped">
<div class="col-xs-12 col-md-8 col-lg-6 mt-4">
<table class="table table-sm table-striped small">
<thead>
<tr>
<th colspan="2" class="text-center">
@ -19,7 +19,7 @@
</thead>
<tbody>
<tr ng-repeat="s in list">
<td><a href="#/ntf/0/{{s.id}}" title="{{s.id}}">{{s.topic}}</a></td>
<td><a href="#!/ntf/0/{{s.id}}" title="{{s.id}}">{{s.topic}}</a></td>
<td class="text-right">{{s.count}}</td>
</tr>
</tbody>

View File

@ -1,7 +1,7 @@
You have received this mail because you are owner of the following subscription:
<ul>
<li><b>ID: </b>$sub.subscriptionId$</li>
<li><b>Datasource Name: </b>$oa_datasource$</li>
<li><b>Topic: </b>$sub.topic$</li>
<li><b>Number of events: </b>$oa_notifications_total$</li>
</ul>
@ -9,9 +9,12 @@ You have received this mail because you are owner of the following subscription:
<hr />
<p>
You can access the notified events at this address: .... <br />
or using the Public Broker Service API.
You can access the notified events at this address:
<a href="$dashboardBaseUrl$$sub.subscriptionId$">$dashboardBaseUrl$$sub.subscriptionId$</a><br />
or using the <a href="$publicApi$"">Public Broker Service API</a> (the ID of the current subscription is <b>$sub.subscriptionId$</b>).
</p>
<hr />
This email message was auto-generated. Please do not respond.
This email message was auto-generated. Please do not respond. If you need support, please contact the
<a href="$helpdesk$">OpenAIRE helpdesk</a>.

View File

@ -1,15 +1,12 @@
package eu.dnetlib.broker;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@Ignore
@RunWith(SpringRunner.class)
@Disabled
@SpringBootTest
public class LiteratureBrokerServiceApplicationTests {
class LiteratureBrokerServiceApplicationTests {
@Test
public void contextLoads() {}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.broker.events.output;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.common.subscriptions.Subscription;
public class EmailDispatcherTest {
@Test
void testGenerateMailContent() throws Exception {
final EmailDispatcher dispatcher = new EmailDispatcher();
dispatcher.setEmailTemplate(new ClassPathResource("/templates/dhp_openaire_mail.st"));
dispatcher.setDashboardBaseUrl("https://provide.openaire.eu/content/notifications/");
dispatcher.setHelpdesk("https://www.openaire.eu/support/helpdesk");
dispatcher.setPublicApi("https://api.openaire.eu/broker");
final Subscription s = new Subscription();
s.setSubscriptionId("sub-00001");
s.setTopic("ENRICH/MISSING/ABSTRACT");
final Event events = new Event();
final Map<String, Object> params = new HashMap<>();
params.put("oa_notifications_total", 1023);
params.put("oa_datasource", "ISTI OpenPortal");
System.out.println(dispatcher.generateMailContent(s, params, events));
}
}

View File

@ -1,7 +1,7 @@
package eu.dnetlib.broker.integration;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;
import eu.dnetlib.broker.objects.OaBrokerEventPayload;
@ -16,7 +16,7 @@ public class ScrollTest {
private static final String subscriptionId = "sub-c9767c84-3597-462b-803b-2d3e09de44c4";
@Test
@Ignore
@Disabled
public void testScroll() {
int total = 0;

View File

@ -6,11 +6,10 @@ import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
@ -20,7 +19,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.objects.OaBrokerEventPayload;
@ -29,8 +27,8 @@ import eu.dnetlib.broker.openaire.AdvQueryObject;
import eu.dnetlib.broker.openaire.ElasticSearchQueryUtils;
import eu.dnetlib.broker.openaire.Range;
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@Disabled
@SpringBootTest
@ContextConfiguration(locations = {
"classpath:/applicationContext-test-queries.xml"
})
@ -41,13 +39,8 @@ public class OpenaireQueriesTest {
@Autowired
private ElasticsearchOperations esOperations;
@Before
public void setUp() throws Exception {
}
@Test
@Ignore
@Disabled
public void testAdvancedShowEvents() {
final AdvQueryObject qObj = new AdvQueryObject();

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 9380:10.19.65.36:9380 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 9200:10.19.65.51:9200 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 5432:10.19.65.40:5432 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 5432:10.19.65.39:5432 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -2,9 +2,14 @@ spring.profiles.active = dev,openaire
#logging.level.root=DEBUG
spring.datasource.url=jdbc:postgresql://localhost:5432/dnet_broker
spring.datasource.username=
spring.datasource.password=
#spring.datasource.url=jdbc:postgresql://localhost:5432/dnet_broker
#spring.datasource.username=
#spring.datasource.password=
spring.datasource.url = jdbc:postgresql://localhost:5432/oa_broker
spring.datasource.username = oa_broker
spring.datasource.password = ohhae8Bi3Xiy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
@ -23,7 +28,6 @@ lbs.database.url = ${spring.datasource.url}
#lbs.elastic.clusterNodes = broker1-dev-dnet.d4science.org:9300
#lbs.elastic.homepage = http://broker1-dev-dnet.d4science.org:9200/_plugin/hq
# for localhost
lbs.elastic.clusterNodes = 127.0.0.1:9200
lbs.elastic.homepage = http://
@ -32,16 +36,6 @@ lbs.elastic.connectionTimeout = 30000
lbs.elastic.eventsIndexName = oa_events_beta
lbs.elastic.notificationsIndexName = oa_notifications_beta
lbs.mail.from = notifications-noreply@openaire.eu
lbs.mail.fromName = Literature Broker Service
lbs.mail.cc = michele.artini@isti.cnr.it
lbs.mail.smtpHost = smtp.isti.cnr.it
lbs.mail.smtpPort = 587
lbs.mail.smtpUser = smtp-dnet
lbs.mail.smtpPassword = hhr*7932
lbs.mail.message.template = classpath:/templates/openaire_mail.st
lbs.queues.maxReturnedValues = 1000
lbs.task.deleteOldEvents.cron = 0 0 4 1/1 * ?

View File

@ -4,8 +4,8 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.1.1</version>
<relativePath>../</relativePath>
<version>3.5.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -22,16 +22,48 @@
<artifactId>dnet-broker-apps-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</dependency>
<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -1,13 +1,10 @@
package eu.dnetlib.broker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.client.RestClients;
@ -19,74 +16,29 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import eu.dnetlib.broker.common.elasticsearch.Event;
import eu.dnetlib.broker.common.elasticsearch.Notification;
import eu.dnetlib.broker.common.properties.ElasticSearchProperties;
import io.prometheus.client.exporter.MetricsServlet;
import io.prometheus.client.hotspot.DefaultExports;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Tag;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
@EnableCaching
@EnableScheduling
@EnableTransactionManagement
@EnableElasticsearchRepositories(basePackageClasses = {
Event.class, Notification.class
})
@ComponentScan(basePackages = "eu.dnetlib")
public class BrokerConfiguration extends AbstractElasticsearchConfiguration {
private static final Log log = LogFactory.getLog(BrokerConfiguration.class);
@Autowired
private ElasticSearchProperties elasticSearchProperties;
public static final String TAG_EVENTS = "Events";
public static final String TAG_SUBSCRIPTIONS = "Subscriptions";
public static final String TAG_NOTIFICATIONS = "Notifications";
public static final String TAG_TOPIC_TYPES = "Topic Types";
public static final String TAG_OPENAIRE = "OpenAIRE";
public static final String TAG_MATCHING = "Subscription-Event Matching";
@Override
@Bean
public RestHighLevelClient elasticsearchClient() {
final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo(elasticSearchProperties.getClusterNodes())
.connectedTo(elasticSearchProperties.getClusterNodes().split(","))
.withConnectTimeout(elasticSearchProperties.getConnectionTimeout())
.withSocketTimeout(elasticSearchProperties.getSocketTimeout())
.build();
return RestClients.create(clientConfiguration).rest();
}
@Bean
public static Docket newSwaggerDocket() {
log.info("Initializing SWAGGER...");
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(p -> p.startsWith("/api/"))
.build()
.tags(new Tag(TAG_EVENTS, "Events management"), new Tag(TAG_SUBSCRIPTIONS, "Subscriptions management"), new Tag(TAG_NOTIFICATIONS,
"Notifications management"), new Tag(TAG_TOPIC_TYPES, "Topic types management"), new Tag(TAG_OPENAIRE, "OpenAIRE use case"))
.apiInfo(new ApiInfo(
"Literature Broker Service",
"APIs documentation",
"1.1",
"urn:tos",
ApiInfo.DEFAULT_CONTACT,
"Apache 2.0",
"http://www.apache.org/licenses/LICENSE-2.0"));
}
@Bean
@ConditionalOnMissingBean(name = "prometheusMetricsServletRegistrationBean")
ServletRegistrationBean<MetricsServlet> prometheusMetricsServletRegistrationBean(@Value("${prometheus.metrics.path:/metrics}") final String metricsPath) {
DefaultExports.initialize();
return new ServletRegistrationBean<>(new MetricsServlet(), metricsPath);
}
}

View File

@ -1,12 +1,41 @@
package eu.dnetlib.broker;
import java.util.Arrays;
import java.util.List;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import eu.dnetlib.common.app.AbstractDnetApp;
import io.swagger.v3.oas.models.tags.Tag;
@SpringBootApplication
public class BrokerPublicApplication {
public class BrokerPublicApplication extends AbstractDnetApp {
public static final String OA_PUBLIC_APIS = "Openaire Broker Public API";
public static void main(final String[] args) {
SpringApplication.run(BrokerPublicApplication.class, args);
}
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("Broker Public APIs")
.pathsToMatch("/**")
.build();
}
@Override
protected String swaggerTitle() {
return "OpenAIRE Public Broker API";
}
@Override
protected List<Tag> swaggerTags() {
return Arrays.asList(new Tag().name(OA_PUBLIC_APIS).description(OA_PUBLIC_APIS));
}
}

View File

@ -8,6 +8,6 @@ public class ApiDocController {
@GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" })
public String apiDoc() {
return "redirect:swagger-ui.html";
return "redirect:swagger-ui/index.html";
}
}

View File

@ -0,0 +1,34 @@
package eu.dnetlib.broker.oa.controllers;
import java.io.Serializable;
import eu.dnetlib.broker.common.feedbacks.FeedbackStatus;
public class EventFeedback implements Serializable {
/**
*
*/
private static final long serialVersionUID = -6967719685282712195L;
private String eventId;
private FeedbackStatus status;
public String getEventId() {
return eventId;
}
public void setEventId(final String eventId) {
this.eventId = eventId;
}
public FeedbackStatus getStatus() {
return status;
}
public void setStatus(final FeedbackStatus status) {
this.status = status;
}
}

View File

@ -1,10 +1,19 @@
package eu.dnetlib.broker.oa.controllers;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import javax.servlet.ServletOutputStream;
@ -15,10 +24,15 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.search.join.ScoreMode;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
@ -30,122 +44,110 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.google.gson.Gson;
import eu.dnetlib.broker.BrokerConfiguration;
import eu.dnetlib.broker.BrokerPublicApplication;
import eu.dnetlib.broker.api.ShortEventMessage;
import eu.dnetlib.broker.common.controllers.AbstractLbsController;
import eu.dnetlib.broker.common.elasticsearch.EventRepository;
import eu.dnetlib.broker.common.elasticsearch.Notification;
import eu.dnetlib.broker.common.elasticsearch.NotificationRepository;
import eu.dnetlib.broker.common.feedbacks.DbEventFeedback;
import eu.dnetlib.broker.common.feedbacks.DbEventFeedbackRepository;
import eu.dnetlib.broker.common.properties.ElasticSearchProperties;
import eu.dnetlib.broker.common.stats.OpenaireDsStatRepository;
import eu.dnetlib.broker.common.subscriptions.Subscription;
import eu.dnetlib.broker.common.subscriptions.SubscriptionRepository;
import eu.dnetlib.broker.objects.OaBrokerEventPayload;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import eu.dnetlib.common.controller.AbstractDnetController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@Profile("openaire")
@RestController
@RequestMapping("/")
@Api(tags = BrokerConfiguration.TAG_OPENAIRE)
public class OpenairePublicController extends AbstractLbsController {
@Tag(name = BrokerPublicApplication.OA_PUBLIC_APIS)
public class OpenairePublicController extends AbstractDnetController {
@Autowired
private ElasticsearchOperations esOperations;
@Autowired
private EventRepository eventRepository;
@Autowired
private NotificationRepository notificationRepository;
@Autowired
private SubscriptionRepository subscriptionRepo;
@Autowired
private OpenaireDsStatRepository openaireDsStatRepository;
@Autowired
private DbEventFeedbackRepository feedbackRepository;
@Autowired
private ElasticSearchProperties props;
@Value("${lbs.hadoop.opendoar.events.path}")
private String opendoarEventsPath;
private static final long SCROLL_TIMEOUT_IN_MILLIS = 5 * 60 * 1000;
private static final Log log = LogFactory.getLog(OpenairePublicController.class);
@ApiOperation("Returns notifications by subscription using scrolls (first page)")
@Operation(summary = "Returns notifications by subscription using scrolls (first page)")
@GetMapping("/scroll/notifications/bySubscriptionId/{subscrId}")
public ScrollPage<ShortEventMessage> prepareScrollNotificationsBySubscrId(@PathVariable final String subscrId) {
final Optional<Subscription> optSub = subscriptionRepo.findById(subscrId);
if (optSub.isPresent()) {
final ElasticsearchRestTemplate esTemplate = (ElasticsearchRestTemplate) esOperations;
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.termQuery("subscriptionId.keyword", subscrId))
.withSearchType(SearchType.DEFAULT)
.withFields("topic", "payload")
.withPageable(PageRequest.of(0, 100))
.build();
final SearchScrollHits<Notification> scroll =
esTemplate.searchScrollStart(SCROLL_TIMEOUT_IN_MILLIS, searchQuery, Notification.class, IndexCoordinates.of(props.getNotificationsIndexName()));
if (scroll.hasSearchHits()) {
final List<ShortEventMessage> values = calculateNotificationMessages(scroll);
return new ScrollPage<>(scroll.getScrollId(), values.isEmpty() || scroll.getScrollId() == null, values);
} else {
esTemplate.searchScrollClear(Arrays.asList(scroll.getScrollId()));
return new ScrollPage<>(null, true, new ArrayList<>());
}
} else {
if (!optSub.isPresent()) {
log.warn("Invalid subscription: " + subscrId);
return new ScrollPage<>(null, true, new ArrayList<>());
}
}
@ApiOperation("Returns notifications by opendorar Id (for example: 301) using scrolls (first page)")
@GetMapping("/scroll/notifications/byOpenDoarId/{opendoarId}")
public ScrollPage<ShortEventMessage> prepareScrollNotificationsByOpendoarId(@PathVariable final String opendoarId) {
final ElasticsearchRestTemplate esTemplate = (ElasticsearchRestTemplate) esOperations;
final String dsId = calculateDsIdFromOpenDoarId(opendoarId);
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.nestedQuery("map", QueryBuilders.termQuery("map.targetDatasourceId", dsId), ScoreMode.None))
.withSearchType(SearchType.DEFAULT)
.withFields("topic", "payload")
.build();
.withQuery(QueryBuilders.termQuery("subscriptionId.keyword", subscrId))
.withSearchType(SearchType.DEFAULT)
.withFields("topic", "payload", "eventId")
.withPageable(PageRequest.of(0, 100))
.build();
final SearchScrollHits<Notification> scroll =
esTemplate.searchScrollStart(SCROLL_TIMEOUT_IN_MILLIS, searchQuery, Notification.class, IndexCoordinates.of(props.getNotificationsIndexName()));
esTemplate.searchScrollStart(SCROLL_TIMEOUT_IN_MILLIS, searchQuery, Notification.class, IndexCoordinates.of(props.getNotificationsIndexName()));
if (scroll.hasSearchHits()) {
final List<ShortEventMessage> values = calculateNotificationMessages(scroll);
return new ScrollPage<>(scroll.getScrollId(), values.isEmpty() || scroll.getScrollId() == null, values);
} else {
esTemplate.searchScrollClear(Arrays.asList(scroll.getScrollId()));
return new ScrollPage<>(null, true, new ArrayList<>());
}
esTemplate.searchScrollClear(Arrays.asList(scroll.getScrollId()));
return new ScrollPage<>(null, true, new ArrayList<>());
}
private String calculateDsIdFromOpenDoarId(final String opendoarId) {
return "10|opendoar____::" + DigestUtils.md5Hex(opendoarId);
}
@ApiOperation("Returns notifications using scrolls (other pages)")
@Operation(summary = "Returns notifications using scrolls (other pages)")
@GetMapping("/scroll/notifications/{scrollId}")
public ScrollPage<ShortEventMessage> scrollNotifications(@PathVariable final String scrollId) {
final ElasticsearchRestTemplate esTemplate = (ElasticsearchRestTemplate) esOperations;
final SearchScrollHits<Notification> scroll =
esTemplate.searchScrollContinue(scrollId, SCROLL_TIMEOUT_IN_MILLIS, Notification.class, IndexCoordinates.of(props.getNotificationsIndexName()));
esTemplate.searchScrollContinue(scrollId, SCROLL_TIMEOUT_IN_MILLIS, Notification.class, IndexCoordinates.of(props.getNotificationsIndexName()));
if (scroll.hasSearchHits()) {
final List<ShortEventMessage> values = calculateNotificationMessages(scroll);
return new ScrollPage<>(scroll.getScrollId(), values.isEmpty() || scroll.getScrollId() == null, values);
} else {
esTemplate.searchScrollClear(Arrays.asList(scroll.getScrollId()));
return new ScrollPage<>(null, true, new ArrayList<>());
}
esTemplate.searchScrollClear(Arrays.asList(scroll.getScrollId()));
return new ScrollPage<>(null, true, new ArrayList<>());
}
@ApiOperation("Returns notifications as file")
@Operation(summary = "Returns notifications as file")
@GetMapping(value = "/file/notifications/bySubscriptionId/{subscrId}", produces = "application/gzip")
public void notificationsAsFile(final HttpServletResponse res, @PathVariable final String subscrId) throws Exception {
@ -157,7 +159,7 @@ public class OpenairePublicController extends AbstractLbsController {
boolean first = true;
IOUtils.write("[\n", gzOut);
IOUtils.write("[\n", gzOut, StandardCharsets.UTF_8);
ScrollPage<ShortEventMessage> page = null;
@ -168,13 +170,13 @@ public class OpenairePublicController extends AbstractLbsController {
if (first) {
first = false;
} else {
IOUtils.write(",\n", gzOut);
IOUtils.write(",\n", gzOut, StandardCharsets.UTF_8);
}
IOUtils.write(gson.toJson(msg), gzOut);
IOUtils.write(gson.toJson(msg), gzOut, StandardCharsets.UTF_8);
}
} while (!page.isCompleted());
IOUtils.write("\n]\n", gzOut);
IOUtils.write("\n]\n", gzOut, StandardCharsets.UTF_8);
gzOut.flush();
@ -182,15 +184,117 @@ public class OpenairePublicController extends AbstractLbsController {
}
@Operation(summary = "Returns events as file by opendoarId")
@GetMapping(value = "/file/events/opendoar/{id}", produces = "application/gzip")
public void opendoarEventsAsFile(final HttpServletResponse res, @PathVariable final String id) {
res.setHeader("Content-Disposition", "attachment; filename=dump.json.gz");
final Configuration conf = new Configuration();
conf.addResource(getClass().getResourceAsStream("/core-site.xml"));
conf.addResource(getClass().getResourceAsStream("/ocean-hadoop-conf.xml"));
final Path pathDir = new Path(opendoarEventsPath + "/" + DigestUtils.md5Hex(id));
try (final FileSystem fs = FileSystem.get(conf);
final ServletOutputStream out = res.getOutputStream();
final GZIPOutputStream gzOut = new GZIPOutputStream(out)) {
boolean first = true;
IOUtils.write("[\n", gzOut, StandardCharsets.UTF_8);
try {
for (final FileStatus fileStatus : fs.listStatus(pathDir)) {
if (fileStatus.isFile()) {
final Path path = fileStatus.getPath();
if (path.getName().endsWith(".json")) {
try (final FSDataInputStream fis = fs.open(path);
final InputStreamReader isr = new InputStreamReader(fis);
final BufferedReader br = new BufferedReader(isr)) {
first = processLine(gzOut, first, br);
}
} else if (path.getName().endsWith(".json.gz")) {
try (final FSDataInputStream fis = fs.open(path);
final GZIPInputStream gzIn = new GZIPInputStream(fis);
final InputStreamReader isr = new InputStreamReader(gzIn);
final BufferedReader br = new BufferedReader(isr)) {
first = processLine(gzOut, first, br);
}
}
}
}
} catch (final FileNotFoundException e) {
log.warn("File not found - " + e.getMessage());
}
IOUtils.write("\n]\n", gzOut, StandardCharsets.UTF_8);
gzOut.flush();
} catch (final Throwable e) {
log.error("Error accessing hdfs file", e);
throw new RuntimeException(e);
}
}
private boolean processLine(final GZIPOutputStream gzOut, boolean first, final BufferedReader br) throws IOException {
String line = br.readLine();
while (line != null) {
if (first) {
first = false;
} else {
IOUtils.write(",\n", gzOut, StandardCharsets.UTF_8);
}
IOUtils.write(line, gzOut, StandardCharsets.UTF_8);
line = br.readLine();
}
return first;
}
@Operation(summary = "Returns the list of subscriptions by user email")
@GetMapping(value = "/subscriptions")
private Iterable<Subscription> listSubscriptionsByUser(@RequestParam final String email) {
return subscriptionRepo.findBySubscriber(email);
}
@Operation(summary = "Returns the status of the application")
@GetMapping(value = "/status")
private Map<String, Long> status() {
final Map<String, Long> res = new LinkedHashMap<>();
res.put("n_subscriptions", subscriptionRepo.count());
res.put("n_events_es", eventRepository.count());
res.put("n_events_db", openaireDsStatRepository.totalEvents());
res.put("n_notifications", notificationRepository.count());
return res;
}
@Operation(summary = "Store the feedback of an event (MOCK)")
@RequestMapping(value = "/feedback/events", method = {
RequestMethod.POST, RequestMethod.PATCH
})
private Map<String, Object> feedbackEvent(@RequestBody final EventFeedback feedback) {
final DbEventFeedback dbEntry = new DbEventFeedback();
dbEntry.setEventId(feedback.getEventId());
dbEntry.setStatus(feedback.getStatus());
feedbackRepository.save(dbEntry);
final Map<String, Object> res = new HashMap<>();
res.put("status", "done");
res.put("feedback", dbEntry);
return res;
}
private List<ShortEventMessage> calculateNotificationMessages(final SearchScrollHits<Notification> scroll) {
if (scroll.getSearchHits().size() > 0) {
return scroll.stream()
.map(SearchHit::getContent)
.map(this::messageFromNotification)
.collect(Collectors.toList());
} else {
return new ArrayList<>();
.map(SearchHit::getContent)
.map(this::messageFromNotification)
.collect(Collectors.toList());
}
return new ArrayList<>();
}
private ShortEventMessage messageFromNotification(final Notification n) {
@ -200,6 +304,7 @@ public class OpenairePublicController extends AbstractLbsController {
final ShortEventMessage res = new ShortEventMessage();
res.setEventId(n.getEventId());
res.setOriginalId(payload.getResult().getOriginalId());
res.setTitle(payload.getResult().getTitles().stream().filter(StringUtils::isNotBlank).findFirst().orElse(null));
res.setTopic(n.getTopic());

View File

@ -1,9 +1,19 @@
spring.profiles.active = dev,openaire
server.public_url =
server.public_desc = API Base URL
#logging.level.root=DEBUG
spring.datasource.url=jdbc:postgresql://localhost:5432/dnet_broker
spring.datasource.username=
maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/dhp-broker-public-application/effective-pom.xml
management.endpoints.web.exposure.include = prometheus,health
management.endpoints.web.base-path = /
management.endpoints.web.path-mapping.prometheus = metrics
management.endpoints.web.path-mapping.health = health
spring.datasource.url=jdbc:postgresql://localhost:5432/oa_broker
spring.datasource.username=oa_broker
spring.datasource.password=
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
@ -19,6 +29,8 @@ spring.jpa.properties.hibernate.format_sql = false
lbs.database.url = ${spring.datasource.url}
lbs.hadoop.opendoar.events.path = /user/michele.artini/broker_events/eventsByOpendoarId
# for development server
#lbs.elastic.clusterNodes = broker1-dev-dnet.d4science.org:9300
#lbs.elastic.homepage = http://broker1-dev-dnet.d4science.org:9200/_plugin/hq
@ -37,8 +49,6 @@ lbs.task.deleteOldEvents.cron = 0 0 4 1/1 * ?
lbs.task.deleteOldNotifications.cron = 0 0 5 1/1 * ?
lbs.task.subscriptionEventsMatcher.cron = 0 0 6 1/1 * ?
spring.data.elasticsearch.cluster-name = ${lbs.elastic.clusterName}
spring.data.elasticsearch.cluster-nodes = ${lbs.elastic.clusterNodes}

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Autogenerated by Cloudera Manager-->
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://nameservice1</value>
</property>
<property>
<name>fs.trash.interval</name>
<value>1</value>
</property>
<property>
<name>io.compression.codecs</name>
<value>org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.BZip2Codec,org.apache.hadoop.io.compress.DeflateCodec,org.apache.hadoop.io.compress.SnappyCodec,org.apache.hadoop.io.compress.Lz4Codec</value>
</property>
<property>
<name>hadoop.security.authentication</name>
<value>simple</value>
</property>
<property>
<name>hadoop.security.authorization</name>
<value>false</value>
</property>
<property>
<name>hadoop.rpc.protection</name>
<value>authentication</value>
</property>
<property>
<name>hadoop.security.auth_to_local</name>
<value>DEFAULT</value>
</property>
<property>
<name>hadoop.proxyuser.oozie.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.oozie.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.mapred.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.mapred.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.flume.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.flume.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.HTTP.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.HTTP.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hive.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hive.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hue.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hue.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.httpfs.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.httpfs.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hdfs.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hdfs.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.yarn.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.yarn.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.security.group.mapping</name>
<value>org.apache.hadoop.security.ShellBasedUnixGroupsMapping</value>
</property>
<property>
<name>hadoop.security.instrumentation.requires.admin</name>
<value>false</value>
</property>
<property>
<name>net.topology.script.file.name</name>
<value>/etc/hadoop/conf.cloudera.yarn2/topology.py</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>65536</value>
</property>
<property>
<name>hadoop.ssl.enabled</name>
<value>false</value>
</property>
<property>
<name>hadoop.ssl.require.client.cert</name>
<value>false</value>
<final>true</final>
</property>
<property>
<name>hadoop.ssl.keystores.factory.class</name>
<value>org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory</value>
<final>true</final>
</property>
<property>
<name>hadoop.ssl.server.conf</name>
<value>ssl-server.xml</value>
<final>true</final>
</property>
<property>
<name>hadoop.ssl.client.conf</name>
<value>ssl-client.xml</value>
<final>true</final>
</property>
</configuration>

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Autogenerated by Cloudera Manager-->
<configuration>
<property>
<name>dfs.nameservices</name>
<value>nameservice1</value>
</property>
<property>
<name>dfs.client.failover.proxy.provider.nameservice1</name>
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
</property>
<property>
<name>dfs.ha.automatic-failover.enabled.nameservice1</name>
<value>true</value>
</property>
<property>
<name>ha.zookeeper.quorum</name>
<value>iis-cdh5-test-m1.ocean.icm.edu.pl:2181,iis-cdh5-test-m2.ocean.icm.edu.pl:2181,iis-cdh5-test-m3.ocean.icm.edu.pl:2181</value>
</property>
<property>
<name>dfs.ha.namenodes.nameservice1</name>
<value>namenode528,namenode434</value>
</property>
<property>
<name>dfs.namenode.rpc-address.nameservice1.namenode528</name>
<value>iis-cdh5-test-m1.ocean.icm.edu.pl:8020</value>
</property>
<property>
<name>dfs.namenode.servicerpc-address.nameservice1.namenode528</name>
<value>iis-cdh5-test-m1.ocean.icm.edu.pl:8022</value>
</property>
<property>
<name>dfs.namenode.http-address.nameservice1.namenode528</name>
<value>iis-cdh5-test-m1.ocean.icm.edu.pl:50070</value>
</property>
<property>
<name>dfs.namenode.https-address.nameservice1.namenode528</name>
<value>iis-cdh5-test-m1.ocean.icm.edu.pl:50470</value>
</property>
<property>
<name>dfs.namenode.rpc-address.nameservice1.namenode434</name>
<value>iis-cdh5-test-m2.ocean.icm.edu.pl:8020</value>
</property>
<property>
<name>dfs.namenode.servicerpc-address.nameservice1.namenode434</name>
<value>iis-cdh5-test-m2.ocean.icm.edu.pl:8022</value>
</property>
<property>
<name>dfs.namenode.http-address.nameservice1.namenode434</name>
<value>iis-cdh5-test-m2.ocean.icm.edu.pl:50070</value>
</property>
<property>
<name>dfs.namenode.https-address.nameservice1.namenode434</name>
<value>iis-cdh5-test-m2.ocean.icm.edu.pl:50470</value>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.blocksize</name>
<value>134217728</value>
</property>
<property>
<name>dfs.client.use.datanode.hostname</name>
<value>false</value>
</property>
<property>
<name>fs.permissions.umask-mode</name>
<value>022</value>
</property>
<property>
<name>dfs.namenode.acls.enabled</name>
<value>false</value>
</property>
<property>
<name>dfs.client.use.legacy.blockreader</name>
<value>false</value>
</property>
<property>
<name>dfs.client.read.shortcircuit</name>
<value>false</value>
</property>
<property>
<name>dfs.domain.socket.path</name>
<value>/var/run/hdfs-sockets/dn</value>
</property>
<property>
<name>dfs.client.read.shortcircuit.skip.checksum</name>
<value>false</value>
</property>
<property>
<name>dfs.client.domain.socket.data.traffic</name>
<value>false</value>
</property>
<property>
<name>dfs.datanode.hdfs-blocks-metadata.enabled</name>
<value>true</value>
</property>
</configuration>

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>OpenAIRE Broker Public API</title>
<meta http-equiv="refresh" content="2; url = ./apidoc" />
</head>
</html>

View File

@ -1,7 +1,7 @@
package eu.dnetlib.broker.oa.integration;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;
import eu.dnetlib.broker.api.ShortEventMessage;
@ -18,7 +18,7 @@ public class ScrollTest {
public class TestScrollPage extends ScrollPage<ShortEventMessage> {}
@Test
@Ignore
@Disabled
public void testScroll() {
int total = 0;

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 9380:10.19.65.36:9380 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -0,0 +1,3 @@
#!/bin/bash
ssh -vNL 9200:10.19.65.51:9200 michele.artini@iis-cdh5-test-gw.ocean.icm.edu.pl

View File

@ -0,0 +1,32 @@
# dhp-mdstore-manager
A key component in the OpenAIRE aggregation workflows is the Metadata Store Manager (MdSM).
It manages the set of metadata record collections resulting from the aggregation processes (MDStore), keeping track of the
logical-physical mapping of each MDStore indicating the HDFS location responsible to store each set of records.
Moreover, as the aggregation workflows are intrinsically asynchronous processes, it must ensure the consistency of the
records stored within each MDStore. Being HDFS an append-only filesystem (i.e. it does not support updates on existing
files as batch operations), the MdSM introduces the concept of MDStore version: each MDStore represents a set of metadata
records, where each set is associated to the timestamp relative to its creation (so that they that can be ordered over time).
One of its versions is defined as the "current" available for clients to read.
Writing a new batch of records in a given MDStore doesn't alter the content available for clients reading from the same
MDStore until the write operations are concluded and committed, therefore implementing a transaction (similarly to
transactions in RDBMS).
Only a predefined amount of versions are kept. From time to time a garbage collection mechanism disposes older MDStore
versions, preserving the last N, where N is a configuration parameter defined in the information system (or in the MDdSM
itself, yet to be decided).
The MdSM implements a lock mechanism that acts as a semaphore: the lock includes a counter that is incremented by one
every time a given MDStore is read, and decrementing it when the read operation is concluded. Locked MDStores
(associated to non-zero semaphores) cannot be deleted or garbage collected.
The MdSM implements the following operations
* GET /mdstores/mdstore/{mdId}/newVersion : Create a new preliminary version of a MDStore, used to begin writing new records.
* GET /mdstores/version/{versionId}/commit/{size} : Promote a preliminary version to current, used when a process wiring new records has finished.
* GET /mdstores/version/{versionId}/abort : Abort a preliminary version, used to discard records temporarily store in a new MDStore version.
* GET /mdstores/mdstore/{mdId}/startReading : Increase the read count of the current MDStore
* GET /mdstores/version/{versionId}/endReading : Decrease the read count of a MDStore version
* GET /mdstores/mdstore/{mdId}/versions : Return all the versions of a MDStore
* DELETE /mdstoremanager/mdstores/mdstore/{mdId} : Delete a MDStore by id
* DELETE /mdstores/versions/expired : Delete expired versions

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.5.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dhp-mdstore-manager</artifactId>
<packaging>jar</packaging>
<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<!-- Hadoop -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
<artifactId>parquet-hadoop</artifactId>
<version>1.5.0-cdh5.13.3</version>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
<artifactId>parquet-avro</artifactId>
<version>1.5.0-cdh5.13.3</version>
</dependency>
<!-- DHP Schemas -->
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-schemas</artifactId>
</dependency>
<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-help-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,36 @@
package eu.dnetlib.data.mdstore.manager;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import eu.dnetlib.common.app.AbstractDnetApp;
@SpringBootApplication
@EnableCaching
@EnableScheduling
@EntityScan("eu.dnetlib.dhp.schema.mdstore")
public class MainApplication extends AbstractDnetApp {
public static void main(final String[] args) {
SpringApplication.run(MainApplication.class, args);
}
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("MDStore APIs")
.pathsToMatch("/mdstores/**")
.build();
}
@Override
protected String swaggerTitle() {
return "MDStore Manager APIs";
}
}

View File

@ -0,0 +1,86 @@
package eu.dnetlib.data.mdstore.manager.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;
import eu.dnetlib.dhp.schema.mdstore.MDStoreVersion;
import eu.dnetlib.dhp.schema.mdstore.MDStoreWithInfo;
import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException;
import eu.dnetlib.data.mdstore.manager.utils.ControllerUtils;
import eu.dnetlib.data.mdstore.manager.utils.DatabaseUtils;
@Controller
public class MDInspectorController {
@Autowired
private DatabaseUtils databaseUtils;
private static final Logger log = LoggerFactory.getLogger(MDInspectorController.class);
@Value("${dhp.mdstore-manager.inspector.records.max}")
private Long MAX_MD_RECORDS;
@RequestMapping("/mdrecords/{id}/{limit}")
public String mdstoreInspector(final ModelMap map, @PathVariable final String id, @PathVariable final long limit) throws MDStoreManagerException {
final MDStoreWithInfo md;
final MDStoreVersion ver;
if (isMdstoreId(id)) {
log.debug("MDSTORE: " + id);
md = databaseUtils.findMdStore(id);
ver = databaseUtils.findVersion(md.getCurrentVersion());
} else {
log.debug("VERSION: " + id);
ver = databaseUtils.findVersion(id);
md = databaseUtils.findMdStore(ver.getMdstore());
}
map.addAttribute("mdId", md.getId());
map.addAttribute("versionId", ver.getId());
map.addAttribute("dsId", md.getDatasourceId());
map.addAttribute("dsName", md.getDatasourceName());
map.addAttribute("apiId", md.getApiId());
map.addAttribute("format", md.getFormat());
map.addAttribute("layout", md.getLayout());
map.addAttribute("interpretation", md.getInterpretation());
map.addAttribute("path", ver.getHdfsPath());
map.addAttribute("lastUpdate", ver.getLastUpdate());
map.addAttribute("size", ver.getSize());
map.addAttribute("limit", Math.min(limit, MAX_MD_RECORDS));
if (md.getCurrentVersion().equals(ver.getId())) {
map.addAttribute("status", "current");
} else if (ver.isWriting()) {
map.addAttribute("status", "writing");
} else {
map.addAttribute("status", "expired");
}
return "inspector";
}
@ExceptionHandler(Exception.class)
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
public ModelAndView handleException(final Exception e) {
return ControllerUtils.errorPage("Metadata Inspector - ERROR", e);
}
private boolean isMdstoreId(final String id) {
return id.length() < 40;
}
}

View File

@ -0,0 +1,232 @@
package eu.dnetlib.data.mdstore.manager.controller;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.google.common.collect.Sets;
import eu.dnetlib.common.controller.AbstractDnetController;
import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException;
import eu.dnetlib.data.mdstore.manager.utils.DatabaseUtils;
import eu.dnetlib.data.mdstore.manager.utils.HdfsClient;
import eu.dnetlib.dhp.schema.mdstore.MDStoreVersion;
import eu.dnetlib.dhp.schema.mdstore.MDStoreWithInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@RestController
@RequestMapping("/mdstores")
@Tag(name = "Metadata Stores")
public class MDStoreController extends AbstractDnetController {
@Autowired
private DatabaseUtils databaseUtils;
@Autowired
private HdfsClient hdfsClient;
private static final Logger log = LoggerFactory.getLogger(DatabaseUtils.class);
@Operation(summary = "Return all the mdstores")
@GetMapping("/")
public Iterable<MDStoreWithInfo> find() {
return databaseUtils.listMdStores();
}
@Operation(summary = "Return all the mdstore identifiers")
@GetMapping("/ids")
public List<String> findIdentifiers() {
return databaseUtils.listMdStoreIDs();
}
@Operation(summary = "Return a mdstores by id")
@GetMapping("/mdstore/{mdId}")
public MDStoreWithInfo getMdStore(@Parameter(name = "the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException {
return databaseUtils.findMdStore(mdId);
}
@Operation(summary = "Increase the read count of the current mdstore")
@GetMapping("/mdstore/{mdId}/startReading")
public MDStoreVersion startReading(@Parameter(name = "the mdstore identifier") @PathVariable final String mdId) throws MDStoreManagerException {
return databaseUtils.startReading(mdId);
}
@Operation(summary = "Create a new mdstore")
@GetMapping("/new/{format}/{layout}/{interpretation}")
public MDStoreWithInfo createMDStore(
@Parameter(name = "mdstore format") @PathVariable final String format,
@Parameter(name = "mdstore layout") @PathVariable final String layout,
@Parameter(name = "mdstore interpretation") @PathVariable final String interpretation,
@Parameter(name = "datasource name") @RequestParam(required = true) final String dsName,
@Parameter(name = "datasource id") @RequestParam(required = true) final String dsId,
@Parameter(name = "api id") @RequestParam(required = true) final String apiId) throws MDStoreManagerException {
final String id = databaseUtils.createMDStore(format, layout, interpretation, dsName, dsId, apiId);
return databaseUtils.findMdStore(id);
}
@Operation(summary = "Delete a mdstore by id")
@DeleteMapping("/mdstore/{mdId}")
public StatusResponse delete(@Parameter(name = "the id of the mdstore that will be deleted") @PathVariable final String mdId) throws MDStoreManagerException {
final String hdfsPath = databaseUtils.deleteMdStore(mdId);
hdfsClient.deletePath(hdfsPath);
return StatusResponse.DELETED;
}
@Operation(summary = "Return all the versions of a mdstore")
@GetMapping("/mdstore/{mdId}/versions")
public Iterable<MDStoreVersion> listVersions(@PathVariable final String mdId) throws MDStoreManagerException {
return databaseUtils.listVersions(mdId);
}
@Operation(summary = "Create a new preliminary version of a mdstore")
@GetMapping("/mdstore/{mdId}/newVersion")
public MDStoreVersion prepareNewVersion(@Parameter(name = "the id of the mdstore for which will be created a new version") @PathVariable final String mdId) {
return databaseUtils.prepareMdStoreVersion(mdId);
}
@Operation(summary = "Promote a preliminary version to current")
@GetMapping("/version/{versionId}/commit/{size}")
public MDStoreVersion commitVersion(@Parameter(name = "the id of the version that will be promoted to the current version") @PathVariable final String versionId,
@Parameter(name = "the size of the new current mdstore") @PathVariable final long size) throws MDStoreManagerException {
try {
return databaseUtils.commitMdStoreVersion(versionId, size);
} finally {
deleteExpiredVersions();
}
}
@Operation(summary = "Abort a preliminary version")
@GetMapping("/version/{versionId}/abort")
public StatusResponse commitVersion(@Parameter(name = "the id of the version to abort") @PathVariable final String versionId) throws MDStoreManagerException {
final String hdfsPath = databaseUtils.deleteMdStoreVersion(versionId, true);
hdfsClient.deletePath(hdfsPath);
return StatusResponse.ABORTED;
}
@Operation(summary = "Return an existing mdstore version")
@GetMapping("/version/{versionId}")
public MDStoreVersion getVersion(@Parameter(name = "the id of the version that has to be deleted") @PathVariable final String versionId)
throws MDStoreManagerException {
return databaseUtils.findVersion(versionId);
}
@Operation(summary = "Delete a mdstore version")
@DeleteMapping("/version/{versionId}")
public StatusResponse deleteVersion(@Parameter(name = "the id of the version that has to be deleted") @PathVariable final String versionId,
@Parameter(name = "if true, the controls on writing and readcount values will be skipped") @RequestParam(required = false, defaultValue = "false") final boolean force)
throws MDStoreManagerException {
final String hdfsPath = databaseUtils.deleteMdStoreVersion(versionId, force);
hdfsClient.deletePath(hdfsPath);
return StatusResponse.DELETED;
}
@Operation(summary = "Decrease the read count of a mdstore version")
@GetMapping("/version/{versionId}/endReading")
public MDStoreVersion endReading(@Parameter(name = "the id of the version that has been completely read") @PathVariable final String versionId)
throws MDStoreManagerException {
return databaseUtils.endReading(versionId);
}
@Operation(summary = "Reset the read count of a mdstore version")
@GetMapping("/version/{versionId}/resetReading")
public MDStoreVersion resetReading(@Parameter(name = "the id of the version") @PathVariable final String versionId)
throws MDStoreManagerException {
return databaseUtils.resetReading(versionId);
}
@Operation(summary = "Delete expired versions")
@DeleteMapping("/versions/expired")
public StatusResponse deleteExpiredVersions() {
new Thread(this::performDeleteOfExpiredVersions).start();
return StatusResponse.DELETING;
}
private synchronized void performDeleteOfExpiredVersions() {
log.info("Deleting expired version...");
for (final String versionId : databaseUtils.listExpiredVersions()) {
try {
final String hdfsPath = databaseUtils.deleteMdStoreVersion(versionId, true);
hdfsClient.deletePath(hdfsPath);
} catch (final MDStoreManagerException e) {
log.warn("Error deleteting version " + versionId, e);
}
}
log.info("Done.");
}
@Operation(summary = "Fix the inconsistencies on HDFS")
@GetMapping("/hdfs/inconsistencies")
public Set<String> fixHdfsInconsistencies(
@Parameter(name = "force the deletion of hdfs paths") @RequestParam(required = false, defaultValue = "false") final boolean delete)
throws MDStoreManagerException {
final Set<String> hdfsDirs = hdfsClient.listHadoopDirs();
final Set<String> validDirs = databaseUtils.listValidHdfsPaths();
final Set<String> toDelete = Sets.difference(hdfsDirs, validDirs);
log.info("Found " + toDelete.size() + " hdfs paths to remove");
if (delete) {
for (final String p : toDelete) {
hdfsClient.deletePath(p);
}
}
return toDelete;
}
@Operation(summary = "Show informations")
@GetMapping("/info")
public Map<String, Object> info() {
final Map<String, Object> info = new LinkedHashMap<>();
info.put("number_of_mdstores", databaseUtils.countMdStores());
info.put("hadoop_user", hdfsClient.getHadoopUser());
info.put("hadoop_cluster", hdfsClient.getHadoopCluster());
info.put("hdfs_base_path", databaseUtils.getHdfsBasePath());
info.put("expired_versions", databaseUtils.listExpiredVersions());
return info;
}
@Operation(summary = "list the file inside the path of a mdstore version")
@GetMapping("/version/{versionId}/parquet/files")
public Set<String> listVersionFiles(@PathVariable final String versionId) throws MDStoreManagerException {
final String path = databaseUtils.findVersion(versionId).getHdfsPath();
return hdfsClient.listContent(path + "/store", HdfsClient::isParquetFile);
}
@Operation(summary = "read the parquet file of a mdstore version")
@GetMapping("/version/{versionId}/parquet/content/{limit}")
public List<Map<String, String>> listVersionParquet(@PathVariable final String versionId, @PathVariable final long limit) throws MDStoreManagerException {
final String path = databaseUtils.findVersion(versionId).getHdfsPath();
return hdfsClient.readParquetFiles(path + "/store", limit);
}
@Operation(summary = "read the parquet file of a mdstore (current version)")
@GetMapping("/mdstore/{mdId}/parquet/content/{limit}")
public List<Map<String, String>> listMdstoreParquet(@PathVariable final String mdId, @PathVariable final long limit) throws MDStoreManagerException {
final String versionId = databaseUtils.findMdStore(mdId).getCurrentVersion();
final String path = databaseUtils.findVersion(versionId).getHdfsPath();
return hdfsClient.readParquetFiles(path + "/store", limit);
}
protected void setDatabaseUtils(final DatabaseUtils databaseUtils) {
this.databaseUtils = databaseUtils;
}
protected void setHdfsClient(final HdfsClient hdfsClient) {
this.hdfsClient = hdfsClient;
}
}

View File

@ -0,0 +1,25 @@
package eu.dnetlib.data.mdstore.manager.controller;
public class StatusResponse {
public static final StatusResponse DELETED = new StatusResponse("DELETED");
public static final StatusResponse DELETING = new StatusResponse("DELETING...");
public static final StatusResponse ABORTED = new StatusResponse("ABORTED");;
private String status;
public StatusResponse() {}
public StatusResponse(final String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setStatus(final String status) {
this.status = status;
}
}

View File

@ -0,0 +1,16 @@
package eu.dnetlib.data.mdstore.manager.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class SwaggerController {
@RequestMapping(value = {
"/apidoc", "/api-doc", "/doc", "/swagger"
}, method = RequestMethod.GET)
public String apiDoc() {
return "redirect:swagger-ui/index.html";
}
}

View File

@ -0,0 +1,41 @@
package eu.dnetlib.data.mdstore.manager.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;
import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException;
import eu.dnetlib.data.mdstore.manager.utils.ControllerUtils;
import eu.dnetlib.data.mdstore.manager.utils.DatabaseUtils;
import eu.dnetlib.data.mdstore.manager.utils.ZeppelinClient;
import eu.dnetlib.dhp.schema.mdstore.MDStoreWithInfo;
@Controller
public class ZeppelinController {
@Autowired
private ZeppelinClient zeppelinClient;
@Autowired
private DatabaseUtils databaseUtils;
@RequestMapping("/zeppelin/{mdId}/{note}")
public String goToZeppelin(@PathVariable final String mdId, final @PathVariable String note) throws MDStoreManagerException {
final MDStoreWithInfo mdstore = databaseUtils.findMdStore(mdId);
final String currentVersion = mdstore.getCurrentVersion();
final String path = databaseUtils.findVersion(currentVersion).getHdfsPath() + "/store";
return "redirect:" + zeppelinClient.zeppelinNote(note, mdstore, path);
}
@ExceptionHandler(Exception.class)
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
public ModelAndView handleException(final Exception e) {
return ControllerUtils.errorPage("Metadata Store Manager - Zeppelin Client", e);
}
}

View File

@ -0,0 +1,29 @@
package eu.dnetlib.data.mdstore.manager.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import eu.dnetlib.common.controller.AbstractDnetController;
import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException;
import eu.dnetlib.data.mdstore.manager.utils.ZeppelinClient;
@RestController
public class ZeppelinRestController extends AbstractDnetController {
@Autowired
private ZeppelinClient zeppelinClient;
@GetMapping("/zeppelin/templates")
public List<String> getTemplates() throws MDStoreManagerException {
try {
// if (zeppelinClient.get)
return zeppelinClient.listTemplates();
} catch (final Throwable e) {
throw new MDStoreManagerException("Zeppelin is unreachable", e);
}
}
}

View File

@ -0,0 +1,34 @@
package eu.dnetlib.data.mdstore.manager.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public class MDStoreManagerException extends Exception{
/**
*
*/
private static final long serialVersionUID = -7503316126409002675L;
public MDStoreManagerException() {
super();
}
public MDStoreManagerException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public MDStoreManagerException(String message, Throwable cause) {
super(message, cause);
}
public MDStoreManagerException(String message) {
super(message);
}
public MDStoreManagerException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,12 @@
package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import eu.dnetlib.dhp.schema.mdstore.MDStoreCurrentVersion;
@Repository
public interface MDStoreCurrentVersionRepository extends JpaRepository<MDStoreCurrentVersion, String> {
long countByCurrentVersion(String versionId);
}

View File

@ -0,0 +1,11 @@
package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import eu.dnetlib.dhp.schema.mdstore.MDStore;
@Repository
public interface MDStoreRepository extends JpaRepository<MDStore, String> {
}

View File

@ -0,0 +1,19 @@
package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import eu.dnetlib.dhp.schema.mdstore.MDStoreVersion;
@Repository
public interface MDStoreVersionRepository extends JpaRepository<MDStoreVersion, String> {
void deleteByMdstore(String id);
long countByMdstoreAndWriting(String id, boolean b);
long countByMdstoreAndReadCountGreaterThan(String id, int count);
Iterable<MDStoreVersion> findByMdstore(String mdId);
}

View File

@ -0,0 +1,10 @@
package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.stereotype.Repository;
import eu.dnetlib.dhp.schema.mdstore.MDStoreWithInfo;
@Repository
public interface MDStoreWithInfoRepository extends ReadOnlyRepository<MDStoreWithInfo, String> {
}

View File

@ -0,0 +1,18 @@
package eu.dnetlib.data.mdstore.manager.repository;
import java.util.Optional;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.Repository;
@NoRepositoryBean
public interface ReadOnlyRepository<T, ID> extends Repository<T, ID> {
Optional<T> findById(ID id);
boolean existsById(ID id);
Iterable<T> findAll();
long count();
}

View File

@ -0,0 +1,22 @@
package eu.dnetlib.data.mdstore.manager.utils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
public class ControllerUtils {
private static final Logger log = LoggerFactory.getLogger(ControllerUtils.class);
public static ModelAndView errorPage(final String title, final Throwable e) {
log.debug(e.getMessage(), e);
final ModelAndView mv = new ModelAndView();
mv.setViewName("error");
mv.addObject("title", title);
mv.addObject("error", e.getMessage());
mv.addObject("stacktrace", ExceptionUtils.getStackTrace(e));
return mv;
}
}

Some files were not shown because too many files have changed in this diff Show More