From e60899bdcc19acf2575084d0e99a4f8259e55a1d Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 13 Feb 2017 11:32:48 +0000 Subject: [PATCH] MERGE uoa-services-portal lazy-routes Branch 45587:45834 into trunk git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45855 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/README.md | 16 +- portal-2/package.json | 5 - portal-2/src/app/app-routing.module.ts | 136 +++++++++- portal-2/src/app/app.module.ts | 22 +- .../depositDatasets-routing.module.ts | 15 ++ .../depositDatasets.component.ts | 2 +- .../datasets/depositDatasets.module.ts | 28 ++ .../depositDatasetsResult.component.ts | 0 .../depositDatasetsResults-routing.module.ts | 14 + .../datasets/depositDatasetsResults.module.ts | 27 ++ .../src/app/deposit/deposit-routing.module.ts | 20 -- portal-2/src/app/deposit/deposit.component.ts | 3 +- portal-2/src/app/deposit/deposit.module.ts | 35 +-- .../app/deposit/depositResult.component.ts | 41 +-- .../depositPublications-routing.module.ts | 14 + .../depositPublications.component.ts | 0 .../depositPublications.module.ts | 28 ++ ...epositPublicationsResult-routing.module.ts | 14 + .../depositPublicationsResult.component.ts | 0 .../depositPublicationsResults.module.ts | 27 ++ .../dataProvider-routing.module.ts | 13 + .../dataProvider/dataProvider.component.ts | 7 +- .../dataProvider/dataProvider.module.ts | 51 ++++ .../dataProvider}/dataProvider.service.ts | 8 +- .../dataProvider/datasetsTab.component.ts | 14 +- .../dataProvider/datasourcesTab.component.ts | 13 +- .../dataProvider/projectsTab.component.ts | 13 +- .../dataProvider/publicationsTab.component.ts | 14 +- .../relatedDatasourcesTab.component.ts | 11 +- .../dataProvider/tabs.component.ts | 139 +++++----- .../dataset/dataset-routing.module.ts | 13 + .../dataset/dataset.component.html | 2 +- .../landingPages/dataset/dataset.component.ts | 2 +- .../landingPages/dataset/dataset.module.ts | 33 +++ .../dataset}/dataset.service.ts | 6 +- .../htmlProjectReport-routing.module.ts | 13 + .../htmlProjectReport.component.ts} | 10 +- .../htmlProjectReport.module.ts | 26 ++ .../htmlProjectReport.service.ts} | 6 +- .../landingPages/landing-routing.module.ts | 26 -- .../src/app/landingPages/landing.module.ts | 46 +--- .../src/app/landingPages/metrics.module.ts | 26 ++ .../organization-routing.module.ts | 13 + .../organization/organization.component.html | 10 +- .../organization/organization.component.ts | 24 +- .../organization/organization.module.ts | 33 +++ .../person/person-routing.module.ts | 13 + .../landingPages/person/person.component.html | 20 +- .../landingPages/person/person.component.ts | 45 ++-- .../app/landingPages/person/person.module.ts | 32 +++ .../person}/person.service.ts | 6 +- .../project/project-routing.module.ts | 13 + .../project/project.component.html | 26 +- .../landingPages/project/project.component.ts | 34 +-- .../landingPages/project/project.module.ts | 36 +++ .../landingPages/project/project.service.ts | 200 ++++++++++++++ .../project/projectService.module.ts | 20 ++ .../publication/publication-routing.module.ts | 13 + .../publication/publication.component.ts | 2 +- .../publication/publication.module.ts | 33 +++ .../publication}/publication.service.ts | 6 +- .../app/landingPages/resultLanding.module.ts | 24 ++ .../app/landingPages/showAuthors.component.ts | 3 +- ...ancedSearchDataProviders-routing.module.ts | 14 + .../advancedSearchDataProviders.module.ts | 28 ++ .../advancedSearchDatasets-routing.module.ts | 14 + .../advanced/advancedSearchDatasets.module.ts | 28 ++ ...ancedSearchOrganizations-routing.module.ts | 14 + .../advancedSearchOrganizations.module.ts | 28 ++ .../advancedSearchPeople-routing.module.ts | 14 + .../advanced/advancedSearchPeople.module.ts | 28 ++ .../advancedSearchProjects-routing.module.ts | 14 + .../advanced/advancedSearchProjects.module.ts | 28 ++ ...vancedSearchPublications-routing.module.ts | 14 + .../advancedSearchPublications.module.ts | 28 ++ .../compatibleDataProviders-routing.module.ts | 14 + .../compatibleDataProviders.component.ts | 2 +- .../compatibleDataProviders.module.ts | 29 ++ .../entityRegistries-routing.module.ts | 14 + .../entityRegistries.component.ts | 2 +- .../dataProviders/entityRegistries.module.ts | 29 ++ .../find/mainSearch-routing.module.ts | 14 + .../app/searchPages/find/mainSearch.module.ts | 36 +++ .../app/searchPages/find/search.component.ts | 102 +++---- .../app/searchPages/search-routing.module.ts | 42 --- portal-2/src/app/searchPages/search.module.ts | 104 -------- .../searchUtils/advancedSearchForm.module.ts | 25 ++ .../searchUtils/advancedSearchPage.module.ts | 28 ++ .../searchUtils/browseEntities.module.ts | 30 +++ .../searchUtils/browseStatistic.component.ts | 15 +- .../searchUtils/searchDownload.module.ts | 22 ++ .../searchUtils/searchForm.module.ts | 22 ++ .../searchUtils/searchPage.module.ts | 31 +++ .../searchUtils/searchPaging.module.ts | 23 ++ .../searchUtils/searchResult.component.ts | 7 +- .../searchUtils/searchResults.module.ts | 31 +++ .../searchDataProviders-routing.module.ts | 14 + .../simple/searchDataProviders.module.ts | 30 +++ .../simple/searchDataproviders.component.ts | 2 +- .../simple/searchDatasets-routing.module.ts | 14 + .../simple/searchDatasets.component.ts | 2 +- .../simple/searchDatasets.module.ts | 30 +++ .../searchOrganizations-routing.module.ts | 14 + .../simple/searchOrganizations.module.ts | 30 +++ .../simple/searchPeople-routing.module.ts | 14 + .../searchPages/simple/searchPeople.module.ts | 30 +++ .../simple/searchProjects-routing.module.ts | 14 + .../simple/searchProjects.module.ts | 30 +++ .../searchPublications-routing.module.ts | 14 + .../simple/searchPublications.component.ts | 2 +- .../simple/searchPublications.module.ts | 30 +++ .../services/dataProvidersService.module.ts | 20 ++ .../app/services/datasetsService.module.ts | 20 ++ .../src/app/services/organization.service.ts | 1 + .../services/organizationService.module.ts | 20 ++ .../services/organizationsService.module.ts | 20 ++ .../src/app/services/peopleService.module.ts | 20 ++ .../app/services/projectsService.module.ts | 20 ++ .../services/publicationsService.module.ts | 20 ++ .../refineFieldResultsService.module.ts | 20 ++ .../src/app/services/reportsService.module.ts | 20 ++ portal-2/src/app/services/services.module.ts | 56 ---- .../navigationBar.component.ts | 100 ++++--- portal-2/src/app/test/test-routing.module.ts | 2 +- portal-2/src/app/test/test.component.ts | 140 +--------- portal-2/src/app/test/test.module.ts | 8 +- portal-2/src/app/utils/altmetrics.module.ts | 20 ++ .../entitiesAutoComplete.component.ts | 16 +- .../entitiesAutoComplete.module.ts | 21 ++ .../entitySearch.service.ts | 9 +- ...ortCSV.component.ts => exportCSV.class.ts} | 20 +- .../fetchDataproviders.class.ts | 252 ++++++++++++++++++ .../fetchDatasets.class.ts | 149 +++++++++++ .../fetchOrganizations.class.ts | 66 +++++ .../fetchEntitiesClasses/fetchPeople.class.ts | 59 ++++ .../fetchProjects.class.ts | 87 ++++++ .../fetchPublications.class.ts | 206 ++++++++++++++ portal-2/src/app/utils/iframe.module.ts | 19 ++ .../src/app/utils/modal/alertModal.module.ts | 17 ++ .../app/utils/modal/loadingModal.module.ts | 19 ++ portal-2/src/app/utils/modal/modal.module.ts | 17 +- portal-2/src/app/utils/paging.module.ts | 27 ++ portal-2/src/app/utils/routerHelper.class.ts | 27 ++ .../ISVocabularies.service.ts | 9 +- .../staticAutoComplete.component.ts | 8 +- .../staticAutoComplete.module.ts | 22 ++ portal-2/src/app/utils/utils.module.ts | 55 ---- portal-2/src/server.aot.ts | 30 ++- portal-2/src/server.ts | 30 ++- 149 files changed, 3395 insertions(+), 966 deletions(-) create mode 100644 portal-2/src/app/deposit/datasets/depositDatasets-routing.module.ts rename portal-2/src/app/deposit/{ => datasets}/depositDatasets.component.ts (99%) create mode 100644 portal-2/src/app/deposit/datasets/depositDatasets.module.ts rename portal-2/src/app/deposit/{ => datasets}/depositDatasetsResult.component.ts (100%) create mode 100644 portal-2/src/app/deposit/datasets/depositDatasetsResults-routing.module.ts create mode 100644 portal-2/src/app/deposit/datasets/depositDatasetsResults.module.ts delete mode 100644 portal-2/src/app/deposit/deposit-routing.module.ts create mode 100644 portal-2/src/app/deposit/publications/depositPublications-routing.module.ts rename portal-2/src/app/deposit/{ => publications}/depositPublications.component.ts (100%) create mode 100644 portal-2/src/app/deposit/publications/depositPublications.module.ts create mode 100644 portal-2/src/app/deposit/publications/depositPublicationsResult-routing.module.ts rename portal-2/src/app/deposit/{ => publications}/depositPublicationsResult.component.ts (100%) create mode 100644 portal-2/src/app/deposit/publications/depositPublicationsResults.module.ts create mode 100644 portal-2/src/app/landingPages/dataProvider/dataProvider-routing.module.ts create mode 100644 portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts rename portal-2/src/app/{services => landingPages/dataProvider}/dataProvider.service.ts (96%) create mode 100644 portal-2/src/app/landingPages/dataset/dataset-routing.module.ts create mode 100644 portal-2/src/app/landingPages/dataset/dataset.module.ts rename portal-2/src/app/{services => landingPages/dataset}/dataset.service.ts (99%) create mode 100644 portal-2/src/app/landingPages/htmlProjectReport/htmlProjectReport-routing.module.ts rename portal-2/src/app/landingPages/{project/htmlProgressReport.component.ts => htmlProjectReport/htmlProjectReport.component.ts} (93%) create mode 100644 portal-2/src/app/landingPages/htmlProjectReport/htmlProjectReport.module.ts rename portal-2/src/app/{services/htmlProgressReport.service.ts => landingPages/htmlProjectReport/htmlProjectReport.service.ts} (84%) delete mode 100644 portal-2/src/app/landingPages/landing-routing.module.ts create mode 100644 portal-2/src/app/landingPages/metrics.module.ts create mode 100644 portal-2/src/app/landingPages/organization/organization-routing.module.ts create mode 100644 portal-2/src/app/landingPages/organization/organization.module.ts create mode 100644 portal-2/src/app/landingPages/person/person-routing.module.ts create mode 100644 portal-2/src/app/landingPages/person/person.module.ts rename portal-2/src/app/{services => landingPages/person}/person.service.ts (91%) create mode 100644 portal-2/src/app/landingPages/project/project-routing.module.ts create mode 100644 portal-2/src/app/landingPages/project/project.module.ts create mode 100644 portal-2/src/app/landingPages/project/project.service.ts create mode 100644 portal-2/src/app/landingPages/project/projectService.module.ts create mode 100644 portal-2/src/app/landingPages/publication/publication-routing.module.ts create mode 100644 portal-2/src/app/landingPages/publication/publication.module.ts rename portal-2/src/app/{services => landingPages/publication}/publication.service.ts (99%) create mode 100644 portal-2/src/app/landingPages/resultLanding.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchDataProviders-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchDatasets-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchDatasets.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchOrganizations-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchPeople-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchPeople.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchProjects-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchProjects.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchPublications-routing.module.ts create mode 100644 portal-2/src/app/searchPages/advanced/advancedSearchPublications.module.ts create mode 100644 portal-2/src/app/searchPages/dataProviders/compatibleDataProviders-routing.module.ts create mode 100644 portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts create mode 100644 portal-2/src/app/searchPages/dataProviders/entityRegistries-routing.module.ts create mode 100644 portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts create mode 100644 portal-2/src/app/searchPages/find/mainSearch-routing.module.ts create mode 100644 portal-2/src/app/searchPages/find/mainSearch.module.ts delete mode 100644 portal-2/src/app/searchPages/search-routing.module.ts delete mode 100644 portal-2/src/app/searchPages/search.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/advancedSearchForm.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/advancedSearchPage.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/browseEntities.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/searchDownload.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/searchForm.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/searchPage.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/searchPaging.module.ts create mode 100644 portal-2/src/app/searchPages/searchUtils/searchResults.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchDataProviders-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchDataProviders.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchDatasets-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchDatasets.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchOrganizations-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchOrganizations.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchPeople-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchPeople.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchProjects-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchProjects.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchPublications-routing.module.ts create mode 100644 portal-2/src/app/searchPages/simple/searchPublications.module.ts create mode 100644 portal-2/src/app/services/dataProvidersService.module.ts create mode 100644 portal-2/src/app/services/datasetsService.module.ts create mode 100644 portal-2/src/app/services/organizationService.module.ts create mode 100644 portal-2/src/app/services/organizationsService.module.ts create mode 100644 portal-2/src/app/services/peopleService.module.ts create mode 100644 portal-2/src/app/services/projectsService.module.ts create mode 100644 portal-2/src/app/services/publicationsService.module.ts create mode 100644 portal-2/src/app/services/refineFieldResultsService.module.ts create mode 100644 portal-2/src/app/services/reportsService.module.ts delete mode 100644 portal-2/src/app/services/services.module.ts create mode 100644 portal-2/src/app/utils/altmetrics.module.ts rename portal-2/src/app/utils/{ => entitiesAutoComplete}/entitiesAutoComplete.component.ts (93%) create mode 100644 portal-2/src/app/utils/entitiesAutoComplete/entitiesAutoComplete.module.ts rename portal-2/src/app/{services => utils/entitiesAutoComplete}/entitySearch.service.ts (96%) rename portal-2/src/app/utils/{exportCSV.component.ts => exportCSV.class.ts} (85%) create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchDataproviders.class.ts create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchDatasets.class.ts create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchOrganizations.class.ts create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchPeople.class.ts create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts create mode 100644 portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts create mode 100644 portal-2/src/app/utils/iframe.module.ts create mode 100644 portal-2/src/app/utils/modal/alertModal.module.ts create mode 100644 portal-2/src/app/utils/modal/loadingModal.module.ts create mode 100644 portal-2/src/app/utils/paging.module.ts create mode 100644 portal-2/src/app/utils/routerHelper.class.ts rename portal-2/src/app/{services => utils/staticAutoComplete}/ISVocabularies.service.ts (93%) rename portal-2/src/app/utils/{ => staticAutoComplete}/staticAutoComplete.component.ts (97%) create mode 100644 portal-2/src/app/utils/staticAutoComplete/staticAutoComplete.module.ts delete mode 100644 portal-2/src/app/utils/utils.module.ts diff --git a/portal-2/README.md b/portal-2/README.md index 340849e8..87547810 100644 --- a/portal-2/README.md +++ b/portal-2/README.md @@ -53,14 +53,17 @@ constructor(element: ElementRef, renderer: Renderer) { } ``` - The application runs XHR requests on the server & once again on the Client-side (when the application bootstraps) - - Use a [UniversalCache](https://github.com/angular/universal-starter/blob/master/src/+app/shared/api.service.ts#L47-L71) instead of regular Http, to save certain requests so they aren't re-ran again on the Client. + - Use a [UniversalCache](https://github.com/angular/universal-starter/blob/master/src/%2Bapp/shared/model/model.service.ts#L34-L50) instead of regular Http, to save certain requests so they aren't re-ran again on the Client. ([Example useage here](https://github.com/angular/universal-starter/blob/cc71e2d5b2d783f2bb52eebd1b5c6fa0ba23f08a/src/%2Bapp/%2Bhome/home.component.ts#L22-L24)) - Know the difference between attributes and properties in relation to the DOM. - Keep your directives stateless as much as possible. For stateful directives, you may need to provide an attribute that reflects the corresponding property with an initial string value such as url in img tag. For our native `` element the src attribute is reflected as the src property of the element type HTMLImageElement. ### Brotli Compression Support -To enable Brotli compression for server response with fallback for gzip replace the following code from src/server.aot.ts - +To enable Brotli compression for server response with fallback for gzip. Install the following packages +``` +npm install --save-dev iltorb accepts @types/accepts express-interceptor memory-cache @types/memory-cache +``` +and replace the following code from src/server.aot.ts. ``` import * as compression from 'compression'; @@ -99,8 +102,11 @@ app.use(interceptor((req, res)=>({ } } else { const { output, encoding } = mcache.get(key); - res.setHeader('Content-Encoding', encoding); - send(output); + if(encodings.has(encoding)){ + res.setHeader('Content-Encoding', encoding); + send(output); + return; + } } send(output); } diff --git a/portal-2/package.json b/portal-2/package.json index 11bcd2c1..408753b3 100644 --- a/portal-2/package.json +++ b/portal-2/package.json @@ -77,21 +77,16 @@ "@types/express": "^4.0.32", "@types/express-serve-static-core": "^4.0.33", "@types/hammerjs": "^2.0.32", - "@types/memory-cache": "0.0.29", "@types/mime": "0.0.28", "@types/node": "^6.0.38", "@types/serve-static": "^1.7.27", "@types/webfontloader": "^1.6.27", "@ngtools/webpack": "~1.1.7", - "accepts": "^1.3.3", "angular2-template-loader": "^0.4.0", "awesome-typescript-loader": "^2.2.4", "cookie-parser": "^1.4.3", - "express-interceptor": "^1.2.0", - "iltorb": "^1.0.13", "imports-loader": "^0.6.5", "json-loader": "^0.5.4", - "memory-cache": "^0.1.6", "nodemon": "^1.10.0", "raw-loader": "^0.5.1", "reflect-metadata": "0.1.8", diff --git a/portal-2/src/app/app-routing.module.ts b/portal-2/src/app/app-routing.module.ts index bd7c54b0..88c82374 100644 --- a/portal-2/src/app/app-routing.module.ts +++ b/portal-2/src/app/app-routing.module.ts @@ -1,10 +1,144 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; +export function getPublicationModule() { + return System.import('./landingPages/publication/publication.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'PublicationModuleNgFactory' : 'PublicationModule')]); +} +export function getDatasetModule() { + return System.import('./landingPages/dataset/dataset.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DatasetModuleNgFactory' : 'DatasetModule')]); +} +export function getPersonModule() { + return System.import('./landingPages/person/person.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'PersonModuleNgFactory' : 'PersonModule')]); +} +export function getProjectModule() { + return System.import('./landingPages/project/project.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'ProjectModuleNgFactory' : 'ProjectModule')]); +} +export function getOrganizationModule() { + return System.import('./landingPages/organization/organization.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'OrganizationModuleNgFactory' : 'OrganizationModule')]); +} +export function getDepositDatasetsModule() { + return System.import('./deposit/datasets/depositDatasets.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DepositDatasetsModuleNgFactory' : 'DepositDatasetsModule')]); +} +export function getDepositDatasetsResultsModule() { + return System.import('./deposit/datasets/depositDatasetsResults.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DepositDatasetsResultsModuleNgFactory' : 'DepositDatasetsResultsModule')]); +} + +export function getDepositPublicationsModule() { + return System.import('./deposit/publications/depositPublications.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DepositPublicationsModuleNgFactory' : 'DepositPublicationsModule')]); +} +export function getDepositPublicationsResultsModule() { + return System.import('./deposit/publications/depositPublicationsResults.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DepositPublicationsResultsModuleNgFactory' : 'DepositPublicationsResultsModule')]); +} +export function getDataProviderModule() { + return System.import('./landingPages/dataProvider/dataProvider.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'DataProviderModuleNgFactory' : 'DataProviderModule')]); +} +export function getMainSearchModule() { + return System.import('./searchPages/find/mainSearch.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'MainSearchModuleNgFactory' : 'MainSearchModule')]); +} +export function getSearchPublicationsModule() { + return System.import('./searchPages/simple/searchPublications.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchPublicationsModuleNgFactory' : 'SearchPublicationsModule')]); +} +export function getSearchDatasetsModule() { + return System.import('./searchPages/simple/searchDatasets.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchDatasetsModuleNgFactory' : 'SearchDatasetsModule')]); +} +export function getSearchProjectsModule() { + return System.import('./searchPages/simple/searchProjects.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchProjectsModuleNgFactory' : 'SearchProjectsModule')]); +} +export function getSearchOrganizationsModule() { + return System.import('./searchPages/simple/searchOrganizations.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchOrganizationsModuleNgFactory' : 'SearchOrganizationsModule')]); +} +export function getSearchDataProvidersModule() { + return System.import('./searchPages/simple/searchDataProviders.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchDataProvidersModuleNgFactory' : 'SearchDataProvidersModule')]); +} +export function getSearchPeopleModule() { + return System.import('./searchPages/simple/searchPeople.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'SearchPeopleModuleNgFactory' : 'SearchPeopleModule')]); +} +export function getCompatibleDataProvidersModule() { + return System.import('./searchPages/dataProviders/compatibleDataProviders.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'CompatibleDataProvidersModuleNgFactory' : 'CompatibleDataProvidersModule')]); +} +export function getEntityRegistriesModule() { + return System.import('./searchPages/dataProviders/entityRegistries.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'EntityRegistriesModuleNgFactory' : 'EntityRegistriesModule')]); +} +export function getAdvancedSearchPublicationsModule() { + return System.import('./searchPages/advanced/advancedSearchPublications.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchPublicationsModuleNgFactory' : 'AdvancedSearchPublicationsModule')]); +} +export function getAdvancedSearchDatasetsModule() { + return System.import('./searchPages/advanced/advancedSearchDatasets.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchDatasetsModuleNgFactory' : 'AdvancedSearchDatasetsModule')]); +} +export function getAdvancedSearchOrganizationsModule() { + return System.import('./searchPages/advanced/advancedSearchOrganizations.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchOrganizationsModuleNgFactory' : 'AdvancedSearchOrganizationsModule')]); +} +export function getAdvancedSearchDataProvidersModule() { + return System.import('./searchPages/advanced/advancedSearchDataProviders.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchDataProvidersModuleNgFactory' : 'AdvancedSearchDataProvidersModule')]); +} +export function getAdvancedSearchProjectsModule() { + return System.import('./searchPages/advanced/advancedSearchProjects.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchProjectsModuleNgFactory' : 'AdvancedSearchProjectsModule')]); +} +export function getAdvancedSearchPeopleModule() { + return System.import('./searchPages/advanced/advancedSearchPeople.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'AdvancedSearchPeopleModuleNgFactory' : 'AdvancedSearchPeopleModule')]); +} +export function gethtmlProjectReportModule() { + return System.import('./landingPages/htmlProjectReport/htmlProjectReport.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'HtmlProjectReportModuleNgFactory' : 'HtmlProjectReportModule')]); +} + @NgModule({ imports: [ RouterModule.forChild([ - { path: '', redirectTo: '/search/find', pathMatch: 'full' } + { path: '', redirectTo: '/search/find', pathMatch: 'full' }, + { path: 'search/publication', loadChildren: getPublicationModule }, + { path: 'search/dataset', loadChildren: getDatasetModule }, + { path: 'search/person', loadChildren: getPersonModule }, + { path: 'search/organization', loadChildren: getOrganizationModule }, + { path: 'search/project', loadChildren: getProjectModule }, + { path: 'search/dataprovider', loadChildren: getDataProviderModule }, + { path: 'deposit-datasets', loadChildren: getDepositDatasetsModule }, + { path: 'deposit-datasets-result', loadChildren: getDepositDatasetsResultsModule }, + { path: 'deposit-publications', loadChildren: getDepositPublicationsModule }, + { path: 'deposit-publications-result', loadChildren: getDepositPublicationsResultsModule }, + { path: 'search/find', loadChildren: getMainSearchModule }, + { path: 'search/find/publications', loadChildren: getSearchPublicationsModule }, + { path: 'search/find/datasets', loadChildren: getSearchDatasetsModule }, + { path: 'search/find/projects', loadChildren: getSearchProjectsModule }, + { path: 'search/find/dataproviders', loadChildren: getSearchDataProvidersModule }, + { path: 'search/find/organizations', loadChildren: getSearchOrganizationsModule }, + { path: 'search/find/people', loadChildren: getSearchPeopleModule }, + { path: 'search/data-providers', loadChildren: getCompatibleDataProvidersModule }, + { path: 'search/entity-registries', loadChildren: getEntityRegistriesModule }, + { path: 'search/advanced/publications', loadChildren: getAdvancedSearchPublicationsModule }, + { path: 'search/advanced/datasets', loadChildren: getAdvancedSearchDatasetsModule }, + { path: 'search/advanced/organizations', loadChildren: getAdvancedSearchOrganizationsModule }, + { path: 'search/advanced/dataproviders', loadChildren: getAdvancedSearchDataProvidersModule }, + { path: 'search/advanced/projects', loadChildren: getAdvancedSearchProjectsModule }, + { path: 'search/advanced/people', loadChildren: getAdvancedSearchPeopleModule }, + { path: 'project-report', loadChildren: gethtmlProjectReportModule } + + ]) ], }) diff --git a/portal-2/src/app/app.module.ts b/portal-2/src/app/app.module.ts index 0ddfbcd5..63b94bb5 100755 --- a/portal-2/src/app/app.module.ts +++ b/portal-2/src/app/app.module.ts @@ -1,4 +1,3 @@ -//import {MaterialModule} from '@angular/material'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; @@ -8,35 +7,20 @@ import { SharedModule } from './shared/shared.module'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent, XLargeDirective } from './app.component'; -// custom modules:: -import {SearchModule} from './searchPages/search.module'; -import {DepoditModule} from './deposit/deposit.module'; -import {LandingModule} from './landingPages/landing.module'; import {SharedComponentsModule} from './sharedComponents/sharedComponents.module'; //navbar -import {UtilsModule} from './utils/utils.module'; -import {TestModule} from './test/test.module'; -import { HomeModule } from './home/home.module'; import { ErrorModule } from './error/error.module'; +import { CacheService } from './shared/cache.service'; -import {ServicesModule} from './services/services.module'; @NgModule({ declarations: [ AppComponent, XLargeDirective ], imports: [ - //MaterialModule.forRoot(), SharedModule, - HomeModule, - SearchModule, - DepoditModule, - LandingModule, + SharedComponentsModule, - UtilsModule, - ServicesModule, - TestModule, - HomeModule, AppRoutingModule, ErrorModule - ], exports:[] + ], exports:[], providers:[CacheService] }) export class AppModule { } diff --git a/portal-2/src/app/deposit/datasets/depositDatasets-routing.module.ts b/portal-2/src/app/deposit/datasets/depositDatasets-routing.module.ts new file mode 100644 index 00000000..d976262c --- /dev/null +++ b/portal-2/src/app/deposit/datasets/depositDatasets-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { DepositDatasetsComponent } from './depositDatasets.component'; +import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: DepositDatasetsComponent } + + ]) + ] +}) +export class DepositDatasetsRoutingModule { } diff --git a/portal-2/src/app/deposit/depositDatasets.component.ts b/portal-2/src/app/deposit/datasets/depositDatasets.component.ts similarity index 99% rename from portal-2/src/app/deposit/depositDatasets.component.ts rename to portal-2/src/app/deposit/datasets/depositDatasets.component.ts index 1b2194e9..489e60d9 100644 --- a/portal-2/src/app/deposit/depositDatasets.component.ts +++ b/portal-2/src/app/deposit/datasets/depositDatasets.component.ts @@ -1,5 +1,5 @@ import {Component} from '@angular/core'; - + @Component({ selector: 'deposit-datasets', template: ` diff --git a/portal-2/src/app/deposit/datasets/depositDatasets.module.ts b/portal-2/src/app/deposit/datasets/depositDatasets.module.ts new file mode 100644 index 00000000..ae2630a4 --- /dev/null +++ b/portal-2/src/app/deposit/datasets/depositDatasets.module.ts @@ -0,0 +1,28 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { DepositDatasetsComponent } from './depositDatasets.component'; +import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; + +import {DepositDatasetsRoutingModule} from './depositDatasets-routing.module'; +import {DepoditModule} from '../deposit.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + DepoditModule, + DepositDatasetsRoutingModule + ], + declarations: [ + + DepositDatasetsComponent, + + ], + exports: [ + DepositDatasetsComponent, + ], + providers: [ + ] +}) +export class DepositDatasetsModule { } diff --git a/portal-2/src/app/deposit/depositDatasetsResult.component.ts b/portal-2/src/app/deposit/datasets/depositDatasetsResult.component.ts similarity index 100% rename from portal-2/src/app/deposit/depositDatasetsResult.component.ts rename to portal-2/src/app/deposit/datasets/depositDatasetsResult.component.ts diff --git a/portal-2/src/app/deposit/datasets/depositDatasetsResults-routing.module.ts b/portal-2/src/app/deposit/datasets/depositDatasetsResults-routing.module.ts new file mode 100644 index 00000000..8356b40a --- /dev/null +++ b/portal-2/src/app/deposit/datasets/depositDatasetsResults-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: DepositDatasetsResultComponent } + + ]) + ] +}) +export class DepositDatasetsResultsRoutingModule { } diff --git a/portal-2/src/app/deposit/datasets/depositDatasetsResults.module.ts b/portal-2/src/app/deposit/datasets/depositDatasetsResults.module.ts new file mode 100644 index 00000000..428e7327 --- /dev/null +++ b/portal-2/src/app/deposit/datasets/depositDatasetsResults.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; + +import {DepositDatasetsResultsRoutingModule} from './depositDatasetsResults-routing.module'; +import {DepoditModule} from '../deposit.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + DepoditModule, + DepositDatasetsResultsRoutingModule + ], + declarations: [ + + DepositDatasetsResultComponent, + + ], + exports: [ + DepositDatasetsResultComponent, + ], + providers: [ + ] +}) +export class DepositDatasetsResultsModule { } diff --git a/portal-2/src/app/deposit/deposit-routing.module.ts b/portal-2/src/app/deposit/deposit-routing.module.ts deleted file mode 100644 index 0db66c1f..00000000 --- a/portal-2/src/app/deposit/deposit-routing.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import { DepositPublicationsComponent } from './depositPublications.component'; -import { DepositDatasetsComponent } from './depositDatasets.component'; -import { DepositPublicationsResultComponent } from './depositPublicationsResult.component'; -import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: 'deposit-publications', component: DepositPublicationsComponent }, - { path: 'deposit-datasets', component: DepositDatasetsComponent }, - { path: 'deposit-publications-result', component: DepositPublicationsResultComponent} , - { path: 'deposit-datasets-result', component: DepositDatasetsResultComponent }, - - ]) - ] -}) -export class DepositRoutingModule { } diff --git a/portal-2/src/app/deposit/deposit.component.ts b/portal-2/src/app/deposit/deposit.component.ts index 3e182db8..ff085191 100644 --- a/portal-2/src/app/deposit/deposit.component.ts +++ b/portal-2/src/app/deposit/deposit.component.ts @@ -3,7 +3,6 @@ import {Observable} from 'rxjs/Observable'; import { Router } from '@angular/router'; import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties'; -import {SearchOrganizationsService} from '../services/searchOrganizations.service'; @Component({ selector: 'deposit', @@ -64,7 +63,7 @@ export class DepositComponent { public selectedId: string = ""; public warningMessage: string = ""; - constructor (private _router: Router, private _searchOrganizationsService: SearchOrganizationsService) { + constructor (private _router: Router) { this.openAccess = OpenaireProperties.getOpenAccess(); this.openAccessRepo = OpenaireProperties.getOpenAccessRepo(); diff --git a/portal-2/src/app/deposit/deposit.module.ts b/portal-2/src/app/deposit/deposit.module.ts index 8dd7495a..eef2e6c4 100644 --- a/portal-2/src/app/deposit/deposit.module.ts +++ b/portal-2/src/app/deposit/deposit.module.ts @@ -1,41 +1,30 @@ +/* Common Component of deposit for both datasets & ppublications*/ + import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; -import { UtilsModule} from '../utils/utils.module' - import { DepositComponent } from './deposit.component'; import { DepositResultComponent } from './depositResult.component'; -import { DepositPublicationsComponent } from './depositPublications.component'; -import { DepositPublicationsResultComponent } from './depositPublicationsResult.component'; -import { DepositDatasetsComponent } from './depositDatasets.component'; -import { DepositDatasetsResultComponent } from './depositDatasetsResult.component'; +import {EntitiesAutocompleteModule} from '../utils/entitiesAutoComplete/entitiesAutoComplete.module'; +import {DataProvidersServiceModule} from '../services/dataProvidersService.module'; +import {OrganizationServiceModule} from '../services/organizationService.module'; -import {ServicesModule} from '../services/services.module'; -import {SearchModule} from '../searchPages/search.module'; -import {DepositRoutingModule} from './deposit-routing.module'; - -//helpers - -@NgModule({ + @NgModule({ imports: [ CommonModule, FormsModule, - UtilsModule, - ServicesModule, - SearchModule, - DepositRoutingModule + EntitiesAutocompleteModule, + DataProvidersServiceModule, + OrganizationServiceModule ], declarations: [ DepositComponent, - DepositResultComponent, - DepositPublicationsComponent, - DepositPublicationsResultComponent, - DepositDatasetsComponent, - DepositDatasetsResultComponent + DepositResultComponent ], exports: [ - //DepositComponent + DepositComponent, + DepositResultComponent ], providers: [ ] diff --git a/portal-2/src/app/deposit/depositResult.component.ts b/portal-2/src/app/deposit/depositResult.component.ts index 0a6f1e17..fed7733c 100644 --- a/portal-2/src/app/deposit/depositResult.component.ts +++ b/portal-2/src/app/deposit/depositResult.component.ts @@ -3,9 +3,8 @@ import {Observable} from 'rxjs/Observable'; import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties'; import { Router } from '@angular/router'; import { ActivatedRoute } from '@angular/router'; -import { SearchDataprovidersComponent } from '../searchPages/simple/searchDataproviders.component'; +import { FetchDataproviders } from '../utils/fetchEntitiesClasses/fetchDataproviders.class'; import { SearchDataprovidersService } from '../services/searchDataproviders.service'; -import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.component'; import {OrganizationService} from '../services/organization.service'; @@ -17,13 +16,15 @@ import {OrganizationService} from '../services/organization.service';

Deposit {{requestFor}}

- -
-

+ +
+

Data providers for institution: {{organization['name']}} () @@ -31,19 +32,21 @@ import {OrganizationService} from '../services/organization.service'; {{organization['name']}}

-

Please use the information/contacts shown below to deposit your {{requestFor}}.

- -
- +
-

"; - info += "

"+this.searchPublicationsComponent.searchUtils.totalResults+" publications

"; + info += "

"+this.fetchPublications.searchUtils.totalResults+" publications

"; - let htmlParams = 'resources?format=html&page=0&size='+this.searchPublicationsComponent.searchUtils.totalResults+'&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "'+this.projectId+'"))'; + let htmlParams = 'resources?format=html&page=0&size='+this.fetchPublications.searchUtils.totalResults+'&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "'+this.projectId+'"))'; this._reportsService.downloadHTMLFile(this.downloadURLAPI+htmlParams, info) .subscribe(data => this.funct(data), error => console.log("Error downloading the file."), diff --git a/portal-2/src/app/landingPages/project/project.module.ts b/portal-2/src/app/landingPages/project/project.module.ts new file mode 100644 index 00000000..71028d44 --- /dev/null +++ b/portal-2/src/app/landingPages/project/project.module.ts @@ -0,0 +1,36 @@ +//import {MaterialModule} from '@angular/material'; +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { ProjectServiceModule} from './projectService.module'; +// import {HtmlProgressReportService} from './htmlProgressReport.service'; + +import { ProjectComponent } from './project.component'; +import { ProjectRoutingModule } from './project-routing.module'; +import {IFrameModule} from '../../utils/iframe.module'; +import {MetricsModule} from '../metrics.module'; +import {ReportsServiceModule} from '../../services/reportsService.module'; +import {PublicationsServiceModule} from '../../services/publicationsService.module'; +import {DatasetsServiceModule} from '../../services/datasetsService.module'; +import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module'; +import { LandingModule } from '../landing.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, LandingModule, + ProjectRoutingModule, + SearchResultsModule, IFrameModule, MetricsModule, ReportsServiceModule, PublicationsServiceModule, DatasetsServiceModule, ProjectServiceModule + ], + declarations: [ + ProjectComponent + ], + providers:[ + // ProjectService, + // HtmlProgressReportService + ], + exports: [ + ProjectComponent + ] +}) +export class ProjectModule { } diff --git a/portal-2/src/app/landingPages/project/project.service.ts b/portal-2/src/app/landingPages/project/project.service.ts new file mode 100644 index 00000000..03c5d7d3 --- /dev/null +++ b/portal-2/src/app/landingPages/project/project.service.ts @@ -0,0 +1,200 @@ +import {Injectable} from '@angular/core'; +import {Http, Response} from '@angular/http'; +import {Observable} from 'rxjs/Observable'; +import {ProjectInfo} from '../../utils/entities/projectInfo'; +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; +import 'rxjs/add/observable/of'; +import 'rxjs/add/operator/do'; +import 'rxjs/add/operator/share'; +import { CacheService } from '../../shared/cache.service'; +@Injectable() +export class ProjectService { + + constructor(private http: Http, public _cache: CacheService) {} + + projectInfo: ProjectInfo; + + getProjectInfo (id: string):any { + console.info("getProjectInfo in service"); + + let url = OpenaireProperties. getSearchAPIURLLast() + 'projects/'+id+"?format=json"; + let key = url; + if (this._cache.has(key)) { + return Observable.of(this._cache.get(key)) + .map(res => this.parseProjectInfo(res)); + } + return this.http.get(url) + .map(res => res.json()) + .map(res => res['result']['metadata']['oaf:entity']['oaf:project']) + .map(res => [res, + res['fundingtree'], + res['rels']['rel']]) + .do(res => { + this._cache.set(key, res); + }) + .map(res => this.parseProjectInfo(res)); + + } + + /* + get project strtDate and endDate + */ + getProjectDates (id: string):any { + + let url = OpenaireProperties. getSearchAPIURLLast()+'projects/'+id+"?format=json"; + let key = url+'_projectDates'; + if (this._cache.has(key)) { + return Observable.of(this._cache.get(key)) + .map(res => [res, + res['fundingtree'], + res['rels']['rel']]) + .map(res => this.parseProjectDates(id,res)) + } + return this.http.get(url) + .map(res => res.json()) + .map(res => res['result']['metadata']['oaf:entity']['oaf:project']) + .do(res => { + this._cache.set(key, res); + }) + .map(res => [res, + res['fundingtree'], + res['rels']['rel']]) + .map(res => this.parseProjectDates(id,res)) + + } + + getHTMLInfo(id: string): any { + console.info("getHTMLInfo in service"); + + let url = OpenaireProperties. getSearchAPIURLLast() + 'projects/'+id+"?format=json"; + let key = url; + if (this._cache.has(key)) { + return Observable.of(this._cache.get(key)) + .map(res => this.parseHTMLInfo(res)); + } + return this.http.get(url) + .map(res => res.json()) + .map(res => res['result']['metadata']['oaf:entity']['oaf:project']) + .do(res => { + this._cache.set(key, res); + }) + .map(res => this.parseHTMLInfo(res)); + } + + private handleError (error: Response) { + // in a real world app, we may send the error to some remote logging infrastructure + // instead of just logging it to the console + console.log(error); + return Observable.throw(error || 'Server error'); + } + + parseHTMLInfo (data: any):any { + let htmlInfo: {"title": string, "acronym": string, "callIdentifier": string}; + + if(data != null) { + htmlInfo = {"title": data.title, "acronym": data.acronym, "callIdentifier": data.callidentifier}; + } + console.info(htmlInfo); + return htmlInfo; + } + + parseProjectInfo (data: any):any { + this.projectInfo = new ProjectInfo(); + + if(data[0] != null) { + this.projectInfo.acronym = data[0].acronym; + this.projectInfo.title = data[0].title; + this.projectInfo.callIdentifier = data[0].callidentifier; + this.projectInfo.contractNum = data[0].code; + this.projectInfo.startDate = data[0].startdate; + this.projectInfo.endDate = data[0].enddate; + this.projectInfo.openAccessMandate = data[0].oamandatepublications; + this.projectInfo.specialClause39 = data[0].ecsc39; + } + if(data[1] != null) { + if(data[1]['funder'] != null) { + this.projectInfo.funder = data[1]['funder'].shortname; + } + + let funding; + this.projectInfo.funding = ""; + + if(data[1]['funding_level_2'] != null) { + funding = data[1]['funding_level_2'].id; + } else if(data[1]['funding_level_1'] != null) { + funding = data[1]['funding_level_1'].id; + } else if(data[1]['funding_level_0'] != null) { + funding = data[1]['funding_level_0'].id; + } + + if(funding != undefined) { + funding = funding.split("::"); + for(let i=1; i(); + + let name = ""; + let url = ""; + + if(!Array.isArray(data[2])) { + if(data[2].hasOwnProperty("legalshortname")) { + name = data[2].legalshortname; + } else if(data[2].hasOwnProperty("legalname")) { + name = data[2].legalname; + } + + if(data[2].hasOwnProperty("to") && name != "") { + url = OpenaireProperties.getsearchLinkToOrganization()+data[2]['to'].content; + } + if(name != "") { + this.projectInfo.organizations.set(name, url); + } + } else { + for(let i=0; iView less authors
- + + {{item['name']}}; diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders-routing.module.ts new file mode 100644 index 00000000..981e2fbf --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchDataProvidersComponent} from './advancedSearchDataProviders.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchDataProvidersComponent } + + ]) + ] +}) +export class AdvancedSearchDataProvidersRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.module.ts new file mode 100644 index 00000000..22dff9a1 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchDataProvidersRoutingModule} from './advancedSearchDataProviders-routing.module'; +import{AdvancedSearchDataProvidersComponent} from './advancedSearchDataProviders.component'; + + +import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + DataProvidersServiceModule, + AdvancedSearchDataProvidersRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchDataProvidersComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchDataProvidersComponent + ] +}) +export class AdvancedSearchDataProvidersModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDatasets-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets-routing.module.ts new file mode 100644 index 00000000..d3c04537 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchDatasetsComponent} from './advancedSearchDatasets.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchDatasetsComponent } + + ]) + ] +}) +export class AdvancedSearchDatasetsRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.module.ts new file mode 100644 index 00000000..3f4b53fe --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchDatasetsRoutingModule} from './advancedSearchDatasets-routing.module'; +import{AdvancedSearchDatasetsComponent} from './advancedSearchDatasets.component'; + + +import {DatasetsServiceModule} from '../../services/datasetsService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + DatasetsServiceModule, + AdvancedSearchDatasetsRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchDatasetsComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchDatasetsComponent + ] +}) +export class AdvancedSearchDatasetsModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations-routing.module.ts new file mode 100644 index 00000000..73bf1720 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchOrganizationsComponent} from './advancedSearchOrganizations.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchOrganizationsComponent } + + ]) + ] +}) +export class AdvancedSearchOrganizationsRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.module.ts new file mode 100644 index 00000000..dce63f08 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchOrganizationsRoutingModule} from './advancedSearchOrganizations-routing.module'; +import{AdvancedSearchOrganizationsComponent} from './advancedSearchOrganizations.component'; + + +import {OrganizationsServiceModule} from '../../services/organizationsService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + OrganizationsServiceModule, + AdvancedSearchOrganizationsRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchOrganizationsComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchOrganizationsComponent + ] +}) +export class AdvancedSearchOrganizationsModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPeople-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPeople-routing.module.ts new file mode 100644 index 00000000..76ab818f --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPeople-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchPeopleComponent} from './advancedSearchPeople.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchPeopleComponent } + + ]) + ] +}) +export class AdvancedSearchPeopleRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPeople.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPeople.module.ts new file mode 100644 index 00000000..8192f3c1 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPeople.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchPeopleRoutingModule} from './advancedSearchPeople-routing.module'; +import{AdvancedSearchPeopleComponent} from './advancedSearchPeople.component'; + + +import {PeopleServiceModule} from '../../services/peopleService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + PeopleServiceModule, + AdvancedSearchPeopleRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchPeopleComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchPeopleComponent + ] +}) +export class AdvancedSearchPeopleModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchProjects-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchProjects-routing.module.ts new file mode 100644 index 00000000..2948f8da --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchProjects-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchProjectsComponent} from './advancedSearchProjects.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchProjectsComponent } + + ]) + ] +}) +export class AdvancedSearchProjectsRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchProjects.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchProjects.module.ts new file mode 100644 index 00000000..caa7787d --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchProjects.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchProjectsRoutingModule} from './advancedSearchProjects-routing.module'; +import{AdvancedSearchProjectsComponent} from './advancedSearchProjects.component'; + + +import {ProjectsServiceModule} from '../../services/projectsService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + ProjectsServiceModule, + AdvancedSearchProjectsRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchProjectsComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchProjectsComponent + ] +}) +export class AdvancedSearchProjectsModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPublications-routing.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPublications-routing.module.ts new file mode 100644 index 00000000..97a2fda8 --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPublications-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{AdvancedSearchPublicationsComponent} from './advancedSearchPublications.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: AdvancedSearchPublicationsComponent } + + ]) + ] +}) +export class AdvancedSearchPublicationsRoutingModule { } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPublications.module.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPublications.module.ts new file mode 100644 index 00000000..c6f0cfcd --- /dev/null +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPublications.module.ts @@ -0,0 +1,28 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ AdvancedSearchPublicationsRoutingModule} from './advancedSearchPublications-routing.module'; +import{AdvancedSearchPublicationsComponent} from './advancedSearchPublications.component'; + + +import {PublicationsServiceModule} from '../../services/publicationsService.module'; + import {AdvancedSearchPageModule} from '../searchUtils/advancedSearchPage.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + PublicationsServiceModule, + AdvancedSearchPublicationsRoutingModule, AdvancedSearchPageModule + + ], + declarations: [ + AdvancedSearchPublicationsComponent + ], + providers:[ + ], + exports: [ + AdvancedSearchPublicationsComponent + ] +}) +export class AdvancedSearchPublicationsModule { } diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders-routing.module.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders-routing.module.ts new file mode 100644 index 00000000..4e474f98 --- /dev/null +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{SearchCompatibleDataprovidersComponent} from './compatibleDataProviders.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SearchCompatibleDataprovidersComponent } + + ]) + ] +}) +export class CompatibleDataProvidersRoutingModule { } diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts index a05309b9..4616295b 100644 --- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts @@ -9,7 +9,7 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro import {SearchFields} from '../../utils/properties/searchFields'; import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; -import {ExportCSVComponent} from '../../utils/exportCSV.component'; +import {ExportCSVComponent} from '../../utils/exportCSV.class'; @Component({ selector: 'search-dataproviders', diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts new file mode 100644 index 00000000..d5497968 --- /dev/null +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts @@ -0,0 +1,29 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ CompatibleDataProvidersRoutingModule} from './compatibleDataProviders-routing.module'; +import{SearchCompatibleDataprovidersComponent} from './compatibleDataProviders.component'; + +import {SearchResultsModule } from '../searchUtils/searchResults.module'; + +import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; +import {SearchFormModule} from '../searchUtils/searchForm.module'; +import {SearchPageModule} from '../searchUtils/searchPage.module'; +@NgModule({ + imports: [ + CommonModule, FormsModule, + DataProvidersServiceModule, + SearchFormModule, SearchResultsModule, CompatibleDataProvidersRoutingModule, SearchPageModule + + ], + declarations: [ + SearchCompatibleDataprovidersComponent + ], + providers:[ + ], + exports: [ + SearchCompatibleDataprovidersComponent + ] +}) +export class CompatibleDataProvidersModule { } diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries-routing.module.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries-routing.module.ts new file mode 100644 index 00000000..ab2bb1ab --- /dev/null +++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{SearchEntityRegistriesComponent} from './entityRegistries.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SearchEntityRegistriesComponent } + + ]) + ] +}) +export class EntityRegistriesRoutingModule { } diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts index f09c78c8..ec4dbb2e 100644 --- a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts @@ -9,7 +9,7 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro import {SearchFields} from '../../utils/properties/searchFields'; import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; -import {ExportCSVComponent} from '../../utils/exportCSV.component'; +import {ExportCSVComponent} from '../../utils/exportCSV.class'; @Component({ selector: 'search-entity-registries', diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts new file mode 100644 index 00000000..0512597c --- /dev/null +++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts @@ -0,0 +1,29 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{ EntityRegistriesRoutingModule} from './entityRegistries-routing.module'; +import{SearchEntityRegistriesComponent} from './entityRegistries.component'; + +import {SearchResultsModule } from '../searchUtils/searchResults.module'; + +import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; +import {SearchFormModule} from '../searchUtils/searchForm.module'; +import {SearchPageModule} from '../searchUtils/searchPage.module'; +@NgModule({ + imports: [ + CommonModule, FormsModule, + DataProvidersServiceModule, + SearchFormModule, SearchResultsModule, EntityRegistriesRoutingModule, SearchPageModule + + ], + declarations: [ + SearchEntityRegistriesComponent + ], + providers:[ + ], + exports: [ + SearchEntityRegistriesComponent + ] +}) +export class EntityRegistriesModule { } diff --git a/portal-2/src/app/searchPages/find/mainSearch-routing.module.ts b/portal-2/src/app/searchPages/find/mainSearch-routing.module.ts new file mode 100644 index 00000000..362ef038 --- /dev/null +++ b/portal-2/src/app/searchPages/find/mainSearch-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import{SearchComponent} from './search.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SearchComponent } + + ]) + ] +}) +export class MainSearchRoutingModule { } diff --git a/portal-2/src/app/searchPages/find/mainSearch.module.ts b/portal-2/src/app/searchPages/find/mainSearch.module.ts new file mode 100644 index 00000000..98a44512 --- /dev/null +++ b/portal-2/src/app/searchPages/find/mainSearch.module.ts @@ -0,0 +1,36 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import{MainSearchRoutingModule} from './mainSearch-routing.module'; +import{SearchComponent} from './search.component'; + +import {SearchResultsModule } from '../searchUtils/searchResults.module'; + +import {DataProvidersServiceModule} from '../../services/dataProvidersService.module'; +import {DatasetsServiceModule} from '../../services/datasetsService.module'; +import {ProjectsServiceModule} from '../../services/projectsService.module'; +import {PublicationsServiceModule} from '../../services/publicationsService.module'; +import {OrganizationsServiceModule} from '../../services/organizationsService.module'; +import {PeopleServiceModule} from '../../services/peopleService.module'; +import {BrowseEntitiesModule} from '../searchUtils/browseEntities.module'; +import {SearchFormModule} from '../searchUtils/searchForm.module'; + +@NgModule({ + imports: [ + CommonModule, FormsModule, + DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, + PublicationsServiceModule, OrganizationsServiceModule, PeopleServiceModule, + BrowseEntitiesModule, SearchFormModule, SearchResultsModule, MainSearchRoutingModule + + ], + declarations: [ + SearchComponent + ], + providers:[ + ], + exports: [ + SearchComponent + ] +}) +export class MainSearchModule { } diff --git a/portal-2/src/app/searchPages/find/search.component.ts b/portal-2/src/app/searchPages/find/search.component.ts index a3935323..32025614 100644 --- a/portal-2/src/app/searchPages/find/search.component.ts +++ b/portal-2/src/app/searchPages/find/search.component.ts @@ -1,14 +1,15 @@ -import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core'; +import {Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; -import { SearchPublicationsComponent } from '../simple/searchPublications.component'; -import { SearchDataprovidersComponent } from '../simple/searchDataproviders.component'; -import { SearchProjectsComponent } from '../simple/searchProjects.component'; -import { SearchDatasetsComponent } from '../simple/searchDatasets.component'; -import { SearchOrganizationsComponent } from '../simple/searchOrganizations.component'; -import { SearchPeopleComponent } from '../simple/searchPeople.component'; + +import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class'; +import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class'; +import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class'; +import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class'; +import { FetchOrganizations } from '../../utils/fetchEntitiesClasses/fetchOrganizations.class'; +import { FetchPeople } from '../../utils/fetchEntitiesClasses/fetchPeople.class'; import {SearchPublicationsService} from '../../services/searchPublications.service'; import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; @@ -21,9 +22,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {SearchFields} from '../../utils/properties/searchFields'; @Component({ + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, selector: 'search-find', template: ` -