[Aggregator|Trunk]

add trunk and branch folders
	commit initial search functionalities of aggregator portal



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-aggregator-portal/trunk@55685 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-05-23 12:20:48 +00:00
commit 063a9494e6
14 changed files with 1154 additions and 0 deletions

54
README.md Normal file
View File

@ -0,0 +1,54 @@
# Angular Universal & Anguar-CLI minimal starter
> This demo is built following the [Angular-CLI Wiki guide](https://github.com/angular/angular-cli/wiki/stories-universal-rendering)
We're utilizing packages from the [Angular Universal @nguniversal](https://github.com/angular/universal) repo, such as [ng-module-map-ngfactory-loader](https://github.com/angular/universal/tree/master/modules/module-map-ngfactory-loader) to enable Lazy Loading.
---
## Static or Dynamic
This repo demonstrates the use of 2 different forms of Server Side Rendering.
**Static** Also known as "prerendering"
* Happens at build time
* Renders your application and replaces the dist index.html with a version rendered at the route `/`.
**Dynamic**
* Happens at runtime
* Uses `ngExpressEngine` to render you application on the fly at the requested url.
---
## Installation
* `npm install` or `yarn`
---
## Development (Client-side only rendering)
* run `npm run start` which will start `ng serve` (project served at the standard: localhost:4200)
---
## Production
Depending on whether you're publishing dynamic or static prerendering, run the build command, and then serve up your dist folder assets.
> **NOTE**: To deploy your **Static** site to a static hosting platform you will have to deploy the *`dist/browser`* folder, rather than the usual *`dist`*
ie: `npm run build:dynamic` or `npm run build:static`. All of the files that need to be served will be found within the `/dist` folder.
---
## Testing Universal (dynamic or static) builds -Locally-
**Dynamic** : **`npm run start:dynamic`**
Compiles your application and spins up a Node Express to dynamically serve your Universal application on `http://localhost:4000`.
**Static** : **`npm run start:static`**
- Compiles your application and prerenders your applications files, spinning up a demo http-server so you can view it on `http://127.0.0.1:8080`

267
angular.json Normal file
View File

@ -0,0 +1,267 @@
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"openaire-search": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/browser",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/robots.txt",
{
"glob": "sitemap.xml",
"input": "src/sitemaps",
"output": "/"
},
{
"glob": "sitemap.xml",
"input": "src/sitemaps",
"output": "/assets"
},
{
"glob": "**/*",
"input": "src/sitemaps/publication",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/dataset",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/software",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/other",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/project",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/organization",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/dataprovider",
"output": "/"
}
],
"styles": [
"src/styles.css",
"node_modules/datatables.net-dt/css/jquery.dataTables.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.js",
"node_modules/datatables.net/js/jquery.dataTables.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "openaire-search:build"
},
"configurations": {
"production": {
"browserTarget": "openaire-search:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "openaire-search:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/jquery/dist/jquery.js",
"node_modules/datatables.net/js/jquery.dataTables.js"
],
"styles": [
"src/styles.css",
"node_modules/datatables.net-dt/css/jquery.dataTables.css"
],
"assets": [
"src/assets",
"src/robots.txt",
{
"glob": "sitemap.xml",
"input": "src/sitemaps",
"output": "/"
},
{
"glob": "sitemap.xml",
"input": "src/sitemaps",
"output": "/assets"
},
{
"glob": "**/*",
"input": "src/sitemaps/publication",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/dataset",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/software",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/other",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/project",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/organization",
"output": "/"
},
{
"glob": "**/*",
"input": "src/sitemaps/dataprovider",
"output": "/"
}
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/server",
"main": "src/main.server.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
}
}
},
"openaire-search-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "openaire-search:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "openaire-search",
"schematics": {
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:component": {
"spec": false,
"inlineStyle": true,
"inlineTemplate": true,
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"spec": false,
"prefix": "app"
},
"@schematics/angular:guard": {
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
}
}

View File

@ -0,0 +1,96 @@
{
"environment" : "beta",
"enablePiwikTrack" : true,
"enableHelper" : true,
"useCache" : true,
"metricsAPIURL" : "https://beta.services.openaire.eu/usagestats/",
"framesAPIURL" : "https://beta.openaire.eu/stats3/",
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
"claimsAPIURL" : "https://beta.services.openaire.eu/claims/rest/claimsService/",
"searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/",
"searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",
"csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports",
"searchCrossrefAPIURL" : "https://api.crossref.org/works",
"searchDataciteAPIURL" : "https://api.datacite.org/works",
"searchOrcidURL" : "https://pub.orcid.org/v2.1/",
"pmidURL" : "http://www.ncbi.nlm.nih.gov/pubmed/",
"doiURL" : "https://dx.doi.org/",
"cordisURL" : "http://cordis.europa.eu/projects/",
"pmcURL" : "http://europepmc.org/articles/",
"handleURL" : "http://hdl.handle.net/",
"openDoarURL": "http://v2.sherpa.ac.uk/id/repository/",
"r3DataURL": "http://service.re3data.org/repository/",
"zenodo" : "https://zenodo.org/",
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234",
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310",
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
"uploadService" : "https://demo.openaire.eu/upload/",
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=",
"piwikSiteId" : "6",
"loginUrl" :"https://beta.services.openaire.eu/uoa-user-management/openid_connect_login",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".openaire.eu",
"feedbackmail" :"openaire.test@gmail.com",
"helperPageUrl" :"http://scoobydoo.di.uoa.gr:16000/api/page/route",
"cacheUrl" :"https://demo.openaire.eu/cache/get?url=",
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/",
"adminToolsAPIURL" :"https://beta.services.openaire.eu/uoa-admin-tools/",
"adminToolsCommunity" :"openaire",
"contextsAPI":"https://beta.services.openaire.eu/openaire/context",
"communityAPI": "https://beta.services.openaire.eu/openaire/community/",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,
"baseLink" : "https://beta.explore.openaire.eu",
"searchLinkToPublication" : "/search/publication?articleId=",
"searchLinkToProject" : "/search/project?projectId=",
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
"searchLinkToDataset" : "/search/dataset?datasetId=",
"searchLinkToOrp" : "/search/other?orpId=",
"searchLinkToOrganization" : "/search/organization?organizationId=",
"searchLinkToPublications" : "/search/find/publications",
"searchLinkToDataProviders" : "/search/find/dataproviders",
"searchLinkToProjects" : "/search/find/projects",
"searchLinkToDatasets" : "/search/find/datasets",
"searchLinkToSoftware" : "/search/find/software",
"searchLinkToOrps" : "/search/find/other",
"searchLinkToOrganizations" : "/search/find/organizations",
"searchLinkToCompatibleDataProviders" : "/search/content-providers",
"searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table",
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries",
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table",
"searchLinkToJournals" : "/search/journals",
"searchLinkToJournalsTable" : "/search/journals-table",
"searchLinkToAdvancedPublications" : "/search/advanced/publications",
"searchLinkToAdvancedProjects" : "/search/advanced/projects",
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
"searchLinkToAdvancedSoftware" : "/search/advanced/software",
"searchLinkToAdvancedOrps" : "/search/advanced/other",
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
"lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows",
"showLastIndexInformationLink" : false,
"widgetLink" : "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
"claimsInformationLink": "https://beta.openaire.eu/linking"
}

14
deploy/copysitemaps Normal file
View File

@ -0,0 +1,14 @@
cp /home/argiro.kokogiannaki/sitemap/dataset/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/dataset/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/publication/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/publication/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/software/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/software/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/other/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/other/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/project/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/project/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/organization/* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/organization/* dist/browser/;
cp /home/argiro.kokogiannaki/sitemap/dataprovider//* dist/server/;
cp /home/argiro.kokogiannaki/sitemap/dataprovider/* dist/browser/;

44
deploy/prepareDeploy.sh Executable file
View File

@ -0,0 +1,44 @@
#ATTENTION
#DON'T run it in svn folder - it REMOVES files
#Copy project in another file "deploy-folder"
#cd "deploy-folder"
#run the script
## cp the file according to the deploy environment
# cp production-properties.json ../src/assets/env-properties.json;
# cp test-properties.json ../src/assets/env-properties.json;
# cp beta-properties.json ../src/assets/env-properties.json;
## uncommect from here-->
# echo -n 'Check that you have the correct properties file';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/assets/env-properties.json;
# echo 'For Production keep meta for bots';
# echo -n 'Check index.html: For test keep meta for noindex, for production remove noindex and keep meta for Search engines verification';
# echo -n "Press key:";
# read -n1 ans
# echo -n "Pressed";
# pico ../src/index.html;
# echo -n 'Check Robots.txt: For test and beta add "Diasallow /", for production remove it!';
# echo -n "Press key:";
# read -n1 ans
# echo -n "Pressed";
# pico ../src/robots.txt;
# rm -rf ../src/assets/common-assets/.svn/;
# rm -rf ../src/app/openaireLibrary/.svn/;
# cd ..; npm run build:ssr; cd deploy;
# rm -rf ../src ../node_modules ../.idea/ ../installOpenaireLib.sh;
# cd ..; rm -rf deploy;
# echo 'Now copy to the server!'
##<-- to here
#Deploy instructions!
#copy "deploy-folder" in beta.explore.openaire.eu, test.openaire.eu or explore.openaire.eu depending which in environment want to deploy and properties selected
#copies of previous deployments exist in "/home/argiro.kokogiannaki/deployments-folder/dashboardYYYY-MM-DD"
#run "npm i"
#become nodejs user: "sudo su nodejs -s /bin/bash"
#go to "cd /srv/www/portal"
#cp files from "cp -r HOME_PATH/deployments-folder/* ."
#restart portal "pm2 restart openaire"

View File

@ -0,0 +1,94 @@
{
"environment" : "production",
"enablePiwikTrack" : true,
"enableHelper" : true,
"useCache" : true,
"metricsAPIURL" : "https://services.openaire.eu/usagestats/",
"framesAPIURL" : "https://www.openaire.eu/stats3/",
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://www.openaire.eu/stats/",
"claimsAPIURL" : "https://services.openaire.eu/claims/rest/claimsService/",
"searchAPIURLLAst" : "https://services.openaire.eu/search/v2/api/",
"searchResourcesAPIURL" : "https://services.openaire.eu/search/v2/api/resources",
"openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=",
"csvAPIURL" : "https://services.openaire.eu/search/v2/api/reports",
"searchCrossrefAPIURL" : "https://api.crossref.org/works",
"searchDataciteAPIURL" : "https://api.datacite.org/works",
"searchOrcidURL" : "https://pub.orcid.org/v2.1/",
"pmidURL" : "http://www.ncbi.nlm.nih.gov/pubmed/",
"doiURL" : "https://dx.doi.org/",
"cordisURL" : "http://cordis.europa.eu/projects/",
"pmcURL" : "http://europepmc.org/articles/",
"handleURL" : "http://hdl.handle.net/",
"openDoarURL": "http://v2.sherpa.ac.uk/id/repository/",
"r3DataURL": "http://service.re3data.org/repository/",
"zenodo" : "https://zenodo.org/",
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234",
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310",
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
"uploadService" : "https://explore.openaire.eu/upload/",
"vocabulariesAPI" :"https://services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=",
"piwikSiteId" : "109",
"loginUrl" :"https://services.openaire.eu/uoa-user-management/openid_connect_login",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".openaire.eu",
"feedbackmail" :"feedback@openaire.eu",
"cacheUrl" :"https://explore.openaire.eu/cache/get?url=",
"datasourcesAPI": "https://services.openaire.eu/openaire/ds/search/",
"adminToolsAPIURL" :"https://services.openaire.eu/uoa-admin-tools/",
"adminToolsCommunity" :"openaire",
"contextsAPI":"https://services.openaire.eu/openaire/context",
"communityAPI": "https://services.openaire.eu/openaire/community/",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,
"baseLink" : "https://explore.openaire.eu",
"searchLinkToPublication" : "/search/publication?articleId=",
"searchLinkToProject" : "/search/project?projectId=",
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
"searchLinkToDataset" : "/search/dataset?datasetId=",
"searchLinkToOrp" : "/search/other?orpId=",
"searchLinkToOrganization" : "/search/organization?organizationId=",
"searchLinkToPublications" : "/search/find/publications",
"searchLinkToDataProviders" : "/search/find/dataproviders",
"searchLinkToProjects" : "/search/find/projects",
"searchLinkToDatasets" : "/search/find/datasets",
"searchLinkToSoftware" : "/search/find/software",
"searchLinkToOrps" : "/search/find/other",
"searchLinkToOrganizations" : "/search/find/organizations",
"searchLinkToCompatibleDataProviders" : "/search/content-providers",
"searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table",
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries",
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table",
"searchLinkToJournals" : "/search/journals",
"searchLinkToJournalsTable" : "/search/journals-table",
"searchLinkToAdvancedPublications" : "/search/advanced/publications",
"searchLinkToAdvancedProjects" : "/search/advanced/projects",
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
"searchLinkToAdvancedSoftware" : "/search/advanced/software",
"searchLinkToAdvancedOrps" : "/search/advanced/other",
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
"lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows",
"showLastIndexInformationLink" : true,
"widgetLink" : "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
"claimsInformationLink": "https://www.openaire.eu/linking"
}

View File

@ -0,0 +1,93 @@
{
"environment" : "test",
"enablePiwikTrack" : true,
"enableHelper" : true,
"useCache" : true,
"metricsAPIURL" : "https://services.openaire.eu/usagestats/",
"framesAPIURL" : "https://test.openaire.eu/stats3/",
"statisticsAPIURL" : "https://beta.services.openaire.eu/stats-api/",
"statisticsFrameAPIURL":"https://test.openaire.eu/stats/",
"claimsAPIURL" : "https://services.openaire.eu/claims/rest/claimsService/",
"searchAPIURLLAst" : "http://services.openaire.eu:8480/shadowSearch/rest/v2/api/",
"searchResourcesAPIURL" : "http://services.openaire.eu:8480/shadowSearch/rest/v2/api/resources",
"csvAPIURL" : "http://services.openaire.eu:8480/shadowSearch/rest/v2/api/reports",
"searchCrossrefAPIURL" : "https://api.crossref.org/works",
"searchDataciteAPIURL" : "https://api.datacite.org/works",
"searchOrcidURL" : "https://pub.orcid.org/v2.1/",
"pmidURL" : "http://www.ncbi.nlm.nih.gov/pubmed/",
"doiURL" : "https://dx.doi.org/",
"cordisURL" : "http://cordis.europa.eu/projects/",
"pmcURL" : "http://europepmc.org/articles/",
"handleURL" : "http://hdl.handle.net/",
"openDoarURL": "http://v2.sherpa.ac.uk/id/repository/",
"r3DataURL": "http://service.re3data.org/repository/",
"zenodo" : "https://zenodo.org/",
"openAccess" : "https://www.openaire.eu/support/faq#article-id-234",
"openAccessRepo" : "https://www.openaire.eu/support/faq#article-id-310",
"fp7Guidlines" : "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
"uploadService" : "https://explore.openaire.eu/upload/",
"vocabulariesAPI" :"https://services.openaire.eu/provision/mvc/vocabularies/",
"piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=",
"piwikSiteId" : "109",
"loginUrl" :"https://services.openaire.eu/uoa-user-management/openid_connect_login",
"logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
"cookieDomain" :".openaire.eu",
"feedbackmail" :"feedback@openaire.eu",
"cacheUrl" :"https://explore.openaire.eu/cache/get?url=",
"datasourcesAPI": "https://services.openaire.eu/openaire/ds/search/",
"adminToolsAPIURL" :"https://services.openaire.eu/uoa-admin-tools/",
"adminToolsCommunity" :"openaire",
"contextsAPI":"https://services.openaire.eu/openaire/context",
"communityAPI": "https://services.openaire.eu/openaire/community/",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,
"baseLink" : "https://test.explore.openaire.eu",
"searchLinkToPublication" : "/search/publication?articleId=",
"searchLinkToProject" : "/search/project?projectId=",
"searchLinkToDataProvider" : "/search/dataprovider?datasourceId=",
"searchLinkToDataset" : "/search/dataset?datasetId=",
"searchLinkToOrp" : "/search/other?orpId=",
"searchLinkToOrganization" : "/search/organization?organizationId=",
"searchLinkToPublications" : "/search/find/publications",
"searchLinkToDataProviders" : "/search/find/dataproviders",
"searchLinkToProjects" : "/search/find/projects",
"searchLinkToDatasets" : "/search/find/datasets",
"searchLinkToSoftware" : "/search/find/software",
"searchLinkToOrps" : "/search/find/other",
"searchLinkToOrganizations" : "/search/find/organizations",
"searchLinkToCompatibleDataProviders" : "/search/content-providers",
"searchLinkToCompatibleDataProvidersTable" : "/search/content-providers-table",
"searchLinkToEntityRegistriesDataProviders" : "/search/entity-registries",
"searchLinkToEntityRegistriesDataProvidersTable" : "/search/entity-registries-table",
"searchLinkToJournals" : "/search/journals",
"searchLinkToJournalsTable" : "/search/journals-table",
"searchLinkToAdvancedPublications" : "/search/advanced/publications",
"searchLinkToAdvancedProjects" : "/search/advanced/projects",
"searchLinkToAdvancedDatasets" : "/search/advanced/datasets",
"searchLinkToAdvancedSoftware" : "/search/advanced/software",
"searchLinkToAdvancedOrps" : "/search/advanced/other",
"searchLinkToAdvancedDataProviders" : "/search/advanced/dataproviders",
"searchLinkToAdvancedOrganizations" : "/search/advanced/organizations",
"lastIndexInformationLink" : "https://www.openaire.eu/aggregation-and-content-provision-workflows",
"showLastIndexInformationLink" : false,
"widgetLink" : "https://test.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
"claimsInformationLink": "https://www.openaire.eu/linking"
}

71
package.json Normal file
View File

@ -0,0 +1,71 @@
{
"name": "openaire-search",
"version": "1.0.0",
"license": "Openaire",
"contributors": [
"Argiro Kokogiannaki <argirok@di.uoa.gr>",
"Konstantina Galouni <kgalouni@di.uoa.gr>"
],
"scripts": {
"ng": "ng",
"start": "ng serve --disable-host-check --host 0.0.0.0 --port 4300",
"start:ssr": "npm run build:ssr && npm run serve:ssr",
"start:prerender": "npm run build:prerender && npm run serve:prerender",
"build": "ng build",
"build:client-and-server-bundles": "ng build --prod --sourceMap --stats-json=true && ng run openaire-search:server:production",
"build:prerender": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:prerender",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"generate:prerender": "cd dist && node prerender",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors",
"serve:prerender": "cd dist/browser && http-server",
"serve:ssr": "node dist/server"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.14",
"@angular/cdk": "^7.3.7",
"@angular/common": "7.2.14",
"@angular/compiler": "7.2.14",
"@angular/core": "7.2.14",
"@angular/forms": "7.2.14",
"@angular/http": "7.2.14",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "7.2.14",
"@angular/platform-browser-dynamic": "7.2.14",
"@angular/platform-server": "7.2.14",
"@angular/router": "7.2.14",
"@nguniversal/express-engine": "^6.0.0",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"@types/express": "^4.16.1",
"angular-datatables": "^4.4.1",
"citation-js": "^0.3.4",
"clipboard": "^1.5.16",
"core-js": "^2.4.1",
"datatables.net": "^1.10.19",
"datatables.net-dt": "^1.10.19",
"jquery": "^3.4.1",
"ngx-json-ld": "0.1.6",
"prom-client": "^11.3.0",
"ts-md5": "^1.2.0",
"tslib": "^1.9.0",
"wikidata-sdk": "^5.2.9",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular/cli": "^7.3.9",
"@angular/compiler-cli": "7.2.14",
"@angular/language-service": "7.2.14",
"@types/datatables.net": "^1.10.17",
"@types/jquery": "^3.3.29",
"@types/node": "^8.0.30",
"cpy-cli": "^1.0.1",
"http-server": "^0.10.0",
"reflect-metadata": "^0.1.10",
"rxjs": "6.5.1",
"rxjs-compat": "^6.5.1",
"ts-loader": "^4.2.0",
"typescript": "3.2.4",
"webpack-cli": "^3.3.2"
}
}

45
prerender.ts Normal file
View File

@ -0,0 +1,45 @@
// Load zone.js for the server.
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
import { join } from 'path';
import { enableProdMode } from '@angular/core';
// Faster server renders w/ Prod mode (dev mode never needed)
enableProdMode();
// Express Engine
import { ngExpressEngine } from '@nguniversal/express-engine';
// Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
import { renderModuleFactory } from '@angular/platform-server';
import { ROUTES } from './static.paths';
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');
const BROWSER_FOLDER = join(process.cwd(), 'browser');
// Load the index.html file containing referances to your application bundle.
const index = readFileSync(join('browser', 'index.html'), 'utf8');
let previousRender = Promise.resolve();
// Iterate each route path
ROUTES.forEach(route => {
const fullPath = join(BROWSER_FOLDER, route);
// Make sure the directory structure is there
if(!existsSync(fullPath)){
mkdirSync(fullPath);
}
// Writes rendered HTML to index.html, replacing the file if it already exists.
previousRender = previousRender.then(_ => renderModuleFactory(AppServerModuleNgFactory, {
document: index,
url: route,
extraProviders: [
provideModuleMap(LAZY_MODULE_MAP)
]
})).then(html => writeFileSync(join(fullPath, 'index.html'), html));
});

200
prometheus.ts Normal file
View File

@ -0,0 +1,200 @@
import * as prom from 'prom-client';
export class Prometheus {
register = new prom.Registry();
counters: Map<string, prom.Counter> = new Map<string, prom.Counter>([
["/", new prom.Counter({
name: 'home',
help: 'Home Page Counter',
registers: [this.register]
})],
["/search/publication", new prom.Counter({
name: 'search_publication',
help: 'Publication Landing Page Counter',
registers: [this.register]
})],
["/search/dataset", new prom.Counter({
name: 'search_dataset',
help: 'Dataset Landing Page Counter',
registers: [this.register]
})],
["/search/software", new prom.Counter({
name: 'search_software',
help: 'Software Landing Page Counter',
registers: [this.register]
})],
["/search/other", new prom.Counter({
name: 'search_other',
help: 'Other Landing Page Counter',
registers: [this.register]
})],
["/search/project", new prom.Counter({
name: 'search_project',
help: 'Project Landing Page Counter',
registers: [this.register]
})],
["/search/dataprovider", new prom.Counter({
name: 'search_dataprovider',
help: 'DataProvider Landing Page Counter',
registers: [this.register]
})],
["/search/organization", new prom.Counter({
name: 'search_organization',
help: 'organization Landing Page Counter',
registers: [this.register]
})],
["/participate/deposit-datasets", new prom.Counter({
name: 'participate_deposit_datasets',
help: 'Participate Deposit Datasets Page Counter',
registers: [this.register]
})],
["/participate/deposit-datasets-result", new prom.Counter({
name: 'participate_deposit_datasets_result',
help: 'Participate Deposit Datasets Result Page Counter',
registers: [this.register]
})],
["/participate/deposit-subject-result", new prom.Counter({
name: 'participate_deposit_subject_result',
help: 'Participate Deposit Subject Result Page Counter',
registers: [this.register]
})],
["/participate/deposit-publications", new prom.Counter({
name: 'participate_deposit_publications',
help: 'Participate Deposit Publications Page Counter',
registers: [this.register]
})],
["/participate/deposit-publications-result", new prom.Counter({
name: 'participate_deposit_publications_result',
help: 'Participate Deposit Publications Result Page Counter',
registers: [this.register]
})],
["/search/find", new prom.Counter({
name: 'search_find',
help: 'Main Search Page Counter',
registers: [this.register]
})],
["/search/find/publications", new prom.Counter({
name: 'search_find_publications',
help: 'Publications Search Page Counter',
registers: [this.register]
})],
["/search/find/datasets", new prom.Counter({
name: 'search_find_datasets',
help: 'Datasets Search Page Counter',
registers: [this.register]
})],
["/search/find/software", new prom.Counter({
name: 'search_find_software',
help: 'Software Search Page Counter',
registers: [this.register]
})],
["/search/find/other", new prom.Counter({
name: 'search_find_other',
help: 'Other Search Page Counter',
registers: [this.register]
})],
["/search/find/projects", new prom.Counter({
name: 'search_find_projects',
help: 'Projects Search Page Counter',
registers: [this.register]
})],
["/search/find/dataproviders", new prom.Counter({
name: 'search_find_dataproviders',
help: 'DataProviders Search Page Counter',
registers: [this.register]
})],
["/search/find/organizations", new prom.Counter({
name: 'search_find_organizations',
help: 'Organizations Search Page Counter',
registers: [this.register]
})],
["/search/content-providers", new prom.Counter({
name: 'search_content_providers',
help: 'Repositories Search Page Counter',
registers: [this.register]
})],
["/search/content-providers-table", new prom.Counter({
name: 'search_content_providers_table',
help: 'Repositories Search Page Table Counter',
registers: [this.register]
})],
["/search/entity-registries", new prom.Counter({
name: 'search_entity_registries',
help: 'Registries Search Page Counter',
registers: [this.register]
})],
["/search/entity-registries-table", new prom.Counter({
name: 'search_entity_registries_table',
help: 'Registries Search Page Table Counter',
registers: [this.register]
})],
["/search/journals", new prom.Counter({
name: 'search_journals',
help: 'Journals Search Page Counter',
registers: [this.register]
})],
["/search/journals-table", new prom.Counter({
name: 'search_journals_table',
help: 'Journals Search Page Table Counter',
registers: [this.register]
})],
["/search/advanced/publications", new prom.Counter({
name: 'search_advanced_publications',
help: 'Publications Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/datasets", new prom.Counter({
name: 'search_advanced_datasets',
help: 'Datasets Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/software", new prom.Counter({
name: 'search_advanced_software',
help: 'Software Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/other", new prom.Counter({
name: 'search_advanced_other',
help: 'Other Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/projects", new prom.Counter({
name: 'search_advanced_projects',
help: 'Projects Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/dataproviders", new prom.Counter({
name: 'search_advanced_dataproviders',
help: 'DataProviders Advanced Search Page Counter',
registers: [this.register]
})],
["/search/advanced/organizations", new prom.Counter({
name: 'search_advanced_organizations',
help: 'Organizations Advanced Search Page Counter',
registers: [this.register]
})],
["/myclaims", new prom.Counter({
name: 'my_claims',
help: 'My Claims Page Counter',
registers: [this.register]
})],
["/claims", new prom.Counter({
name: 'claims',
help: 'Admin Claims Page Counter',
registers: [this.register]
})],
["/participate/claim", new prom.Counter({
name: 'participate_claim',
help: 'Linking Page Counter',
registers: [this.register]
})],
["/participate/direct-claim", new prom.Counter({
name: 'participate_direct_claim',
help: 'Direct Linking Page Counter',
registers: [this.register]
})]
]);
}

87
server.ts Normal file
View File

@ -0,0 +1,87 @@
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { renderModuleFactory } from '@angular/platform-server';
import { enableProdMode } from '@angular/core';
import * as express from 'express';
import { join } from 'path';
import { readFileSync } from 'fs';
// Faster server renders w/ Prod mode (dev mode never needed)
enableProdMode();
// Express server
const app = express();
const PORT = process.env.PORT || 4000;
const DIST_FOLDER = join(process.cwd(), 'dist');
// Our index.html we'll use as our template
const template = readFileSync(join(DIST_FOLDER, 'browser', 'index.html')).toString();
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');
// Express Engine
import { ngExpressEngine } from '@nguniversal/express-engine';
// Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
import {Prometheus} from "./prometheus";
import {Counter} from "prom-client";
/*
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
app.engine('html', ngExpressEngine({
bootstrap: AppServerModuleNgFactory,
providers: [
provideModuleMap(LAZY_MODULE_MAP)
]
}));
*/
// be able to get request and get domain from there
const prometheus: Prometheus = new Prometheus();
app.engine('html', (_, options, callback) => {
let engine = ngExpressEngine({
bootstrap: AppServerModuleNgFactory,
providers: [
{ provide: 'request', useFactory: () => options.req, deps: [] },
provideModuleMap(LAZY_MODULE_MAP)
]
});
engine(_, options, callback);
});
app.set('view engine', 'html');
app.set('views', join(DIST_FOLDER, 'browser'));
/* - Example Express Rest API endpoints -
app.get('/api/**', (req, res) => { });
*/
// Server static files from /browser
app.get('*.*', express.static(join(DIST_FOLDER, 'browser'), {
maxAge: '1y'
}));
// All regular routes use the Universal engine
app.get('*', (req, res) => {
let start = new Date();
let counter: Counter = prometheus.counters.get(req.path);
if(counter !== undefined) {
counter.inc(1, new Date());
res.render('index', { req });
// event triggers when express is done sending response
res.on('finish', function() {
console.log(new Date().getTime() - start.getTime());
});
} else {
res.render('index', { req });
}
});
// Start up the Node server
app.listen(PORT, () => {
console.log(`Node Express server listening on http://localhost:${PORT}`);
});

15
static.paths.ts Normal file
View File

@ -0,0 +1,15 @@
export const ROUTES = [
'/',
'/lazy',
'/home',
'/search/publication','/search/project','/search/dataset','/search/dataprovider','/search/organization',
'/search/find',
'/search/person','/search/publication','/search/project','/search/dataset','/search/dataprovider','/search/organization',
'/search/find/people','/search/find/publications','/search/find/projects','/search/find/datasets','/search/find/dataproviders','/search/find/organizations',
'/search/advanced/people','/search/advanced/publications','/search/advanced/projects','/search/advanced/datasets','/search/advanced/dataproviders','/search/advanced/organizations',
'/participate/deposit-publications','/participate/deposit-datasets','/participate/deposit-publications-result','/participate/deposit-datasets-result','/participate/deposit-subject-result',
'/search/content-providers','/search/content-providers-table','/search/entity-registries','/search/entity-registries-table','/search/journals','/search/journals-table',
'/project-report','/claims','/myclaims','/participate/claim','/participate/direct-claim','/claims-project-manager',
'/test','/user-info',
'/error', '/*path'
];

22
tsconfig.json Normal file
View File

@ -0,0 +1,22 @@
{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"module": "es2015",
"baseUrl": "./"
}
}

52
webpack.server.config.js Normal file
View File

@ -0,0 +1,52 @@
// Work around for https://github.com/angular/angular-cli/issues/7200
const path = require('path');
const webpack = require('webpack');
module.exports = {
//mode: 'none',
entry: {
// This is our Express server for Dynamic universal
server: './server.ts',
// This is an example of Static prerendering (generative)
prerender: './prerender.ts'
},
target: 'node',
resolve: { extensions: ['.ts', '.js'] },
// Make sure we include all node_modules etc
externals: [/(node_modules|main\..*\.js)/,],
optimization: {
minimize: false
},
output: {
// Puts the output at the root of the dist folder
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
,{
// Mark files inside `@angular/core` as using SystemJS style dynamic imports.
// Removing this will cause deprecation warnings to appear.
test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/,
parser: { system: true },
},
]
},
plugins: [
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{} // a map of your routes
),
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{}
)
]
}