From 9f596e0e89901b7ea6ead092db94c4da905e01a9 Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 21 Jun 2026 22:48:51 +0200 Subject: [PATCH 01/42] added URI encoding for single bund project requests --- service/src/main/inse/projects/projects_search_client.py | 8 +++++--- webapp/src/app/modules/projects/projects.component.ts | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index a53c2f1f..0a0653b2 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -3,7 +3,7 @@ import logging from typing import Any, Dict, List, Optional, Set, Tuple import httpx - +import urllib from inse.config import get_settings from inse.models.bund_project import BundProject from inse.projects.model import ( @@ -193,7 +193,7 @@ def _complete_response_to_bund_project_page( def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]: - """Fetches the details of a single Bund project based on its project ID. + """Decodes project_id and fetches the details of a single Bund project based on its project ID. Args: project_id (str): The ID of the project to fetch. @@ -201,7 +201,9 @@ def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]: Returns: Optional[BundProjectDetails]: The details of the project if found, otherwise None. """ - query = {"term": {"Förderkennzeichen.keyword": {"value": project_id}}} + + decoded_id = urllib.parse.unquote(project_id) + query = {"term": {"Förderkennzeichen.keyword": {"value": decoded_id}}} response = elasticsearch.search( index=ESIndex.PROJECTS_BUND_V1, diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts index 4fc6f46d..78563c74 100644 --- a/webapp/src/app/modules/projects/projects.component.ts +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -118,7 +118,8 @@ export class ProjectsComponent { getDetaiLink(fundingProject: FundingProject): string | null { if (fundingProject.type === 'bund') { - return '/projects/bund/' + fundingProject.id; + const encodedId = encodeURIComponent(fundingProject.id) + return '/projects/bund/' + encodedId; } else if (fundingProject.type === 'dfg') { return '/projects/dfg/' + fundingProject.id; } else { -- 2.56.1 From 42cf5d7897e5052d28b74fdb8cfbb0553158635a Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 00:04:02 +0200 Subject: [PATCH 02/42] moved project details pages from /person-projects to /projects --- .../bund-details/bund-details.component.html | 0 .../bund-details/bund-details.component.scss | 0 .../bund-details/bund-details.component.ts | 0 .../dfg-details/dfg-details.component.html | 0 .../dfg-details/dfg-details.component.scss | 0 .../dfg-details/dfg-details.component.ts | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename webapp/src/app/modules/{person-projects => projects}/bund-details/bund-details.component.html (100%) rename webapp/src/app/modules/{person-projects => projects}/bund-details/bund-details.component.scss (100%) rename webapp/src/app/modules/{person-projects => projects}/bund-details/bund-details.component.ts (100%) rename webapp/src/app/modules/{person-projects => projects}/dfg-details/dfg-details.component.html (100%) rename webapp/src/app/modules/{person-projects => projects}/dfg-details/dfg-details.component.scss (100%) rename webapp/src/app/modules/{person-projects => projects}/dfg-details/dfg-details.component.ts (100%) diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.html b/webapp/src/app/modules/projects/bund-details/bund-details.component.html similarity index 100% rename from webapp/src/app/modules/person-projects/bund-details/bund-details.component.html rename to webapp/src/app/modules/projects/bund-details/bund-details.component.html diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.scss b/webapp/src/app/modules/projects/bund-details/bund-details.component.scss similarity index 100% rename from webapp/src/app/modules/person-projects/bund-details/bund-details.component.scss rename to webapp/src/app/modules/projects/bund-details/bund-details.component.scss diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.ts b/webapp/src/app/modules/projects/bund-details/bund-details.component.ts similarity index 100% rename from webapp/src/app/modules/person-projects/bund-details/bund-details.component.ts rename to webapp/src/app/modules/projects/bund-details/bund-details.component.ts diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.html b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html similarity index 100% rename from webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.html rename to webapp/src/app/modules/projects/dfg-details/dfg-details.component.html diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.scss b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.scss similarity index 100% rename from webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.scss rename to webapp/src/app/modules/projects/dfg-details/dfg-details.component.scss diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.ts b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts similarity index 100% rename from webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.ts rename to webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts -- 2.56.1 From 299c7c3d9bf30fd3332d9bdd9d95eb327a306ca1 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 00:04:20 +0200 Subject: [PATCH 03/42] added EU single project resolver --- .../app/resolvers/eu-single-project-resolver.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 webapp/src/app/resolvers/eu-single-project-resolver.ts diff --git a/webapp/src/app/resolvers/eu-single-project-resolver.ts b/webapp/src/app/resolvers/eu-single-project-resolver.ts new file mode 100644 index 00000000..4bb3eb86 --- /dev/null +++ b/webapp/src/app/resolvers/eu-single-project-resolver.ts @@ -0,0 +1,16 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { ProjectsService } from '../api/api/projects.service'; +import { CordisEuProject } from '../api'; + +export const euSingleProjectResolver: ResolveFn = ( + route, + state, +) => { + const projectsService = inject(ProjectsService); + const projectId = route.paramMap.get('id'); + if (!projectId) { + throw new Error('EU Cordis Project ID is required'); + } + return projectsService.getSingleEuCordisProject(projectId); +}; -- 2.56.1 From 15bfdf55bcb9550c1b2aab4b09213328e2b1da48 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 00:05:06 +0200 Subject: [PATCH 04/42] added signle EU project details page component to frontend --- webapp/src/app/api/api/projects.service.ts | 58 ++ webapp/src/app/app.routes.ts | 17 +- .../eu-details.component.html | 296 +++++++++ .../eu-details.component.scss | 619 ++++++++++++++++++ .../eu-cordis-details/eu-details.component.ts | 180 +++++ .../modules/projects/projects.component.ts | 5 +- 6 files changed, 1171 insertions(+), 4 deletions(-) create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index 9edfb7fe..9514c05f 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -21,6 +21,8 @@ import { BundProjectDetails } from '../model/bundProjectDetails'; // @ts-ignore import { BundProjectPage } from '../model/bundProjectPage'; // @ts-ignore +import { CordisEuProject } from '../model/cordisEuProject'; +// @ts-ignore import { CordisEuProjectPage } from '../model/cordisEuProjectPage'; // @ts-ignore import { DfgProjectDetails } from '../model/dfgProjectDetails'; @@ -425,6 +427,62 @@ export class ProjectsService extends BaseService { ); } + /** + * Get a single EU Cordis project. + * Returns a single EU Cordis project based on its ID. + * @endpoint get /api/projects/eu/{id} + * @param id The ID of the EU Cordis project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleEuCordisProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSingleEuCordisProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleEuCordisProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleEuCordisProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSingleEuCordisProject.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/eu/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * Get bund projects. * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 5bf5ab58..9d7bfba8 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -16,6 +16,7 @@ import { cordisEuProjectPageResolver } from './resolvers/cordis-eu-project-page. import { cordisEuProjectsFundingResolver } from './resolvers/cordis-eu-projects-funding.resolver'; import { fundingProjectPageResolver } from './resolvers/funding-project-page.resolver'; import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver'; +import { euSingleProjectResolver } from './resolvers/eu-single-project-resolver'; export const routes: Routes = [ { @@ -111,7 +112,7 @@ export const routes: Routes = [ canActivate: [userGuard], pathMatch: 'full', loadComponent: () => - import('./modules/person-projects/dfg-details/dfg-details.component').then( + import('./modules/projects/dfg-details/dfg-details.component').then( (mod) => mod.DfgDetailsComponent, ), resolve: { @@ -123,12 +124,24 @@ export const routes: Routes = [ canActivate: [userGuard], pathMatch: 'full', loadComponent: () => - import('./modules/person-projects/bund-details/bund-details.component').then( + import('./modules/projects/bund-details/bund-details.component').then( (mod) => mod.BundDetailsComponent, ), resolve: { bundSingleProject: bundSingleProjectResolver, }, + }, + { + path: 'projects/eu/:id', + canActivate: [userGuard], + pathMatch: 'full', + loadComponent: () => + import('./modules/projects/eu-cordis-details/eu-details.component').then( + (mod) => mod.EuDetailsComponent, + ), + resolve: { + euSingleProject: euSingleProjectResolver, + }, }, { path: 'person/:id', diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html new file mode 100644 index 00000000..2f30b6a0 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -0,0 +1,296 @@ +
+ + + @if (euProject) { +
+
+
+ EU Projekt + ID: {{ euProject.id }} + @if (euProject.rcn) { + RCN: {{ euProject.rcn }} + } + @if (euProject.acronym) { + {{ euProject.acronym }} + } +
+

{{ euProject.title || 'Ohne Titel' }}

+ @if (euProject.frameworkProgramme) { +

+ Rahmenprogramm: + + {{ getFrameworkDisplay(euProject.frameworkProgramme) }} + +

+ } +
+ @if (euProject.status) { +
+ circle + {{ getStatusDisplay(euProject.status) }} +
+ } + @if (euProject.fundingScheme) { +
+ assignment + {{ getFundingSchemeDisplay(euProject.fundingScheme) }} +
+ } + @if (euProject.grantDoi) { + + link + DOI: {{ euProject.grantDoi }} + + } +
+
+ +
+
+ calendar_today +
+ {{ euProject.startDate || 'N/A' }} + Startdatum +
+
+
+ event_busy +
+ {{ euProject.endDate || 'N/A' }} + Enddatum +
+
+
+ access_time +
+ {{ getFundingStatus(euProject.endDate) }} + Status +
+
+ @if (euProject.ecMaxContribution) { +
+ euro_symbol +
+ {{ formatCurrency(euProject.ecMaxContribution) }} + EU-Beitrag +
+
+ } + @if (euProject.totalCost) { +
+ attach_money +
+ {{ formatCurrency(euProject.totalCost) }} + Gesamtkosten +
+
+ } + @if (euProject.masterCall) { +
+ call_split +
+ {{ euProject.masterCall }} + Master Call +
+
+ } +
+
+ + @if (euProject.objective) { + +
+ description +

Projektziel

+
+

{{ euProject.objective }}

+
+ } + +
+
+ + @if (euProject.topics) { + +
+ topic +

Themen

+ {{ getFormattedTopics(euProject.topics).length }} +
+
+ @for (topic of getFormattedTopics(euProject.topics); track topic) { +
+ {{ topic }} + search +
+ } +
+
+ } + + + @if (getKeywords(euProject.keywords).length > 0) { + +
+ tag +

Schlüsselwörter

+ {{ getKeywords(euProject.keywords).length }} +
+
+ @for (keyword of getKeywords(euProject.keywords); track keyword) { +
+ {{ keyword }} + search +
+ } +
+
+ } +
+ + +
+ } @else { +
+
+ error_outline +

EU Projekt nicht gefunden.

+
+
+ } +
\ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss new file mode 100644 index 00000000..4a26295b --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss @@ -0,0 +1,619 @@ +// Complete SCSS with all styles + +.detail-page { + padding: 28px 32px 42px; + max-width: 100%; + margin: 0 auto; +} + +.page-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-bottom: 24px; +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + cursor: pointer; + font-size: 14px; + transition: all 0.2s; +} + +.back-link:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.back-link mat-icon { + width: 20px; + height: 20px; + font-size: 20px; +} + +.breadcrumb { + display: flex; + align-items: center; + gap: 6px; + color: var(--sg-text-muted); + font-size: 13px; +} + +.breadcrumb mat-icon { + width: 18px; + height: 18px; + font-size: 18px; +} + +.breadcrumb span:last-child { + color: var(--sg-text); + font-weight: 500; +} + +.project-hero { + background: #f8fafc; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-md); + padding: 28px 32px; + margin-bottom: 28px; +} + +.hero-content { + margin-bottom: 24px; +} + +.eyebrow { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 12px; + flex-wrap: wrap; +} + +.project-badge { + display: inline-block; + padding: 4px 12px; + background: #e8edf5; + color: var(--sg-text); + border-radius: var(--sg-radius-sm); + font-size: 12px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.project-id { + color: var(--sg-text-muted); + font-size: 13px; +} + +.project-rcn { + display: inline-block; + padding: 4px 10px; + background: #e8f0fe; + color: #1a73e8; + border-radius: var(--sg-radius-sm); + font-size: 12px; + font-weight: 500; +} + +.project-acronym { + display: inline-block; + padding: 4px 10px; + background: #fff3e0; + color: #e65100; + border-radius: var(--sg-radius-sm); + font-size: 12px; + font-weight: 600; +} + +h1 { + margin: 0 0 8px; + font-size: 26px; + line-height: 1.3; + font-weight: 700; + color: var(--sg-text); +} + +.project-framework { + margin: 0 0 16px; + color: var(--sg-text-muted); + font-size: 14px; +} + +.framework-tag { + display: inline-block; + padding: 2px 10px; + background: #e8edf5; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.framework-tag:hover { + background: #d5dde8; +} + +.hero-actions { + display: flex; + flex-wrap: wrap; + gap: 10px; +} + +.status-badge { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 14px; + border-radius: var(--sg-radius-sm); + color: #fff; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.status-badge:hover { + transform: translateY(-1px); + box-shadow: 0 2px 8px rgba(0,0,0,0.15); +} + +.status-badge mat-icon { + width: 16px; + height: 16px; + font-size: 16px; +} + +.scheme-info { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 6px 14px; + background: #fff; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + font-size: 13px; + cursor: pointer; + transition: all 0.2s; +} + +.scheme-info:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.scheme-info mat-icon { + color: var(--sg-text-muted); + width: 18px; + height: 18px; + font-size: 18px; +} + +.doi-link { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 14px; + background: #e8f0fe; + border: 1px solid #c5d8f0; + border-radius: var(--sg-radius-sm); + color: #1a73e8; + text-decoration: none; + font-size: 13px; + transition: all 0.2s; +} + +.doi-link:hover { + background: #d5e3fa; +} + +.doi-link mat-icon { + width: 18px; + height: 18px; + font-size: 18px; +} + +.metrics-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 16px; + padding-top: 20px; + border-top: 1px solid #d9e2f0; +} + +.metric-item { + display: flex; + align-items: center; + gap: 12px; +} + +.metric-item mat-icon { + color: var(--sg-text-muted); + width: 24px; + height: 24px; + font-size: 24px; +} + +.metric-content { + display: flex; + flex-direction: column; +} + +.metric-content strong { + font-size: 15px; + color: var(--sg-text); + line-height: 1.3; +} + +.metric-content span { + font-size: 12px; + color: var(--sg-text-muted); +} + +.card { + margin-bottom: 24px; + border-color: #d9e2f0 !important; + border-radius: var(--sg-radius-md) !important; +} + +.card ::ng-deep .mat-mdc-card-content { + padding: 0; +} + +.section-header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px 20px 12px; + border-bottom: 1px solid #f0f2f5; +} + +.section-header mat-icon { + color: var(--sg-text-muted); + width: 22px; + height: 22px; + font-size: 22px; +} + +.section-header h2 { + margin: 0; + font-size: 16px; + font-weight: 600; + color: var(--sg-text); +} + +.count-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 24px; + height: 24px; + padding: 0 8px; + margin-left: auto; + background: #e8edf5; + border-radius: 12px; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 500; +} + +.description-text { + padding: 16px 20px 20px; + margin: 0; + color: var(--sg-text); + font-size: 14px; + line-height: 1.6; +} + +.content-grid { + display: grid; + grid-template-columns: 2fr 1fr; + gap: 24px; +} + +.main-content { + display: flex; + flex-direction: column; + gap: 24px; +} + +.sidebar { + display: flex; + flex-direction: column; + gap: 24px; +} + +.topics-grid { + display: grid; + grid-template-columns: 1fr; + gap: 10px; + padding: 16px 20px 20px; +} + +.topic-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 14px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + cursor: pointer; + transition: all 0.2s; +} + +.topic-item:hover { + background: #f8fafc; + border-color: #b8c5d6; + transform: translateY(-1px); +} + +.topic-value { + color: var(--sg-text); + font-size: 13px; + word-break: break-word; +} + +.topic-item .search-icon { + color: var(--sg-text-muted); + width: 18px; + height: 18px; + font-size: 18px; + opacity: 0; + transition: opacity 0.2s; +} + +.topic-item:hover .search-icon { + opacity: 1; +} + +.keywords-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + padding: 16px 20px 20px; +} + +.keyword-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 14px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + cursor: pointer; + transition: all 0.2s; + position: relative; +} + +.keyword-item:hover { + background: #f8fafc; + border-color: #b8c5d6; + transform: translateY(-1px); +} + +.keyword-value { + color: var(--sg-text); + font-size: 13px; + word-break: break-word; +} + +.keyword-item .search-icon { + color: var(--sg-text-muted); + width: 16px; + height: 16px; + font-size: 16px; + opacity: 0; + transition: opacity 0.2s; +} + +.keyword-item:hover .search-icon { + opacity: 1; +} + +.details-list { + margin: 0; + padding: 16px 20px 20px; +} + +.detail-row { + display: grid; + grid-template-columns: 140px 1fr; + gap: 12px; + padding: 8px 0; + border-bottom: 1px solid #f0f2f5; +} + +.detail-row:last-child { + border-bottom: none; +} + +.detail-row dt { + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 500; +} + +.detail-row dd { + margin: 0; + color: var(--sg-text); + font-size: 13px; + word-break: break-word; + display: flex; + align-items: center; + gap: 6px; +} + +.detail-row dd.clickable { + cursor: pointer; + transition: color 0.2s; +} + +.detail-row dd.clickable:hover { + color: var(--sg-primary, #0066cc); +} + +.detail-row dd.clickable:hover .search-icon { + opacity: 1; +} + +.search-icon { + width: 16px; + height: 16px; + font-size: 16px; + opacity: 0; + transition: opacity 0.2s; + color: var(--sg-text-muted); +} + +.detail-row dd:hover .search-icon { + opacity: 1; +} + +.status-indicator { + display: inline-block; + padding: 2px 10px; + border-radius: var(--sg-radius-sm); + color: #fff; + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.status-indicator:hover { + transform: scale(1.05); +} + +.external-link { + display: inline-flex; + align-items: center; + gap: 4px; + color: var(--sg-primary, #0066cc); + text-decoration: none; + word-break: break-all; +} + +.external-link:hover { + text-decoration: underline; +} + +.external-link .external-icon { + width: 16px; + height: 16px; + font-size: 16px; +} + +.error-container { + display: flex; + align-items: center; + justify-content: center; + min-height: 400px; +} + +.error-state { + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + color: var(--sg-text-muted); +} + +.error-state mat-icon { + width: 48px; + height: 48px; + font-size: 48px; + color: #e74c3c; +} + +.error-state p { + margin: 0; + font-size: 16px; +} + +// Utility function for date formatting +.format-date { + // Handled in component +} + +@media (max-width: 992px) { + .content-grid { + grid-template-columns: 1fr; + gap: 20px; + } + + .keywords-grid { + grid-template-columns: 1fr 1fr; + } +} + +@media (max-width: 768px) { + .detail-page { + padding: 16px; + } + + .page-header { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } + + .project-hero { + padding: 20px; + } + + .metrics-grid { + grid-template-columns: 1fr 1fr; + gap: 12px; + } + + h1 { + font-size: 22px; + } + + .detail-row { + grid-template-columns: 1fr; + gap: 4px; + } + + .eyebrow { + gap: 8px; + } + + .topics-grid { + grid-template-columns: 1fr; + } + + .keywords-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 480px) { + .metrics-grid { + grid-template-columns: 1fr; + } + + .hero-actions { + flex-direction: column; + } + + .status-badge, + .scheme-info, + .doi-link { + width: 100%; + justify-content: center; + } +} \ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts new file mode 100644 index 00000000..0c4020a9 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -0,0 +1,180 @@ +import { Component, OnInit, inject } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { MatChipsModule } from '@angular/material/chips'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-eu-details', + standalone: true, + imports: [CommonModule, MatCardModule, MatIconModule, MatChipsModule], + templateUrl: './eu-details.component.html', + styleUrl: './eu-details.component.scss', +}) +export class EuDetailsComponent implements OnInit { + private route = inject(ActivatedRoute); + euProject: any | undefined; + + constructor(private router: Router) {} + + ngOnInit(): void { + this.route.data.subscribe(({ euSingleProject }) => { + console.log('EU Project:', euSingleProject); + this.euProject = euSingleProject; + }); + } + + getInitials(name: string | null | undefined): string { + if (!name) return ''; + const parts = name.trim().split(/\s+/); + if (parts.length > 1) { + return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase(); + } + return parts[0][0].toUpperCase(); + } + + getFundingStatus(endDate: string | null | undefined): string { + if (!endDate) return 'N/A'; + const end = new Date(endDate); + const now = new Date(); + + if (isNaN(end.getTime())) return endDate; + + return end >= now ? 'Laufend' : 'Abgeschlossen'; + } + + formatCurrency(amount: number | null | undefined): string { + if (amount === null || amount === undefined) return 'N/A'; + + return new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + minimumFractionDigits: 0, + maximumFractionDigits: 0 + }).format(amount); + } + + getStatusColor(status: string | null | undefined): string { + if (!status) return '#95a5a6'; + + const statusUpper = status.toUpperCase(); + if (statusUpper.includes('CLOSED') || statusUpper.includes('COMPLETED')) { + return '#27ae60'; + } else if (statusUpper.includes('ONGOING') || statusUpper.includes('ACTIVE')) { + return '#f39c12'; + } else if (statusUpper.includes('SIGNED')) { + return '#3498db'; + } else if (statusUpper.includes('CANCELLED')) { + return '#e74c3c'; + } else { + return '#95a5a6'; + } + } + + getStatusDisplay(status: string | null | undefined): string { + if (!status) return 'N/A'; + + const statusMap: { [key: string]: string } = { + 'CLOSED': 'Abgeschlossen', + 'COMPLETED': 'Abgeschlossen', + 'ONGOING': 'Laufend', + 'ACTIVE': 'Aktiv', + 'SIGNED': 'Unterzeichnet', + 'CANCELLED': 'Abgebrochen', + 'SUSPENDED': 'Unterbrochen' + }; + + const statusUpper = status.toUpperCase(); + return statusMap[statusUpper] || status; + } + + getFrameworkDisplay(framework: string | null | undefined): string { + if (!framework) return 'N/A'; + + const frameworkMap: { [key: string]: string } = { + 'H2020': 'Horizon 2020', + 'FP7': '7. Rahmenprogramm', + 'FP6': '6. Rahmenprogramm', + 'HE': 'Horizon Europe' + }; + + return frameworkMap[framework] || framework; + } + + getFundingSchemeDisplay(scheme: string | null | undefined): string { + if (!scheme) return 'N/A'; + + const schemeMap: { [key: string]: string } = { + 'MSCA-IF-EF-SE': 'MSCA Individual Fellowship - European Fellowship - Standard', + 'MSCA-IF-EF': 'MSCA Individual Fellowship - European Fellowship', + 'MSCA-IF-GF': 'MSCA Individual Fellowship - Global Fellowship', + 'MSCA-IF': 'MSCA Individual Fellowship', + 'MSCA-ITN': 'MSCA Innovative Training Networks', + 'MSCA-RISE': 'MSCA Research and Innovation Staff Exchange', + 'MSCA-COFUND': 'MSCA Co-funding of Regional, National and International Programmes' + }; + + return schemeMap[scheme] || scheme; + } + + getFormattedTopics(topics: string | null | undefined): string[] { + if (!topics) return []; + return topics.split(',').map(t => t.trim()); + } + + getKeywords(keywords: string | null | undefined): string[] { + if (!keywords) return []; + if (keywords === 'false') return []; + // If keywords is a string with comma-separated values + if (typeof keywords === 'string') { + return keywords.split(',').map(k => k.trim()).filter(k => k && k !== 'false'); + } + return []; + } + + searchByTopic(topic: string): void { + this.router.navigate(['/eu-projects'], { + queryParams: { + topic: topic + } + }); + } + + searchByKeyword(keyword: string): void { + this.router.navigate(['/eu-projects'], { + queryParams: { + keyword: keyword + } + }); + } + + searchByFramework(framework: string): void { + this.router.navigate(['/eu-projects'], { + queryParams: { + framework: framework + } + }); + } + + searchByFundingScheme(scheme: string): void { + this.router.navigate(['/eu-projects'], { + queryParams: { + fundingScheme: scheme + } + }); + } + + searchByStatus(status: string): void { + this.router.navigate(['/eu-projects'], { + queryParams: { + status: status + } + }); + } + + goBack(): void { + window.history.back(); + } +} \ No newline at end of file diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts index 78563c74..5feada32 100644 --- a/webapp/src/app/modules/projects/projects.component.ts +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -122,8 +122,9 @@ export class ProjectsComponent { return '/projects/bund/' + encodedId; } else if (fundingProject.type === 'dfg') { return '/projects/dfg/' + fundingProject.id; - } else { + } else if (fundingProject.type === 'eu') { + return '/projects/eu/' + fundingProject.id; + } else return null; } - } } -- 2.56.1 From 0326fba2d460344b298873126c80d162c0d4d3a0 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 00:06:02 +0200 Subject: [PATCH 05/42] added eu project details endpoint to backend --- .../inse/projects/projects_search_client.py | 18 ++++++++++++++- service/src/main/inse/projects/router.py | 23 +++++++++++++++++++ service/src/main/inse/projects/service.py | 11 +++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index 0a0653b2..777e51de 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -29,7 +29,6 @@ from inse.models.cordis_eu_project import CordisEuProject from inse.integrations import elasticsearch from inse.model import ESCluster, ESIndex - settings = get_settings() logger = logging.getLogger(__name__) @@ -559,6 +558,23 @@ def get_cordis_eu_projects_by_project_ids( ) +def get_eu_cordis_projects_by_id( + project_ids: List[str], +) -> CordisEuProject: + query = {"bool": {"filter": [{"term": {"id": project_ids}}]}} + + response = elasticsearch.search( + query=query, + index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + cluster=ESCluster.INSE, + ) + + hits = response.get("hits", {}).get("hits", []) + if hits: + hit = hits[0] + return CordisEuProject.model_validate(hit["_source"]) + return None + # DFG diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py index 509f5d8b..20d655ff 100644 --- a/service/src/main/inse/projects/router.py +++ b/service/src/main/inse/projects/router.py @@ -15,6 +15,7 @@ from inse.projects.model import ( ProjectsFilteringProperties, ProjectsSortBy, SortDirection, + CordisEuProject ) from inse.models.dfg_project_details import DfgProjectDetails from inse.models.bund_project_details import BundProjectDetails @@ -131,6 +132,28 @@ def get_single_bund_project( ) +@router.get( + "/eu/{id}", + summary="Get a single EU Cordis project.", + description="Returns a single EU Cordis project based on its ID.", + operation_id="getSingleEuCordisProject", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": CordisEuProject, + }, + status.HTTP_404_NOT_FOUND: {"description": "Project not found"}, + }, + response_model_by_alias=False, +) +def get_single_eu_cordis_project( + id: Annotated[str, Path(description="The ID of the EU Cordis project to retrieve.")], +) -> CordisEuProject: + logger.debug(f"Received request to get single EU Cordis project for id={id}") + return projects_service.get_single_eu_cordis_project( + project_id=id, + ) + @router.get( "/institution/bund/funding-over-time", summary="Get funding over time for bund projects.", diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py index 75c72e0e..bf756cd0 100644 --- a/service/src/main/inse/projects/service.py +++ b/service/src/main/inse/projects/service.py @@ -17,6 +17,7 @@ from inse.projects.model import ( ProjectsFilteringProperties, ProjectsSortBy, SortDirection, + CordisEuProject ) from inse.models.dfg_project_details import DfgProjectDetails from inse.models.bund_project_details import BundProjectDetails @@ -322,6 +323,15 @@ def get_single_bund_project( raise NotFoundException(f"BUND project with id {project_id} not found") return project +def get_single_eu_cordis_project( + project_id: str, +) -> CordisEuProject: + logger.debug(f"Fetching single EU Cordis project for id={project_id}") + + project = projects_search_client.get_eu_cordis_projects_by_id(project_id) + if not project: + raise NotFoundException(f"EU project with id {project_id} not found") + return project def search_cordis_eu_projects_for_author_id( raw_oa_author_id: str, @@ -347,3 +357,4 @@ def search_cordis_eu_projects_for_author_id( ) return funding_project_page + -- 2.56.1 From f894a48c31c36c0825eb6772cb880e420212fe7c Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 23:56:03 +0200 Subject: [PATCH 06/42] generated models for EU projects fp7 programm indexes --- .../projects_eu_cordis/fp7/fp7_eurosci_voc.py | 98 ++++++++ .../projects_eu_cordis/fp7/fp7_legal_basis.py | 96 ++++++++ .../fp7/fp7_organization.py | 139 ++++++++++++ .../projects_eu_cordis/fp7/fp7_project.py | 131 +++++++++++ .../fp7/fp7_project_details.py | 214 ++++++++++++++++++ .../projects_eu_cordis/fp7/fp7_project_ipr.py | 125 ++++++++++ .../projects_eu_cordis/fp7/fp7_publication.py | 123 ++++++++++ .../fp7/fp7_report_summary.py | 101 +++++++++ .../projects_eu_cordis/fp7/fp7_topic.py | 94 ++++++++ .../projects_eu_cordis/fp7/fp7_web_link.py | 107 +++++++++ 10 files changed, 1228 insertions(+) create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py new file mode 100644 index 00000000..27e2cec2 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_eurosci_voc.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7EurosciVoc(BaseModel): + """ + Fp7EurosciVoc + """ # noqa: E501 + code: Optional[StrictStr] = None + description: Optional[StrictStr] = None + id: Optional[StrictStr] = None + path: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7EurosciVoc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7EurosciVoc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "description": obj.get("description"), + "id": obj.get("id"), + "path": obj.get("path"), + "projectID": obj.get("projectID"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py new file mode 100644 index 00000000..b4868f44 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_legal_basis.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7LegalBasis(BaseModel): + """ + Fp7LegalBasis + """ # noqa: E501 + id: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart") + __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7LegalBasis from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7LegalBasis from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "legalBasis": obj.get("legalBasis"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "uniqueProgrammePart": obj.get("uniqueProgrammePart") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py new file mode 100644 index 00000000..9c6b1ffb --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_organization.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7Organization(BaseModel): + """ + Fp7Organization + """ # noqa: E501 + sme: Optional[StrictBool] = Field(default=None, alias="SME") + active: Optional[StrictBool] = None + activity_type: Optional[StrictStr] = Field(default=None, alias="activityType") + city: Optional[StrictStr] = None + contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm") + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + country: Optional[StrictStr] = None + ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecContribution") + end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation") + geolocation: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + net_ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="netEcContribution") + nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode") + order: Optional[StrictInt] = None + organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID") + organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL") + post_code: Optional[StrictStr] = Field(default=None, alias="postCode") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + role: Optional[StrictStr] = None + short_name: Optional[StrictStr] = Field(default=None, alias="shortName") + street: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber") + __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7Organization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7Organization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "SME": obj.get("SME"), + "active": obj.get("active"), + "activityType": obj.get("activityType"), + "city": obj.get("city"), + "contactForm": obj.get("contactForm"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "country": obj.get("country"), + "ecContribution": obj.get("ecContribution"), + "endOfParticipation": obj.get("endOfParticipation"), + "geolocation": obj.get("geolocation"), + "id": obj.get("id"), + "name": obj.get("name"), + "netEcContribution": obj.get("netEcContribution"), + "nutsCode": obj.get("nutsCode"), + "order": obj.get("order"), + "organisationID": obj.get("organisationID"), + "organizationURL": obj.get("organizationURL"), + "postCode": obj.get("postCode"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "role": obj.get("role"), + "shortName": obj.get("shortName"), + "street": obj.get("street"), + "totalCost": obj.get("totalCost"), + "vatNumber": obj.get("vatNumber") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py new file mode 100644 index 00000000..346bc4df --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7Project(BaseModel): + """ + Fp7Project + """ # noqa: E501 + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py new file mode 100644 index 00000000..be45d0db --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_details.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API - Extended Models +""" # noqa: E501 + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +# Import all the base models +from inse.models.projects_eu_cordis.fp7.fp7_project import Fp7Project +from inse.models.projects_eu_cordis.fp7.fp7_organization import Fp7Organization +from inse.models.projects_eu_cordis.fp7.fp7_publication import Fp7Publication +from inse.models.projects_eu_cordis.fp7.fp7_project_ipr import Fp7ProjectIPR +from inse.models.projects_eu_cordis.fp7.fp7_report_summary import Fp7ReportSummary +from inse.models.projects_eu_cordis.fp7.fp7_topic import Fp7Topic +from inse.models.projects_eu_cordis.fp7.fp7_web_link import Fp7WebLink +from inse.models.projects_eu_cordis.fp7.fp7_eurosci_voc import Fp7EurosciVoc +from inse.models.projects_eu_cordis.fp7.fp7_legal_basis import Fp7LegalBasis + + +class Fp7ProjectDetails(BaseModel): + """ + Comprehensive FP7 Project model combining all related entities. + This model extends the base Fp7Project with all associated data. + """ + # Project core information (flattened from Fp7Project) + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + + # Related entities (collections) + organizations: Optional[List[Fp7Organization]] = Field(default=None, description="Organizations participating in the project") + publications: Optional[List[Fp7Publication]] = Field(default=None, description="Publications related to the project") + iprs: Optional[List[Fp7ProjectIPR]] = Field(default=None, description="Intellectual Property Rights related to the project") + report_summaries: Optional[List[Fp7ReportSummary]] = Field(default=None, description="Report summaries for the project") + topics_list: Optional[List[Fp7Topic]] = Field(default=None, alias="topicsList", description="Topics associated with the project") + web_links: Optional[List[Fp7WebLink]] = Field(default=None, description="Web links related to the project") + eurosci_voc: Optional[List[Fp7EurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications") + legal_basis_list: Optional[List[Fp7LegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information") + + # Project statistics (aggregated) + organization_count: Optional[int] = Field(default=None, alias="organizationCount") + publication_count: Optional[int] = Field(default=None, alias="publicationCount") + ipr_count: Optional[int] = Field(default=None, alias="iprCount") + + __properties: ClassVar[List[str]] = [ + "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", + "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", + "humanValidated", "id", "keywords", "legalBasis", "masterCall", + "nature", "objective", "rcn", "startDate", "status", "subCall", + "title", "topics", "totalCost", + "organizations", "publications", "iprs", "reportSummaries", + "topicsList", "webLinks", "eurosciVoc", "legalBasisList", + "organizationCount", "publicationCount", "iprCount" + ] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + populate_by_name=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7ProjectDetailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias.""" + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7ProjectDetailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + # Project core fields + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost"), + + # Related entities + "organizations": [Fp7Organization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None, + "publications": [Fp7Publication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None, + "iprs": [Fp7ProjectIPR.from_dict(ipr) for ipr in obj.get("iprs", [])] if obj.get("iprs") else None, + "reportSummaries": [Fp7ReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None, + "topicsList": [Fp7Topic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None, + "webLinks": [Fp7WebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None, + "eurosciVoc": [Fp7EurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None, + "legalBasisList": [Fp7LegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None, + + # Statistics + "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0, + "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0, + "iprCount": len(obj.get("iprs", [])) if obj.get("iprs") else 0, + }) + return _obj + + @classmethod + def from_project_with_relations( + cls, + project: Fp7Project, + organizations: Optional[List[Fp7Organization]] = None, + publications: Optional[List[Fp7Publication]] = None, + iprs: Optional[List[Fp7ProjectIPR]] = None, + report_summaries: Optional[List[Fp7ReportSummary]] = None, + topics_list: Optional[List[Fp7Topic]] = None, + web_links: Optional[List[Fp7WebLink]] = None, + eurosci_voc: Optional[List[Fp7EurosciVoc]] = None, + legal_basis_list: Optional[List[Fp7LegalBasis]] = None, + ) -> Self: + """ + Factory method to create a detailed project from a base project and its relations. + + Args: + project: The base Fp7Project object + organizations: List of organizations participating in the project + publications: List of publications related to the project + iprs: List of IPRs related to the project + report_summaries: List of report summaries + topics_list: List of topics associated with the project + web_links: List of web links + eurosci_voc: List of EuroSciVoc classifications + legal_basis_list: List of legal basis information + + Returns: + Fp7ProjectDetailed instance + """ + project_dict = project.to_dict() if project else {} + + return cls( + **project_dict, + organizations=organizations or [], + publications=publications or [], + iprs=iprs or [], + reportSummaries=report_summaries or [], + topicsList=topics_list or [], + webLinks=web_links or [], + eurosciVoc=eurosci_voc or [], + legalBasisList=legal_basis_list or [], + organizationCount=len(organizations) if organizations else 0, + publicationCount=len(publications) if publications else 0, + iprCount=len(iprs) if iprs else 0, + ) \ No newline at end of file diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py new file mode 100644 index 00000000..cfbdd89b --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_project_ipr.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7ProjectIPR(BaseModel): + """ + Fp7ProjectIPR + """ # noqa: E501 + applicant_name: Optional[StrictStr] = Field(default=None, alias="applicantName") + application_date: Optional[date] = Field(default=None, alias="applicationDate") + application_identifier: Optional[StrictStr] = Field(default=None, alias="applicationIdentifier") + application_kind: Optional[StrictStr] = Field(default=None, alias="applicationKind") + application_prefix: Optional[StrictStr] = Field(default=None, alias="applicationPrefix") + award_date: Optional[date] = Field(default=None, alias="awardDate") + award_identifier: Optional[StrictStr] = Field(default=None, alias="awardIdentifier") + award_kind: Optional[StrictStr] = Field(default=None, alias="awardKind") + award_prefix: Optional[StrictStr] = Field(default=None, alias="awardPrefix") + epo_app_url: Optional[StrictStr] = Field(default=None, alias="epoAppUrl") + epo_pub_url: Optional[StrictStr] = Field(default=None, alias="epoPubUrl") + id: Optional[StrictStr] = None + organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID") + patent_family_identifier: Optional[StrictStr] = Field(default=None, alias="patentFamilyIdentifier") + patent_type: Optional[StrictStr] = Field(default=None, alias="patentType") + priority_date: Optional[date] = Field(default=None, alias="priorityDate") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["applicantName", "applicationDate", "applicationIdentifier", "applicationKind", "applicationPrefix", "awardDate", "awardIdentifier", "awardKind", "awardPrefix", "epoAppUrl", "epoPubUrl", "id", "organisationID", "patentFamilyIdentifier", "patentType", "priorityDate", "projectID", "title", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7ProjectIPR from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7ProjectIPR from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applicantName": obj.get("applicantName"), + "applicationDate": obj.get("applicationDate"), + "applicationIdentifier": obj.get("applicationIdentifier"), + "applicationKind": obj.get("applicationKind"), + "applicationPrefix": obj.get("applicationPrefix"), + "awardDate": obj.get("awardDate"), + "awardIdentifier": obj.get("awardIdentifier"), + "awardKind": obj.get("awardKind"), + "awardPrefix": obj.get("awardPrefix"), + "epoAppUrl": obj.get("epoAppUrl"), + "epoPubUrl": obj.get("epoPubUrl"), + "id": obj.get("id"), + "organisationID": obj.get("organisationID"), + "patentFamilyIdentifier": obj.get("patentFamilyIdentifier"), + "patentType": obj.get("patentType"), + "priorityDate": obj.get("priorityDate"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "type": obj.get("type") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py new file mode 100644 index 00000000..2e9ab1ff --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_publication.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7Publication(BaseModel): + """ + Fp7Publication + """ # noqa: E501 + authors: Optional[StrictStr] = None + collection: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + doi: Optional[StrictStr] = None + id: Optional[StrictStr] = None + is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs") + journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber") + journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages") + published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear") + publisher: Optional[StrictStr] = None + qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi") + rcn: Optional[StrictStr] = None + repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl") + title: Optional[StrictStr] = None + volume: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7Publication from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7Publication from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authors": obj.get("authors"), + "collection": obj.get("collection"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "doi": obj.get("doi"), + "id": obj.get("id"), + "isPublishedAs": obj.get("isPublishedAs"), + "journalNumber": obj.get("journalNumber"), + "journalTitle": obj.get("journalTitle"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "publishedPages": obj.get("publishedPages"), + "publishedYear": obj.get("publishedYear"), + "publisher": obj.get("publisher"), + "qaProcessedDoi": obj.get("qaProcessedDoi"), + "rcn": obj.get("rcn"), + "repositoryUrl": obj.get("repositoryUrl"), + "title": obj.get("title"), + "volume": obj.get("volume") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py new file mode 100644 index 00000000..43ce8910 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_report_summary.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7ReportSummary(BaseModel): + """ + Fp7ReportSummary + """ # noqa: E501 + attachments: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + id: Optional[StrictStr] = None + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7ReportSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7ReportSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachments": obj.get("attachments"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "id": obj.get("id"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py new file mode 100644 index 00000000..27a59a47 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_topic.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7Topic(BaseModel): + """ + Fp7Topic + """ # noqa: E501 + id: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + topic: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7Topic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7Topic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "topic": obj.get("topic") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py new file mode 100644 index 00000000..6898b07f --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/fp7/fp7_web_link.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + CORDIS FP7 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Fp7WebLink(BaseModel): + """ + Fp7WebLink + """ # noqa: E501 + archived_date: Optional[datetime] = Field(default=None, alias="archivedDate") + available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages") + id: Optional[StrictStr] = None + link_id: Optional[StrictStr] = Field(default=None, alias="linkId") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + represents: Optional[StrictStr] = None + source: Optional[StrictStr] = None + status: Optional[StrictStr] = None + type: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Fp7WebLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Fp7WebLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "archivedDate": obj.get("archivedDate"), + "availableLanguages": obj.get("availableLanguages"), + "id": obj.get("id"), + "linkId": obj.get("linkId"), + "projectID": obj.get("projectID"), + "represents": obj.get("represents"), + "source": obj.get("source"), + "status": obj.get("status"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + -- 2.56.1 From ee7bd7ba05d0d6b664e0883618afbfc0d795e2a4 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 23:56:39 +0200 Subject: [PATCH 07/42] generated models for EU projects horizon 2020 programm indexes --- .../horizon2020/h2020_deliverable.py | 103 ++++++++ .../horizon2020/h2020_erc_pi.py | 102 ++++++++ .../horizon2020/h2020_eurosci_voc.py | 98 ++++++++ .../horizon2020/h2020_legal_basis.py | 96 ++++++++ .../horizon2020/h2020_organization.py | 139 +++++++++++ .../horizon2020/h2020_project.py | 131 ++++++++++ .../horizon2020/h2020_project_details.py | 224 ++++++++++++++++++ .../horizon2020/h2020_publication.py | 123 ++++++++++ .../horizon2020/h2020_report_summary.py | 101 ++++++++ .../horizon2020/h2020_topic.py | 94 ++++++++ .../horizon2020/h2020_web_link.py | 107 +++++++++ 11 files changed, 1318 insertions(+) create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py new file mode 100644 index 00000000..29166ca3 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_deliverable.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020Deliverable(BaseModel): + """ + H2020Deliverable + """ # noqa: E501 + collection: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + deliverable_type: Optional[StrictStr] = Field(default=None, alias="deliverableType") + description: Optional[StrictStr] = None + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["collection", "contentUpdateDate", "deliverableType", "description", "projectAcronym", "projectID", "rcn", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020Deliverable from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020Deliverable from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "collection": obj.get("collection"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "deliverableType": obj.get("deliverableType"), + "description": obj.get("description"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "url": obj.get("url") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py new file mode 100644 index 00000000..b16ed4d0 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_erc_pi.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020ErcPI(BaseModel): + """ + H2020ErcPI + """ # noqa: E501 + first_name: Optional[StrictStr] = Field(default=None, alias="firstName") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + id: Optional[StrictStr] = None + last_name: Optional[StrictStr] = Field(default=None, alias="lastName") + organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["firstName", "fundingScheme", "id", "lastName", "organisationID", "projectAcronym", "projectID", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020ErcPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020ErcPI from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "firstName": obj.get("firstName"), + "fundingScheme": obj.get("fundingScheme"), + "id": obj.get("id"), + "lastName": obj.get("lastName"), + "organisationID": obj.get("organisationID"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py new file mode 100644 index 00000000..f6227b6c --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_eurosci_voc.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020EurosciVoc(BaseModel): + """ + H2020EurosciVoc + """ # noqa: E501 + code: Optional[StrictStr] = None + description: Optional[StrictStr] = None + id: Optional[StrictStr] = None + path: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020EurosciVoc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020EurosciVoc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "description": obj.get("description"), + "id": obj.get("id"), + "path": obj.get("path"), + "projectID": obj.get("projectID"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py new file mode 100644 index 00000000..43327f68 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_legal_basis.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020LegalBasis(BaseModel): + """ + H2020LegalBasis + """ # noqa: E501 + id: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart") + __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020LegalBasis from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020LegalBasis from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "legalBasis": obj.get("legalBasis"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "uniqueProgrammePart": obj.get("uniqueProgrammePart") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py new file mode 100644 index 00000000..057c1b71 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_organization.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020Organization(BaseModel): + """ + H2020Organization + """ # noqa: E501 + sme: Optional[StrictBool] = Field(default=None, alias="SME") + active: Optional[StrictBool] = None + activity_type: Optional[StrictStr] = Field(default=None, alias="activityType") + city: Optional[StrictStr] = None + contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm") + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + country: Optional[StrictStr] = None + ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecContribution") + end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation") + geolocation: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + net_ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="netEcContribution") + nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode") + order: Optional[StrictInt] = None + organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID") + organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL") + post_code: Optional[StrictStr] = Field(default=None, alias="postCode") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + role: Optional[StrictStr] = None + short_name: Optional[StrictStr] = Field(default=None, alias="shortName") + street: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber") + __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020Organization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020Organization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "SME": obj.get("SME"), + "active": obj.get("active"), + "activityType": obj.get("activityType"), + "city": obj.get("city"), + "contactForm": obj.get("contactForm"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "country": obj.get("country"), + "ecContribution": obj.get("ecContribution"), + "endOfParticipation": obj.get("endOfParticipation"), + "geolocation": obj.get("geolocation"), + "id": obj.get("id"), + "name": obj.get("name"), + "netEcContribution": obj.get("netEcContribution"), + "nutsCode": obj.get("nutsCode"), + "order": obj.get("order"), + "organisationID": obj.get("organisationID"), + "organizationURL": obj.get("organizationURL"), + "postCode": obj.get("postCode"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "role": obj.get("role"), + "shortName": obj.get("shortName"), + "street": obj.get("street"), + "totalCost": obj.get("totalCost"), + "vatNumber": obj.get("vatNumber") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py new file mode 100644 index 00000000..5aa572bd --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020Project(BaseModel): + """ + H2020Project + """ # noqa: E501 + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py new file mode 100644 index 00000000..fe0e3478 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_project_details.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API - Extended Models +""" # noqa: E501 + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +# Import all the base models +from inse.models.projects_eu_cordis.horizon2020.h2020_project import H2020Project +from inse.models.projects_eu_cordis.horizon2020.h2020_organization import H2020Organization +from inse.models.projects_eu_cordis.horizon2020.h2020_publication import H2020Publication +from inse.models.projects_eu_cordis.horizon2020.h2020_deliverable import H2020Deliverable +from inse.models.projects_eu_cordis.horizon2020.h2020_report_summary import H2020ReportSummary +from inse.models.projects_eu_cordis.horizon2020.h2020_topic import H2020Topic +from inse.models.projects_eu_cordis.horizon2020.h2020_web_link import H2020WebLink +from inse.models.projects_eu_cordis.horizon2020.h2020_eurosci_voc import H2020EurosciVoc +from inse.models.projects_eu_cordis.horizon2020.h2020_legal_basis import H2020LegalBasis +from inse.models.projects_eu_cordis.horizon2020.h2020_erc_pi import H2020ErcPI + + +class H2020ProjectDetails(BaseModel): + """ + Comprehensive Horizon 2020 Project model combining all related entities. + This model extends the base H2020Project with all associated data. + """ + # Project core information (flattened from H2020Project) + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + + # Related entities (collections) + organizations: Optional[List[H2020Organization]] = Field(default=None, description="Organizations participating in the project") + publications: Optional[List[H2020Publication]] = Field(default=None, description="Publications related to the project") + deliverables: Optional[List[H2020Deliverable]] = Field(default=None, description="Deliverables of the project") + report_summaries: Optional[List[H2020ReportSummary]] = Field(default=None, alias="reportSummaries", description="Report summaries for the project") + topics_list: Optional[List[H2020Topic]] = Field(default=None, alias="topicsList", description="Topics associated with the project") + web_links: Optional[List[H2020WebLink]] = Field(default=None, alias="webLinks", description="Web links related to the project") + eurosci_voc: Optional[List[H2020EurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications") + legal_basis_list: Optional[List[H2020LegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information") + erc_principal_investigators: Optional[List[H2020ErcPI]] = Field(default=None, alias="ercPrincipalInvestigators", description="ERC Principal Investigators (specific to H2020)") + + # Project statistics (aggregated) + organization_count: Optional[int] = Field(default=None, alias="organizationCount") + publication_count: Optional[int] = Field(default=None, alias="publicationCount") + deliverable_count: Optional[int] = Field(default=None, alias="deliverableCount") + erc_pi_count: Optional[int] = Field(default=None, alias="ercPiCount") + + __properties: ClassVar[List[str]] = [ + "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", + "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", + "humanValidated", "id", "keywords", "legalBasis", "masterCall", + "nature", "objective", "rcn", "startDate", "status", "subCall", + "title", "topics", "totalCost", + "organizations", "publications", "deliverables", "reportSummaries", + "topicsList", "webLinks", "eurosciVoc", "legalBasisList", + "ercPrincipalInvestigators", + "organizationCount", "publicationCount", "deliverableCount", "ercPiCount" + ] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + populate_by_name=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020ProjectDetailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias.""" + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020ProjectDetailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + # Project core fields + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost"), + + # Related entities + "organizations": [H2020Organization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None, + "publications": [H2020Publication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None, + "deliverables": [H2020Deliverable.from_dict(deliv) for deliv in obj.get("deliverables", [])] if obj.get("deliverables") else None, + "reportSummaries": [H2020ReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None, + "topicsList": [H2020Topic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None, + "webLinks": [H2020WebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None, + "eurosciVoc": [H2020EurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None, + "legalBasisList": [H2020LegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None, + "ercPrincipalInvestigators": [H2020ErcPI.from_dict(pi) for pi in obj.get("ercPrincipalInvestigators", [])] if obj.get("ercPrincipalInvestigators") else None, + + # Statistics + "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0, + "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0, + "deliverableCount": len(obj.get("deliverables", [])) if obj.get("deliverables") else 0, + "ercPiCount": len(obj.get("ercPrincipalInvestigators", [])) if obj.get("ercPrincipalInvestigators") else 0, + }) + return _obj + + @classmethod + def from_project_with_relations( + cls, + project: H2020Project, + organizations: Optional[List[H2020Organization]] = None, + publications: Optional[List[H2020Publication]] = None, + deliverables: Optional[List[H2020Deliverable]] = None, + report_summaries: Optional[List[H2020ReportSummary]] = None, + topics_list: Optional[List[H2020Topic]] = None, + web_links: Optional[List[H2020WebLink]] = None, + eurosci_voc: Optional[List[H2020EurosciVoc]] = None, + legal_basis_list: Optional[List[H2020LegalBasis]] = None, + erc_principal_investigators: Optional[List[H2020ErcPI]] = None, + ) -> Self: + """ + Factory method to create a detailed project from a base project and its relations. + + Args: + project: The base H2020Project object + organizations: List of organizations participating in the project + publications: List of publications related to the project + deliverables: List of deliverables of the project + report_summaries: List of report summaries + topics_list: List of topics associated with the project + web_links: List of web links + eurosci_voc: List of EuroSciVoc classifications + legal_basis_list: List of legal basis information + erc_principal_investigators: List of ERC Principal Investigators + + Returns: + H2020ProjectDetailed instance + """ + project_dict = project.to_dict() if project else {} + + return cls( + **project_dict, + organizations=organizations or [], + publications=publications or [], + deliverables=deliverables or [], + reportSummaries=report_summaries or [], + topicsList=topics_list or [], + webLinks=web_links or [], + eurosciVoc=eurosci_voc or [], + legalBasisList=legal_basis_list or [], + ercPrincipalInvestigators=erc_principal_investigators or [], + organizationCount=len(organizations) if organizations else 0, + publicationCount=len(publications) if publications else 0, + deliverableCount=len(deliverables) if deliverables else 0, + ercPiCount=len(erc_principal_investigators) if erc_principal_investigators else 0, + ) \ No newline at end of file diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py new file mode 100644 index 00000000..ffe9a440 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_publication.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020Publication(BaseModel): + """ + H2020Publication + """ # noqa: E501 + authors: Optional[StrictStr] = None + collection: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + doi: Optional[StrictStr] = None + id: Optional[StrictStr] = None + is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs") + journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber") + journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages") + published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear") + publisher: Optional[StrictStr] = None + qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi") + rcn: Optional[StrictStr] = None + repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl") + title: Optional[StrictStr] = None + volume: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020Publication from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020Publication from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authors": obj.get("authors"), + "collection": obj.get("collection"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "doi": obj.get("doi"), + "id": obj.get("id"), + "isPublishedAs": obj.get("isPublishedAs"), + "journalNumber": obj.get("journalNumber"), + "journalTitle": obj.get("journalTitle"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "publishedPages": obj.get("publishedPages"), + "publishedYear": obj.get("publishedYear"), + "publisher": obj.get("publisher"), + "qaProcessedDoi": obj.get("qaProcessedDoi"), + "rcn": obj.get("rcn"), + "repositoryUrl": obj.get("repositoryUrl"), + "title": obj.get("title"), + "volume": obj.get("volume") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py new file mode 100644 index 00000000..e1f7e49f --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_report_summary.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020ReportSummary(BaseModel): + """ + H2020ReportSummary + """ # noqa: E501 + attachments: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + id: Optional[StrictStr] = None + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020ReportSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020ReportSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachments": obj.get("attachments"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "id": obj.get("id"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py new file mode 100644 index 00000000..0c6bedbb --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_topic.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020Topic(BaseModel): + """ + H2020Topic + """ # noqa: E501 + id: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + topic: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020Topic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020Topic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "topic": obj.get("topic") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py new file mode 100644 index 00000000..a8e45638 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon2020/h2020_web_link.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + CORDIS Horizon 2020 Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class H2020WebLink(BaseModel): + """ + H2020WebLink + """ # noqa: E501 + archived_date: Optional[datetime] = Field(default=None, alias="archivedDate") + available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages") + id: Optional[StrictStr] = None + link_id: Optional[StrictStr] = Field(default=None, alias="linkId") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + represents: Optional[StrictStr] = None + source: Optional[StrictStr] = None + status: Optional[StrictStr] = None + type: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of H2020WebLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of H2020WebLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "archivedDate": obj.get("archivedDate"), + "availableLanguages": obj.get("availableLanguages"), + "id": obj.get("id"), + "linkId": obj.get("linkId"), + "projectID": obj.get("projectID"), + "represents": obj.get("represents"), + "source": obj.get("source"), + "status": obj.get("status"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + -- 2.56.1 From 6ae5f3e620cd6b03090ad3e14a4051e3ebb90675 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 22 Jun 2026 23:57:04 +0200 Subject: [PATCH 08/42] generated models for EU projects horizon_europe programm indexes --- .../horizon_europe/heu_deliverable.py | 103 +++++++++ .../horizon_europe/heu_eurosci_voc.py | 98 ++++++++ .../horizon_europe/heu_legal_basis.py | 96 ++++++++ .../horizon_europe/heu_organization.py | 139 ++++++++++++ .../horizon_europe/heu_project.py | 131 +++++++++++ .../horizon_europe/heu_project_details.py | 214 ++++++++++++++++++ .../horizon_europe/heu_publication.py | 123 ++++++++++ .../horizon_europe/heu_report_summary.py | 101 +++++++++ .../horizon_europe/heu_topic.py | 94 ++++++++ .../horizon_europe/heu_web_link.py | 107 +++++++++ 10 files changed, 1206 insertions(+) create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py create mode 100644 service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py new file mode 100644 index 00000000..ba858158 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_deliverable.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUDeliverable(BaseModel): + """ + HEUDeliverable + """ # noqa: E501 + collection: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + deliverable_type: Optional[StrictStr] = Field(default=None, alias="deliverableType") + description: Optional[StrictStr] = None + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["collection", "contentUpdateDate", "deliverableType", "description", "projectAcronym", "projectID", "rcn", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUDeliverable from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUDeliverable from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "collection": obj.get("collection"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "deliverableType": obj.get("deliverableType"), + "description": obj.get("description"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "url": obj.get("url") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py new file mode 100644 index 00000000..586f3777 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_eurosci_voc.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUEurosciVoc(BaseModel): + """ + HEUEurosciVoc + """ # noqa: E501 + code: Optional[StrictStr] = None + description: Optional[StrictStr] = None + id: Optional[StrictStr] = None + path: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "description", "id", "path", "projectID", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUEurosciVoc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUEurosciVoc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "description": obj.get("description"), + "id": obj.get("id"), + "path": obj.get("path"), + "projectID": obj.get("projectID"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py new file mode 100644 index 00000000..0c4e288e --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_legal_basis.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEULegalBasis(BaseModel): + """ + HEULegalBasis + """ # noqa: E501 + id: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + unique_programme_part: Optional[StrictStr] = Field(default=None, alias="uniqueProgrammePart") + __properties: ClassVar[List[str]] = ["id", "legalBasis", "projectID", "title", "uniqueProgrammePart"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEULegalBasis from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEULegalBasis from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "legalBasis": obj.get("legalBasis"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "uniqueProgrammePart": obj.get("uniqueProgrammePart") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py new file mode 100644 index 00000000..109a5a5a --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_organization.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUOrganization(BaseModel): + """ + HEUOrganization + """ # noqa: E501 + sme: Optional[StrictBool] = Field(default=None, alias="SME") + active: Optional[StrictBool] = None + activity_type: Optional[StrictStr] = Field(default=None, alias="activityType") + city: Optional[StrictStr] = None + contact_form: Optional[StrictStr] = Field(default=None, alias="contactForm") + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + country: Optional[StrictStr] = None + ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecContribution") + end_of_participation: Optional[StrictBool] = Field(default=None, alias="endOfParticipation") + geolocation: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + net_ec_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="netEcContribution") + nuts_code: Optional[StrictStr] = Field(default=None, alias="nutsCode") + order: Optional[StrictInt] = None + organisation_id: Optional[StrictStr] = Field(default=None, alias="organisationID") + organization_url: Optional[StrictStr] = Field(default=None, alias="organizationURL") + post_code: Optional[StrictStr] = Field(default=None, alias="postCode") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + role: Optional[StrictStr] = None + short_name: Optional[StrictStr] = Field(default=None, alias="shortName") + street: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + vat_number: Optional[StrictStr] = Field(default=None, alias="vatNumber") + __properties: ClassVar[List[str]] = ["SME", "active", "activityType", "city", "contactForm", "contentUpdateDate", "country", "ecContribution", "endOfParticipation", "geolocation", "id", "name", "netEcContribution", "nutsCode", "order", "organisationID", "organizationURL", "postCode", "projectAcronym", "projectID", "rcn", "role", "shortName", "street", "totalCost", "vatNumber"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUOrganization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUOrganization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "SME": obj.get("SME"), + "active": obj.get("active"), + "activityType": obj.get("activityType"), + "city": obj.get("city"), + "contactForm": obj.get("contactForm"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "country": obj.get("country"), + "ecContribution": obj.get("ecContribution"), + "endOfParticipation": obj.get("endOfParticipation"), + "geolocation": obj.get("geolocation"), + "id": obj.get("id"), + "name": obj.get("name"), + "netEcContribution": obj.get("netEcContribution"), + "nutsCode": obj.get("nutsCode"), + "order": obj.get("order"), + "organisationID": obj.get("organisationID"), + "organizationURL": obj.get("organizationURL"), + "postCode": obj.get("postCode"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "role": obj.get("role"), + "shortName": obj.get("shortName"), + "street": obj.get("street"), + "totalCost": obj.get("totalCost"), + "vatNumber": obj.get("vatNumber") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py new file mode 100644 index 00000000..c843fc17 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUProject(BaseModel): + """ + HEUProject + """ # noqa: E501 + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + __properties: ClassVar[List[str]] = ["acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", "humanValidated", "id", "keywords", "legalBasis", "masterCall", "nature", "objective", "rcn", "startDate", "status", "subCall", "title", "topics", "totalCost"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUProject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUProject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py new file mode 100644 index 00000000..05bacd3a --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_project_details.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API - Extended Models +""" # noqa: E501 + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +# Import all the base models +from inse.models.projects_eu_cordis.horizon_europe.heu_project import HEUProject +from inse.models.projects_eu_cordis.horizon_europe.heu_organization import HEUOrganization +from inse.models.projects_eu_cordis.horizon_europe.heu_publication import HEUPublication +from inse.models.projects_eu_cordis.horizon_europe.heu_deliverable import HEUDeliverable +from inse.models.projects_eu_cordis.horizon_europe.heu_report_summary import HEUReportSummary +from inse.models.projects_eu_cordis.horizon_europe.heu_topic import HEUTopic +from inse.models.projects_eu_cordis.horizon_europe.heu_web_link import HEUWebLink +from inse.models.projects_eu_cordis.horizon_europe.heu_eurosci_voc import HEUEurosciVoc +from inse.models.projects_eu_cordis.horizon_europe.heu_legal_basis import HEULegalBasis + + +class HEUProjectDetails(BaseModel): + """ + Comprehensive Horizon Europe Project model combining all related entities. + This model extends the base HEUProject with all associated data. + """ + # Project core information (flattened from HEUProject) + acronym: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + ec_max_contribution: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="ecMaxContribution") + ec_signature_date: Optional[date] = Field(default=None, alias="ecSignatureDate") + end_date: Optional[date] = Field(default=None, alias="endDate") + framework_programme: Optional[StrictStr] = Field(default=None, alias="frameworkProgramme") + funding_scheme: Optional[StrictStr] = Field(default=None, alias="fundingScheme") + grant_doi: Optional[StrictStr] = Field(default=None, alias="grantDoi") + human_validated: Optional[StrictBool] = Field(default=None, alias="humanValidated") + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + legal_basis: Optional[StrictStr] = Field(default=None, alias="legalBasis") + master_call: Optional[StrictStr] = Field(default=None, alias="masterCall") + nature: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + rcn: Optional[StrictStr] = None + start_date: Optional[date] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + sub_call: Optional[StrictStr] = Field(default=None, alias="subCall") + title: Optional[StrictStr] = None + topics: Optional[StrictStr] = None + total_cost: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalCost") + + # Related entities (collections) + organizations: Optional[List[HEUOrganization]] = Field(default=None, description="Organizations participating in the project") + publications: Optional[List[HEUPublication]] = Field(default=None, description="Publications related to the project") + deliverables: Optional[List[HEUDeliverable]] = Field(default=None, description="Deliverables of the project") + report_summaries: Optional[List[HEUReportSummary]] = Field(default=None, alias="reportSummaries", description="Report summaries for the project") + topics_list: Optional[List[HEUTopic]] = Field(default=None, alias="topicsList", description="Topics associated with the project") + web_links: Optional[List[HEUWebLink]] = Field(default=None, alias="webLinks", description="Web links related to the project") + eurosci_voc: Optional[List[HEUEurosciVoc]] = Field(default=None, alias="eurosciVoc", description="EuroSciVoc classifications") + legal_basis_list: Optional[List[HEULegalBasis]] = Field(default=None, alias="legalBasisList", description="Legal basis information") + + # Project statistics (aggregated) + organization_count: Optional[int] = Field(default=None, alias="organizationCount") + publication_count: Optional[int] = Field(default=None, alias="publicationCount") + deliverable_count: Optional[int] = Field(default=None, alias="deliverableCount") + + __properties: ClassVar[List[str]] = [ + "acronym", "contentUpdateDate", "ecMaxContribution", "ecSignatureDate", + "endDate", "frameworkProgramme", "fundingScheme", "grantDoi", + "humanValidated", "id", "keywords", "legalBasis", "masterCall", + "nature", "objective", "rcn", "startDate", "status", "subCall", + "title", "topics", "totalCost", + "organizations", "publications", "deliverables", "reportSummaries", + "topicsList", "webLinks", "eurosciVoc", "legalBasisList", + "organizationCount", "publicationCount", "deliverableCount" + ] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + populate_by_name=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUProjectDetailed from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias.""" + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUProjectDetailed from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + # Project core fields + "acronym": obj.get("acronym"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "ecSignatureDate": obj.get("ecSignatureDate"), + "endDate": obj.get("endDate"), + "frameworkProgramme": obj.get("frameworkProgramme"), + "fundingScheme": obj.get("fundingScheme"), + "grantDoi": obj.get("grantDoi"), + "humanValidated": obj.get("humanValidated"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "legalBasis": obj.get("legalBasis"), + "masterCall": obj.get("masterCall"), + "nature": obj.get("nature"), + "objective": obj.get("objective"), + "rcn": obj.get("rcn"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "subCall": obj.get("subCall"), + "title": obj.get("title"), + "topics": obj.get("topics"), + "totalCost": obj.get("totalCost"), + + # Related entities + "organizations": [HEUOrganization.from_dict(org) for org in obj.get("organizations", [])] if obj.get("organizations") else None, + "publications": [HEUPublication.from_dict(pub) for pub in obj.get("publications", [])] if obj.get("publications") else None, + "deliverables": [HEUDeliverable.from_dict(deliv) for deliv in obj.get("deliverables", [])] if obj.get("deliverables") else None, + "reportSummaries": [HEUReportSummary.from_dict(report) for report in obj.get("reportSummaries", [])] if obj.get("reportSummaries") else None, + "topicsList": [HEUTopic.from_dict(topic) for topic in obj.get("topicsList", [])] if obj.get("topicsList") else None, + "webLinks": [HEUWebLink.from_dict(link) for link in obj.get("webLinks", [])] if obj.get("webLinks") else None, + "eurosciVoc": [HEUEurosciVoc.from_dict(voc) for voc in obj.get("eurosciVoc", [])] if obj.get("eurosciVoc") else None, + "legalBasisList": [HEULegalBasis.from_dict(lb) for lb in obj.get("legalBasisList", [])] if obj.get("legalBasisList") else None, + + # Statistics + "organizationCount": len(obj.get("organizations", [])) if obj.get("organizations") else 0, + "publicationCount": len(obj.get("publications", [])) if obj.get("publications") else 0, + "deliverableCount": len(obj.get("deliverables", [])) if obj.get("deliverables") else 0, + }) + return _obj + + @classmethod + def from_project_with_relations( + cls, + project: HEUProject, + organizations: Optional[List[HEUOrganization]] = None, + publications: Optional[List[HEUPublication]] = None, + deliverables: Optional[List[HEUDeliverable]] = None, + report_summaries: Optional[List[HEUReportSummary]] = None, + topics_list: Optional[List[HEUTopic]] = None, + web_links: Optional[List[HEUWebLink]] = None, + eurosci_voc: Optional[List[HEUEurosciVoc]] = None, + legal_basis_list: Optional[List[HEULegalBasis]] = None, + ) -> Self: + """ + Factory method to create a detailed project from a base project and its relations. + + Args: + project: The base HEUProject object + organizations: List of organizations participating in the project + publications: List of publications related to the project + deliverables: List of deliverables of the project + report_summaries: List of report summaries + topics_list: List of topics associated with the project + web_links: List of web links + eurosci_voc: List of EuroSciVoc classifications + legal_basis_list: List of legal basis information + + Returns: + HEUProjectDetailed instance + """ + project_dict = project.to_dict() if project else {} + + return cls( + **project_dict, + organizations=organizations or [], + publications=publications or [], + deliverables=deliverables or [], + reportSummaries=report_summaries or [], + topicsList=topics_list or [], + webLinks=web_links or [], + eurosciVoc=eurosci_voc or [], + legalBasisList=legal_basis_list or [], + organizationCount=len(organizations) if organizations else 0, + publicationCount=len(publications) if publications else 0, + deliverableCount=len(deliverables) if deliverables else 0, + ) \ No newline at end of file diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py new file mode 100644 index 00000000..9d3424df --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_publication.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUPublication(BaseModel): + """ + HEUPublication + """ # noqa: E501 + authors: Optional[StrictStr] = None + collection: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + doi: Optional[StrictStr] = None + id: Optional[StrictStr] = None + is_published_as: Optional[StrictStr] = Field(default=None, alias="isPublishedAs") + journal_number: Optional[StrictStr] = Field(default=None, alias="journalNumber") + journal_title: Optional[StrictStr] = Field(default=None, alias="journalTitle") + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + published_pages: Optional[StrictStr] = Field(default=None, alias="publishedPages") + published_year: Optional[StrictInt] = Field(default=None, alias="publishedYear") + publisher: Optional[StrictStr] = None + qa_processed_doi: Optional[StrictStr] = Field(default=None, alias="qaProcessedDoi") + rcn: Optional[StrictStr] = None + repository_url: Optional[StrictStr] = Field(default=None, alias="repositoryUrl") + title: Optional[StrictStr] = None + volume: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["authors", "collection", "contentUpdateDate", "doi", "id", "isPublishedAs", "journalNumber", "journalTitle", "projectAcronym", "projectID", "publishedPages", "publishedYear", "publisher", "qaProcessedDoi", "rcn", "repositoryUrl", "title", "volume"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUPublication from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUPublication from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authors": obj.get("authors"), + "collection": obj.get("collection"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "doi": obj.get("doi"), + "id": obj.get("id"), + "isPublishedAs": obj.get("isPublishedAs"), + "journalNumber": obj.get("journalNumber"), + "journalTitle": obj.get("journalTitle"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "publishedPages": obj.get("publishedPages"), + "publishedYear": obj.get("publishedYear"), + "publisher": obj.get("publisher"), + "qaProcessedDoi": obj.get("qaProcessedDoi"), + "rcn": obj.get("rcn"), + "repositoryUrl": obj.get("repositoryUrl"), + "title": obj.get("title"), + "volume": obj.get("volume") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py new file mode 100644 index 00000000..bf5850fc --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_report_summary.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUReportSummary(BaseModel): + """ + HEUReportSummary + """ # noqa: E501 + attachments: Optional[StrictStr] = None + content_update_date: Optional[datetime] = Field(default=None, alias="contentUpdateDate") + id: Optional[StrictStr] = None + project_acronym: Optional[StrictStr] = Field(default=None, alias="projectAcronym") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + rcn: Optional[StrictStr] = None + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["attachments", "contentUpdateDate", "id", "projectAcronym", "projectID", "rcn", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUReportSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUReportSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachments": obj.get("attachments"), + "contentUpdateDate": obj.get("contentUpdateDate"), + "id": obj.get("id"), + "projectAcronym": obj.get("projectAcronym"), + "projectID": obj.get("projectID"), + "rcn": obj.get("rcn"), + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py new file mode 100644 index 00000000..4aa58787 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_topic.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUTopic(BaseModel): + """ + HEUTopic + """ # noqa: E501 + id: Optional[StrictStr] = None + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + title: Optional[StrictStr] = None + topic: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "projectID", "title", "topic"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUTopic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUTopic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "projectID": obj.get("projectID"), + "title": obj.get("title"), + "topic": obj.get("topic") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py new file mode 100644 index 00000000..50797815 --- /dev/null +++ b/service/src/main/inse/models/projects_eu_cordis/horizon_europe/heu_web_link.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + CORDIS Horizon Europe Multi-Index API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HEUWebLink(BaseModel): + """ + HEUWebLink + """ # noqa: E501 + archived_date: Optional[datetime] = Field(default=None, alias="archivedDate") + available_languages: Optional[StrictStr] = Field(default=None, alias="availableLanguages") + id: Optional[StrictStr] = None + link_id: Optional[StrictStr] = Field(default=None, alias="linkId") + project_id: Optional[StrictStr] = Field(default=None, alias="projectID") + represents: Optional[StrictStr] = None + source: Optional[StrictStr] = None + status: Optional[StrictStr] = None + type: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["archivedDate", "availableLanguages", "id", "linkId", "projectID", "represents", "source", "status", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HEUWebLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HEUWebLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "archivedDate": obj.get("archivedDate"), + "availableLanguages": obj.get("availableLanguages"), + "id": obj.get("id"), + "linkId": obj.get("linkId"), + "projectID": obj.get("projectID"), + "represents": obj.get("represents"), + "source": obj.get("source"), + "status": obj.get("status"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + -- 2.56.1 From ba384dffbb52deedc6263d94fcbc0763607fa3c5 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:03:08 +0200 Subject: [PATCH 09/42] created data enrichment logic for EU projects --- .../eu_cordis_projects_enrichment_client.py | 372 ++++++++++++++++++ 1 file changed, 372 insertions(+) create mode 100644 service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py diff --git a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py new file mode 100644 index 00000000..88e314cb --- /dev/null +++ b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py @@ -0,0 +1,372 @@ +import json +import logging +from typing import Any, Dict, List, Optional, Union + +from inse.config import get_settings +from inse.integrations import elasticsearch +from inse.model import ESCluster, ESIndex + +# Import base models +from inse.models.cordis_eu_project import CordisEuProject + +# Import FP7 models +from inse.models.projects_eu_cordis.fp7.fp7_project import Fp7Project +from inse.models.projects_eu_cordis.fp7.fp7_organization import Fp7Organization +from inse.models.projects_eu_cordis.fp7.fp7_publication import Fp7Publication +from inse.models.projects_eu_cordis.fp7.fp7_project_ipr import Fp7ProjectIPR +from inse.models.projects_eu_cordis.fp7.fp7_report_summary import Fp7ReportSummary +from inse.models.projects_eu_cordis.fp7.fp7_topic import Fp7Topic +from inse.models.projects_eu_cordis.fp7.fp7_web_link import Fp7WebLink +from inse.models.projects_eu_cordis.fp7.fp7_eurosci_voc import Fp7EurosciVoc +from inse.models.projects_eu_cordis.fp7.fp7_legal_basis import Fp7LegalBasis +from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails + +# Import H2020 models +from inse.models.projects_eu_cordis.horizon2020.h2020_project import H2020Project +from inse.models.projects_eu_cordis.horizon2020.h2020_organization import H2020Organization +from inse.models.projects_eu_cordis.horizon2020.h2020_publication import H2020Publication +from inse.models.projects_eu_cordis.horizon2020.h2020_deliverable import H2020Deliverable +from inse.models.projects_eu_cordis.horizon2020.h2020_report_summary import H2020ReportSummary +from inse.models.projects_eu_cordis.horizon2020.h2020_topic import H2020Topic +from inse.models.projects_eu_cordis.horizon2020.h2020_web_link import H2020WebLink +from inse.models.projects_eu_cordis.horizon2020.h2020_eurosci_voc import H2020EurosciVoc +from inse.models.projects_eu_cordis.horizon2020.h2020_legal_basis import H2020LegalBasis +from inse.models.projects_eu_cordis.horizon2020.h2020_erc_pi import H2020ErcPI +from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails + +# Import Horizon Europe models +from inse.models.projects_eu_cordis.horizon_europe.heu_project import HEUProject +from inse.models.projects_eu_cordis.horizon_europe.heu_organization import HEUOrganization +from inse.models.projects_eu_cordis.horizon_europe.heu_publication import HEUPublication +from inse.models.projects_eu_cordis.horizon_europe.heu_deliverable import HEUDeliverable +from inse.models.projects_eu_cordis.horizon_europe.heu_report_summary import HEUReportSummary +from inse.models.projects_eu_cordis.horizon_europe.heu_topic import HEUTopic +from inse.models.projects_eu_cordis.horizon_europe.heu_web_link import HEUWebLink +from inse.models.projects_eu_cordis.horizon_europe.heu_eurosci_voc import HEUEurosciVoc +from inse.models.projects_eu_cordis.horizon_europe.heu_legal_basis import HEULegalBasis +from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails + +settings = get_settings() +logger = logging.getLogger(__name__) +logger.setLevel(settings.logging_level) + + +def get_enriched_cordis_project_by_id( + project_id: str, +) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]: + """ + Fetches and enriches a single Cordis EU project by its ID across all program types. + + Args: + project_id: The project ID to fetch + + Returns: + The enriched detailed project model, or None if not found + """ + if not project_id: + return None + + # Step 1: Search for the project across all indices + query = {"bool": {"filter": [{"term": {"id": project_id}}]}} + + response = elasticsearch.search( + query=query, + index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + cluster=ESCluster.INSE, + size=1, + ) + + hits = response.get("hits", {}).get("hits", []) + if not hits: + logger.info(f"No project found with ID: {project_id}") + return None + + hit = hits[0] + index = hit.get("_index", "") + source = hit.get("_source", {}) + + # Determine program type from index name + program_type = _determine_program_type_from_index(index) + + # Enrich and return the project based on program type + if program_type == "fp7": + return _enrich_fp7_project(project_id, source) + elif program_type == "h2020": + return _enrich_h2020_project(project_id, source) + elif program_type == "heu": + return _enrich_heu_project(project_id, source) + else: + # Unknown type, return base model + logger.warning(f"Unknown program type for index: {index}") + return CordisEuProject.model_validate(source) + + +def _determine_program_type_from_index(index: str) -> str: + """Determines the program type from the Elasticsearch index name.""" + index_lower = index.lower() + if "fp7" in index_lower: + return "fp7" + elif "horizon_2020" or () in index_lower: + return "h2020" + elif "heu" in index_lower or "horizon_europe" in index_lower: + return "heu" + return "unknown" + + +def _enrich_fp7_project( + project_id: str, + project_source: Dict[str, Any] +) -> Optional[Fp7ProjectDetails]: + """Enriches a single FP7 project with all related data.""" + try: + project = Fp7Project.model_validate(project_source) + except Exception as e: + logger.error(f"Failed to validate FP7 project {project_id}: {e}") + return None + + # Fetch all related data + organizations = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_organizations", + model_class=Fp7Organization + ) + publications = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_publications", + model_class=Fp7Publication + ) + iprs = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_iprs", + model_class=Fp7ProjectIPR + ) + report_summaries = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_report_summaries", + model_class=Fp7ReportSummary + ) + topics_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_topics", + model_class=Fp7Topic + ) + web_links = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_web_links", + model_class=Fp7WebLink + ) + eurosci_voc = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_eurosci_voc", + model_class=Fp7EurosciVoc + ) + legal_basis_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_fp7_legal_basis", + model_class=Fp7LegalBasis + ) + + # Build and return enriched project + return Fp7ProjectDetails.from_project_with_relations( + project=project, + organizations=organizations.get(project_id, []), + publications=publications.get(project_id, []), + iprs=iprs.get(project_id, []), + report_summaries=report_summaries.get(project_id, []), + topics_list=topics_list.get(project_id, []), + web_links=web_links.get(project_id, []), + eurosci_voc=eurosci_voc.get(project_id, []), + legal_basis_list=legal_basis_list.get(project_id, []), + ) + + +def _enrich_h2020_project( + project_id: str, + project_source: Dict[str, Any] +) -> Optional[H2020ProjectDetails]: + """Enriches a single H2020 project with all related data.""" + try: + project = H2020Project.model_validate(project_source) + except Exception as e: + logger.error(f"Failed to validate H2020 project {project_id}: {e}") + return None + + # Fetch all related data + organizations = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_organizations", + model_class=H2020Organization + ) + publications = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_publications", + model_class=H2020Publication + ) + deliverables = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_deliverables", + model_class=H2020Deliverable + ) + report_summaries = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_report_summaries", + model_class=H2020ReportSummary + ) + topics_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_topics", + model_class=H2020Topic + ) + web_links = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_web_links", + model_class=H2020WebLink + ) + eurosci_voc = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_eurosci_voc", + model_class=H2020EurosciVoc + ) + legal_basis_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_legal_basis", + model_class=H2020LegalBasis + ) + erc_pis = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_h2020_erc_pis", + model_class=H2020ErcPI + ) + + # Build and return enriched project + return H2020ProjectDetails.from_project_with_relations( + project=project, + organizations=organizations.get(project_id, []), + publications=publications.get(project_id, []), + deliverables=deliverables.get(project_id, []), + report_summaries=report_summaries.get(project_id, []), + topics_list=topics_list.get(project_id, []), + web_links=web_links.get(project_id, []), + eurosci_voc=eurosci_voc.get(project_id, []), + legal_basis_list=legal_basis_list.get(project_id, []), + erc_principal_investigators=erc_pis.get(project_id, []), + ) + + +def _enrich_heu_project( + project_id: str, + project_source: Dict[str, Any] +) -> Optional[HEUProjectDetails]: + """Enriches a single Horizon Europe project with all related data.""" + try: + project = HEUProject.model_validate(project_source) + except Exception as e: + logger.error(f"Failed to validate Horizon Europe project {project_id}: {e}") + return None + + # Fetch all related data + organizations = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_organizations", + model_class=HEUOrganization + ) + publications = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_publications", + model_class=HEUPublication + ) + deliverables = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_deliverables", + model_class=HEUDeliverable + ) + report_summaries = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_report_summaries", + model_class=HEUReportSummary + ) + topics_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_topics", + model_class=HEUTopic + ) + web_links = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_web_links", + model_class=HEUWebLink + ) + eurosci_voc = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_eurosci_voc", + model_class=HEUEurosciVoc + ) + legal_basis_list = _fetch_related_entities( + project_ids=[project_id], + index_pattern="cordis_eu_heu_legal_basis", + model_class=HEULegalBasis + ) + + # Build and return enriched project + return HEUProjectDetails.from_project_with_relations( + project=project, + organizations=organizations.get(project_id, []), + publications=publications.get(project_id, []), + deliverables=deliverables.get(project_id, []), + report_summaries=report_summaries.get(project_id, []), + topics_list=topics_list.get(project_id, []), + web_links=web_links.get(project_id, []), + eurosci_voc=eurosci_voc.get(project_id, []), + legal_basis_list=legal_basis_list.get(project_id, []), + ) + + +def _fetch_related_entities( + project_ids: List[str], + index_pattern: str, + model_class: Any +) -> Dict[str, List[Any]]: + """ + Fetches and groups related entities from Elasticsearch by project ID. + + Args: + project_ids: List of project IDs to fetch entities for + index_pattern: The index pattern to search (supports wildcards) + model_class: The Pydantic model class to validate against + + Returns: + Dictionary mapping project IDs to lists of entities + """ + query = {"bool": {"filter": [{"terms": {"projectID": project_ids}}]}} + + try: + response = elasticsearch.search( + query=query, + index=index_pattern, + cluster=ESCluster.INSE, + size=1 + ) + except Exception as e: + logger.warning(f"Failed to fetch from {index_pattern}: {e}") + return {} + + grouped = {} + hits = response.get("hits", {}).get("hits", []) + + for hit in hits: + source = hit.get("_source", {}) + project_id = source.get("projectID") + + if not project_id: + continue + + if project_id not in grouped: + grouped[project_id] = [] + + try: + entity = model_class.model_validate(source) + grouped[project_id].append(entity) + except Exception as e: + logger.warning(f"Failed to validate entity for project {project_id}: {e}") + continue + + return grouped \ No newline at end of file -- 2.56.1 From 9908f8c0447210212a51e7e07771e90137ce8275 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:03:32 +0200 Subject: [PATCH 10/42] added backend logic for EU Cordis projects --- service/src/main/inse/projects/model.py | 24 +++++- .../inse/projects/projects_search_client.py | 36 +++++---- service/src/main/inse/projects/router.py | 78 +++++++++++++++++-- service/src/main/inse/projects/service.py | 7 +- 4 files changed, 117 insertions(+), 28 deletions(-) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py index d0957d4d..526e55af 100644 --- a/service/src/main/inse/projects/model.py +++ b/service/src/main/inse/projects/model.py @@ -9,7 +9,10 @@ from inse.models.bund_project import BundProject from inse.models.eu_project import EuProject from inse.models.cordis_eu_project import CordisEuProject from inse.model import ESIndex - +from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails +from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails +from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails +from typing import Union class ProjectType(StrEnum): BUND = "bund" @@ -165,6 +168,25 @@ class CordisEuProjectPage(Page): ) +class EuCordisProjectResponse(BaseModel): + """ + Response model for EU Cordis project endpoints. + """ + success: bool = Field(description="Indicates if the request was successful") + project_type: Optional[str] = Field( + default=None, + description="The type of project: 'fp7', 'h2020', or 'heu'" + ) + data: Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]] = Field( + default=None, + description="The project data" + ) + error: Optional[str] = Field( + default=None, + description="Error message if the request failed" + ) + + class FundingProject(BaseModel): type: ProjectType = Field( description="The type of the project.", diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index 777e51de..4cd2812a 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -22,13 +22,16 @@ from inse.projects.model import ( ProjectsSortBy, SortDirection, ) - +from inse.projects.eu_cordis_projects_enrichment_client import get_enriched_cordis_project_by_id from inse.models.dfg_project_details import DfgProjectDetails from inse.models.bund_project_details import BundProjectDetails from inse.models.cordis_eu_project import CordisEuProject from inse.integrations import elasticsearch from inse.model import ESCluster, ESIndex - +from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails +from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails +from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails +from typing import Union settings = get_settings() logger = logging.getLogger(__name__) @@ -559,22 +562,21 @@ def get_cordis_eu_projects_by_project_ids( def get_eu_cordis_projects_by_id( - project_ids: List[str], -) -> CordisEuProject: - query = {"bool": {"filter": [{"term": {"id": project_ids}}]}} - - response = elasticsearch.search( - query=query, - index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, - cluster=ESCluster.INSE, + project_id: str, +) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]: + """ + Fetches and enriches a single Cordis EU project by its ID. + + Args: + project_id: The project ID to fetch + + Returns: + The enriched project details, or None if not found + """ + enriched_project = get_enriched_cordis_project_by_id( + project_id=project_id ) - - hits = response.get("hits", {}).get("hits", []) - if hits: - hit = hits[0] - return CordisEuProject.model_validate(hit["_source"]) - return None - + return enriched_project # DFG diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py index 20d655ff..7aa1cddb 100644 --- a/service/src/main/inse/projects/router.py +++ b/service/src/main/inse/projects/router.py @@ -15,7 +15,7 @@ from inse.projects.model import ( ProjectsFilteringProperties, ProjectsSortBy, SortDirection, - CordisEuProject + EuCordisProjectResponse ) from inse.models.dfg_project_details import DfgProjectDetails from inse.models.bund_project_details import BundProjectDetails @@ -27,6 +27,11 @@ from inse.institutions.institutions_search_client import ( ) from inse.institutions.router import get_institutions_search_client +from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails +from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails +from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails +from typing import Union + logger = logging.getLogger(__name__) router = APIRouter(prefix="/api/projects", tags=[Tags.PROJECTS]) @@ -140,19 +145,76 @@ def get_single_bund_project( responses={ status.HTTP_200_OK: { "description": "Successful Response", - "model": CordisEuProject, + "model": EuCordisProjectResponse, }, - status.HTTP_404_NOT_FOUND: {"description": "Project not found"}, + status.HTTP_404_NOT_FOUND: { + "description": "Project not found", + "model": EuCordisProjectResponse + }, + status.HTTP_500_INTERNAL_SERVER_ERROR: { + "description": "Internal server error", + "model": EuCordisProjectResponse + } }, - response_model_by_alias=False, ) + + def get_single_eu_cordis_project( id: Annotated[str, Path(description="The ID of the EU Cordis project to retrieve.")], -) -> CordisEuProject: +) -> EuCordisProjectResponse: + """ + Get a single EU Cordis project by ID. + Returns a wrapper response containing the project data or error information. + """ logger.debug(f"Received request to get single EU Cordis project for id={id}") - return projects_service.get_single_eu_cordis_project( - project_id=id, - ) + + try: + # Get the project from the service + project = projects_service.get_single_eu_cordis_project(project_id=id) + + # Check if project exists + if project is None: + logger.warning(f"Project with ID {id} not found") + return EuCordisProjectResponse( + success=False, + project_type=None, + data=None, + error=f"Project with ID {id} not found" + ) + + # Determine the project type + if isinstance(project, Fp7ProjectDetails): + project_type = "fp7" + elif isinstance(project, H2020ProjectDetails): + project_type = "h2020" + elif isinstance(project, HEUProjectDetails): + project_type = "heu" + else: + # Unknown project type - maybe it's the base CordisEuProject + logger.warning(f"Unknown project type for ID {id}: {type(project)}") + return EuCordisProjectResponse( + success=False, + project_type=None, + data=None, + error=f"Unknown project type for ID {id}" + ) + + # Return success with the project data + return EuCordisProjectResponse( + success=True, + project_type=project_type, + data=project, + error=None + ) + + except Exception as e: + logger.error(f"Error retrieving project with ID {id}: {str(e)}", exc_info=True) + return EuCordisProjectResponse( + success=False, + project_type=None, + data=None, + error=f"Internal server error: {str(e)}" + ) @router.get( "/institution/bund/funding-over-time", diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py index bf756cd0..955d8289 100644 --- a/service/src/main/inse/projects/service.py +++ b/service/src/main/inse/projects/service.py @@ -27,7 +27,10 @@ from inse.institutions.institutions_search_client import ( from inse.exceptions import NotFoundException from inse.persons.logic import get_author_name_by_id from inse.works.logic import get_publication_dois_of_author - +from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails +from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails +from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails +from typing import Union logger = logging.getLogger(__name__) @@ -325,7 +328,7 @@ def get_single_bund_project( def get_single_eu_cordis_project( project_id: str, -) -> CordisEuProject: +) -> Optional[Union[Fp7ProjectDetails, H2020ProjectDetails, HEUProjectDetails]]: logger.debug(f"Fetching single EU Cordis project for id={project_id}") project = projects_search_client.get_eu_cordis_projects_by_id(project_id) -- 2.56.1 From 70fe8ce14fca2f07d61d29998e7031a0f05822dc Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:08:00 +0200 Subject: [PATCH 11/42] generated frontend models and interfaces --- webapp/src/app/api/api/projects.service.ts | 107 +++++++++++++++++- webapp/src/app/api/model/data.ts | 73 ++++++++++++ webapp/src/app/api/model/eccontribution.ts | 14 +++ webapp/src/app/api/model/ecmaxcontribution.ts | 14 +++ .../src/app/api/model/ecmaxcontribution1.ts | 14 +++ .../app/api/model/euCordisProjectResponse.ts | 25 ++++ webapp/src/app/api/model/fp7EurosciVoc.ts | 23 ++++ webapp/src/app/api/model/fp7LegalBasis.ts | 22 ++++ webapp/src/app/api/model/fp7Organization.ts | 46 ++++++++ webapp/src/app/api/model/fp7ProjectDetails.ts | 60 ++++++++++ webapp/src/app/api/model/fp7ProjectIPR.ts | 36 ++++++ webapp/src/app/api/model/fp7Publication.ts | 35 ++++++ webapp/src/app/api/model/fp7ReportSummary.ts | 24 ++++ webapp/src/app/api/model/fp7Topic.ts | 21 ++++ webapp/src/app/api/model/fp7WebLink.ts | 27 +++++ webapp/src/app/api/model/h2020Deliverable.ts | 25 ++++ webapp/src/app/api/model/h2020ErcPI.ts | 25 ++++ webapp/src/app/api/model/h2020EurosciVoc.ts | 23 ++++ webapp/src/app/api/model/h2020LegalBasis.ts | 22 ++++ webapp/src/app/api/model/h2020Organization.ts | 46 ++++++++ .../src/app/api/model/h2020ProjectDetails.ts | 63 +++++++++++ webapp/src/app/api/model/h2020Publication.ts | 35 ++++++ .../src/app/api/model/h2020ReportSummary.ts | 24 ++++ webapp/src/app/api/model/h2020Topic.ts | 21 ++++ webapp/src/app/api/model/h2020WebLink.ts | 27 +++++ webapp/src/app/api/model/hEUDeliverable.ts | 25 ++++ webapp/src/app/api/model/hEUEurosciVoc.ts | 23 ++++ webapp/src/app/api/model/hEULegalBasis.ts | 22 ++++ webapp/src/app/api/model/hEUOrganization.ts | 46 ++++++++ webapp/src/app/api/model/hEUProjectDetails.ts | 60 ++++++++++ webapp/src/app/api/model/hEUPublication.ts | 35 ++++++ webapp/src/app/api/model/hEUReportSummary.ts | 24 ++++ webapp/src/app/api/model/hEUTopic.ts | 21 ++++ webapp/src/app/api/model/hEUWebLink.ts | 27 +++++ webapp/src/app/api/model/models.ts | 34 ++++++ webapp/src/app/api/model/neteccontribution.ts | 14 +++ webapp/src/app/api/model/totalcost.ts | 14 +++ 37 files changed, 1195 insertions(+), 2 deletions(-) create mode 100644 webapp/src/app/api/model/data.ts create mode 100644 webapp/src/app/api/model/eccontribution.ts create mode 100644 webapp/src/app/api/model/ecmaxcontribution.ts create mode 100644 webapp/src/app/api/model/ecmaxcontribution1.ts create mode 100644 webapp/src/app/api/model/euCordisProjectResponse.ts create mode 100644 webapp/src/app/api/model/fp7EurosciVoc.ts create mode 100644 webapp/src/app/api/model/fp7LegalBasis.ts create mode 100644 webapp/src/app/api/model/fp7Organization.ts create mode 100644 webapp/src/app/api/model/fp7ProjectDetails.ts create mode 100644 webapp/src/app/api/model/fp7ProjectIPR.ts create mode 100644 webapp/src/app/api/model/fp7Publication.ts create mode 100644 webapp/src/app/api/model/fp7ReportSummary.ts create mode 100644 webapp/src/app/api/model/fp7Topic.ts create mode 100644 webapp/src/app/api/model/fp7WebLink.ts create mode 100644 webapp/src/app/api/model/h2020Deliverable.ts create mode 100644 webapp/src/app/api/model/h2020ErcPI.ts create mode 100644 webapp/src/app/api/model/h2020EurosciVoc.ts create mode 100644 webapp/src/app/api/model/h2020LegalBasis.ts create mode 100644 webapp/src/app/api/model/h2020Organization.ts create mode 100644 webapp/src/app/api/model/h2020ProjectDetails.ts create mode 100644 webapp/src/app/api/model/h2020Publication.ts create mode 100644 webapp/src/app/api/model/h2020ReportSummary.ts create mode 100644 webapp/src/app/api/model/h2020Topic.ts create mode 100644 webapp/src/app/api/model/h2020WebLink.ts create mode 100644 webapp/src/app/api/model/hEUDeliverable.ts create mode 100644 webapp/src/app/api/model/hEUEurosciVoc.ts create mode 100644 webapp/src/app/api/model/hEULegalBasis.ts create mode 100644 webapp/src/app/api/model/hEUOrganization.ts create mode 100644 webapp/src/app/api/model/hEUProjectDetails.ts create mode 100644 webapp/src/app/api/model/hEUPublication.ts create mode 100644 webapp/src/app/api/model/hEUReportSummary.ts create mode 100644 webapp/src/app/api/model/hEUTopic.ts create mode 100644 webapp/src/app/api/model/hEUWebLink.ts create mode 100644 webapp/src/app/api/model/neteccontribution.ts create mode 100644 webapp/src/app/api/model/totalcost.ts diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index 45e35a5a..c69e39c9 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -27,14 +27,14 @@ import { BundProjectDetails } from '../model/bundProjectDetails'; // @ts-ignore import { BundProjectPage } from '../model/bundProjectPage'; // @ts-ignore -import { CordisEuProject } from '../model/cordisEuProject'; -// @ts-ignore import { CordisEuProjectPage } from '../model/cordisEuProjectPage'; // @ts-ignore import { DfgProjectDetails } from '../model/dfgProjectDetails'; // @ts-ignore import { DfgProjectPage } from '../model/dfgProjectPage'; // @ts-ignore +import { EuCordisProjectResponse } from '../model/euCordisProjectResponse'; +// @ts-ignore import { EuOrganizationProjectSummaryPage } from '../model/euOrganizationProjectSummaryPage'; // @ts-ignore import { FundingProjectPage } from '../model/fundingProjectPage'; @@ -760,6 +760,109 @@ export class ProjectsService extends BaseService { ); } + /** + * Get a single EU Cordis project. + * Returns a single EU Cordis project based on its ID. + * @endpoint get /api/projects/eu/{id} + * @param id The ID of the EU Cordis project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleEuCordisProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleEuCordisProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleEuCordisProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleEuCordisProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleEuCordisProject.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/eu/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + /** * Get bund projects. * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. diff --git a/webapp/src/app/api/model/data.ts b/webapp/src/app/api/model/data.ts new file mode 100644 index 00000000..cfd77d9c --- /dev/null +++ b/webapp/src/app/api/model/data.ts @@ -0,0 +1,73 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Totalcost } from './totalcost'; +import { H2020ProjectDetails } from './h2020ProjectDetails'; +import { Ecmaxcontribution } from './ecmaxcontribution'; +import { Fp7ProjectDetails } from './fp7ProjectDetails'; +import { HEUOrganization } from './hEUOrganization'; +import { HEUPublication } from './hEUPublication'; +import { Fp7WebLink } from './fp7WebLink'; +import { HEUWebLink } from './hEUWebLink'; +import { HEUDeliverable } from './hEUDeliverable'; +import { Fp7ProjectIPR } from './fp7ProjectIPR'; +import { HEUEurosciVoc } from './hEUEurosciVoc'; +import { H2020ErcPI } from './h2020ErcPI'; +import { HEULegalBasis } from './hEULegalBasis'; +import { HEUTopic } from './hEUTopic'; +import { Fp7ReportSummary } from './fp7ReportSummary'; +import { HEUReportSummary } from './hEUReportSummary'; +import { HEUProjectDetails } from './hEUProjectDetails'; + + +/** + * The project data + */ +export interface Data { + acronym?: string; + contentUpdateDate?: string; + ecMaxContribution?: Ecmaxcontribution | null; + ecSignatureDate?: string; + endDate?: string; + frameworkProgramme?: string; + fundingScheme?: string; + grantDoi?: string; + humanValidated?: boolean; + id?: string; + keywords?: string; + legalBasis?: string; + masterCall?: string; + nature?: string; + objective?: string; + rcn?: string; + startDate?: string; + status?: string; + subCall?: string; + title?: string; + topics?: string; + totalCost?: Totalcost | null; + organizations?: Array; + publications?: Array; + iprs?: Array; + report_summaries?: Array; + topicsList?: Array; + web_links?: Array; + eurosciVoc?: Array; + legalBasisList?: Array; + organizationCount?: number; + publicationCount?: number; + iprCount?: number; + deliverables?: Array; + reportSummaries?: Array; + webLinks?: Array; + ercPrincipalInvestigators?: Array; + deliverableCount?: number; + ercPiCount?: number; +} + diff --git a/webapp/src/app/api/model/eccontribution.ts b/webapp/src/app/api/model/eccontribution.ts new file mode 100644 index 00000000..a93cc6ea --- /dev/null +++ b/webapp/src/app/api/model/eccontribution.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Eccontribution { +} + diff --git a/webapp/src/app/api/model/ecmaxcontribution.ts b/webapp/src/app/api/model/ecmaxcontribution.ts new file mode 100644 index 00000000..5ed2a74c --- /dev/null +++ b/webapp/src/app/api/model/ecmaxcontribution.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Ecmaxcontribution { +} + diff --git a/webapp/src/app/api/model/ecmaxcontribution1.ts b/webapp/src/app/api/model/ecmaxcontribution1.ts new file mode 100644 index 00000000..cc59333d --- /dev/null +++ b/webapp/src/app/api/model/ecmaxcontribution1.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Ecmaxcontribution1 { +} + diff --git a/webapp/src/app/api/model/euCordisProjectResponse.ts b/webapp/src/app/api/model/euCordisProjectResponse.ts new file mode 100644 index 00000000..47bc1b53 --- /dev/null +++ b/webapp/src/app/api/model/euCordisProjectResponse.ts @@ -0,0 +1,25 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Data } from './data'; + + +/** + * Response model for EU Cordis project endpoints. + */ +export interface EuCordisProjectResponse { + /** + * Indicates if the request was successful + */ + success: boolean; + project_type?: string | null; + data?: Data | null; + error?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7EurosciVoc.ts b/webapp/src/app/api/model/fp7EurosciVoc.ts new file mode 100644 index 00000000..fb7e8deb --- /dev/null +++ b/webapp/src/app/api/model/fp7EurosciVoc.ts @@ -0,0 +1,23 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7EurosciVoc + */ +export interface Fp7EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7LegalBasis.ts b/webapp/src/app/api/model/fp7LegalBasis.ts new file mode 100644 index 00000000..89a05742 --- /dev/null +++ b/webapp/src/app/api/model/fp7LegalBasis.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7LegalBasis + */ +export interface Fp7LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7Organization.ts b/webapp/src/app/api/model/fp7Organization.ts new file mode 100644 index 00000000..32053ea5 --- /dev/null +++ b/webapp/src/app/api/model/fp7Organization.ts @@ -0,0 +1,46 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Neteccontribution } from './neteccontribution'; +import { Totalcost } from './totalcost'; +import { Eccontribution } from './eccontribution'; + + +/** + * Fp7Organization + */ +export interface Fp7Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: Eccontribution | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: Neteccontribution | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: Totalcost | null; + vatNumber?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7ProjectDetails.ts b/webapp/src/app/api/model/fp7ProjectDetails.ts new file mode 100644 index 00000000..3c79edb4 --- /dev/null +++ b/webapp/src/app/api/model/fp7ProjectDetails.ts @@ -0,0 +1,60 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Fp7EurosciVoc } from './fp7EurosciVoc'; +import { Totalcost } from './totalcost'; +import { Ecmaxcontribution } from './ecmaxcontribution'; +import { Fp7WebLink } from './fp7WebLink'; +import { Fp7Publication } from './fp7Publication'; +import { Fp7ReportSummary } from './fp7ReportSummary'; +import { Fp7Topic } from './fp7Topic'; +import { Fp7ProjectIPR } from './fp7ProjectIPR'; +import { Fp7Organization } from './fp7Organization'; +import { Fp7LegalBasis } from './fp7LegalBasis'; + + +/** + * Comprehensive FP7 Project model combining all related entities. This model extends the base Fp7Project with all associated data. + */ +export interface Fp7ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: Ecmaxcontribution | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: Totalcost | null; + organizations?: Array | null; + publications?: Array | null; + iprs?: Array | null; + report_summaries?: Array | null; + topicsList?: Array | null; + web_links?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + iprCount?: number | null; +} + diff --git a/webapp/src/app/api/model/fp7ProjectIPR.ts b/webapp/src/app/api/model/fp7ProjectIPR.ts new file mode 100644 index 00000000..f35487c4 --- /dev/null +++ b/webapp/src/app/api/model/fp7ProjectIPR.ts @@ -0,0 +1,36 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7ProjectIPR + */ +export interface Fp7ProjectIPR { + applicantName?: string | null; + applicationDate?: string | null; + applicationIdentifier?: string | null; + applicationKind?: string | null; + applicationPrefix?: string | null; + awardDate?: string | null; + awardIdentifier?: string | null; + awardKind?: string | null; + awardPrefix?: string | null; + epoAppUrl?: string | null; + epoPubUrl?: string | null; + id?: string | null; + organisationID?: string | null; + patentFamilyIdentifier?: string | null; + patentType?: string | null; + priorityDate?: string | null; + projectID?: string | null; + title?: string | null; + type?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7Publication.ts b/webapp/src/app/api/model/fp7Publication.ts new file mode 100644 index 00000000..fd0e2491 --- /dev/null +++ b/webapp/src/app/api/model/fp7Publication.ts @@ -0,0 +1,35 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7Publication + */ +export interface Fp7Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7ReportSummary.ts b/webapp/src/app/api/model/fp7ReportSummary.ts new file mode 100644 index 00000000..f0413439 --- /dev/null +++ b/webapp/src/app/api/model/fp7ReportSummary.ts @@ -0,0 +1,24 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7ReportSummary + */ +export interface Fp7ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7Topic.ts b/webapp/src/app/api/model/fp7Topic.ts new file mode 100644 index 00000000..f39a021e --- /dev/null +++ b/webapp/src/app/api/model/fp7Topic.ts @@ -0,0 +1,21 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7Topic + */ +export interface Fp7Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; +} + diff --git a/webapp/src/app/api/model/fp7WebLink.ts b/webapp/src/app/api/model/fp7WebLink.ts new file mode 100644 index 00000000..eeaff7ab --- /dev/null +++ b/webapp/src/app/api/model/fp7WebLink.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Fp7WebLink + */ +export interface Fp7WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020Deliverable.ts b/webapp/src/app/api/model/h2020Deliverable.ts new file mode 100644 index 00000000..390d2c7a --- /dev/null +++ b/webapp/src/app/api/model/h2020Deliverable.ts @@ -0,0 +1,25 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020Deliverable + */ +export interface H2020Deliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020ErcPI.ts b/webapp/src/app/api/model/h2020ErcPI.ts new file mode 100644 index 00000000..48ae3ff0 --- /dev/null +++ b/webapp/src/app/api/model/h2020ErcPI.ts @@ -0,0 +1,25 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020ErcPI + */ +export interface H2020ErcPI { + firstName?: string | null; + fundingScheme?: string | null; + id?: string | null; + lastName?: string | null; + organisationID?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020EurosciVoc.ts b/webapp/src/app/api/model/h2020EurosciVoc.ts new file mode 100644 index 00000000..7d1ea931 --- /dev/null +++ b/webapp/src/app/api/model/h2020EurosciVoc.ts @@ -0,0 +1,23 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020EurosciVoc + */ +export interface H2020EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020LegalBasis.ts b/webapp/src/app/api/model/h2020LegalBasis.ts new file mode 100644 index 00000000..d247488d --- /dev/null +++ b/webapp/src/app/api/model/h2020LegalBasis.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020LegalBasis + */ +export interface H2020LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020Organization.ts b/webapp/src/app/api/model/h2020Organization.ts new file mode 100644 index 00000000..bb832216 --- /dev/null +++ b/webapp/src/app/api/model/h2020Organization.ts @@ -0,0 +1,46 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Neteccontribution } from './neteccontribution'; +import { Totalcost } from './totalcost'; +import { Eccontribution } from './eccontribution'; + + +/** + * H2020Organization + */ +export interface H2020Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: Eccontribution | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: Neteccontribution | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: Totalcost | null; + vatNumber?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020ProjectDetails.ts b/webapp/src/app/api/model/h2020ProjectDetails.ts new file mode 100644 index 00000000..39172950 --- /dev/null +++ b/webapp/src/app/api/model/h2020ProjectDetails.ts @@ -0,0 +1,63 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Totalcost } from './totalcost'; +import { Ecmaxcontribution } from './ecmaxcontribution'; +import { H2020LegalBasis } from './h2020LegalBasis'; +import { H2020ErcPI } from './h2020ErcPI'; +import { H2020Deliverable } from './h2020Deliverable'; +import { H2020WebLink } from './h2020WebLink'; +import { H2020Publication } from './h2020Publication'; +import { H2020ReportSummary } from './h2020ReportSummary'; +import { H2020Topic } from './h2020Topic'; +import { H2020EurosciVoc } from './h2020EurosciVoc'; +import { H2020Organization } from './h2020Organization'; + + +/** + * Comprehensive Horizon 2020 Project model combining all related entities. This model extends the base H2020Project with all associated data. + */ +export interface H2020ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: Ecmaxcontribution | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: Totalcost | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + ercPrincipalInvestigators?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; + ercPiCount?: number | null; +} + diff --git a/webapp/src/app/api/model/h2020Publication.ts b/webapp/src/app/api/model/h2020Publication.ts new file mode 100644 index 00000000..945e22d2 --- /dev/null +++ b/webapp/src/app/api/model/h2020Publication.ts @@ -0,0 +1,35 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020Publication + */ +export interface H2020Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020ReportSummary.ts b/webapp/src/app/api/model/h2020ReportSummary.ts new file mode 100644 index 00000000..a5975ffb --- /dev/null +++ b/webapp/src/app/api/model/h2020ReportSummary.ts @@ -0,0 +1,24 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020ReportSummary + */ +export interface H2020ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020Topic.ts b/webapp/src/app/api/model/h2020Topic.ts new file mode 100644 index 00000000..8ddb1991 --- /dev/null +++ b/webapp/src/app/api/model/h2020Topic.ts @@ -0,0 +1,21 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020Topic + */ +export interface H2020Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; +} + diff --git a/webapp/src/app/api/model/h2020WebLink.ts b/webapp/src/app/api/model/h2020WebLink.ts new file mode 100644 index 00000000..26d54599 --- /dev/null +++ b/webapp/src/app/api/model/h2020WebLink.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * H2020WebLink + */ +export interface H2020WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUDeliverable.ts b/webapp/src/app/api/model/hEUDeliverable.ts new file mode 100644 index 00000000..05d8c5ba --- /dev/null +++ b/webapp/src/app/api/model/hEUDeliverable.ts @@ -0,0 +1,25 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUDeliverable + */ +export interface HEUDeliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUEurosciVoc.ts b/webapp/src/app/api/model/hEUEurosciVoc.ts new file mode 100644 index 00000000..93921ab7 --- /dev/null +++ b/webapp/src/app/api/model/hEUEurosciVoc.ts @@ -0,0 +1,23 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUEurosciVoc + */ +export interface HEUEurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/hEULegalBasis.ts b/webapp/src/app/api/model/hEULegalBasis.ts new file mode 100644 index 00000000..e3cb66ca --- /dev/null +++ b/webapp/src/app/api/model/hEULegalBasis.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEULegalBasis + */ +export interface HEULegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUOrganization.ts b/webapp/src/app/api/model/hEUOrganization.ts new file mode 100644 index 00000000..65b365aa --- /dev/null +++ b/webapp/src/app/api/model/hEUOrganization.ts @@ -0,0 +1,46 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Neteccontribution } from './neteccontribution'; +import { Totalcost } from './totalcost'; +import { Eccontribution } from './eccontribution'; + + +/** + * HEUOrganization + */ +export interface HEUOrganization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: Eccontribution | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: Neteccontribution | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: Totalcost | null; + vatNumber?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUProjectDetails.ts b/webapp/src/app/api/model/hEUProjectDetails.ts new file mode 100644 index 00000000..2d36478e --- /dev/null +++ b/webapp/src/app/api/model/hEUProjectDetails.ts @@ -0,0 +1,60 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Totalcost } from './totalcost'; +import { Ecmaxcontribution } from './ecmaxcontribution'; +import { HEULegalBasis } from './hEULegalBasis'; +import { HEUOrganization } from './hEUOrganization'; +import { HEUTopic } from './hEUTopic'; +import { HEUPublication } from './hEUPublication'; +import { HEUWebLink } from './hEUWebLink'; +import { HEUReportSummary } from './hEUReportSummary'; +import { HEUDeliverable } from './hEUDeliverable'; +import { HEUEurosciVoc } from './hEUEurosciVoc'; + + +/** + * Comprehensive Horizon Europe Project model combining all related entities. This model extends the base HEUProject with all associated data. + */ +export interface HEUProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: Ecmaxcontribution | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: Totalcost | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; +} + diff --git a/webapp/src/app/api/model/hEUPublication.ts b/webapp/src/app/api/model/hEUPublication.ts new file mode 100644 index 00000000..4d067177 --- /dev/null +++ b/webapp/src/app/api/model/hEUPublication.ts @@ -0,0 +1,35 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUPublication + */ +export interface HEUPublication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUReportSummary.ts b/webapp/src/app/api/model/hEUReportSummary.ts new file mode 100644 index 00000000..b9e1a299 --- /dev/null +++ b/webapp/src/app/api/model/hEUReportSummary.ts @@ -0,0 +1,24 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUReportSummary + */ +export interface HEUReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUTopic.ts b/webapp/src/app/api/model/hEUTopic.ts new file mode 100644 index 00000000..a0a5e764 --- /dev/null +++ b/webapp/src/app/api/model/hEUTopic.ts @@ -0,0 +1,21 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUTopic + */ +export interface HEUTopic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; +} + diff --git a/webapp/src/app/api/model/hEUWebLink.ts b/webapp/src/app/api/model/hEUWebLink.ts new file mode 100644 index 00000000..81c5d60f --- /dev/null +++ b/webapp/src/app/api/model/hEUWebLink.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * HEUWebLink + */ +export interface HEUWebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; +} + diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 89f601cc..6f643388 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -31,6 +31,7 @@ export * from './cordisEuProjectPage'; export * from './costUsd'; export * from './customAuthor'; export * from './customAuthorsListResponse'; +export * from './data'; export * from './dehydratedAuthor'; export * from './dehydratedFunder'; export * from './dehydratedInstitution'; @@ -38,16 +39,47 @@ export * from './dehydratedSource'; export * from './dfgProjectDetails'; export * from './dfgProjectPage'; export * from './dfgProjectSummary'; +export * from './eccontribution'; +export * from './ecmaxcontribution'; +export * from './euCordisProjectResponse'; export * from './euOrganizationProjectSummary'; export * from './euOrganizationProjectSummaryPage'; export * from './filterInformation'; export * from './filterProperties'; +export * from './fp7EurosciVoc'; +export * from './fp7LegalBasis'; +export * from './fp7Organization'; +export * from './fp7ProjectDetails'; +export * from './fp7ProjectIPR'; +export * from './fp7Publication'; +export * from './fp7ReportSummary'; +export * from './fp7Topic'; +export * from './fp7WebLink'; export * from './funderByAuthor'; export * from './fundersByAuthorResponse'; export * from './fundingProject'; export * from './fundingProjectPage'; export * from './fwci'; export * from './groupByResult'; +export * from './h2020Deliverable'; +export * from './h2020ErcPI'; +export * from './h2020EurosciVoc'; +export * from './h2020LegalBasis'; +export * from './h2020Organization'; +export * from './h2020ProjectDetails'; +export * from './h2020Publication'; +export * from './h2020ReportSummary'; +export * from './h2020Topic'; +export * from './h2020WebLink'; +export * from './hEUDeliverable'; +export * from './hEUEurosciVoc'; +export * from './hEULegalBasis'; +export * from './hEUOrganization'; +export * from './hEUProjectDetails'; +export * from './hEUPublication'; +export * from './hEUReportSummary'; +export * from './hEUTopic'; +export * from './hEUWebLink'; export * from './hTTPValidationError'; export * from './identityGrant'; export * from './institution'; @@ -69,6 +101,7 @@ export * from './matchedOfficer'; export * from './mentionedPerson'; export * from './meta'; export * from './model2YrMeanCitedness'; +export * from './neteccontribution'; export * from './newsArticle'; export * from './newsArticleDetail'; export * from './newsPage'; @@ -95,6 +128,7 @@ export * from './topics'; export * from './topicsByTime'; export * from './topicsByYear'; export * from './topicsListResponse'; +export * from './totalcost'; export * from './universityRanking'; export * from './universityTopicData'; export * from './user'; diff --git a/webapp/src/app/api/model/neteccontribution.ts b/webapp/src/app/api/model/neteccontribution.ts new file mode 100644 index 00000000..925189cf --- /dev/null +++ b/webapp/src/app/api/model/neteccontribution.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Neteccontribution { +} + diff --git a/webapp/src/app/api/model/totalcost.ts b/webapp/src/app/api/model/totalcost.ts new file mode 100644 index 00000000..d4a48a9a --- /dev/null +++ b/webapp/src/app/api/model/totalcost.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Totalcost { +} + -- 2.56.1 From 52a259a92719e12211ad8d10f9fcc36d089772ef Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:08:49 +0200 Subject: [PATCH 12/42] refactored EU Cordis projects component --- .../eu-details.component.html | 729 +++++++++++++----- .../eu-details.component.scss | 577 ++++++++++++++ .../eu-cordis-details/eu-details.component.ts | 262 +++++-- 3 files changed, 1340 insertions(+), 228 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html index 2f30b6a0..9a51d3ae 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -12,58 +12,76 @@
EU Projekt + @if (euProject.programType) { + + {{ + euProject.programType === 'fp7' + ? 'FP7' + : euProject.programType === 'h2020' + ? 'H2020' + : euProject.programType === 'heu' + ? 'Horizon Europe' + : '' + }} + + } ID: {{ euProject.id }} - @if (euProject.rcn) { - RCN: {{ euProject.rcn }} - } - @if (euProject.acronym) { - {{ euProject.acronym }} - }

{{ euProject.title || 'Ohne Titel' }}

@if (euProject.frameworkProgramme) {

- Rahmenprogramm: - - {{ getFrameworkDisplay(euProject.frameworkProgramme) }} - + {{ + getFrameworkDisplay(euProject.frameworkProgramme) + }}

}
@if (euProject.status) { -
+
circle {{ getStatusDisplay(euProject.status) }}
} @if (euProject.fundingScheme) { -
+
assignment - {{ getFundingSchemeDisplay(euProject.fundingScheme) }} + {{ + getFundingSchemeDisplay(euProject.fundingScheme) + }}
} @if (euProject.grantDoi) { - + link DOI: {{ euProject.grantDoi }} }
- +
calendar_today
- {{ euProject.startDate || 'N/A' }} - Startdatum + {{ formatDate(euProject.startDate) || 'N/A' }} + Förderbeginn
event_busy
- {{ euProject.endDate || 'N/A' }} - Enddatum + {{ formatDate(euProject.endDate) || 'N/A' }} + Förderende
@@ -91,199 +109,546 @@
} - @if (euProject.masterCall) { + @if (euProject.organizationCount !== undefined) {
- call_split + business
- {{ euProject.masterCall }} - Master Call + {{ euProject.organizationCount }} + Organisationen +
+
+ } + @if (euProject.publicationCount !== undefined) { +
+ description +
+ {{ euProject.publicationCount }} + Publikationen
}
- - @if (euProject.objective) { - -
+ +
+ + @if (euProject.organizations && euProject.organizations.length > 0) { + + } + @if (euProject.publications && euProject.publications.length > 0) { + + } + @if (euProject.iprs && euProject.iprs.length > 0) { + + } + @if (euProject.deliverables && euProject.deliverables.length > 0) { + + } +
+ + +
+ + @if (activeTab === 'overview') { +
+
+
+ @if (euProject.objective) { + +
+ description +

Projektziel

+
+

{{ euProject.objective }}

+
+ } + + @if (getFormattedTopics(euProject.topics).length > 0) { + +
+ topic +

Themen

+ {{ + getFormattedTopics(euProject.topics).length + }} +
+
+ @for ( + topic of getFormattedTopics(euProject.topics); + track topic + ) { +
+ {{ topic }} +
+ } +
+
+ } + + + @if (getKeywords(euProject.keywords).length > 0) { + +
+ tag +

Schlüsselwörter

+ {{ + getKeywords(euProject.keywords).length + }} +
+
+ @for ( + keyword of getKeywords(euProject.keywords); + track keyword + ) { +
+ {{ keyword }} +
+ } +
+
+ } + + + @if (euProject.eurosciVoc && euProject.eurosciVoc.length > 0) { + +
+ science +

EuroSciVoc

+ {{ + euProject.eurosciVoc.length + }} +
+
+ @for (voc of euProject.eurosciVoc; track voc.id) { +
+ {{ voc.code }} + {{ voc.title }} +
+ } +
+
+ } +
+ + +
-

{{ euProject.objective }}

- - } + } -
-
- - @if (euProject.topics) { + + @if (activeTab === 'organizations' && euProject.organizations) { +
- topic -

Themen

- {{ getFormattedTopics(euProject.topics).length }} + business +

Organisationen ({{ euProject.organizations.length }})

-
- @for (topic of getFormattedTopics(euProject.topics); track topic) { -
- {{ topic }} - search +
+ @for (org of euProject.organizations; track org.organisationID) { +
+
{{ getInitials(org.name) }}
+
+
+ {{ + org.name || org.shortName || 'Unbekannte Organisation' + }} +
+
+ @if (org.shortName) { + {{ org.shortName }} + } + @if (org.role) { + {{ org.role }} + } + @if (org.country) { + {{ org.country }} + } + @if (org.sme) { + SME + } + @if (org.city) { + {{ org.city }} + } +
+
+ @if (org.ecContribution) { +
+ EU-Beitrag: + {{ + formatCurrency(org.ecContribution) + }} +
+ } + @if (org.totalCost) { +
+ Kosten: + {{ + formatCurrency(org.totalCost) + }} +
+ }
}
- } +
+ } - - @if (getKeywords(euProject.keywords).length > 0) { + + @if (activeTab === 'publications' && euProject.publications) { +
- tag -

Schlüsselwörter

- {{ getKeywords(euProject.keywords).length }} + description +

Publikationen ({{ euProject.publications.length }})

-
- @for (keyword of getKeywords(euProject.keywords); track keyword) { -
- {{ keyword }} - search +
+ @for (pub of euProject.publications; track pub.doi) { +
+
+ article +
+
+
{{ pub.title || 'Kein Titel' }}
+
+ {{ pub.authors || 'Autoren unbekannt' }} +
+
+ @if (pub.journalTitle) { + {{ pub.journalTitle }} + } + @if (pub.publishedYear) { + ({{ pub.publishedYear }}) + } + @if (pub.publisher) { + {{ pub.publisher }} + } +
+
+
+ @if (pub.doi) { + + open_in_new + + } + @if (pub.repositoryUrl) { + + folder_open + + } +
}
- } -
+
+ } -
+ } - - -
- schedule -

Zeitliche Übersicht

-
-
-
-
Startdatum
-
{{ euProject.startDate || 'N/A' }}
+ + @if (activeTab === 'deliverables' && euProject.deliverables) { +
+ +
+ assignment +

Deliverables ({{ euProject.deliverables.length }})

-
-
Enddatum
-
{{ euProject.endDate || 'N/A' }}
+
+ @for (deliv of euProject.deliverables; track deliv.url) { +
+
+ file_present +
+
+
+ {{ deliv.description || 'Ohne Beschreibung' }} +
+
+ @if (deliv.deliverableType) { + {{ + deliv.deliverableType + }} + } + @if (deliv.url) { + + open_in_new + Zum Deliverable + + } +
+
+
+ }
- @if (euProject.ecSignatureDate) { -
-
EU-Unterzeichnung
-
{{ euProject.ecSignatureDate }}
-
- } - @if (euProject.contentUpdateDate) { -
-
Letzte Aktualisierung
-
{{ euProject.contentUpdateDate }}
-
- } - @if (euProject.grantDoi) { - - } -
-
- + +
+ } } @else {
@@ -293,4 +658,4 @@
} - \ No newline at end of file + diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss index 4a26295b..bbb60de8 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss @@ -616,4 +616,581 @@ h1 { width: 100%; justify-content: center; } +} +// Add these to your existing SCSS file + +// Program badges +.program-badge { + display: inline-block; + padding: 4px 12px; + border-radius: var(--sg-radius-sm); + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.5px; + + &.fp7 { + background: #e8eaf6; + color: #283593; + } + + &.h2020 { + background: #e3f2fd; + color: #0d47a1; + } + + &.heu { + background: #e8f5e9; + color: #1b5e20; + } +} + +// Tabs +.tabs-container { + display: flex; + gap: 4px; + padding: 0 4px; + margin-bottom: 24px; + background: #f8fafc; + border-radius: var(--sg-radius-md); + border: 1px solid #d9e2f0; + overflow-x: auto; +} + +.tab-btn { + display: flex; + align-items: center; + gap: 8px; + padding: 12px 20px; + background: transparent; + border: none; + border-radius: var(--sg-radius-sm); + color: var(--sg-text-muted); + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; + white-space: nowrap; + + &:hover { + background: rgba(0, 0, 0, 0.04); + color: var(--sg-text); + } + + &.active { + background: #fff; + color: var(--sg-primary, #0066cc); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + } + + mat-icon { + width: 20px; + height: 20px; + font-size: 20px; + } +} + +.tab-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 20px; + height: 20px; + padding: 0 6px; + background: #e8edf5; + border-radius: 10px; + color: var(--sg-text-muted); + font-size: 11px; + font-weight: 600; +} + +.tab-content { + animation: fadeIn 0.3s ease; +} + +@keyframes fadeIn { + from { opacity: 0; transform: translateY(8px); } + to { opacity: 1; transform: translateY(0); } +} + +// Organizations +.organizations-list { + padding: 16px 20px 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.organization-item { + display: flex; + align-items: center; + gap: 16px; + padding: 14px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + cursor: pointer; + transition: all 0.2s; + + &:hover { + background: #f8fafc; + border-color: #b8c5d6; + transform: translateY(-1px); + } +} + +.org-avatar { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + flex-shrink: 0; + background: #e8edf5; + border-radius: 50%; + color: var(--sg-text); + font-weight: 600; + font-size: 14px; +} + +.org-info { + flex: 1; + min-width: 0; +} + +.org-name { + font-weight: 500; + color: var(--sg-text); + font-size: 14px; +} + +.org-details { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 4px; + font-size: 12px; + color: var(--sg-text-muted); + + .org-short { + font-weight: 500; + color: var(--sg-text); + } + + .org-role { + padding: 1px 8px; + background: #e8edf5; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + } + + .org-country { + padding: 1px 8px; + background: #e3f2fd; + border-radius: var(--sg-radius-sm); + color: #0d47a1; + } + + .org-sme-badge { + padding: 1px 8px; + background: #fff3e0; + border-radius: var(--sg-radius-sm); + color: #e65100; + font-weight: 600; + } + + .org-city { + color: var(--sg-text-muted); + } +} + +.org-contribution, +.org-cost { + display: flex; + flex-direction: column; + align-items: flex-end; + padding-left: 16px; + border-left: 1px solid #d9e2f0; + + .contribution-label, + .cost-label { + font-size: 11px; + color: var(--sg-text-muted); + } + + .contribution-value, + .cost-value { + font-weight: 600; + font-size: 14px; + color: var(--sg-text); + } +} + +// Publications +.publications-list { + padding: 16px 20px 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.publication-item { + display: flex; + align-items: flex-start; + gap: 16px; + padding: 14px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + transition: all 0.2s; + + &:hover { + background: #f8fafc; + } +} + +.pub-icon { + flex-shrink: 0; + color: var(--sg-text-muted); + + mat-icon { + width: 24px; + height: 24px; + font-size: 24px; + } +} + +.pub-info { + flex: 1; + min-width: 0; +} + +.pub-title { + font-weight: 500; + color: var(--sg-text); + font-size: 14px; +} + +.pub-authors { + color: var(--sg-text-muted); + font-size: 13px; + margin-top: 2px; +} + +.pub-meta { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 4px; + font-size: 12px; + color: var(--sg-text-muted); + + .pub-journal { + color: var(--sg-text); + } + + .pub-year, + .pub-publisher { + color: var(--sg-text-muted); + } +} + +.pub-actions { + display: flex; + gap: 8px; + flex-shrink: 0; + + .pub-link { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border-radius: var(--sg-radius-sm); + color: var(--sg-text-muted); + transition: all 0.2s; + + &:hover { + background: #e8edf5; + color: var(--sg-primary, #0066cc); + } + + mat-icon { + width: 18px; + height: 18px; + font-size: 18px; + } + } +} + +// IPRs +.iprs-list { + padding: 16px 20px 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.ipr-item { + display: flex; + align-items: flex-start; + gap: 16px; + padding: 14px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + transition: all 0.2s; + + &:hover { + background: #f8fafc; + } +} + +.ipr-icon { + flex-shrink: 0; + color: #f39c12; + + mat-icon { + width: 24px; + height: 24px; + font-size: 24px; + } +} + +.ipr-info { + flex: 1; + min-width: 0; +} + +.ipr-title { + font-weight: 500; + color: var(--sg-text); + font-size: 14px; +} + +.ipr-details { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 4px; + font-size: 12px; + + .ipr-type { + padding: 1px 8px; + background: #fff3e0; + border-radius: var(--sg-radius-sm); + color: #e65100; + font-weight: 500; + } + + .ipr-patent-type { + padding: 1px 8px; + background: #e8eaf6; + border-radius: var(--sg-radius-sm); + color: #283593; + } + + .ipr-applicant { + color: var(--sg-text-muted); + } +} + +.ipr-identifiers { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 4px; + font-size: 11px; + color: var(--sg-text-muted); + + .ipr-app-id, + .ipr-award-id { + padding: 1px 8px; + background: #f5f7fa; + border-radius: var(--sg-radius-sm); + } +} + +// Deliverables +.deliverables-list { + padding: 16px 20px 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.deliverable-item { + display: flex; + align-items: flex-start; + gap: 16px; + padding: 14px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + transition: all 0.2s; + + &:hover { + background: #f8fafc; + } +} + +.deliv-icon { + flex-shrink: 0; + color: #7b1fa2; + + mat-icon { + width: 24px; + height: 24px; + font-size: 24px; + } +} + +.deliv-info { + flex: 1; + min-width: 0; +} + +.deliv-description { + font-weight: 500; + color: var(--sg-text); + font-size: 14px; +} + +.deliv-meta { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 4px; + font-size: 12px; + align-items: center; + + .deliv-type { + padding: 1px 8px; + background: #f3e5f5; + border-radius: var(--sg-radius-sm); + color: #7b1fa2; + } + + .deliv-link { + display: inline-flex; + align-items: center; + gap: 4px; + color: var(--sg-primary, #0066cc); + text-decoration: none; + + &:hover { + text-decoration: underline; + } + + mat-icon { + width: 16px; + height: 16px; + font-size: 16px; + } + } +} + +// EuroSciVoc +.eurosci-voc-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; + padding: 16px 20px 20px; +} + +.eurosci-voc-item { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + background: #f8fafc; + border-radius: var(--sg-radius-sm); + border: 1px solid #d9e2f0; + + .voc-code { + font-weight: 600; + font-size: 12px; + color: var(--sg-text-muted); + background: #e8edf5; + padding: 2px 8px; + border-radius: var(--sg-radius-sm); + } + + .voc-title { + font-size: 13px; + color: var(--sg-text); + } +} + +// ERC PIs +.erc-pi-list { + padding: 16px 20px 20px; + display: flex; + flex-direction: column; + gap: 8px; +} + +.erc-pi-item { + display: flex; + align-items: center; + gap: 12px; + padding: 10px 14px; + background: #f8fafc; + border-radius: var(--sg-radius-sm); + border: 1px solid #d9e2f0; + + .pi-name { + font-weight: 500; + color: var(--sg-text); + font-size: 14px; + } + + .pi-title { + color: var(--sg-text-muted); + font-size: 13px; + } +} + +// Responsive +@media (max-width: 992px) { + .eurosci-voc-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 768px) { + .tabs-container { + gap: 2px; + padding: 0 2px; + } + + .tab-btn { + padding: 8px 12px; + font-size: 12px; + + mat-icon { + width: 16px; + height: 16px; + font-size: 16px; + } + } + + .organization-item, + .publication-item, + .ipr-item, + .deliverable-item { + flex-wrap: wrap; + } + + .org-contribution, + .org-cost { + width: 100%; + padding-left: 0; + padding-top: 8px; + border-left: none; + border-top: 1px solid #d9e2f0; + flex-direction: row; + gap: 8px; + align-items: center; + } } \ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 0c4020a9..6c9ee825 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -4,25 +4,146 @@ import { CommonModule } from '@angular/common'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatChipsModule } from '@angular/material/chips'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { Router } from '@angular/router'; +import { formatGermanDate } from '../../../shared/utils/formatters'; +// Type definitions for the enriched project +interface Organization { + name?: string; + shortName?: string; + role?: string; + country?: string; + city?: string; + ecContribution?: number; + totalCost?: number; + activityType?: string; + sme?: boolean; + organisationID?: string; +} + +interface Publication { + title?: string; + authors?: string; + doi?: string; + journalTitle?: string; + publishedYear?: number; + publisher?: string; + repositoryUrl?: string; +} + +interface Deliverable { + description?: string; + deliverableType?: string; + url?: string; +} + +interface Ipr { + title?: string; + type?: string; + applicantName?: string; + applicationIdentifier?: string; + awardIdentifier?: string; + patentType?: string; +} + +interface ErcPI { + firstName?: string; + lastName?: string; + title?: string; + organisationID?: string; +} + +interface EnrichedProject { + // Core project fields + id?: string; + title?: string; + acronym?: string; + rcn?: string; + status?: string; + startDate?: string; + endDate?: string; + ecMaxContribution?: number; + totalCost?: number; + ecSignatureDate?: string; + contentUpdateDate?: string; + grantDoi?: string; + frameworkProgramme?: string; + fundingScheme?: string; + masterCall?: string; + subCall?: string; + objective?: string; + topics?: string; + keywords?: string; + nature?: string; + legalBasis?: string; + + // Enriched data + organizations?: Organization[]; + publications?: Publication[]; + deliverables?: Deliverable[]; + iprs?: Ipr[]; + ercPrincipalInvestigators?: ErcPI[]; + reportSummaries?: any[]; + topicsList?: any[]; + webLinks?: any[]; + eurosciVoc?: any[]; + legalBasisList?: any[]; + + // Statistics + organizationCount?: number; + publicationCount?: number; + deliverableCount?: number; + iprCount?: number; + ercPiCount?: number; + + // Program type + programType?: 'fp7' | 'h2020' | 'heu'; +} @Component({ selector: 'app-eu-details', standalone: true, - imports: [CommonModule, MatCardModule, MatIconModule, MatChipsModule], + imports: [ + CommonModule, + MatCardModule, + MatIconModule, + MatChipsModule, + MatButtonModule, + MatDividerModule, + MatTooltipModule, + ], templateUrl: './eu-details.component.html', styleUrl: './eu-details.component.scss', }) export class EuDetailsComponent implements OnInit { private route = inject(ActivatedRoute); - euProject: any | undefined; + euProject: EnrichedProject | undefined; + activeTab: + | 'overview' + | 'organizations' + | 'publications' + | 'iprs' + | 'deliverables' = 'overview'; constructor(private router: Router) {} ngOnInit(): void { this.route.data.subscribe(({ euSingleProject }) => { console.log('EU Project:', euSingleProject); - this.euProject = euSingleProject; + this.euProject = euSingleProject.data; + + // Determine program type + if (this.euProject) { + if (euSingleProject.iprs !== undefined) { + this.euProject.programType = 'fp7'; + } else if (euSingleProject.ercPrincipalInvestigators !== undefined) { + this.euProject.programType = 'h2020'; + } else if (euSingleProject.deliverables !== undefined) { + this.euProject.programType = 'heu'; + } + } }); } @@ -39,30 +160,43 @@ export class EuDetailsComponent implements OnInit { if (!endDate) return 'N/A'; const end = new Date(endDate); const now = new Date(); - + if (isNaN(end.getTime())) return endDate; - + return end >= now ? 'Laufend' : 'Abgeschlossen'; } formatCurrency(amount: number | null | undefined): string { if (amount === null || amount === undefined) return 'N/A'; - + return new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, - maximumFractionDigits: 0 + maximumFractionDigits: 0, }).format(amount); } + getDuration(start: string | undefined, end: string | undefined): string { + if (!start || !end) return ''; + return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`; + } + formatDate(date: string | undefined) { + if (date) { + return formatGermanDate(date); + } + return date; + } getStatusColor(status: string | null | undefined): string { if (!status) return '#95a5a6'; - + const statusUpper = status.toUpperCase(); if (statusUpper.includes('CLOSED') || statusUpper.includes('COMPLETED')) { return '#27ae60'; - } else if (statusUpper.includes('ONGOING') || statusUpper.includes('ACTIVE')) { + } else if ( + statusUpper.includes('ONGOING') || + statusUpper.includes('ACTIVE') + ) { return '#f39c12'; } else if (statusUpper.includes('SIGNED')) { return '#3498db'; @@ -75,106 +209,142 @@ export class EuDetailsComponent implements OnInit { getStatusDisplay(status: string | null | undefined): string { if (!status) return 'N/A'; - + const statusMap: { [key: string]: string } = { - 'CLOSED': 'Abgeschlossen', - 'COMPLETED': 'Abgeschlossen', - 'ONGOING': 'Laufend', - 'ACTIVE': 'Aktiv', - 'SIGNED': 'Unterzeichnet', - 'CANCELLED': 'Abgebrochen', - 'SUSPENDED': 'Unterbrochen' + CLOSED: 'Abgeschlossen', + COMPLETED: 'Abgeschlossen', + ONGOING: 'Laufend', + ACTIVE: 'Aktiv', + SIGNED: 'Unterzeichnet', + CANCELLED: 'Abgebrochen', + SUSPENDED: 'Unterbrochen', }; - + const statusUpper = status.toUpperCase(); return statusMap[statusUpper] || status; } getFrameworkDisplay(framework: string | null | undefined): string { if (!framework) return 'N/A'; - + const frameworkMap: { [key: string]: string } = { - 'H2020': 'Horizon 2020', - 'FP7': '7. Rahmenprogramm', - 'FP6': '6. Rahmenprogramm', - 'HE': 'Horizon Europe' + HORIZON: ' Horizon Europe', + H2020: 'Horizon 2020', + FP7: '7. Rahmenprogramm', + FP6: '6. Rahmenprogramm', + HE: 'Horizon Europe', }; - + return frameworkMap[framework] || framework; } getFundingSchemeDisplay(scheme: string | null | undefined): string { if (!scheme) return 'N/A'; - + const schemeMap: { [key: string]: string } = { - 'MSCA-IF-EF-SE': 'MSCA Individual Fellowship - European Fellowship - Standard', + 'MSCA-IF-EF-SE': + 'MSCA Individual Fellowship - European Fellowship - Standard', 'MSCA-IF-EF': 'MSCA Individual Fellowship - European Fellowship', 'MSCA-IF-GF': 'MSCA Individual Fellowship - Global Fellowship', 'MSCA-IF': 'MSCA Individual Fellowship', 'MSCA-ITN': 'MSCA Innovative Training Networks', 'MSCA-RISE': 'MSCA Research and Innovation Staff Exchange', - 'MSCA-COFUND': 'MSCA Co-funding of Regional, National and International Programmes' + 'MSCA-COFUND': + 'MSCA Co-funding of Regional, National and International Programmes', }; - + return schemeMap[scheme] || scheme; } getFormattedTopics(topics: string | null | undefined): string[] { if (!topics) return []; - return topics.split(',').map(t => t.trim()); + return topics + .split(',') + .map((t) => t.trim()) + .filter((t) => t); } getKeywords(keywords: string | null | undefined): string[] { if (!keywords) return []; if (keywords === 'false') return []; - // If keywords is a string with comma-separated values if (typeof keywords === 'string') { - return keywords.split(',').map(k => k.trim()).filter(k => k && k !== 'false'); + return keywords + .split(',') + .map((k) => k.trim()) + .filter((k) => k && k !== 'false'); } return []; } + getTotalEcContribution(): number { + if (!this.euProject?.organizations) return 0; + return this.euProject.organizations + .filter((org) => org.ecContribution !== undefined) + .reduce((sum, org) => sum + (org.ecContribution || 0), 0); + } + + getOrganizationCountries(): string[] { + if (!this.euProject?.organizations) return []; + const countries = new Set( + this.euProject.organizations + .filter((org) => org.country) + .map((org) => org.country as string), + ); + return Array.from(countries); + } + + // Tab switching + setTab( + tab: + | 'overview' + | 'organizations' + | 'publications' + | 'iprs' + | 'deliverables', + ): void { + this.activeTab = tab; + } + + // Search functions searchByTopic(topic: string): void { this.router.navigate(['/eu-projects'], { - queryParams: { - topic: topic - } + queryParams: { topic: topic }, }); } searchByKeyword(keyword: string): void { this.router.navigate(['/eu-projects'], { - queryParams: { - keyword: keyword - } + queryParams: { keyword: keyword }, }); } searchByFramework(framework: string): void { this.router.navigate(['/eu-projects'], { - queryParams: { - framework: framework - } + queryParams: { framework: framework }, }); } searchByFundingScheme(scheme: string): void { this.router.navigate(['/eu-projects'], { - queryParams: { - fundingScheme: scheme - } + queryParams: { fundingScheme: scheme }, }); } searchByStatus(status: string): void { this.router.navigate(['/eu-projects'], { + queryParams: { status: status }, + }); + } + + searchForInstitutionName(institutionName: string): void { + this.router.navigate(['/institutions'], { queryParams: { - status: status - } + search: institutionName, + }, }); } goBack(): void { window.history.back(); } -} \ No newline at end of file +} -- 2.56.1 From 89fc34996ef4f610ea40e98615f870ca8e9210a6 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:09:27 +0200 Subject: [PATCH 13/42] BUND projects component adjustments --- .../bund-details/bund-details.component.html | 34 +++++++++++-------- .../bund-details/bund-details.component.ts | 28 +++++++-------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/webapp/src/app/modules/projects/bund-details/bund-details.component.html b/webapp/src/app/modules/projects/bund-details/bund-details.component.html index 9b0df147..1c9f4132 100644 --- a/webapp/src/app/modules/projects/bund-details/bund-details.component.html +++ b/webapp/src/app/modules/projects/bund-details/bund-details.component.html @@ -46,14 +46,21 @@ calendar_today
{{ getStartDate() || 'N/A' }} - Startdatum + Förderbeginn
event_busy
{{ getFundingStatus(getEndDate()) }} - Enddatum + Förderende +
+
+
+ access_time +
+ {{ getStatusDisplay(bundProject.funding_end_date) }} + Status
@if (bundProject.funding_amount) { @@ -77,18 +84,17 @@ - @if (bundProject.description) { - -
- description -

Beschreibung

-
-

{{ bundProject.description }}

-
- } -
+ @if (bundProject.description) { + +
+ description +

Beschreibung

+
+

{{ bundProject.description }}

+
+ } @if (getAssociatedPersons().length > 0) { @@ -351,11 +357,11 @@ } @if (getDuration()) { diff --git a/webapp/src/app/modules/projects/bund-details/bund-details.component.ts b/webapp/src/app/modules/projects/bund-details/bund-details.component.ts index 5ad9007b..3a5c3f6c 100644 --- a/webapp/src/app/modules/projects/bund-details/bund-details.component.ts +++ b/webapp/src/app/modules/projects/bund-details/bund-details.component.ts @@ -5,7 +5,7 @@ import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { BundProjectDetails } from '../../../api/model/bundProjectDetails'; import { Router } from '@angular/router'; - +import { formatGermanDate } from '../../../shared/utils/formatters'; @Component({ selector: 'app-bund-details', standalone: true, @@ -41,8 +41,8 @@ export class BundDetailsComponent implements OnInit { const year = parseInt(fundingEndDate, 10); if (isNaN(year)) return fundingEndDate; return year >= new Date().getFullYear() - ? `${fundingEndDate} (laufend)` - : `${fundingEndDate} (abgeschlossen)`; + ? `${fundingEndDate}` + : `${fundingEndDate}`; } formatCurrency(amount: number | null | undefined): string { @@ -104,15 +104,6 @@ export class BundDetailsComponent implements OnInit { // } // }); // } - private formatGermanDate(dateString: string): string { - if (!dateString) return ''; - - return new Intl.DateTimeFormat('de-DE', { - day: 'numeric', - month: 'long', - year: 'numeric', - }).format(new Date(dateString)); - } /** * All associated persons as a simple list. */ @@ -120,11 +111,11 @@ export class BundDetailsComponent implements OnInit { return this.bundProject?.associated_persons || []; } getStartDate(): string { - return this.formatGermanDate(this.bundProject?.funding_start_date ?? ''); + return formatGermanDate(this.bundProject?.funding_start_date ?? ''); } getEndDate(): string { - return this.formatGermanDate(this.bundProject?.funding_end_date ?? ''); + return formatGermanDate(this.bundProject?.funding_end_date ?? ''); } getDuration(): string { @@ -133,7 +124,7 @@ export class BundDetailsComponent implements OnInit { if (!start || !end) return ''; - return `von ${this.formatGermanDate(start)} bis ${this.formatGermanDate(end)}`; + return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`; } /** * All institutions as a simple list. @@ -156,7 +147,12 @@ export class BundDetailsComponent implements OnInit { if (!this.bundProject?.funding_amount) return 'N/A'; return this.formatCurrency(this.bundProject.funding_amount); } - + getStatusDisplay(fundingEndDate: string | null | undefined): string { + if (!fundingEndDate) return 'N/A'; + if (fundingEndDate === '2999') return 'Laufend'; + const year = parseInt(fundingEndDate, 10); + return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`; + } goBack(): void { window.history.back(); } -- 2.56.1 From 6173db73b57c36ce64c2671d73c34d0f7fc572bc Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:10:24 +0200 Subject: [PATCH 14/42] date formatted --- .../dfg-details/dfg-details.component.html | 38 ++++++++++--------- .../dfg-details/dfg-details.component.ts | 34 +++++++++++++++-- .../eu-details.component.scss | 4 -- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html index 81947db7..cf9a55dd 100644 --- a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html +++ b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html @@ -44,14 +44,21 @@ calendar_today
{{ dfgProject.funding_start_date || 'N/A' }} - Fördersbeginn + Förderbeginn
event_busy
{{ getFundingStatus(dfgProject.funding_end_date) }} - Fördersende + Förderende +
+
+
+ access_time +
+ {{ getStatusDisplay(dfgProject.funding_end_date) }} + Status
@@ -198,12 +204,8 @@
{{ dfgProject.funding_type || 'N/A' }}
-->
-
Fördersbeginn
-
{{ dfgProject.funding_start_date || 'N/A' }}
-
-
-
Fördersende
-
{{ getFundingStatus(dfgProject.funding_end_date) }}
+
Laufzeit
+
{{ getDuration() }}
@if (dfgProject.subproject_of) {
diff --git a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts index ab8ca4ea..ec1dac1b 100644 --- a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts +++ b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.ts @@ -36,13 +36,34 @@ export class DfgDetailsComponent implements OnInit { getFundingStatus(fundingEndDate: string | null | undefined): string { if (!fundingEndDate) return 'N/A'; - if (fundingEndDate === '2999') return 'laufend'; + if (fundingEndDate === '2999') return 'Laufend'; const year = parseInt(fundingEndDate, 10); if (isNaN(year)) return fundingEndDate; return year >= new Date().getFullYear() - ? `${fundingEndDate} (laufend)` - : `${fundingEndDate} (abgeschlossen)`; + ? `${fundingEndDate}` + : `${fundingEndDate}`; } + + getStatusDisplay(fundingEndDate: string | null | undefined): string { + if (!fundingEndDate) return 'N/A'; + if (fundingEndDate === '2999') return 'Laufend'; + const year = parseInt(fundingEndDate, 10); + return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`; + } + + getStatusColor(status: string | null | undefined): string { + if (!status) return '#95a5a6'; + + const statusUpper = status.toUpperCase(); + if (statusUpper.includes('Abgeschlossen')) { + return '#27ae60'; + } else if (statusUpper.includes('Laufend')) { + return '#f39c12'; + } else { + return '#95a5a6'; + } + } + searchForPersonName(personName: string): void { this.router.navigate(['/persons'], { queryParams: { @@ -70,7 +91,14 @@ export class DfgDetailsComponent implements OnInit { getInstitutions(): string[] { return this.dfgProject?.institutions || []; } + getDuration(): string { + const start = this.dfgProject?.funding_start_date; + const end = this.dfgProject?.funding_end_date; + if (!start || !end) return ''; + + return `von ${start} bis ${end}`; + } goBack(): void { window.history.back(); } diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss index bbb60de8..19553278 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss @@ -1,5 +1,3 @@ -// Complete SCSS with all styles - .detail-page { padding: 28px 32px 42px; max-width: 100%; @@ -617,8 +615,6 @@ h1 { justify-content: center; } } -// Add these to your existing SCSS file - // Program badges .program-badge { display: inline-block; -- 2.56.1 From 171a7d08b73a41e7e8381c611704e7cbf0ee57f4 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:10:48 +0200 Subject: [PATCH 15/42] added external date -> german date formatter --- webapp/src/app/shared/utils/formatters.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 webapp/src/app/shared/utils/formatters.ts diff --git a/webapp/src/app/shared/utils/formatters.ts b/webapp/src/app/shared/utils/formatters.ts new file mode 100644 index 00000000..58cc03bc --- /dev/null +++ b/webapp/src/app/shared/utils/formatters.ts @@ -0,0 +1,9 @@ +export function formatGermanDate(dateString: string): string { + if (!dateString) return ''; + + return new Intl.DateTimeFormat('de-DE', { + day: 'numeric', + month: 'long', + year: 'numeric', + }).format(new Date(dateString)); +} -- 2.56.1 From 443169bc90590fe554ba5e40a0786ec0a6e5d8c5 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:11:15 +0200 Subject: [PATCH 16/42] resolver adjusted for the new data model --- webapp/src/app/resolvers/eu-single-project-resolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/resolvers/eu-single-project-resolver.ts b/webapp/src/app/resolvers/eu-single-project-resolver.ts index 4bb3eb86..032ba63e 100644 --- a/webapp/src/app/resolvers/eu-single-project-resolver.ts +++ b/webapp/src/app/resolvers/eu-single-project-resolver.ts @@ -1,9 +1,9 @@ import { inject } from '@angular/core'; import { ResolveFn } from '@angular/router'; import { ProjectsService } from '../api/api/projects.service'; -import { CordisEuProject } from '../api'; +import { EuCordisProjectResponse } from '../api'; -export const euSingleProjectResolver: ResolveFn = ( +export const euSingleProjectResolver: ResolveFn = ( route, state, ) => { -- 2.56.1 From 04cb26092753a9ee1887a4549eb72e517f244af2 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:11:26 +0200 Subject: [PATCH 17/42] added models to FILES --- webapp/src/app/api/.openapi-generator/FILES | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 0a468ed3..1f846392 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -54,6 +54,7 @@ model/cordisEuProjectPage.ts model/costUsd.ts model/customAuthor.ts model/customAuthorsListResponse.ts +model/data.ts model/dehydratedAuthor.ts model/dehydratedFunder.ts model/dehydratedInstitution.ts @@ -61,16 +62,47 @@ model/dehydratedSource.ts model/dfgProjectDetails.ts model/dfgProjectPage.ts model/dfgProjectSummary.ts +model/eccontribution.ts +model/ecmaxcontribution.ts +model/euCordisProjectResponse.ts model/euOrganizationProjectSummary.ts model/euOrganizationProjectSummaryPage.ts model/filterInformation.ts model/filterProperties.ts +model/fp7EurosciVoc.ts +model/fp7LegalBasis.ts +model/fp7Organization.ts +model/fp7ProjectDetails.ts +model/fp7ProjectIPR.ts +model/fp7Publication.ts +model/fp7ReportSummary.ts +model/fp7Topic.ts +model/fp7WebLink.ts model/funderByAuthor.ts model/fundersByAuthorResponse.ts model/fundingProject.ts model/fundingProjectPage.ts model/fwci.ts model/groupByResult.ts +model/h2020Deliverable.ts +model/h2020ErcPI.ts +model/h2020EurosciVoc.ts +model/h2020LegalBasis.ts +model/h2020Organization.ts +model/h2020ProjectDetails.ts +model/h2020Publication.ts +model/h2020ReportSummary.ts +model/h2020Topic.ts +model/h2020WebLink.ts +model/hEUDeliverable.ts +model/hEUEurosciVoc.ts +model/hEULegalBasis.ts +model/hEUOrganization.ts +model/hEUProjectDetails.ts +model/hEUPublication.ts +model/hEUReportSummary.ts +model/hEUTopic.ts +model/hEUWebLink.ts model/hTTPValidationError.ts model/identityGrant.ts model/institution.ts @@ -93,6 +125,7 @@ model/mentionedPerson.ts model/meta.ts model/model2YrMeanCitedness.ts model/models.ts +model/neteccontribution.ts model/newsArticle.ts model/newsArticleDetail.ts model/newsPage.ts @@ -119,6 +152,7 @@ model/topics.ts model/topicsByTime.ts model/topicsByYear.ts model/topicsListResponse.ts +model/totalcost.ts model/universityRanking.ts model/universityTopicData.ts model/user.ts -- 2.56.1 From ce6f29292ce6755953ed6cbc321dcea5a5e5b78c Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 00:29:20 +0200 Subject: [PATCH 18/42] test --- service/src/main/inse/projects/model.py | 1 - 1 file changed, 1 deletion(-) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py index 526e55af..137867ae 100644 --- a/service/src/main/inse/projects/model.py +++ b/service/src/main/inse/projects/model.py @@ -167,7 +167,6 @@ class CordisEuProjectPage(Page): default_factory=list, description="The CORDIS EU projects on this page." ) - class EuCordisProjectResponse(BaseModel): """ Response model for EU Cordis project endpoints. -- 2.56.1 From 7045d9ea7aef86abcf7e0e325e7a3bdcf5c39ae6 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 09:27:16 +0200 Subject: [PATCH 19/42] index names fixed --- .../eu_cordis_projects_enrichment_client.py | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py index 88e314cb..6852a48c 100644 --- a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py +++ b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py @@ -106,7 +106,7 @@ def _determine_program_type_from_index(index: str) -> str: index_lower = index.lower() if "fp7" in index_lower: return "fp7" - elif "horizon_2020" or () in index_lower: + elif "horizon_2020" in index_lower: return "h2020" elif "heu" in index_lower or "horizon_europe" in index_lower: return "heu" @@ -157,7 +157,7 @@ def _enrich_fp7_project( ) eurosci_voc = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_fp7_eurosci_voc", + index_pattern="cordis_eu_fp7_euroscivoc", model_class=Fp7EurosciVoc ) legal_basis_list = _fetch_related_entities( @@ -194,47 +194,47 @@ def _enrich_h2020_project( # Fetch all related data organizations = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_organizations", + index_pattern="cordis_eu_horizon_2020_organizations", model_class=H2020Organization ) publications = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_publications", + index_pattern="cordis_eu_horizon_2020_publications", model_class=H2020Publication ) deliverables = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_deliverables", + index_pattern="cordis_eu_horizon_2020_deliverables", model_class=H2020Deliverable ) report_summaries = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_report_summaries", + index_pattern="cordis_eu_horizon_2020_report_summaries", model_class=H2020ReportSummary ) topics_list = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_topics", + index_pattern="cordis_eu_horizon_2020_topics", model_class=H2020Topic ) web_links = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_web_links", + index_pattern="cordis_eu_horizon_2020_web_links", model_class=H2020WebLink ) eurosci_voc = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_eurosci_voc", + index_pattern="cordis_eu_horizon_2020_euroscivoc", model_class=H2020EurosciVoc ) legal_basis_list = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_legal_basis", + index_pattern="cordis_eu_horizon_2020_legal_basis", model_class=H2020LegalBasis ) erc_pis = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_h2020_erc_pis", + index_pattern="cordis_eu_horizon_2020_erc_pis", model_class=H2020ErcPI ) @@ -267,42 +267,43 @@ def _enrich_heu_project( # Fetch all related data organizations = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_organizations", + index_pattern="cordis_eu_horizon_europe_organizations", model_class=HEUOrganization ) + print("ORGS",organizations) publications = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_publications", + index_pattern="cordis_eu_horizon_europe_publications", model_class=HEUPublication ) deliverables = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_deliverables", + index_pattern="cordis_eu_horizon_europe_deliverables", model_class=HEUDeliverable ) report_summaries = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_report_summaries", + index_pattern="cordis_eu_horizon_europe_report_summaries", model_class=HEUReportSummary ) topics_list = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_topics", + index_pattern="cordis_eu_horizon_europe_topics", model_class=HEUTopic ) web_links = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_web_links", + index_pattern="cordis_eu_horizon_europe_web_links", model_class=HEUWebLink ) eurosci_voc = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_eurosci_voc", + index_pattern="cordis_eu_horizon_europe_euroscivoc", model_class=HEUEurosciVoc ) legal_basis_list = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_heu_legal_basis", + index_pattern="cordis_eu_horizon_europe_legal_basis", model_class=HEULegalBasis ) @@ -343,7 +344,7 @@ def _fetch_related_entities( query=query, index=index_pattern, cluster=ESCluster.INSE, - size=1 + size=10000 ) except Exception as e: logger.warning(f"Failed to fetch from {index_pattern}: {e}") -- 2.56.1 From e2c055f58c25374a0e1b3b52e57106d775917c2a Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 14:23:23 +0200 Subject: [PATCH 20/42] added queryParams <-> navbar binding --- .../eu-details.component.html | 2 +- .../eu-cordis-details/eu-details.component.ts | 259 ++++++++++-------- 2 files changed, 145 insertions(+), 116 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html index 9a51d3ae..d08c1dbb 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -562,7 +562,7 @@

Geistiges Eigentum (IPRs) ({{ euProject.iprs.length }})

- @for (ipr of euProject.iprs; track ipr) { + @for (ipr of euProject.iprs; track ipr.title) {
@if (ipr.type === 'PATENT') { diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 6c9ee825..58a47b81 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -1,3 +1,4 @@ +// eu-details.component.ts (updated) import { Component, OnInit, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { CommonModule } from '@angular/common'; @@ -9,98 +10,10 @@ import { MatDividerModule } from '@angular/material/divider'; import { MatTooltipModule } from '@angular/material/tooltip'; import { Router } from '@angular/router'; import { formatGermanDate } from '../../../shared/utils/formatters'; -// Type definitions for the enriched project -interface Organization { - name?: string; - shortName?: string; - role?: string; - country?: string; - city?: string; - ecContribution?: number; - totalCost?: number; - activityType?: string; - sme?: boolean; - organisationID?: string; -} +import { Data } from '../../../api'; -interface Publication { - title?: string; - authors?: string; - doi?: string; - journalTitle?: string; - publishedYear?: number; - publisher?: string; - repositoryUrl?: string; -} -interface Deliverable { - description?: string; - deliverableType?: string; - url?: string; -} - -interface Ipr { - title?: string; - type?: string; - applicantName?: string; - applicationIdentifier?: string; - awardIdentifier?: string; - patentType?: string; -} - -interface ErcPI { - firstName?: string; - lastName?: string; - title?: string; - organisationID?: string; -} - -interface EnrichedProject { - // Core project fields - id?: string; - title?: string; - acronym?: string; - rcn?: string; - status?: string; - startDate?: string; - endDate?: string; - ecMaxContribution?: number; - totalCost?: number; - ecSignatureDate?: string; - contentUpdateDate?: string; - grantDoi?: string; - frameworkProgramme?: string; - fundingScheme?: string; - masterCall?: string; - subCall?: string; - objective?: string; - topics?: string; - keywords?: string; - nature?: string; - legalBasis?: string; - - // Enriched data - organizations?: Organization[]; - publications?: Publication[]; - deliverables?: Deliverable[]; - iprs?: Ipr[]; - ercPrincipalInvestigators?: ErcPI[]; - reportSummaries?: any[]; - topicsList?: any[]; - webLinks?: any[]; - eurosciVoc?: any[]; - legalBasisList?: any[]; - - // Statistics - organizationCount?: number; - publicationCount?: number; - deliverableCount?: number; - iprCount?: number; - ercPiCount?: number; - - // Program type - programType?: 'fp7' | 'h2020' | 'heu'; -} +export type TabType = 'overview' | 'organizations' | 'publications' | 'iprs' | 'deliverables'; @Component({ selector: 'app-eu-details', @@ -119,17 +32,19 @@ interface EnrichedProject { }) export class EuDetailsComponent implements OnInit { private route = inject(ActivatedRoute); - euProject: EnrichedProject | undefined; - activeTab: - | 'overview' - | 'organizations' - | 'publications' - | 'iprs' - | 'deliverables' = 'overview'; - - constructor(private router: Router) {} + private router = inject(Router); + + euProject: Data| undefined; + activeTab: TabType = 'overview'; + programType: String = "" + // Track if tabs have content + hasOrganizations = false; + hasPublications = false; + hasIprs = false; + hasDeliverables = false; ngOnInit(): void { + // Subscribe to route data for project this.route.data.subscribe(({ euSingleProject }) => { console.log('EU Project:', euSingleProject); this.euProject = euSingleProject.data; @@ -137,16 +52,139 @@ export class EuDetailsComponent implements OnInit { // Determine program type if (this.euProject) { if (euSingleProject.iprs !== undefined) { - this.euProject.programType = 'fp7'; + this.programType = 'fp7'; } else if (euSingleProject.ercPrincipalInvestigators !== undefined) { - this.euProject.programType = 'h2020'; + this.programType = 'h2020'; } else if (euSingleProject.deliverables !== undefined) { - this.euProject.programType = 'heu'; + this.programType = 'heu'; } + + // Check which tabs have content + this.hasOrganizations = this.euProject.organizations && this.euProject.organizations.length > 0 || false; + this.hasPublications = this.euProject.publications && this.euProject.publications.length > 0 || false; + this.hasIprs = this.euProject.iprs && this.euProject.iprs.length > 0 || false; + this.hasDeliverables = this.euProject.deliverables && this.euProject.deliverables.length > 0 || false; + } + }); + + // Subscribe to query params for tab synchronization + this.route.queryParams.subscribe(params => { + const tabParam = params['tab'] as TabType; + if (tabParam && this.isValidTab(tabParam)) { + // Check if the tab has content before switching + if (this.tabHasContent(tabParam)) { + this.activeTab = tabParam; + } else { + // If tab has no content, switch to overview and update URL + this.updateTabQueryParam('overview'); + } + } else { + // If no valid tab param, set to overview and update URL + this.updateTabQueryParam('overview'); } }); } + /** + * Check if a tab value is valid + */ + private isValidTab(tab: string): tab is TabType { + return ['overview', 'organizations', 'publications', 'iprs', 'deliverables'].includes(tab); + } + + /** + * Check if a tab has content to display + */ + private tabHasContent(tab: TabType): boolean { + switch (tab) { + case 'overview': + return true; + case 'organizations': + return this.hasOrganizations; + case 'publications': + return this.hasPublications; + case 'iprs': + return this.hasIprs; + case 'deliverables': + return this.hasDeliverables; + default: + return false; + } + } + + /** + * Update URL query param for tab + */ + private updateTabQueryParam(tab: TabType): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { tab: tab }, + queryParamsHandling: 'merge', // Preserve other query params + }); + } + + /** + * Set active tab and update URL + */ + setTab(tab: TabType): void { + if (this.activeTab === tab) return; + + // Check if tab has content + if (!this.tabHasContent(tab)) { + return; + } + + this.activeTab = tab; + this.updateTabQueryParam(tab); + } + + /** + * Check if a tab is active + */ + isTabActive(tab: TabType): boolean { + return this.activeTab === tab; + } + + /** + * Check if a tab should be visible (has content) + */ + shouldShowTab(tab: TabType): boolean { + return this.tabHasContent(tab); + } + + /** + * Get tab label with count + */ + getTabLabel(tab: TabType): string { + const labels: Record = { + overview: 'Übersicht', + organizations: 'Organisationen', + publications: 'Publikationen', + iprs: 'IPRs', + deliverables: 'Ergebnisse', + }; + return labels[tab]; + } + + /** + * Get tab count badge + */ + getTabCount(tab: TabType): number | null { + switch (tab) { + case 'organizations': + return this.euProject?.organizations?.length || null; + case 'publications': + return this.euProject?.publications?.length || null; + case 'iprs': + return this.euProject?.iprs?.length || null; + case 'deliverables': + return this.euProject?.deliverables?.length || null; + default: + return null; + } + } + + getInitials(name: string | null | undefined): string { if (!name) return ''; const parts = name.trim().split(/\s+/); @@ -176,17 +214,20 @@ export class EuDetailsComponent implements OnInit { maximumFractionDigits: 0, }).format(amount); } + getDuration(start: string | undefined, end: string | undefined): string { if (!start || !end) return ''; return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`; } + formatDate(date: string | undefined) { if (date) { return formatGermanDate(date); } return date; } + getStatusColor(status: string | null | undefined): string { if (!status) return '#95a5a6'; @@ -293,18 +334,6 @@ export class EuDetailsComponent implements OnInit { return Array.from(countries); } - // Tab switching - setTab( - tab: - | 'overview' - | 'organizations' - | 'publications' - | 'iprs' - | 'deliverables', - ): void { - this.activeTab = tab; - } - // Search functions searchByTopic(topic: string): void { this.router.navigate(['/eu-projects'], { @@ -347,4 +376,4 @@ export class EuDetailsComponent implements OnInit { goBack(): void { window.history.back(); } -} +} \ No newline at end of file -- 2.56.1 From f617c204fdac73a288456af2ceec6e155e1a5532 Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 14:23:35 +0200 Subject: [PATCH 21/42] fixed wrong index name --- .../main/inse/projects/eu_cordis_projects_enrichment_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py index 6852a48c..7871e202 100644 --- a/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py +++ b/service/src/main/inse/projects/eu_cordis_projects_enrichment_client.py @@ -137,7 +137,7 @@ def _enrich_fp7_project( ) iprs = _fetch_related_entities( project_ids=[project_id], - index_pattern="cordis_eu_fp7_iprs", + index_pattern="cordis_eu_fp7_project_iprs", model_class=Fp7ProjectIPR ) report_summaries = _fetch_related_entities( -- 2.56.1 From 7b0270f57a36cfeffbf8c7be82458e2bcbfd4dfb Mon Sep 17 00:00:00 2001 From: genja Date: Tue, 23 Jun 2026 14:24:15 +0200 Subject: [PATCH 22/42] added colored status element --- .../bund-details/bund-details.component.html | 12 +++++++++- .../bund-details/bund-details.component.scss | 22 +++++++++++++++++++ .../bund-details/bund-details.component.ts | 11 ++++++++++ .../dfg-details/dfg-details.component.html | 6 +++++ .../dfg-details/dfg-details.component.scss | 22 +++++++++++++++++++ .../dfg-details/dfg-details.component.ts | 9 ++++---- 6 files changed, 76 insertions(+), 6 deletions(-) diff --git a/webapp/src/app/modules/projects/bund-details/bund-details.component.html b/webapp/src/app/modules/projects/bund-details/bund-details.component.html index 1c9f4132..fcceb4bd 100644 --- a/webapp/src/app/modules/projects/bund-details/bund-details.component.html +++ b/webapp/src/app/modules/projects/bund-details/bund-details.component.html @@ -26,6 +26,14 @@

}
+
+ circle + {{ getStatusDisplay(bundProject.funding_end_date) }} +
@@ -220,7 +216,7 @@ } - @if (getKeywords(euProject.keywords).length > 0) { + + @if (getKeywordChips().length > 0) { + +
+ tag +

Schlüsselwörter

+ {{ + getKeywordChips().length + }} +
+
+ @for ( + keyword of getKeywordChips(); + track keyword.id || keyword.label + ) { + + + } +
+
} @@ -255,9 +278,39 @@
@for (voc of euProject.eurosciVoc; track voc.id) { -
- {{ voc.code }} - {{ voc.title }} +
+
+ @if (voc.path) { + @for ( + segment of getPathSegments(voc.path); + track segment + ) { + {{ segment }} + @if (!$last) { + chevron_right + } + } + } @else { + {{ + voc.code || 'N/A' + }} + } +
+ @if (voc.code) { + {{ voc.code }} + } + @if (voc.description) { + {{ + voc.description + }} + } + @if (voc.path) { + search + }
}
@@ -334,13 +387,13 @@ @if (euProject.ecMaxContribution) {
Max. EU-Beitrag
-
{{ formatCurrency(euProject.ecMaxContribution) }}
+
{{ formatCurr(euProject.ecMaxContribution) }}
} @if (euProject.totalCost) {
Gesamtkosten
-
{{ formatCurrency(euProject.totalCost) }}
+
{{ formatCurr(euProject.totalCost) }}
} @if (euProject.ecSignatureDate) { @@ -367,7 +420,12 @@
Laufzeit
-
{{ getDuration(euProject.startDate,euProject.endDate) || 'N/A' }}
+
+ {{ + getDuration(euProject.startDate, euProject.endDate) || + 'N/A' + }} +
@if (euProject.ecSignatureDate) {
@@ -400,7 +458,7 @@ @if ( - euProject.programType === 'h2020' && + programType === 'h2020' && euProject.ercPrincipalInvestigators && euProject.ercPrincipalInvestigators.length > 0 ) { @@ -434,7 +492,7 @@
} - + + + + @if (activeTab === 'organizations' && euProject.organizations) { + } diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss index 19553278..60c230aa 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss @@ -163,7 +163,7 @@ h1 { .status-badge:hover { transform: translateY(-1px); - box-shadow: 0 2px 8px rgba(0,0,0,0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); } .status-badge mat-icon { @@ -376,49 +376,20 @@ h1 { opacity: 1; } -.keywords-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 10px; - padding: 16px 20px 20px; -} - -.keyword-item { +.interest-tags { display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 14px; - border: 1px solid #d9e2f0; - border-radius: var(--sg-radius-sm); - background: #fff; - cursor: pointer; - transition: all 0.2s; - position: relative; + flex-wrap: wrap; + gap: 12px; + padding: 16px 20px 12px; } - -.keyword-item:hover { - background: #f8fafc; - border-color: #b8c5d6; - transform: translateY(-1px); -} - -.keyword-value { - color: var(--sg-text); - font-size: 13px; - word-break: break-word; -} - -.keyword-item .search-icon { +.interest-tags .interest-empty { + padding: 9px 16px; + border: 1px solid #e2e8f0; + border-style: dashed; + border-radius: 7px; color: var(--sg-text-muted); - width: 16px; - height: 16px; - font-size: 16px; - opacity: 0; - transition: opacity 0.2s; -} - -.keyword-item:hover .search-icon { - opacity: 1; + font-size: 13px; + font-weight: 600; } .details-list { @@ -541,20 +512,11 @@ h1 { font-size: 16px; } -// Utility function for date formatting -.format-date { - // Handled in component -} - -@media (max-width: 992px) { +@media (max-width: 1116px) { .content-grid { grid-template-columns: 1fr; gap: 20px; } - - .keywords-grid { - grid-template-columns: 1fr 1fr; - } } @media (max-width: 768px) { @@ -585,16 +547,16 @@ h1 { grid-template-columns: 1fr; gap: 4px; } - + .eyebrow { gap: 8px; } - + .topics-grid { grid-template-columns: 1fr; } - - .keywords-grid { + + .interest-tags { grid-template-columns: 1fr; } } @@ -607,7 +569,7 @@ h1 { .hero-actions { flex-direction: column; } - + .status-badge, .scheme-info, .doi-link { @@ -624,17 +586,17 @@ h1 { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; - + &.fp7 { background: #e8eaf6; color: #283593; } - + &.h2020 { background: #e3f2fd; color: #0d47a1; } - + &.heu { background: #e8f5e9; color: #1b5e20; @@ -667,18 +629,18 @@ h1 { cursor: pointer; transition: all 0.2s; white-space: nowrap; - + &:hover { background: rgba(0, 0, 0, 0.04); color: var(--sg-text); } - + &.active { background: #fff; color: var(--sg-primary, #0066cc); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); } - + mat-icon { width: 20px; height: 20px; @@ -705,123 +667,15 @@ h1 { } @keyframes fadeIn { - from { opacity: 0; transform: translateY(8px); } - to { opacity: 1; transform: translateY(0); } -} - -// Organizations -.organizations-list { - padding: 16px 20px 20px; - display: flex; - flex-direction: column; - gap: 12px; -} - -.organization-item { - display: flex; - align-items: center; - gap: 16px; - padding: 14px 16px; - border: 1px solid #d9e2f0; - border-radius: var(--sg-radius-sm); - background: #fff; - cursor: pointer; - transition: all 0.2s; - - &:hover { - background: #f8fafc; - border-color: #b8c5d6; - transform: translateY(-1px); + from { + opacity: 0; + transform: translateY(8px); + } + to { + opacity: 1; + transform: translateY(0); } } - -.org-avatar { - display: flex; - align-items: center; - justify-content: center; - width: 40px; - height: 40px; - flex-shrink: 0; - background: #e8edf5; - border-radius: 50%; - color: var(--sg-text); - font-weight: 600; - font-size: 14px; -} - -.org-info { - flex: 1; - min-width: 0; -} - -.org-name { - font-weight: 500; - color: var(--sg-text); - font-size: 14px; -} - -.org-details { - display: flex; - flex-wrap: wrap; - gap: 8px; - margin-top: 4px; - font-size: 12px; - color: var(--sg-text-muted); - - .org-short { - font-weight: 500; - color: var(--sg-text); - } - - .org-role { - padding: 1px 8px; - background: #e8edf5; - border-radius: var(--sg-radius-sm); - color: var(--sg-text); - } - - .org-country { - padding: 1px 8px; - background: #e3f2fd; - border-radius: var(--sg-radius-sm); - color: #0d47a1; - } - - .org-sme-badge { - padding: 1px 8px; - background: #fff3e0; - border-radius: var(--sg-radius-sm); - color: #e65100; - font-weight: 600; - } - - .org-city { - color: var(--sg-text-muted); - } -} - -.org-contribution, -.org-cost { - display: flex; - flex-direction: column; - align-items: flex-end; - padding-left: 16px; - border-left: 1px solid #d9e2f0; - - .contribution-label, - .cost-label { - font-size: 11px; - color: var(--sg-text-muted); - } - - .contribution-value, - .cost-value { - font-weight: 600; - font-size: 14px; - color: var(--sg-text); - } -} - // Publications .publications-list { padding: 16px 20px 20px; @@ -839,7 +693,7 @@ h1 { border-radius: var(--sg-radius-sm); background: #fff; transition: all 0.2s; - + &:hover { background: #f8fafc; } @@ -848,7 +702,7 @@ h1 { .pub-icon { flex-shrink: 0; color: var(--sg-text-muted); - + mat-icon { width: 24px; height: 24px; @@ -880,11 +734,11 @@ h1 { margin-top: 4px; font-size: 12px; color: var(--sg-text-muted); - + .pub-journal { color: var(--sg-text); } - + .pub-year, .pub-publisher { color: var(--sg-text-muted); @@ -895,7 +749,7 @@ h1 { display: flex; gap: 8px; flex-shrink: 0; - + .pub-link { display: flex; align-items: center; @@ -905,12 +759,12 @@ h1 { border-radius: var(--sg-radius-sm); color: var(--sg-text-muted); transition: all 0.2s; - + &:hover { background: #e8edf5; color: var(--sg-primary, #0066cc); } - + mat-icon { width: 18px; height: 18px; @@ -936,7 +790,7 @@ h1 { border-radius: var(--sg-radius-sm); background: #fff; transition: all 0.2s; - + &:hover { background: #f8fafc; } @@ -945,7 +799,7 @@ h1 { .ipr-icon { flex-shrink: 0; color: #f39c12; - + mat-icon { width: 24px; height: 24px; @@ -970,7 +824,7 @@ h1 { gap: 8px; margin-top: 4px; font-size: 12px; - + .ipr-type { padding: 1px 8px; background: #fff3e0; @@ -978,14 +832,14 @@ h1 { color: #e65100; font-weight: 500; } - + .ipr-patent-type { padding: 1px 8px; background: #e8eaf6; border-radius: var(--sg-radius-sm); color: #283593; } - + .ipr-applicant { color: var(--sg-text-muted); } @@ -998,7 +852,7 @@ h1 { margin-top: 4px; font-size: 11px; color: var(--sg-text-muted); - + .ipr-app-id, .ipr-award-id { padding: 1px 8px; @@ -1024,7 +878,7 @@ h1 { border-radius: var(--sg-radius-sm); background: #fff; transition: all 0.2s; - + &:hover { background: #f8fafc; } @@ -1033,7 +887,7 @@ h1 { .deliv-icon { flex-shrink: 0; color: #7b1fa2; - + mat-icon { width: 24px; height: 24px; @@ -1059,25 +913,25 @@ h1 { margin-top: 4px; font-size: 12px; align-items: center; - + .deliv-type { padding: 1px 8px; background: #f3e5f5; border-radius: var(--sg-radius-sm); color: #7b1fa2; } - + .deliv-link { display: inline-flex; align-items: center; gap: 4px; color: var(--sg-primary, #0066cc); text-decoration: none; - + &:hover { text-decoration: underline; } - + mat-icon { width: 16px; height: 16px; @@ -1088,33 +942,156 @@ h1 { // EuroSciVoc .eurosci-voc-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 8px; + display: flex; + flex-direction: column; + gap: 12px; padding: 16px 20px 20px; } .eurosci-voc-item { display: flex; align-items: center; - gap: 8px; - padding: 8px 12px; + gap: 12px; + padding: 12px 16px; background: #f8fafc; - border-radius: var(--sg-radius-sm); - border: 1px solid #d9e2f0; - - .voc-code { - font-weight: 600; - font-size: 12px; - color: var(--sg-text-muted); - background: #e8edf5; - padding: 2px 8px; - border-radius: var(--sg-radius-sm); + border: 1px solid #e6e9ed; + border-radius: 8px; + flex-wrap: wrap; +} + +.eurosci-voc-item.clickable:hover { + background: #f0f3f7; + border-color: #b8c5d6; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} + +.eurosci-voc-item .voc-path { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 4px; + flex: 1; + min-width: 200px; +} + +.eurosci-voc-item .path-segment { + font-size: 13px; + font-weight: 500; + color: #1a1a1a; + padding: 2px 8px; + border-radius: 4px; + background: #fff; + border: 1px solid #e6e9ed; +} + +.eurosci-voc-item .path-segment:last-child { + background: #e8f0fe; + border-color: #c5d8f0; + color: #005a9c; + font-weight: 600; +} + +.eurosci-voc-item .path-separator { + width: 16px; + height: 16px; + font-size: 16px; + color: #6b7a8a; +} + +.eurosci-voc-item .voc-code { + font-size: 12px; + color: #6b7a8a; + font-family: monospace; + background: #eef2f7; + padding: 2px 8px; + border-radius: 4px; + white-space: nowrap; +} + +.eurosci-voc-item .voc-description { + font-size: 13px; + color: #6b7a8a; + font-style: italic; +} + +// Alternative: Horizontal chip-style layout +.eurosci-voc-grid-chips { + display: flex; + flex-wrap: wrap; + gap: 8px; + padding: 16px 20px 20px; +} + +.eurosci-voc-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 12px; + background: #f8fafc; + border: 1px solid #e6e9ed; + border-radius: 20px; + font-size: 13px; +} + +.eurosci-voc-chip:hover { + background: #f0f3f7; + border-color: #b8c5d6; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); +} + +.eurosci-voc-chip .chip-path { + display: flex; + align-items: center; + gap: 4px; +} + +.eurosci-voc-chip .chip-segment { + font-weight: 500; +} + +.eurosci-voc-chip .chip-separator { + font-size: 12px; + color: #6b7a8a; +} + +.eurosci-voc-chip .chip-segment:last-child { + color: #005a9c; +} + +// Responsive +@media (max-width: 768px) { + .eurosci-voc-item { + flex-direction: column; + align-items: flex-start; + gap: 8px; } - - .voc-title { - font-size: 13px; - color: var(--sg-text); + + .eurosci-voc-item .voc-path { + min-width: 100%; + } + + .eurosci-voc-item .search-icon { + opacity: 1; + align-self: flex-end; + } + + .eurosci-voc-item .path-segment { + font-size: 12px; + } +} + +@media (max-width: 480px) { + .eurosci-voc-item { + padding: 10px 12px; + } + + .eurosci-voc-item .path-segment { + font-size: 11px; + padding: 1px 6px; + } + + .eurosci-voc-item .voc-code { + font-size: 10px; } } @@ -1134,13 +1111,13 @@ h1 { background: #f8fafc; border-radius: var(--sg-radius-sm); border: 1px solid #d9e2f0; - + .pi-name { font-weight: 500; color: var(--sg-text); font-size: 14px; } - + .pi-title { color: var(--sg-text-muted); font-size: 13px; @@ -1159,34 +1136,21 @@ h1 { gap: 2px; padding: 0 2px; } - + .tab-btn { padding: 8px 12px; font-size: 12px; - + mat-icon { width: 16px; height: 16px; font-size: 16px; } } - - .organization-item, + .publication-item, .ipr-item, .deliverable-item { flex-wrap: wrap; } - - .org-contribution, - .org-cost { - width: 100%; - padding-left: 0; - padding-top: 8px; - border-left: none; - border-top: 1px solid #d9e2f0; - flex-direction: row; - gap: 8px; - align-items: center; - } -} \ No newline at end of file +} diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 58a47b81..558b9851 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -9,11 +9,19 @@ import { MatButtonModule } from '@angular/material/button'; import { MatDividerModule } from '@angular/material/divider'; import { MatTooltipModule } from '@angular/material/tooltip'; import { Router } from '@angular/router'; -import { formatGermanDate } from '../../../shared/utils/formatters'; -import { Data } from '../../../api'; - - -export type TabType = 'overview' | 'organizations' | 'publications' | 'iprs' | 'deliverables'; +import { + formatGermanDate, + formatCurrency, +} from '../../../shared/utils/formatters'; +import { EuProjectData } from '../../../api/model/euProjectData'; +import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component'; +import { OrganizationsTableComponent } from './organizations-table/organizations-table/organizations-table.component'; +export type TabType = + | 'overview' + | 'organizations' + | 'publications' + | 'iprs' + | 'deliverables'; @Component({ selector: 'app-eu-details', @@ -26,6 +34,8 @@ export type TabType = 'overview' | 'organizations' | 'publications' | 'iprs' | ' MatButtonModule, MatDividerModule, MatTooltipModule, + TopicChipComponent, + OrganizationsTableComponent, ], templateUrl: './eu-details.component.html', styleUrl: './eu-details.component.scss', @@ -33,21 +43,20 @@ export type TabType = 'overview' | 'organizations' | 'publications' | 'iprs' | ' export class EuDetailsComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - - euProject: Data| undefined; + + euProject: EuProjectData | undefined; activeTab: TabType = 'overview'; - programType: String = "" + programType: String = ''; // Track if tabs have content hasOrganizations = false; hasPublications = false; hasIprs = false; hasDeliverables = false; - ngOnInit(): void { // Subscribe to route data for project this.route.data.subscribe(({ euSingleProject }) => { console.log('EU Project:', euSingleProject); - this.euProject = euSingleProject.data; + this.euProject = euSingleProject.eu_project_data; // Determine program type if (this.euProject) { @@ -58,28 +67,34 @@ export class EuDetailsComponent implements OnInit { } else if (euSingleProject.deliverables !== undefined) { this.programType = 'heu'; } - // Check which tabs have content - this.hasOrganizations = this.euProject.organizations && this.euProject.organizations.length > 0 || false; - this.hasPublications = this.euProject.publications && this.euProject.publications.length > 0 || false; - this.hasIprs = this.euProject.iprs && this.euProject.iprs.length > 0 || false; - this.hasDeliverables = this.euProject.deliverables && this.euProject.deliverables.length > 0 || false; + this.hasOrganizations = + (this.euProject.organizations && + this.euProject.organizations.length > 0) || + false; + this.hasPublications = + (this.euProject.publications && + this.euProject.publications.length > 0) || + false; + this.hasIprs = + (this.euProject.iprs && this.euProject.iprs.length > 0) || false; + this.hasDeliverables = + (this.euProject.deliverables && + this.euProject.deliverables.length > 0) || + false; } }); // Subscribe to query params for tab synchronization - this.route.queryParams.subscribe(params => { + this.route.queryParams.subscribe((params) => { const tabParam = params['tab'] as TabType; if (tabParam && this.isValidTab(tabParam)) { - // Check if the tab has content before switching if (this.tabHasContent(tabParam)) { this.activeTab = tabParam; } else { - // If tab has no content, switch to overview and update URL this.updateTabQueryParam('overview'); } } else { - // If no valid tab param, set to overview and update URL this.updateTabQueryParam('overview'); } }); @@ -89,7 +104,13 @@ export class EuDetailsComponent implements OnInit { * Check if a tab value is valid */ private isValidTab(tab: string): tab is TabType { - return ['overview', 'organizations', 'publications', 'iprs', 'deliverables'].includes(tab); + return [ + 'overview', + 'organizations', + 'publications', + 'iprs', + 'deliverables', + ].includes(tab); } /** @@ -128,12 +149,12 @@ export class EuDetailsComponent implements OnInit { */ setTab(tab: TabType): void { if (this.activeTab === tab) return; - + // Check if tab has content if (!this.tabHasContent(tab)) { return; } - + this.activeTab = tab; this.updateTabQueryParam(tab); } @@ -145,13 +166,6 @@ export class EuDetailsComponent implements OnInit { return this.activeTab === tab; } - /** - * Check if a tab should be visible (has content) - */ - shouldShowTab(tab: TabType): boolean { - return this.tabHasContent(tab); - } - /** * Get tab label with count */ @@ -184,16 +198,6 @@ export class EuDetailsComponent implements OnInit { } } - - getInitials(name: string | null | undefined): string { - if (!name) return ''; - const parts = name.trim().split(/\s+/); - if (parts.length > 1) { - return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase(); - } - return parts[0][0].toUpperCase(); - } - getFundingStatus(endDate: string | null | undefined): string { if (!endDate) return 'N/A'; const end = new Date(endDate); @@ -204,17 +208,6 @@ export class EuDetailsComponent implements OnInit { return end >= now ? 'Laufend' : 'Abgeschlossen'; } - formatCurrency(amount: number | null | undefined): string { - if (amount === null || amount === undefined) return 'N/A'; - - return new Intl.NumberFormat('de-DE', { - style: 'currency', - currency: 'EUR', - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(amount); - } - getDuration(start: string | undefined, end: string | undefined): string { if (!start || !end) return ''; @@ -228,6 +221,13 @@ export class EuDetailsComponent implements OnInit { return date; } + formatCurr(value: number | undefined | null) { + if (value) { + return formatCurrency(value); + } + return value; + } + getStatusColor(status: string | null | undefined): string { if (!status) return '#95a5a6'; @@ -317,6 +317,62 @@ export class EuDetailsComponent implements OnInit { return []; } + /** + * Get keywords mapped to topic chip format + */ + getKeywordChips(): { + label: string; + count?: number; + description?: string; + subfieldName?: string; + fieldName?: string; + domainName?: string; + color?: string; + id?: string; + }[] { + const keywords = this.getKeywords(this.euProject?.keywords); + if (keywords.length === 0) return []; + + // Simple keyword list + return keywords.map((keyword, index) => ({ + label: keyword, + count: 1, + description: `Schlüsselwort: ${keyword}`, + subfieldName: '', + fieldName: '', + domainName: '', + color: this.getKeywordColor(index), + id: keyword, + })); + } + + /** + * Get color for keyword based on index + */ + private getKeywordColor(index: number): string { + const colors = [ + '#3498db', // Blue + '#e67e22', // Orange + '#27ae60', // Green + '#8e44ad', // Purple + '#e74c3c', // Red + '#1abc9c', // Teal + '#f39c12', // Gold + '#2c3e50', // Navy + ]; + return colors[index % colors.length]; + } + + /** + * Get path segments from a path string + * Example: "natural sciences/chemical sciences/polymer sciences" + * => ["natural sciences", "chemical sciences", "polymer sciences"] + */ + getPathSegments(path: string | undefined): string[] { + if (!path) return []; + return path.split('/').filter((segment) => segment.trim()); + } + getTotalEcContribution(): number { if (!this.euProject?.organizations) return 0; return this.euProject.organizations @@ -364,16 +420,4 @@ export class EuDetailsComponent implements OnInit { queryParams: { status: status }, }); } - - searchForInstitutionName(institutionName: string): void { - this.router.navigate(['/institutions'], { - queryParams: { - search: institutionName, - }, - }); - } - - goBack(): void { - window.history.back(); - } -} \ No newline at end of file +} -- 2.56.1 From 577a927e20961c416342321e11ee61b68ac79639 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 11:28:52 +0200 Subject: [PATCH 26/42] created separated component for organization table for EU Cordis Projects --- .../organizations-table.component.html | 126 ++++++++++++++++ .../organizations-table.component.scss | 137 ++++++++++++++++++ .../organizations-table.component.ts | 50 +++++++ 3 files changed, 313 insertions(+) create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html new file mode 100644 index 00000000..b1a68c07 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html @@ -0,0 +1,126 @@ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name +
+ {{ + org.name || org.shortName || 'Unbekannte Organisation' + }} +
+
Rolle + @if (org.role) { + {{ org.role }} + } @else { + — + } + Stadt + @if (org.city) { + + {{ org.city }} + + + + } @else { + — + } + EU-Beitrag + @if (org.ecContribution) { + {{ + formatCurr(org.ecContribution) + }} + } @else { + — + } + Aktivitätstyp + @if (org.activityType) { + {{ org.activityType }} + } @else { + — + } + SME + @if (org.sme) { + SME + } @else { + — + } + URL + @if (org.organizationURL) { + + open_in_new + + } @else { + — + } +
+
+
+
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss new file mode 100644 index 00000000..a9c7c11a --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss @@ -0,0 +1,137 @@ + +// Organizations + +.organizations-tab { + .card { + margin-bottom: 24px; + } + + .organizations-table-wrapper { + padding: 0 20px 20px; + overflow-x: auto; + + table { + width: 100%; + border-radius: 8px; + overflow: hidden; + } + + .mat-mdc-header-cell { + font-weight: 600; + color: #6b7a8a; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 0.5px; + background: #f8fafc; + border-bottom: 2px solid #e6e9ed; + padding: 12px 16px; + } + + .mat-mdc-cell { + padding: 12px 16px; + border-bottom: 1px solid #f0f2f5; + font-size: 13px; + } + + .mat-mdc-row { + transition: background 0.2s ease; + } + + .mat-mdc-row:hover { + background: #f8fafc; + } + } + + .org-name-cell { + display: flex; + align-items: center; + gap: 24px; + cursor: pointer; + } + + .org-name-text { + font-weight: 500; + color: #1a1a1a; + } + + .org-name-cell:hover .org-name-text { + color: #005a9c; + text-decoration: underline; + } + + .role-chip { + display: inline-block; + padding: 2px 10px; + background: #e8edf5; + border-radius: 12px; + font-size: 12px; + color: #6b7a8a; + } + + .country-chip { + display: inline-flex; + align-items: center; + gap: 10px; + font-size: 13px; + } + + .currency-value { + font-weight: 500; + color: #1a1a1a; + } + + .empty-value { + color: #6b7a8a; + } + + .activity-chip { + display: inline-block; + padding: 2px 10px; + background: #f0f3f7; + border-radius: 12px; + font-size: 12px; + color: #6b7a8a; + } + + .sme-badge { + display: inline-block; + padding: 2px 8px; + background: #e8f5e9; + color: #2e7d32; + border-radius: 4px; + font-weight: 500; + font-size: 12px; + } + .url-badge { + display: inline-block; + padding: 2px 8px; + background: #e8f5e9; + color: #2e7d32; + border-radius: 4px; + font-weight: 500; + font-size: 12px; + } +} + +@media (max-width: 768px) { + .organizations-tab { + .organizations-table-wrapper { + padding: 0 12px 12px; + } + + .mat-mdc-header-cell, + .mat-mdc-cell { + padding: 8px 10px; + font-size: 12px; + } + .country-flag { + font-size: 18px; + line-height: 1; + } + .org-avatar-small { + width: 24px; + height: 24px; + font-size: 10px; + } + } +} diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts new file mode 100644 index 00000000..7bc5e3e8 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts @@ -0,0 +1,50 @@ +import { Component, inject,Input } from '@angular/core'; +import { MatTableModule } from '@angular/material/table'; +import { Router } from '@angular/router'; +import { formatCurrency } from '../../../../../shared/utils/formatters'; +import { MatIcon } from '@angular/material/icon'; +import { MatCard } from '@angular/material/card'; +import { HEUOrganization } from '../../../../../api'; +@Component({ + selector: 'app-organizations-table', + imports: [MatTableModule,MatIcon,MatCard], + templateUrl: './organizations-table.component.html', + styleUrl: './organizations-table.component.scss', +}) +export class OrganizationsTableComponent { + private router = inject(Router); + + @Input() orgs!: HEUOrganization[]; + + // Displayed columns for the organizations table + organizationDisplayedColumns: string[] = [ + 'name', + 'role', + 'country', + 'ecContribution', + 'activityType', + 'sme', + 'organizationURL', + ]; + + searchForInstitutionName(institutionName: string): void { + this.router.navigate(['/institutions'], { + queryParams: { + search: institutionName, + }, + }); + } + getSvgByCountryCode(code: string) { + const codeLower = code.toLowerCase(); + if (codeLower === 'uk') { + return 'gb'; + } + return codeLower; + } + formatCurr(value: number | undefined | null) { + if (value) { + return formatCurrency(value); + } + return value; + } +} -- 2.56.1 From fa3209d2532af1cdbe07c1af438ffd7bfe4ae919 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 11:29:08 +0200 Subject: [PATCH 27/42] added currency formatter --- webapp/src/app/shared/utils/formatters.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webapp/src/app/shared/utils/formatters.ts b/webapp/src/app/shared/utils/formatters.ts index 58cc03bc..3131672a 100644 --- a/webapp/src/app/shared/utils/formatters.ts +++ b/webapp/src/app/shared/utils/formatters.ts @@ -7,3 +7,14 @@ export function formatGermanDate(dateString: string): string { year: 'numeric', }).format(new Date(dateString)); } + +export function formatCurrency(amount: number | null | undefined): string { + if (amount === null || amount === undefined) return 'N/A'; + + return new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + minimumFractionDigits: 0, + maximumFractionDigits: 0, + }).format(amount); +} -- 2.56.1 From a7e4039342b1253ded15160eb7ecf762958a3969 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 19:12:07 +0200 Subject: [PATCH 28/42] added searching for work by DOI and Title fallback --- service/src/main/inse/works/logic.py | 18 ++--- service/src/main/inse/works/search_client.py | 77 +++++++++++++++----- service/src/main/inse/works/service.py | 18 +++-- 3 files changed, 75 insertions(+), 38 deletions(-) diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index 9d5918cf..3bd7a9a2 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -197,22 +197,16 @@ def _get_primary_topic_counts_from_es(author_id: str) -> list[dict]: async def get_work( work_id: str, + title:str, client: OpenAlexWorksSearchClient | None = None, ) -> Work: search_client = client or OpenAlexWorksSearchClient() - try: - data = await search_client.search_work(work_id) - except MissingApiKeyError as exc: - raise HTTPException( - status_code=HTTP_503_SERVICE_UNAVAILABLE, - detail="OpenAlex works search is not configured.", - ) from exc - except httpx.HTTPError as exc: - raise HTTPException( - status_code=HTTP_502_BAD_GATEWAY, - detail="OpenAlex works search request failed.", - ) from exc + + data = await search_client.search_work(work_id) elements, _ = _parse_full_work_search_response(data) + if (not elements) and title: + response_by_title = await search_client.search_for_work_by_title(title=title) + elements, _ = _parse_full_work_search_response(response_by_title) if not elements: raise HTTPException( status_code=HTTP_404_NOT_FOUND, diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py index fe60c665..93188678 100644 --- a/service/src/main/inse/works/search_client.py +++ b/service/src/main/inse/works/search_client.py @@ -7,10 +7,10 @@ import logging from typing import Any import httpx - +import urllib from .. import config - - +from inse.integrations import elasticsearch +from inse.model import ESCluster, ESIndex class MissingApiKeyError(Exception): pass @@ -164,23 +164,62 @@ class OpenAlexWorksSearchClient: response.raise_for_status() return response.json() - async def search_work(self, work_id: str) -> dict[str, Any]: + + async def search_work(self, identifier: str) -> dict[str, Any]: + if not self.api_key: + raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") + decoded_id = urllib.parse.unquote(identifier) + body = { + "query": { + "bool": { + "should": [ + { + "term": { + "_id": { + "value": decoded_id, + "boost": 5 + } + } + }, + { + "term": { + "doi": { + "value": "https://doi.org/" + decoded_id.lower(), + "boost": 3 + } + } + } + ], + "minimum_should_match": 1 + } + } + } + print(body) + response = elasticsearch.search(index=f'{ESIndex.OPENALEX_WORKS}*',body=body,cluster=ESCluster.NES,size=1) + return response + + async def search_for_work_by_title( + self, + title: str, + ) -> dict[str, Any]: if not self.api_key: raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") - indexed_work_id = f"https://openalex.org/{work_id.strip().split('/')[-1]}" - async with httpx.AsyncClient( - base_url=self.base_url, - timeout=self.timeout, - transport=self.transport, - ) as client: - response = await client.post( - f"/{self.index}/_search", - headers={"Authorization": f"ApiKey {self.api_key}"}, - json={ - "size": 1, - "query": {"term": {"id": indexed_work_id}}, + query_clauses = [ + {"match_phrase": {"title": title}}, + ] + + body = { + "query": { + "bool": { + "must": query_clauses, }, - ) - response.raise_for_status() - return response.json() + }, + "sort": [ + {"publication_year": {"order": "desc", "missing": "_last"}}, + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + ], + } + response = elasticsearch.search(index=f'{ESIndex.OPENALEX_WORKS}*',body=body,cluster=ESCluster.NES,size=1) + + return response \ No newline at end of file diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index e0d84c57..38d44230 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -4,7 +4,7 @@ REST API for publication works. """ -from typing import Annotated +from typing import Annotated, Optional from fastapi import APIRouter from fastapi import Depends @@ -123,17 +123,21 @@ async def get_topics_by_time_by_author( @router.get( - "/detail/{work_id}", + "/detail/{identifier}", operation_id="getWork", response_model=Work, - summary="Returns one publication.", + summary="Returns one publication by OpenAlex ID or DOI.", ) -async def get_work( - work_id: Annotated[ - str, Path(description="The OpenAlex work id, for example W2741809807.") +async def get_work_by_identifier( + identifier: Annotated[ + str, Path(description="The OpenAlex work id (e.g., W2741809807) or DOI number of the publication.") ], + title: Annotated[ + Optional[str], Query(description="Do we want to fallback to title search if ID and DOI dont work?") + ] = "", principal: security.Principal = Depends( security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"]) ), ): - return await logic.get_work(work_id) + print("RUN SERVICE") + return await logic.get_work(identifier,title=title) \ No newline at end of file -- 2.56.1 From 19af4e1abcac4ed3502331fed97b9b2a0ad0c8f9 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 19:12:33 +0200 Subject: [PATCH 29/42] regenerated service --- service/src/main/inse/works/service.py | 1 - webapp/src/app/api/api/works.service.ts | 33 +++++++++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index 38d44230..42399bad 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -139,5 +139,4 @@ async def get_work_by_identifier( security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"]) ), ): - print("RUN SERVICE") return await logic.get_work(identifier,title=title) \ No newline at end of file diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 20d855a3..82f38cbe 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -619,14 +619,16 @@ export class WorksService extends BaseService { } /** - * Returns one publication. - * @endpoint get /api/works/detail/{work_id} - * @param workId The OpenAlex work id, for example W2741809807. + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/works/detail/{identifier} + * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. + * @param title Do we want to fallback to title search if ID and DOI dont work? * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public getWork( - workId: string, + identifier: string, + title?: string, observe?: 'body', reportProgress?: boolean, options?: { @@ -636,7 +638,8 @@ export class WorksService extends BaseService { }, ): Observable; public getWork( - workId: string, + identifier: string, + title?: string, observe?: 'response', reportProgress?: boolean, options?: { @@ -646,7 +649,8 @@ export class WorksService extends BaseService { }, ): Observable>; public getWork( - workId: string, + identifier: string, + title?: string, observe?: 'events', reportProgress?: boolean, options?: { @@ -656,7 +660,8 @@ export class WorksService extends BaseService { }, ): Observable>; public getWork( - workId: string, + identifier: string, + title?: string, observe: any = 'body', reportProgress: boolean = false, options?: { @@ -665,12 +670,19 @@ export class WorksService extends BaseService { transferCache?: boolean; }, ): Observable { - if (workId === null || workId === undefined) { + if (identifier === null || identifier === undefined) { throw new Error( - 'Required parameter workId was null or undefined when calling getWork.', + 'Required parameter identifier was null or undefined when calling getWork.', ); } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + let localVarHeaders = this.defaultHeaders; // authentication (bearer) required @@ -709,10 +721,11 @@ export class WorksService extends BaseService { } } - let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'workId', value: workId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, + params: localVarQueryParameters, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, -- 2.56.1 From de35748ba733db529142273c86f1470b695ed7c5 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 19:13:07 +0200 Subject: [PATCH 30/42] added resolver for work search --- webapp/src/app/app.routes.ts | 5 ++- .../publication-detail.component.ts | 44 +++++-------------- .../src/app/resolvers/publication-resolver.ts | 16 +++++++ 3 files changed, 31 insertions(+), 34 deletions(-) create mode 100644 webapp/src/app/resolvers/publication-resolver.ts diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index a4021d4f..734b521b 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -17,7 +17,7 @@ import { cordisEuProjectsFundingResolver } from './resolvers/cordis-eu-projects- import { fundingProjectPageResolver } from './resolvers/funding-project-page.resolver'; import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver'; import { euSingleProjectResolver } from './resolvers/eu-single-project-resolver'; - +import { publicationResolver } from './resolvers/publication-resolver'; export const routes: Routes = [ { path: '', @@ -106,6 +106,9 @@ export const routes: Routes = [ import('./modules/publication-detail/publication-detail.component').then( (mod) => mod.PublicationDetailComponent, ), + resolve: { + publication: publicationResolver, + }, }, { path: 'projects/dfg/:id', diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index 2eeb7feb..c2850656 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -8,7 +8,6 @@ import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute, RouterLink } from '@angular/router'; import { finalize } from 'rxjs'; - import { Authorship, Location as ApiLocation, @@ -54,18 +53,18 @@ export class PublicationDetailComponent implements OnInit { notFound = false; ngOnInit(): void { - this.route.paramMap - .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe((params) => { - const publicationId = params.get('publicationId'); - if (!publicationId) { - this.loading = false; - this.notFound = true; - return; - } + this.loading = true; - this.loadPublication(publicationId); - }); + this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({ + next: ({ publication }) => { + this.publication = publication; + this.loading = false; + }, + error: () => { + this.notFound = true; + this.loading = false; + }, + }); } navigateBack(): void { @@ -157,27 +156,6 @@ export class PublicationDetailComponent implements OnInit { return 'Kein Open Access'; } - private loadPublication(publicationId: string): void { - this.loading = true; - this.notFound = false; - this.publication = null; - - const basePath = this.worksService.configuration.basePath ?? ''; - this.httpClient - .get( - `${basePath}/api/works/detail/${encodeURIComponent(publicationId)}`, - ) - .pipe(finalize(() => (this.loading = false))) - .subscribe({ - next: (publication) => { - this.publication = publication; - }, - error: () => { - this.notFound = true; - }, - }); - } - private doiUrl(doi: string | null | undefined): string | null { if (!doi) return null; return doi.startsWith('http') ? doi : `https://doi.org/${doi}`; diff --git a/webapp/src/app/resolvers/publication-resolver.ts b/webapp/src/app/resolvers/publication-resolver.ts new file mode 100644 index 00000000..d0e1111e --- /dev/null +++ b/webapp/src/app/resolvers/publication-resolver.ts @@ -0,0 +1,16 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { WorksService,Work } from '../api'; + +export const publicationResolver: ResolveFn = (route) => { + + const id = route.paramMap.get('publicationId'); + const title = route.queryParamMap.get('title') ?? ''; + const worksService = inject(WorksService); + + if (!id) { + throw new Error('Publication id is required'); + } + + return worksService.getWork(id, title); +}; -- 2.56.1 From d23e8474aee132dfdffc8b758bb51d3cf5ef7ebb Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 19:13:38 +0200 Subject: [PATCH 31/42] added searchForPublication function to publications list --- .../eu-details.component.html | 2 +- .../eu-cordis-details/eu-details.component.ts | 342 ++++++++++++------ 2 files changed, 240 insertions(+), 104 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html index b8ff2eea..367eda5c 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -568,7 +568,7 @@
@for (pub of euProject.publications; track pub.doi) { -
+
article
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 558b9851..a73c2e04 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -1,6 +1,6 @@ -// eu-details.component.ts (updated) -import { Component, OnInit, inject } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +// eu-details.component.ts (refactored) +import { Component, OnInit, inject, OnDestroy } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; import { CommonModule } from '@angular/common'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; @@ -8,7 +8,7 @@ import { MatChipsModule } from '@angular/material/chips'; import { MatButtonModule } from '@angular/material/button'; import { MatDividerModule } from '@angular/material/divider'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { Router } from '@angular/router'; +import { Subscription } from 'rxjs'; import { formatGermanDate, formatCurrency, @@ -16,6 +16,8 @@ import { import { EuProjectData } from '../../../api/model/euProjectData'; import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component'; import { OrganizationsTableComponent } from './organizations-table/organizations-table/organizations-table.component'; +import { HEUPublication } from '../../../api'; + export type TabType = | 'overview' | 'organizations' @@ -40,77 +42,123 @@ export type TabType = templateUrl: './eu-details.component.html', styleUrl: './eu-details.component.scss', }) -export class EuDetailsComponent implements OnInit { +export class EuDetailsComponent implements OnInit, OnDestroy { private route = inject(ActivatedRoute); private router = inject(Router); + // Data euProject: EuProjectData | undefined; + programType: string = ''; + + // UI State activeTab: TabType = 'overview'; - programType: String = ''; - // Track if tabs have content + isLoading = true; + + // Tab content flags hasOrganizations = false; hasPublications = false; hasIprs = false; hasDeliverables = false; + + // Subscriptions + private subscriptions: Subscription = new Subscription(); + + // Tab configuration + private readonly tabConfig: Record = { + overview: { label: 'Übersicht', icon: 'info', order: 0 }, + organizations: { label: 'Organisationen', icon: 'business', order: 1 }, + publications: { label: 'Publikationen', icon: 'article', order: 2 }, + iprs: { label: 'IPRs', icon: 'gavel', order: 3 }, + deliverables: { label: 'Ergebnisse', icon: 'assignment', order: 4 } + }; + ngOnInit(): void { - // Subscribe to route data for project - this.route.data.subscribe(({ euSingleProject }) => { - console.log('EU Project:', euSingleProject); - this.euProject = euSingleProject.eu_project_data; + // Subscribe to route data + this.subscriptions.add( + this.route.data.subscribe(({ euSingleProject }) => { + console.log('EU Project:', euSingleProject); + this.euProject = euSingleProject.eu_project_data; + this.isLoading = false; - // Determine program type - if (this.euProject) { - if (euSingleProject.iprs !== undefined) { - this.programType = 'fp7'; - } else if (euSingleProject.ercPrincipalInvestigators !== undefined) { - this.programType = 'h2020'; - } else if (euSingleProject.deliverables !== undefined) { - this.programType = 'heu'; + if (this.euProject) { + this.determineProgramType(euSingleProject); + this.updateTabContentFlags(); + this.handleTabFromQueryParams(); } - // Check which tabs have content - this.hasOrganizations = - (this.euProject.organizations && - this.euProject.organizations.length > 0) || - false; - this.hasPublications = - (this.euProject.publications && - this.euProject.publications.length > 0) || - false; - this.hasIprs = - (this.euProject.iprs && this.euProject.iprs.length > 0) || false; - this.hasDeliverables = - (this.euProject.deliverables && - this.euProject.deliverables.length > 0) || - false; - } - }); + }) + ); - // Subscribe to query params for tab synchronization - this.route.queryParams.subscribe((params) => { - const tabParam = params['tab'] as TabType; - if (tabParam && this.isValidTab(tabParam)) { - if (this.tabHasContent(tabParam)) { - this.activeTab = tabParam; - } else { + // Subscribe to query params changes + this.subscriptions.add( + this.route.queryParams.subscribe((params) => { + // Only handle if data is already loaded + if (this.euProject) { + this.handleTabFromQueryParams(params); + } + }) + ); + } + + ngOnDestroy(): void { + this.subscriptions.unsubscribe(); + } + + // ============= PRIVATE METHODS ============= + + /** + * Determine program type based on available data + */ + private determineProgramType(euSingleProject: any): void { + if (euSingleProject.iprs !== undefined) { + this.programType = 'fp7'; + } else if (euSingleProject.ercPrincipalInvestigators !== undefined) { + this.programType = 'h2020'; + } else if (euSingleProject.deliverables !== undefined) { + this.programType = 'heu'; + } + } + + /** + * Update flags for which tabs have content + */ + private updateTabContentFlags(): void { + this.hasOrganizations = + (this.euProject?.organizations && this.euProject.organizations.length > 0) || false; + this.hasPublications = + (this.euProject?.publications && this.euProject.publications.length > 0) || false; + this.hasIprs = + (this.euProject?.iprs && this.euProject.iprs.length > 0) || false; + this.hasDeliverables = + (this.euProject?.deliverables && this.euProject.deliverables.length > 0) || false; + } + + /** + * Handle tab selection from query params + */ + private handleTabFromQueryParams(params?: any): void { + const queryParams = params || this.route.snapshot.queryParams; + const tabParam = queryParams['tab'] as TabType; + + if (tabParam && this.isValidTab(tabParam)) { + if (this.tabHasContent(tabParam)) { + this.activeTab = tabParam; + } else { + // Only update if it's a different tab + if (this.activeTab !== 'overview') { this.updateTabQueryParam('overview'); } - } else { - this.updateTabQueryParam('overview'); } - }); + } else if (!queryParams['tab'] && this.activeTab !== 'overview') { + // Set default tab only if no tab param exists + this.updateTabQueryParam('overview'); + } } /** * Check if a tab value is valid */ private isValidTab(tab: string): tab is TabType { - return [ - 'overview', - 'organizations', - 'publications', - 'iprs', - 'deliverables', - ].includes(tab); + return ['overview', 'organizations', 'publications', 'iprs', 'deliverables'].includes(tab); } /** @@ -137,21 +185,45 @@ export class EuDetailsComponent implements OnInit { * Update URL query param for tab */ private updateTabQueryParam(tab: TabType): void { + // Prevent unnecessary navigation + const currentTab = this.route.snapshot.queryParams['tab']; + if (currentTab === tab) return; + this.router.navigate([], { relativeTo: this.route, queryParams: { tab: tab }, - queryParamsHandling: 'merge', // Preserve other query params - }); + queryParamsHandling: 'merge', + }).catch(err => console.error('Tab navigation failed:', err)); } + /** + * Get color for keyword based on index + */ + private getKeywordColor(index: number): string { + const colors = [ + '#3498db', // Blue + '#e67e22', // Orange + '#27ae60', // Green + '#8e44ad', // Purple + '#e74c3c', // Red + '#1abc9c', // Teal + '#f39c12', // Gold + '#2c3e50', // Navy + ]; + return colors[index % colors.length]; + } + + // ============= PUBLIC METHODS ============= + /** * Set active tab and update URL */ setTab(tab: TabType): void { if (this.activeTab === tab) return; - + // Check if tab has content if (!this.tabHasContent(tab)) { + console.warn(`Tab "${tab}" has no content`); return; } @@ -166,18 +238,25 @@ export class EuDetailsComponent implements OnInit { return this.activeTab === tab; } + /** + * Check if tab is visible (has content) + */ + isTabVisible(tab: TabType): boolean { + return this.tabHasContent(tab); + } + /** * Get tab label with count */ getTabLabel(tab: TabType): string { - const labels: Record = { - overview: 'Übersicht', - organizations: 'Organisationen', - publications: 'Publikationen', - iprs: 'IPRs', - deliverables: 'Ergebnisse', - }; - return labels[tab]; + return this.tabConfig[tab].label; + } + + /** + * Get tab icon + */ + getTabIcon(tab: TabType): string { + return this.tabConfig[tab].icon; } /** @@ -198,6 +277,17 @@ export class EuDetailsComponent implements OnInit { } } + /** + * Get sorted tabs that have content + */ + getVisibleTabs(): TabType[] { + return (['overview', 'organizations', 'publications', 'iprs', 'deliverables'] as TabType[]) + .filter(tab => this.tabHasContent(tab)) + .sort((a, b) => this.tabConfig[a].order - this.tabConfig[b].order); + } + + // ============= FORMATTING METHODS ============= + getFundingStatus(endDate: string | null | undefined): string { if (!endDate) return 'N/A'; const end = new Date(endDate); @@ -210,22 +300,21 @@ export class EuDetailsComponent implements OnInit { getDuration(start: string | undefined, end: string | undefined): string { if (!start || !end) return ''; - return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`; } - formatDate(date: string | undefined) { + formatDate(date: string | undefined): string | undefined { if (date) { return formatGermanDate(date); } return date; } - formatCurr(value: number | undefined | null) { + formatCurr(value: number | undefined | null): string | null | undefined { if (value) { return formatCurrency(value); } - return value; + return String(value); } getStatusColor(status: string | null | undefined): string { @@ -234,10 +323,7 @@ export class EuDetailsComponent implements OnInit { const statusUpper = status.toUpperCase(); if (statusUpper.includes('CLOSED') || statusUpper.includes('COMPLETED')) { return '#27ae60'; - } else if ( - statusUpper.includes('ONGOING') || - statusUpper.includes('ACTIVE') - ) { + } else if (statusUpper.includes('ONGOING') || statusUpper.includes('ACTIVE')) { return '#f39c12'; } else if (statusUpper.includes('SIGNED')) { return '#3498db'; @@ -283,15 +369,13 @@ export class EuDetailsComponent implements OnInit { if (!scheme) return 'N/A'; const schemeMap: { [key: string]: string } = { - 'MSCA-IF-EF-SE': - 'MSCA Individual Fellowship - European Fellowship - Standard', + 'MSCA-IF-EF-SE': 'MSCA Individual Fellowship - European Fellowship - Standard', 'MSCA-IF-EF': 'MSCA Individual Fellowship - European Fellowship', 'MSCA-IF-GF': 'MSCA Individual Fellowship - Global Fellowship', 'MSCA-IF': 'MSCA Individual Fellowship', 'MSCA-ITN': 'MSCA Innovative Training Networks', 'MSCA-RISE': 'MSCA Research and Innovation Staff Exchange', - 'MSCA-COFUND': - 'MSCA Co-funding of Regional, National and International Programmes', + 'MSCA-COFUND': 'MSCA Co-funding of Regional, National and International Programmes', }; return schemeMap[scheme] || scheme; @@ -333,7 +417,6 @@ export class EuDetailsComponent implements OnInit { const keywords = this.getKeywords(this.euProject?.keywords); if (keywords.length === 0) return []; - // Simple keyword list return keywords.map((keyword, index) => ({ label: keyword, count: 1, @@ -346,27 +429,8 @@ export class EuDetailsComponent implements OnInit { })); } - /** - * Get color for keyword based on index - */ - private getKeywordColor(index: number): string { - const colors = [ - '#3498db', // Blue - '#e67e22', // Orange - '#27ae60', // Green - '#8e44ad', // Purple - '#e74c3c', // Red - '#1abc9c', // Teal - '#f39c12', // Gold - '#2c3e50', // Navy - ]; - return colors[index % colors.length]; - } - /** * Get path segments from a path string - * Example: "natural sciences/chemical sciences/polymer sciences" - * => ["natural sciences", "chemical sciences", "polymer sciences"] */ getPathSegments(path: string | undefined): string[] { if (!path) return []; @@ -390,34 +454,106 @@ export class EuDetailsComponent implements OnInit { return Array.from(countries); } - // Search functions + // ============= SEARCH / NAVIGATION METHODS ============= + + /** + * Navigate to projects with topic filter + */ searchByTopic(topic: string): void { + if (!topic) { + console.warn('Cannot search with empty topic'); + return; + } + this.router.navigate(['/eu-projects'], { queryParams: { topic: topic }, - }); + }).catch(err => console.error('Navigation to topic failed:', err)); } + /** + * Navigate to projects with keyword filter + */ searchByKeyword(keyword: string): void { + if (!keyword) { + console.warn('Cannot search with empty keyword'); + return; + } + this.router.navigate(['/eu-projects'], { queryParams: { keyword: keyword }, - }); + }).catch(err => console.error('Navigation to keyword failed:', err)); } + /** + * Navigate to projects with framework filter + */ searchByFramework(framework: string): void { + if (!framework) { + console.warn('Cannot search with empty framework'); + return; + } + this.router.navigate(['/eu-projects'], { queryParams: { framework: framework }, - }); + }).catch(err => console.error('Navigation to framework failed:', err)); } + /** + * Navigate to projects with funding scheme filter + */ searchByFundingScheme(scheme: string): void { + if (!scheme) { + console.warn('Cannot search with empty funding scheme'); + return; + } + this.router.navigate(['/eu-projects'], { queryParams: { fundingScheme: scheme }, - }); + }).catch(err => console.error('Navigation to funding scheme failed:', err)); } + /** + * Navigate to projects with status filter + */ searchByStatus(status: string): void { + if (!status) { + console.warn('Cannot search with empty status'); + return; + } + this.router.navigate(['/eu-projects'], { queryParams: { status: status }, - }); + }).catch(err => console.error('Navigation to status failed:', err)); } -} + + /** + * Navigate to publication details + */ + searchForPublication(pub: HEUPublication): void { + if (!pub) { + console.warn('Cannot navigate with empty publication'); + return; + } + + const doi = pub.doi?.trim() ?? "unknown"; + + // Encode DOI and navigate + const encodedDoi = encodeURIComponent(doi); + + this.router.navigate(['/publication', encodedDoi], { + queryParams: { + title: pub.title || '' + }, + }).catch(err => console.error('Navigation to publication failed:', err)); + } + + /** + * Navigate back to projects list with optional filter + */ + goBack(filters?: { [key: string]: any }): void { + this.router.navigate(['/eu-projects'], { + queryParams: filters || {}, + queryParamsHandling: 'merge', + }).catch(err => console.error('Navigation back failed:', err)); + } +} \ No newline at end of file -- 2.56.1 From f9fc8addceac1b4f2c4a85f14cda81ebfcfb20fc Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 21:47:43 +0200 Subject: [PATCH 32/42] moved publications table to a separate component --- .../eu-details.component.html | 10 +- .../eu-details.component.scss | 16 +- .../eu-cordis-details/eu-details.component.ts | 175 +++++++------ .../publications-table.component.html | 141 +++++++++++ .../publications-table.component.scss | 233 ++++++++++++++++++ .../publications-table.component.ts | 87 +++++++ 6 files changed, 576 insertions(+), 86 deletions(-) create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss create mode 100644 webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html index 367eda5c..782e5acd 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -557,8 +557,10 @@ @if (activeTab === 'organizations' && euProject.organizations) { } - - + @if (activeTab === 'publications' && euProject.publications) { + + } + @if (activeTab === 'iprs' && euProject.iprs) { @@ -626,7 +628,7 @@
@for (ipr of euProject.iprs; track ipr.title) { -
+
@if (ipr.type === 'PATENT') { emoji_events diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss index 60c230aa..4728e222 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.scss @@ -269,13 +269,13 @@ h1 { padding: 0; } -.section-header { - display: flex; - align-items: center; - gap: 10px; - padding: 16px 20px 12px; - border-bottom: 1px solid #f0f2f5; -} + .section-header { + display: flex; + align-items: center; + gap: 12px; + padding: 16px 20px; + border-bottom: 1px solid #e6e9ed; + } .section-header mat-icon { color: var(--sg-text-muted); @@ -286,7 +286,7 @@ h1 { .section-header h2 { margin: 0; - font-size: 16px; + font-size: 18px; font-weight: 600; color: var(--sg-text); } diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index a73c2e04..449bae54 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -16,8 +16,8 @@ import { import { EuProjectData } from '../../../api/model/euProjectData'; import { TopicChipComponent } from '../../../shared/ui/topic-chip/topic-chip.component'; import { OrganizationsTableComponent } from './organizations-table/organizations-table/organizations-table.component'; -import { HEUPublication } from '../../../api'; - +import { Fp7ProjectIPR } from '../../../api'; +import { PublicationsTableComponent } from './publications-table/publications-table.component'; export type TabType = | 'overview' | 'organizations' @@ -38,6 +38,7 @@ export type TabType = MatTooltipModule, TopicChipComponent, OrganizationsTableComponent, + PublicationsTableComponent ], templateUrl: './eu-details.component.html', styleUrl: './eu-details.component.scss', @@ -49,27 +50,30 @@ export class EuDetailsComponent implements OnInit, OnDestroy { // Data euProject: EuProjectData | undefined; programType: string = ''; - + // UI State activeTab: TabType = 'overview'; isLoading = true; - + // Tab content flags hasOrganizations = false; hasPublications = false; hasIprs = false; hasDeliverables = false; - + // Subscriptions private subscriptions: Subscription = new Subscription(); // Tab configuration - private readonly tabConfig: Record = { + private readonly tabConfig: Record< + TabType, + { label: string; icon: string; order: number } + > = { overview: { label: 'Übersicht', icon: 'info', order: 0 }, organizations: { label: 'Organisationen', icon: 'business', order: 1 }, publications: { label: 'Publikationen', icon: 'article', order: 2 }, iprs: { label: 'IPRs', icon: 'gavel', order: 3 }, - deliverables: { label: 'Ergebnisse', icon: 'assignment', order: 4 } + deliverables: { label: 'Ergebnisse', icon: 'assignment', order: 4 }, }; ngOnInit(): void { @@ -85,7 +89,7 @@ export class EuDetailsComponent implements OnInit, OnDestroy { this.updateTabContentFlags(); this.handleTabFromQueryParams(); } - }) + }), ); // Subscribe to query params changes @@ -95,7 +99,7 @@ export class EuDetailsComponent implements OnInit, OnDestroy { if (this.euProject) { this.handleTabFromQueryParams(params); } - }) + }), ); } @@ -122,14 +126,20 @@ export class EuDetailsComponent implements OnInit, OnDestroy { * Update flags for which tabs have content */ private updateTabContentFlags(): void { - this.hasOrganizations = - (this.euProject?.organizations && this.euProject.organizations.length > 0) || false; - this.hasPublications = - (this.euProject?.publications && this.euProject.publications.length > 0) || false; - this.hasIprs = + this.hasOrganizations = + (this.euProject?.organizations && + this.euProject.organizations.length > 0) || + false; + this.hasPublications = + (this.euProject?.publications && + this.euProject.publications.length > 0) || + false; + this.hasIprs = (this.euProject?.iprs && this.euProject.iprs.length > 0) || false; - this.hasDeliverables = - (this.euProject?.deliverables && this.euProject.deliverables.length > 0) || false; + this.hasDeliverables = + (this.euProject?.deliverables && + this.euProject.deliverables.length > 0) || + false; } /** @@ -138,7 +148,7 @@ export class EuDetailsComponent implements OnInit, OnDestroy { private handleTabFromQueryParams(params?: any): void { const queryParams = params || this.route.snapshot.queryParams; const tabParam = queryParams['tab'] as TabType; - + if (tabParam && this.isValidTab(tabParam)) { if (this.tabHasContent(tabParam)) { this.activeTab = tabParam; @@ -158,7 +168,13 @@ export class EuDetailsComponent implements OnInit, OnDestroy { * Check if a tab value is valid */ private isValidTab(tab: string): tab is TabType { - return ['overview', 'organizations', 'publications', 'iprs', 'deliverables'].includes(tab); + return [ + 'overview', + 'organizations', + 'publications', + 'iprs', + 'deliverables', + ].includes(tab); } /** @@ -189,11 +205,13 @@ export class EuDetailsComponent implements OnInit, OnDestroy { const currentTab = this.route.snapshot.queryParams['tab']; if (currentTab === tab) return; - this.router.navigate([], { - relativeTo: this.route, - queryParams: { tab: tab }, - queryParamsHandling: 'merge', - }).catch(err => console.error('Tab navigation failed:', err)); + this.router + .navigate([], { + relativeTo: this.route, + queryParams: { tab: tab }, + queryParamsHandling: 'merge', + }) + .catch((err) => console.error('Tab navigation failed:', err)); } /** @@ -220,7 +238,7 @@ export class EuDetailsComponent implements OnInit, OnDestroy { */ setTab(tab: TabType): void { if (this.activeTab === tab) return; - + // Check if tab has content if (!this.tabHasContent(tab)) { console.warn(`Tab "${tab}" has no content`); @@ -281,8 +299,16 @@ export class EuDetailsComponent implements OnInit, OnDestroy { * Get sorted tabs that have content */ getVisibleTabs(): TabType[] { - return (['overview', 'organizations', 'publications', 'iprs', 'deliverables'] as TabType[]) - .filter(tab => this.tabHasContent(tab)) + return ( + [ + 'overview', + 'organizations', + 'publications', + 'iprs', + 'deliverables', + ] as TabType[] + ) + .filter((tab) => this.tabHasContent(tab)) .sort((a, b) => this.tabConfig[a].order - this.tabConfig[b].order); } @@ -323,7 +349,10 @@ export class EuDetailsComponent implements OnInit, OnDestroy { const statusUpper = status.toUpperCase(); if (statusUpper.includes('CLOSED') || statusUpper.includes('COMPLETED')) { return '#27ae60'; - } else if (statusUpper.includes('ONGOING') || statusUpper.includes('ACTIVE')) { + } else if ( + statusUpper.includes('ONGOING') || + statusUpper.includes('ACTIVE') + ) { return '#f39c12'; } else if (statusUpper.includes('SIGNED')) { return '#3498db'; @@ -369,13 +398,15 @@ export class EuDetailsComponent implements OnInit, OnDestroy { if (!scheme) return 'N/A'; const schemeMap: { [key: string]: string } = { - 'MSCA-IF-EF-SE': 'MSCA Individual Fellowship - European Fellowship - Standard', + 'MSCA-IF-EF-SE': + 'MSCA Individual Fellowship - European Fellowship - Standard', 'MSCA-IF-EF': 'MSCA Individual Fellowship - European Fellowship', 'MSCA-IF-GF': 'MSCA Individual Fellowship - Global Fellowship', 'MSCA-IF': 'MSCA Individual Fellowship', 'MSCA-ITN': 'MSCA Innovative Training Networks', 'MSCA-RISE': 'MSCA Research and Innovation Staff Exchange', - 'MSCA-COFUND': 'MSCA Co-funding of Regional, National and International Programmes', + 'MSCA-COFUND': + 'MSCA Co-funding of Regional, National and International Programmes', }; return schemeMap[scheme] || scheme; @@ -464,10 +495,12 @@ export class EuDetailsComponent implements OnInit, OnDestroy { console.warn('Cannot search with empty topic'); return; } - - this.router.navigate(['/eu-projects'], { - queryParams: { topic: topic }, - }).catch(err => console.error('Navigation to topic failed:', err)); + + this.router + .navigate(['/eu-projects'], { + queryParams: { topic: topic }, + }) + .catch((err) => console.error('Navigation to topic failed:', err)); } /** @@ -478,10 +511,12 @@ export class EuDetailsComponent implements OnInit, OnDestroy { console.warn('Cannot search with empty keyword'); return; } - - this.router.navigate(['/eu-projects'], { - queryParams: { keyword: keyword }, - }).catch(err => console.error('Navigation to keyword failed:', err)); + + this.router + .navigate(['/eu-projects'], { + queryParams: { keyword: keyword }, + }) + .catch((err) => console.error('Navigation to keyword failed:', err)); } /** @@ -492,10 +527,12 @@ export class EuDetailsComponent implements OnInit, OnDestroy { console.warn('Cannot search with empty framework'); return; } - - this.router.navigate(['/eu-projects'], { - queryParams: { framework: framework }, - }).catch(err => console.error('Navigation to framework failed:', err)); + + this.router + .navigate(['/eu-projects'], { + queryParams: { framework: framework }, + }) + .catch((err) => console.error('Navigation to framework failed:', err)); } /** @@ -506,10 +543,14 @@ export class EuDetailsComponent implements OnInit, OnDestroy { console.warn('Cannot search with empty funding scheme'); return; } - - this.router.navigate(['/eu-projects'], { - queryParams: { fundingScheme: scheme }, - }).catch(err => console.error('Navigation to funding scheme failed:', err)); + + this.router + .navigate(['/eu-projects'], { + queryParams: { fundingScheme: scheme }, + }) + .catch((err) => + console.error('Navigation to funding scheme failed:', err), + ); } /** @@ -520,40 +561,26 @@ export class EuDetailsComponent implements OnInit, OnDestroy { console.warn('Cannot search with empty status'); return; } - - this.router.navigate(['/eu-projects'], { - queryParams: { status: status }, - }).catch(err => console.error('Navigation to status failed:', err)); + + this.router + .navigate(['/eu-projects'], { + queryParams: { status: status }, + }) + .catch((err) => console.error('Navigation to status failed:', err)); } - /** - * Navigate to publication details - */ - searchForPublication(pub: HEUPublication): void { - if (!pub) { - console.warn('Cannot navigate with empty publication'); - return; - } - - const doi = pub.doi?.trim() ?? "unknown"; - - // Encode DOI and navigate - const encodedDoi = encodeURIComponent(doi); - - this.router.navigate(['/publication', encodedDoi], { - queryParams: { - title: pub.title || '' - }, - }).catch(err => console.error('Navigation to publication failed:', err)); + searchForPatent(patent: Fp7ProjectIPR) { + console.log(patent) } - /** * Navigate back to projects list with optional filter */ goBack(filters?: { [key: string]: any }): void { - this.router.navigate(['/eu-projects'], { - queryParams: filters || {}, - queryParamsHandling: 'merge', - }).catch(err => console.error('Navigation back failed:', err)); + this.router + .navigate(['/eu-projects'], { + queryParams: filters || {}, + queryParamsHandling: 'merge', + }) + .catch((err) => console.error('Navigation back failed:', err)); } -} \ No newline at end of file +} diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html new file mode 100644 index 00000000..79cda076 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html @@ -0,0 +1,141 @@ +
+ + @if (showHeader) { +
+ description +

{{ headerTitle }} ({{ getPublicationCount() }})

+
+ } +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Titel +
+ + {{ pub.title || 'Kein Titel' }} + +
+
Autoren + @if (pub.authors) { + @let authorList = parseAuthors(pub.authors); + @if (authorList.length > 0) { +
+ @for (author of authorList; track author; let last = $last) { + + + {{ author }} + + @if (!last) { + , + } + + } +
+ } @else { + — + } + } @else { + — + } +
Zeitschrift + @if (pub.journalTitle) { + {{ pub.journalTitle }} + } @else { + — + } + Jahr + @if (pub.publishedYear) { + {{ pub.publishedYear }} + } @else { + — + } + Verlag + @if (pub.publisher) { + {{ pub.publisher }} + } @else { + — + } + Links + +
+
+
+
\ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss new file mode 100644 index 00000000..f84c64b4 --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss @@ -0,0 +1,233 @@ +// Publications Table + +.publications-tab { + .card { + margin-bottom: 24px; + } + + .section-header { + display: flex; + align-items: center; + gap: 12px; + padding: 16px 20px; + border-bottom: 1px solid #e6e9ed; + + mat-icon { + color: #6b7a8a; + font-size: 24px; + width: 24px; + height: 24px; + } + + h2 { + margin: 0; + font-size: 18px; + font-weight: 600; + color: #1a1a1a; + } + } + + table { + width: 100%; + border-radius: 8px; + overflow: hidden; + } + + .mat-mdc-header-cell { + font-weight: 600; + color: #6b7a8a; + font-size: 12px; + text-transform: uppercase; + letter-spacing: 0.5px; + background: #f8fafc; + border-bottom: 2px solid #e6e9ed; + padding: 12px 16px; + } + + .mat-mdc-cell { + padding: 12px 16px; + border-bottom: 1px solid #f0f2f5; + font-size: 13px; + } + + .mat-mdc-row { + transition: background 0.2s ease; + cursor: pointer; + } + + .mat-mdc-row:hover { + background: #f8fafc; + } + + .pub-title-cell { + display: flex; + align-items: center; + gap: 8px; + cursor: pointer; + } + + .pub-title-text { + font-weight: 500; + color: #1a1a1a; + line-height: 1.4; + } + + .pub-title-cell:hover .pub-title-text { + color: #005a9c; + text-decoration: underline; + } + + .authors-text { + color: #4a5a6a; + font-size: 13px; + color: #1a1a1a; + line-height: 1.4; + } + .author-name:hover { + color: #005a9c; + text-decoration: underline; + } + + .journal-chip { + display: inline-block; + padding: 2px 10px; + background: #e8edf5; + border-radius: 12px; + font-size: 12px; + color: #6b7a8a; + max-width: 200px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .year-value { + font-weight: 500; + color: #1a1a1a; + } + + .publisher-text { + color: #4a5a6a; + font-size: 13px; + } + + .empty-value { + color: #6b7a8a; + font-size: 13px; + } + + .links-container { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; + } + + .link-button { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 4px 10px; + background: #f0f3f7; + border-radius: 12px; + color: #4a5a6a; + text-decoration: none; + font-size: 11px; + font-weight: 500; + transition: all 0.2s ease; + + &:hover { + background: #e8edf5; + color: #005a9c; + transform: translateY(-1px); + } + + .link-icon { + font-size: 14px; + width: 14px; + height: 14px; + color: #6b7a8a; + } + + .link-label { + font-size: 10px; + text-transform: uppercase; + letter-spacing: 0.3px; + } + } + + // Responsive styles + @media (max-width: 768px) { + .section-header { + padding: 12px 16px; + + h2 { + font-size: 16px; + } + } + + .mat-mdc-header-cell, + .mat-mdc-cell { + padding: 8px 10px; + font-size: 12px; + } + + .publicationDisplayedColumns { + // Hide less important columns on mobile + .mat-column-publisher { + display: none; + } + } + + .journal-chip { + max-width: 120px; + font-size: 11px; + } + + .link-button { + padding: 2px 8px; + font-size: 10px; + + .link-label { + display: none; + } + } + + .pub-title-text { + font-size: 13px; + } + } + + @media (max-width: 480px) { + .mat-column-journal { + display: none; + } + + .mat-column-publisher { + display: none; + } + + .mat-mdc-cell { + padding: 6px 8px; + font-size: 11px; + } + + .authors-text { + font-size: 11px; + max-width: 100px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + } + + .links-container { + gap: 4px; + } + + .link-button { + padding: 2px 6px; + font-size: 9px; + } + } +} diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts new file mode 100644 index 00000000..44f5af5e --- /dev/null +++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts @@ -0,0 +1,87 @@ +import { Component, computed, inject, Input } from '@angular/core'; +import { MatTableModule } from '@angular/material/table'; +import { Router } from '@angular/router'; +import { MatIcon } from '@angular/material/icon'; +import { MatCard } from '@angular/material/card'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { CommonModule } from '@angular/common'; +import { HEUPublication } from '../../../../api'; + +@Component({ + selector: 'app-publications-table', + imports: [CommonModule, MatTableModule, MatIcon, MatCard, MatTooltipModule], + templateUrl: './publications-table.component.html', + styleUrl: './publications-table.component.scss', +}) +export class PublicationsTableComponent { + private router = inject(Router); + + @Input() publications: HEUPublication[] = []; + @Input() showHeader: boolean = true; + @Input() headerTitle: string = 'Publikationen'; + + // Displayed columns for the publications table + publicationDisplayedColumns: string[] = [ + 'title', + 'authors', + 'journal', + 'year', + 'publisher', + 'links', + ]; + author_names = computed(() => 'keka'); + /** + * Navigate to publication details + */ + searchForPublication(pub: HEUPublication): void { + if (!pub) { + console.warn('Cannot navigate with empty publication'); + return; + } + + const doi = pub.doi?.trim() ?? 'unknown'; + + // Encode DOI and navigate + const encodedDoi = encodeURIComponent(doi); + + this.router + .navigate(['/publication', encodedDoi], { + queryParams: { + title: pub.title || '', + }, + }) + .catch((err) => console.error('Navigation to publication failed:', err)); + } + + getPublicationCount(): number { + return this.publications?.length || 0; + } + searchForPersonName(personName: string): void { + this.router.navigate(['/persons'], { + queryParams: { + query: personName, + }, + }); + } + // Parse authors string into array of individual authors + parseAuthors(authorsString: string | undefined): string[] { + if (!authorsString) return []; + + // Common separators: 'and', ',', ';', '&' + // Also handle cases like "Author1, Author2 and Author3" + let authors = authorsString; + + // Replace ' and ' with ', ' for consistent splitting + authors = authors.replace(/\s+and\s+/g, ', '); + + // Split by common separators + let authorList = authors.split(/[,;]\s*/); + + // Clean up each author name + authorList = authorList + .map((author) => author.trim()) + .filter((author) => author.length > 0); + + return authorList; + } +} -- 2.56.1 From 5f158053d37fb02f496abada9e26298ae69690d3 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 21:48:05 +0200 Subject: [PATCH 33/42] organizations table ui adjusted --- .../organizations-table.component.html | 49 +++--- .../organizations-table.component.scss | 157 ++++++++++++++++-- .../organizations-table.component.ts | 5 + 3 files changed, 170 insertions(+), 41 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html index b1a68c07..1e5bfd19 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.html @@ -1,6 +1,10 @@
- -
+ +
+ business +

Organisationen ({{ orgs.length || 0 }})

+
+
@@ -62,20 +66,6 @@ - - - @@ -99,20 +89,25 @@ } + @@ -123,4 +118,4 @@
Aktivitätstyp URL - @if (org.organizationURL) { - - open_in_new - - } @else { - — - } +
-
+
\ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss index a9c7c11a..0ed8015c 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.scss @@ -1,4 +1,3 @@ - // Organizations .organizations-tab { @@ -6,9 +5,29 @@ margin-bottom: 24px; } + .section-header { + display: flex; + align-items: center; + gap: 12px; + padding: 16px 20px; + border-bottom: 1px solid #e6e9ed; + + mat-icon { + color: #6b7a8a; + font-size: 24px; + width: 24px; + height: 24px; + } + + h2 { + margin: 0; + font-size: 18px; + font-weight: 600; + color: #1a1a1a; + } + } + .organizations-table-wrapper { - padding: 0 20px 20px; - overflow-x: auto; table { width: 100%; @@ -75,6 +94,11 @@ font-size: 13px; } + .country-flag { + width: auto; + height: 10px; + } + .currency-value { font-weight: 500; color: #1a1a1a; @@ -102,19 +126,54 @@ font-weight: 500; font-size: 12px; } - .url-badge { - display: inline-block; + + .links-container { + display: inline-flex; + align-items: center; + gap: 8px; + } + + .link-button { + display: inline-flex; + align-items: center; + gap: 4px; padding: 2px 8px; - background: #e8f5e9; - color: #2e7d32; + background: #f0f3f7; border-radius: 4px; - font-weight: 500; + color: #4a5a6a; + text-decoration: none; font-size: 12px; + transition: all 0.2s ease; + + &:hover { + background: #e8edf5; + color: #005a9c; + } + + .link-icon { + font-size: 16px; + width: 16px; + height: 16px; + color: #6b7a8a; + } + + .link-label { + font-size: 11px; + font-weight: 500; + } } } @media (max-width: 768px) { .organizations-tab { + .section-header { + padding: 12px 16px; + + h2 { + font-size: 16px; + } + } + .organizations-table-wrapper { padding: 0 12px 12px; } @@ -124,14 +183,84 @@ padding: 8px 10px; font-size: 12px; } + .country-flag { - font-size: 18px; - line-height: 1; + height: 8px; } - .org-avatar-small { - width: 24px; - height: 24px; - font-size: 10px; + + .role-chip, + .activity-chip { + font-size: 11px; + padding: 2px 8px; + } + + .sme-badge { + font-size: 11px; + padding: 2px 6px; + } + + .link-button { + padding: 2px 6px; + font-size: 11px; + + .link-label { + font-size: 10px; + } + + .link-icon { + font-size: 14px; + width: 14px; + height: 14px; + } + } + + .org-name-text { + font-size: 13px; } } } + +@media (max-width: 480px) { + .organizations-tab { + .mat-column-role { + display: none; + } + + .mat-column-activityType { + display: none; + } + + .mat-mdc-cell { + padding: 6px 8px; + font-size: 11px; + } + + .country-chip { + font-size: 11px; + gap: 6px; + } + + .currency-value { + font-size: 12px; + } + + .links-container { + gap: 4px; + } + + .link-button { + padding: 2px 4px; + font-size: 10px; + + .link-label { + display: none; + } + + .link-icon { + font-size: 16px; + width: 16px; + height: 16px; + } + } + } +} \ No newline at end of file diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts index 7bc5e3e8..c5f61a8d 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table/organizations-table.component.ts @@ -15,6 +15,8 @@ export class OrganizationsTableComponent { private router = inject(Router); @Input() orgs!: HEUOrganization[]; + @Input() showHeader: boolean = true; + @Input() headerTitle: string = 'Organizationen'; // Displayed columns for the organizations table organizationDisplayedColumns: string[] = [ @@ -41,6 +43,9 @@ export class OrganizationsTableComponent { } return codeLower; } + getOrgsCount(): number { + return this.orgs?.length || 0; + } formatCurr(value: number | undefined | null) { if (value) { return formatCurrency(value); -- 2.56.1 From f965b2c0a22e566a7138d2a7cc46fd7720d670be Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 21:48:37 +0200 Subject: [PATCH 34/42] added new endpoint for searching patents (by id and title) --- service/src/main/inse/model.py | 3 + .../inse/patents/elastic_search_client.py | 132 +++++++++++++++--- service/src/main/inse/patents/logic.py | 26 ++++ service/src/main/inse/patents/service.py | 23 ++- .../patents/test_elastic_search_client.py | 21 ++- 5 files changed, 174 insertions(+), 31 deletions(-) diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py index 9633207b..028d5eb7 100644 --- a/service/src/main/inse/model.py +++ b/service/src/main/inse/model.py @@ -55,6 +55,9 @@ class ESIndex(StrEnum): OPENALEX_AUTHORS = "openalex-authors" OPENALEX_INSTITUTIONS = "openalex-institutions" OPENALEX_PUBLICATIONS = "openalex-publications" + + EPO_INDEX = "epo_index_1.0" + USPTO_INDEX = "uspto_patents_3.0" PROJECTS_BUND_V1 = "projects_bund_v1" PROJECTS_DFG_ALL = "projects_dfg_all" diff --git a/service/src/main/inse/patents/elastic_search_client.py b/service/src/main/inse/patents/elastic_search_client.py index f10694e6..698e9d84 100644 --- a/service/src/main/inse/patents/elastic_search_client.py +++ b/service/src/main/inse/patents/elastic_search_client.py @@ -4,15 +4,13 @@ HTTP client for patent searches in EPO and USPTO Elasticsearch indices. """ from typing import Any - +from inse.integrations import elasticsearch +from inse.model import ESCluster, ESIndex import httpx - +import asyncio from .. import config from .name_matching import search_name_variants -EPO_INDEX = "epo_index_1.0" -USPTO_INDEX = "uspto_patents_3.0" - DEFAULT_SEARCH_SIZE = 100 @@ -168,21 +166,117 @@ class PatentSearchClient: } async def search_epo(self, payload: dict[str, Any]) -> dict[str, Any]: - return await self._search(EPO_INDEX, payload) + return await self._search(ESIndex.EPO_INDEX, payload) async def search_uspto(self, payload: dict[str, Any]) -> dict[str, Any]: - return await self._search(USPTO_INDEX, payload) + return await self._search(ESIndex.USPTO_INDEX, payload) async def _search(self, index: str, payload: dict[str, Any]) -> dict[str, Any]: - async with httpx.AsyncClient( - base_url=self.base_url, - timeout=self.timeout, - transport=self.transport, - ) as client: - response = await client.post( - f"/{index}/_search", - headers=self._headers(), - json=payload, - ) - response.raise_for_status() - return response.json() \ No newline at end of file + response = elasticsearch.search(index=index,body=payload,cluster=ESCluster.INSE) + return response + + async def get_by_id_or_title( + self, + patent_id: str, + prefix: str, + title: str, + size: int = 1, + ) -> dict[str, Any]: + """Search EPO and USPTO by ID; fall back to match_phrase on title if no hits. + + Args: + patent_id: The raw document/publication number (e.g. "1234567", "US1234567A"). + prefix: "EP" routes the title fallback to EPO; "US" routes it to USPTO. + Both indices are always queried for the ID lookup. + title: Used only when the ID lookup returns zero hits. + size: Maximum number of results to return. + """ + epo_id_payload = self._epo_query_by_id(patent_id, size) + uspto_id_payload = self._uspto_query_by_id(patent_id, size) + + epo_result, uspto_result = await asyncio.gather( + self.search_epo(epo_id_payload), + self.search_uspto(uspto_id_payload), + ) + + epo_hits = epo_result.get("hits", {}).get("total", {}).get("value", 0) + uspto_hits = uspto_result.get("hits", {}).get("total", {}).get("value", 0) + + if epo_hits > 0 or uspto_hits > 0: + if prefix.upper() == "EP" and epo_hits > 0: + return epo_result + if prefix.upper() == "US" and uspto_hits > 0: + return uspto_result + return epo_result if epo_hits > 0 else uspto_result + + if prefix.upper() == "US": + payload = self._uspto_query_by_title(title, size) + return await self.search_uspto(payload) + + payload = self._epo_query_by_title(title, size) + return await self.search_epo(payload) + #query builders + + def _epo_query_by_id(self, patent_id: str, size: int) -> dict[str, Any]: + """Term query against doc_number; strips a leading 'EP' prefix if present.""" + raw_id = patent_id.upper().removeprefix("EP") + return { + "size": size, + "_source": [ + "doc_number", "country", "kind", "date_publication", + "date_publication_year", "application_number", + "application_filing_date", "title_en", "title_de", "abstract", + "inventors_name", "applicants_name", "ipc", "cpc", + ], + "query": {"term": {"doc_number": raw_id}}, + } + + def _uspto_query_by_id(self, patent_id: str, size: int) -> dict[str, Any]: + """Term query against publication_number; tries the ID as-is.""" + return { + "size": size, + "track_total_hits": True, + "sort": [{"publication_date": {"order": "desc", "missing": "_last"}}, "_doc"], + "_source": [ + "publication_number", "country", "publication_date", + "publication_year", "application_number", "application_date", + "application_type", "title", "abstract", "inventors_names", + "assignees_orgs", "ipcr", "cpc", "number_of_claims", "status", + ], + "query": {"term": {"publication_number": patent_id}}, + } + + def _epo_query_by_title(self, title: str, size: int) -> dict[str, Any]: + """match_phrase fallback on title_en (and title_de as a should clause).""" + return { + "size": size, + "_source": [ + "doc_number", "country", "kind", "date_publication", + "date_publication_year", "application_number", + "application_filing_date", "title_en", "title_de", "abstract", + "inventors_name", "applicants_name", "ipc", "cpc", + ], + "query": { + "bool": { + "should": [ + {"match_phrase": {"title_en": title}}, + {"match_phrase": {"title_de": title}}, + {"match_phrase": {"title_fr": title}}, + ], + "minimum_should_match": 1, + } + }, + } + + def _uspto_query_by_title(self, title: str, size: int) -> dict[str, Any]: + """match_phrase fallback on title.""" + return { + "size": size, + "_source": [ + "publication_number", "country", "publication_date", + "publication_year", "application_number", "application_date", + "application_type", "title", "abstract", "inventors_names", + "assignees_orgs", "ipcr", "cpc", "number_of_claims", "status", + ], + "query": {"match_phrase": {"title": title}}, + } \ No newline at end of file diff --git a/service/src/main/inse/patents/logic.py b/service/src/main/inse/patents/logic.py index 65765f1f..3763cef8 100644 --- a/service/src/main/inse/patents/logic.py +++ b/service/src/main/inse/patents/logic.py @@ -9,6 +9,7 @@ import httpx from fastapi import HTTPException from starlette.status import HTTP_502_BAD_GATEWAY from starlette.status import HTTP_503_SERVICE_UNAVAILABLE +from starlette.status import HTTP_404_NOT_FOUND from ..persons import logic as person_logic from ..models.openalex.author import Author @@ -22,6 +23,31 @@ from .name_matching import name_matches logger = logging.getLogger(__name__) +async def get_patent( + patent_id: str, + title: str, + prefix: str, + client: PatentSearchClient | None = None, +) -> model.PatentEntry: + search_client = client or PatentSearchClient() + + data = await search_client.get_by_id_or_title( + patent_id=patent_id, + prefix=prefix, + title=title, + ) + + parse = _parse_uspto_hits if prefix.upper() == "US" else _parse_epo_hits + elements = parse(data) + + if not elements: + raise HTTPException( + status_code=HTTP_404_NOT_FOUND, + detail="Patent not found.", + ) + return elements[0] + + async def get_patents_by_author_id( author_id: str, client: PatentSearchClient | None = None, diff --git a/service/src/main/inse/patents/service.py b/service/src/main/inse/patents/service.py index 53a27446..6d84f842 100644 --- a/service/src/main/inse/patents/service.py +++ b/service/src/main/inse/patents/service.py @@ -6,7 +6,9 @@ from fastapi import APIRouter from . import logic from . import model - +from typing import Annotated, Optional +from fastapi import Path +from fastapi import Query router = APIRouter(prefix="/api/inse-service/authors", tags=["Patents"]) @@ -18,3 +20,22 @@ router = APIRouter(prefix="/api/inse-service/authors", tags=["Patents"]) ) async def get_patents_by_author(author_id: str): return await logic.get_patents_by_author_id(author_id) + +@router.get( + "/patents/{identifier}", + operation_id="getPatentByIdOrTitle", + response_model=model.PatentEntry, + summary="Returns one publication by OpenAlex ID or DOI.", +) +async def get_patent_by_identifier( + identifier: Annotated[ + str, Path(description="") + ], + prefix: Annotated[ + Optional[str], Query(description="Application Prefix (EP or US)") + ] = "", + title: Annotated[ + Optional[str], Query(description="Do we want to fallback to title search if ID and DOI dont work?") + ] = "", +): + return await logic.get_patent(patent_id=identifier,prefix=prefix,title=title) \ No newline at end of file diff --git a/service/src/main/inse/patents/test_elastic_search_client.py b/service/src/main/inse/patents/test_elastic_search_client.py index 08729ea6..729e8d51 100644 --- a/service/src/main/inse/patents/test_elastic_search_client.py +++ b/service/src/main/inse/patents/test_elastic_search_client.py @@ -1,5 +1,5 @@ -import httpx import pytest +from unittest.mock import patch, MagicMock from inse.patents.elastic_search_client import ( DEFAULT_SEARCH_SIZE, @@ -34,16 +34,15 @@ def test_uspto_index_is_3_0(): @pytest.mark.anyio async def test_search_epo_posts_to_correct_index(): - requests: list[str] = [] + captured: list[dict] = [] - def handler(request: httpx.Request) -> httpx.Response: - requests.append(request.url.path) - return httpx.Response(200, json={"hits": {"hits": []}}) + def fake_search(index: str, body: dict): + captured.append({"index": index, "body": body}) + return {"hits": {"hits": []}} - transport = httpx.MockTransport(handler) - client = PatentSearchClient(api_key="test-key", transport=transport) + with patch("inse.integrations.elasticsearch.search", side_effect=fake_search): + client = PatentSearchClient(api_key="test-key") + await client.search_epo(client.epo_query_by_inventor("Weber", "Christian")) - await client.search_epo(client.epo_query_by_inventor("Weber", "Christian")) - - assert len(requests) == 1 - assert requests[0].endswith(f"/{EPO_INDEX}/_search") + assert len(captured) == 1 + assert captured[0]["index"] == EPO_INDEX \ No newline at end of file -- 2.56.1 From d2d194ea07c82cf50f6dfabf11e5e036ec85fe39 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 21:48:50 +0200 Subject: [PATCH 35/42] regenerated services --- webapp/src/app/api/api/patents.service.ts | 450 +++++++++++------- webapp/src/app/api/model/ipcClassification.ts | 20 + webapp/src/app/api/model/patentEntry.ts | 36 +- 3 files changed, 320 insertions(+), 186 deletions(-) create mode 100644 webapp/src/app/api/model/ipcClassification.ts diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index 4ec5192e..4128de16 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -1,174 +1,276 @@ -/** - * Innovation Search Engine API - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - -export interface IpcClassification { - symbol: string; - section: string | null; - class: string | null; - subclass: string | null; - main_group: string | null; - subgroup: string | null; -} - -export interface PatentEntry { - patent_id: string; - source: string; - title: string | null; - abstract: string | null; - publication_date: string | null; - publication_year: string | null; - application_number: string | null; - application_date: string | null; - kind: string | null; - application_type: string | null; - number_of_claims: number | null; - status: string | null; - inventors: string[]; - assignees: string[]; - ipc: string[]; - ipc_descriptions: IpcClassification[]; - cpc: string[]; - cpc_descriptions: IpcClassification[]; - country: string | null; -} - -export interface PatentsByAuthorResponse { - author_id: string; - author_name: string | null; - patent_count: number; - patents: PatentEntry[]; -} - -type GetPatentsByAuthorOptions = { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; -}; - -@Injectable({ - providedIn: 'root', -}) -export class PatentsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - - /** - * Get patents by author. - * @endpoint get /api/inse-service/authors/{author_id}/patents - * @param authorId - * @param observe - * @param reportProgress - */ - public getPatentsByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable; - public getPatentsByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable>; - public getPatentsByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable>; - public getPatentsByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: GetPatentsByAuthorOptions, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ - name: 'authorId', - value: authorId, - in: 'path', - style: 'simple', - explode: false, - dataType: 'string', - dataFormat: undefined, - })}/patents`; - - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } -} +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { PatentEntry } from '../model/patentEntry'; +// @ts-ignore +import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + +@Injectable({ + providedIn: 'root', +}) +export class PatentsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/inse-service/authors/patents/{identifier} + * @param identifier + * @param prefix Application Prefix (EP or US) + * @param title Do we want to fallback to title search if ID and DOI dont work? + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + prefix, + 'prefix', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/model/ipcClassification.ts b/webapp/src/app/api/model/ipcClassification.ts new file mode 100644 index 00000000..74805329 --- /dev/null +++ b/webapp/src/app/api/model/ipcClassification.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface IpcClassification { + symbol: string; + section?: string | null; + 'class'?: string | null; + subclass?: string | null; + main_group?: string | null; + subgroup?: string | null; +} + diff --git a/webapp/src/app/api/model/patentEntry.ts b/webapp/src/app/api/model/patentEntry.ts index a6a3619c..5565ab9a 100644 --- a/webapp/src/app/api/model/patentEntry.ts +++ b/webapp/src/app/api/model/patentEntry.ts @@ -1,22 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ +import { IpcClassification } from './ipcClassification'; -export interface PatentEntry { - patent_id: string; - source: string; - title?: string | null; - abstract?: string | null; - publication_date?: string | null; - publication_year?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - country?: string | null; + +export interface PatentEntry { + patent_id: string; + source: string; + title?: string | null; + 'abstract'?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; } + -- 2.56.1 From f2336db46cd274074b5f67aa1fb8852f7751e4d5 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 21:49:21 +0200 Subject: [PATCH 36/42] minor fixes for make the component work --- webapp/src/app/api/.openapi-generator/FILES | 1 + .../person-patents.component.html | 19 +++++-------------- .../person-patents.component.ts | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 957f3067..ebb55315 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -111,6 +111,7 @@ model/institutionInformation.ts model/institutionNetworkNode.ts model/institutionPage.ts model/institutionsListResponse.ts +model/ipcClassification.ts model/item.ts model/itemCreate.ts model/itemPage.ts diff --git a/webapp/src/app/modules/person-patents/person-patents.component.html b/webapp/src/app/modules/person-patents/person-patents.component.html index b8389633..dc376937 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.html +++ b/webapp/src/app/modules/person-patents/person-patents.component.html @@ -53,7 +53,7 @@
- @if (selectedPatent.assignees.length > 0) { + @if (selectedPatent.assignees && selectedPatent.assignees.length > 0) {

Anmelder

    @@ -64,7 +64,7 @@
} - @if (selectedPatent.ipc_descriptions.length > 0) { + @if (selectedPatent.ipc_descriptions && selectedPatent.ipc_descriptions.length > 0) {

Klassifikation (IPC)

@@ -110,7 +110,7 @@ }
- } @else if (selectedPatent.ipc.length > 0) { + } @else if (selectedPatent.ipc && selectedPatent.ipc.length > 0) {

Klassifikation (IPC)

    @@ -121,7 +121,7 @@
} - @if (selectedPatent.cpc_descriptions.length > 0) { + @if (selectedPatent.cpc_descriptions && selectedPatent.cpc_descriptions.length > 0) {

Klassifikation (CPC)

@@ -167,16 +167,7 @@ }
- } @else if (selectedPatent.cpc.length > 0) { -
-

Klassifikation (CPC)

-
    - @for (cpc of selectedPatent.cpc; track cpc) { -
  • {{ cpc }}
  • - } -
-
- } + }
} diff --git a/webapp/src/app/modules/person-patents/person-patents.component.ts b/webapp/src/app/modules/person-patents/person-patents.component.ts index e4cb9912..53bbf252 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.ts +++ b/webapp/src/app/modules/person-patents/person-patents.component.ts @@ -1,8 +1,9 @@ import { Component, OnInit, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; -import { PatentsService, PatentEntry, IpcClassification } from '../../api/api/patents.service'; - +import { PatentsService } from '../../api/api/patents.service'; +import { PatentEntry } from '../../api'; +import { IpcClassification } from '../../api/model/ipcClassification'; type SortMode = 'date' | 'title'; type SourceFilter = 'all' | 'EPO' | 'USPTO'; type ClassificationSystem = 'IPC' | 'CPC'; @@ -171,7 +172,7 @@ export class PersonPatentsComponent implements OnInit { this.updateQueryParams(); } - formatDate(date: string | null): string { + formatDate(date: string | null | undefined): string { if (!date) return '-'; const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); return new Intl.DateTimeFormat('de-DE').format(new Date(d)); @@ -374,10 +375,16 @@ export class PersonPatentsComponent implements OnInit { seen.add(normalized); rows.push({ label, value }); }; + if (entry.section){ + addRow('Sektion', entry.section); + } + if (entry.class){ + addRow('Klasse', entry.class); + } + if (entry.subclass){ + addRow('Unterklasse', entry.subclass); + } - addRow('Sektion', entry.section); - addRow('Klasse', entry.class); - addRow('Unterklasse', entry.subclass); return rows; } -- 2.56.1 From 98db289928854811f1438d6b2bfba3ccdb612d29 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 22:31:16 +0200 Subject: [PATCH 37/42] regenerated services --- webapp/src/app/api/api/patents.service.ts | 425 ++++++++++++++---- .../src/app/api/model/allPatentsResponse.ts | 19 + 2 files changed, 364 insertions(+), 80 deletions(-) create mode 100644 webapp/src/app/api/model/allPatentsResponse.ts diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index f8f78f64..a9b21b25 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -1,3 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, @@ -5,34 +16,25 @@ import { HttpParams, HttpResponse, HttpEvent, + HttpParameterCodec, HttpContext, } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; + +// @ts-ignore +import { AllPatentsResponse } from '../model/allPatentsResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { PatentEntry } from '../model/patentEntry'; +// @ts-ignore +import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse'; + +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { PatentEntry } from '../model/patentEntry'; -import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse'; - - - - - - - -export interface AllPatentsResponse { - total: number; - page: number; - size: number; - patents: PatentEntry[]; -} - -type GetPatentsByAuthorOptions = { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; -}; @Injectable({ providedIn: 'root', @@ -46,37 +48,112 @@ export class PatentsService extends BaseService { super(basePath, configuration); } - public getPatentsByAuthor( - authorId: string, + /** + * Get all patents with pagination and search. + * @endpoint get /api/inse-service/patents + * @param page + * @param size + * @param search + * @param source + * @param sortBy + * @param sortDirection + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, observe?: 'body', reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable; - public getPatentsByAuthor( - authorId: string, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, observe?: 'response', reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable>; - public getPatentsByAuthor( - authorId: string, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, observe?: 'events', reportProgress?: boolean, - options?: GetPatentsByAuthorOptions, - ): Observable>; - public getPatentsByAuthor( - authorId: string, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, - options?: GetPatentsByAuthorOptions, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', - ); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + source, + 'source', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); @@ -89,6 +166,7 @@ export class PatentsService extends BaseService { const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -104,18 +182,235 @@ export class PatentsService extends BaseService { } } - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam( + let localVarPath = `/api/inse-service/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, { - name: 'authorId', - value: authorId, - in: 'path', - style: 'simple', - explode: false, - dataType: 'string', - dataFormat: undefined, + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, }, - )}/patents`; + ); + } + /** + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/inse-service/authors/patents/{identifier} + * @param identifier + * @param prefix Application Prefix (EP or US) + * @param title Do we want to fallback to title search if ID and DOI dont work? + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + prefix, + 'prefix', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request( 'get', @@ -133,34 +428,4 @@ export class PatentsService extends BaseService { }, ); } - - public getAllPatents( - page: number = 0, - size: number = 10, - search?: string, - source?: string, - sortBy: string = 'date', - sortDirection: string = 'desc', - ): Observable { - let params = new HttpParams() - .set('page', String(page)) - .set('size', String(size)) - .set('sort_by', sortBy) - .set('sort_direction', sortDirection); - - if (search) params = params.set('search', search); - if (source) params = params.set('source', source); - - const localVarHeaders = this.defaultHeaders; - const { basePath, withCredentials } = this.configuration; - - return this.httpClient.get( - `${basePath}/api/inse-service/patents`, - { - params, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - }, - ); - } } diff --git a/webapp/src/app/api/model/allPatentsResponse.ts b/webapp/src/app/api/model/allPatentsResponse.ts new file mode 100644 index 00000000..dfe6fb24 --- /dev/null +++ b/webapp/src/app/api/model/allPatentsResponse.ts @@ -0,0 +1,19 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PatentEntry } from './patentEntry'; + + +export interface AllPatentsResponse { + total: number; + page: number; + size: number; + patents: Array; +} + -- 2.56.1 From 5530e5738baa656ada556f2f644d88f0b817db99 Mon Sep 17 00:00:00 2001 From: genja Date: Thu, 25 Jun 2026 22:31:40 +0200 Subject: [PATCH 38/42] search for patents added --- .../projects/eu-cordis-details/eu-details.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 449bae54..27bd7922 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -38,7 +38,7 @@ export type TabType = MatTooltipModule, TopicChipComponent, OrganizationsTableComponent, - PublicationsTableComponent + PublicationsTableComponent, ], templateUrl: './eu-details.component.html', styleUrl: './eu-details.component.scss', @@ -569,8 +569,12 @@ export class EuDetailsComponent implements OnInit, OnDestroy { .catch((err) => console.error('Navigation to status failed:', err)); } - searchForPatent(patent: Fp7ProjectIPR) { - console.log(patent) + searchForPatent(patent:Fp7ProjectIPR): void { + this.router.navigate(['/patents'], { + queryParams: { + search: patent.title, + }, + }); } /** * Navigate back to projects list with optional filter -- 2.56.1 From 79496353281fb88c6ea8a97a3b7a3fdd8ecbc361 Mon Sep 17 00:00:00 2001 From: genja Date: Fri, 26 Jun 2026 01:30:30 +0200 Subject: [PATCH 39/42] layout adjustments --- .../eu-details.component.html | 152 +----------------- .../eu-details.component.scss | 1 + .../eu-cordis-details/eu-details.component.ts | 127 +++------------ .../publications-table.component.html | 4 +- 4 files changed, 29 insertions(+), 255 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html index 782e5acd..9e688cb3 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.html @@ -140,6 +140,7 @@ @@ -488,7 +488,7 @@
gavel -

Patente (IPRs) ({{ euProject.iprs.length }})

+

Intellectual Property Rights ({{ euProject.iprs.length }})

@for (ipr of euProject.iprs; track ipr.title) { -- 2.56.1