Skip to content
Snippets Groups Projects
Commit 78f53443 authored by Callari, Roberto's avatar Callari, Roberto
Browse files

data catalogue

parent b930067c
No related branches found
No related tags found
No related merge requests found
Showing
with 282 additions and 3 deletions
...@@ -11,7 +11,7 @@ export const routes: Routes = [ ...@@ -11,7 +11,7 @@ export const routes: Routes = [
path: 'pages', path: 'pages',
loadChildren: () => import('./pages/pages.module') loadChildren: () => import('./pages/pages.module')
.then(m => m.PagesModule), .then(m => m.PagesModule),
canActivate: [AuthGuard]
}, },
{ {
path: 'auth', path: 'auth',
......
...@@ -74,7 +74,7 @@ export function createTranslateLoader(http: HttpClient) { ...@@ -74,7 +74,7 @@ export function createTranslateLoader(http: HttpClient) {
view: ['external-app', 'maps', 'home', 'about', 'charts', 'lorem-ipsum'] view: ['external-app', 'maps', 'home', 'about', 'charts', 'lorem-ipsum']
}, },
CITIZEN: { CITIZEN: {
view: ['home', 'about', 'ui-features'] view: ['home', 'about', 'ui-features','catalogues']
} }
}, },
}) })
......
...@@ -7,12 +7,13 @@ import { ...@@ -7,12 +7,13 @@ import {
} from '@angular/common/http'; } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { NbAuthOAuth2JWTToken, NbAuthOAuth2Token, NbAuthService } from '@nebular/auth'; import { NbAuthOAuth2JWTToken, NbAuthOAuth2Token, NbAuthService } from '@nebular/auth';
import { ConfigService } from '@ngx-config/core';
@Injectable() @Injectable()
export class TokenInterceptor implements HttpInterceptor { export class TokenInterceptor implements HttpInterceptor {
token; token;
constructor(public auth: NbAuthService) { } constructor(public auth: NbAuthService, public config:ConfigService) {}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (req.url.indexOf('/assets/') > -1) { if (req.url.indexOf('/assets/') > -1) {
...@@ -23,6 +24,10 @@ export class TokenInterceptor implements HttpInterceptor { ...@@ -23,6 +24,10 @@ export class TokenInterceptor implements HttpInterceptor {
return next.handle(req); return next.handle(req);
} }
if (req.url.indexOf(this.config.getSettings('idra_base_url')) > -1) {
return next.handle(req);
}
this.auth.getToken().subscribe((x: NbAuthOAuth2JWTToken) => this.token = x); this.auth.getToken().subscribe((x: NbAuthOAuth2JWTToken) => this.token = x);
let newHeaders = req.headers; let newHeaders = req.headers;
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DataCatalogueComponent } from './data-catalogue.component';
import { DatasetComponent } from './dataset/dataset.component';
import { SearchComponent } from './search/search.component';
const routes: Routes = [{
path: '',
redirectTo:'',
component: DataCatalogueComponent,
children: [ {
path: 'search',
component: SearchComponent,
}, {
path: 'datasets/:id',
component: DatasetComponent,
}],
}];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DataCatalogueRoutingModule { }
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'ngx-data-catalogue',
template: `
<router-outlet></router-outlet>
`,
})
export class DataCatalogueComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataCatalogueRoutingModule } from './data-catalogue-routing.module';
import { SearchComponent } from './search/search.component';
import { DatasetComponent } from './dataset/dataset.component';
import { DataCatalogueComponent } from './data-catalogue.component';
@NgModule({
declarations: [DataCatalogueComponent, SearchComponent, DatasetComponent],
imports: [
CommonModule,
DataCatalogueRoutingModule
]
})
export class DataCatalogueModule { }
<p>dataset works!</p>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DatasetComponent } from './dataset.component';
describe('DatasetComponent', () => {
let component: DatasetComponent;
let fixture: ComponentFixture<DatasetComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DatasetComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DatasetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'ngx-dataset',
templateUrl: './dataset.component.html',
styleUrls: ['./dataset.component.scss']
})
export class DatasetComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
export class Datalet {
id?: string;
nodeID?: string;
datasetID?: string;
distributionID?: string;
datalet_html?: string;
title?: string;
customTitle?: boolean;
registerDate?: string;
lastSeenDate?: string;
views?: number;
constructor(){}
}
\ No newline at end of file
export enum DCATAPFormat {
IDRA = "IDRA",
TURTLE = "TURTLE",
NTRIPLES = "NTRIPLES",
RDFXML = "RDF/XML",
N3 = "N3",
RDFJSON = "RDF/JSON",
JSONLD = "JSON-LD",
}
\ No newline at end of file
import { DCATDistribution } from "./dcatdistribution";
import { DCTLocation } from "./dctlocation";
import { DCTPeriodOfTime } from "./dctperiod-of-time";
import { DCTStandard } from "./dctstandard";
import { FOAFAgent } from "./foafagent";
import { SKOSConcept } from "./skosconcept";
import { VCardOrganization } from "./vcard-organization";
export class DCATDataset {
id: string;
nodeID: string;
title: string;
description: string;
distributions?: DCATDistribution[];
theme?: SKOSConcept[];
publisher?: FOAFAgent;
contactPoint?: VCardOrganization[];
keywords?: string[];
accessRights?: string;
conformsTo?: DCTStandard[];
documentation?: string[];
frequency?: string;
hasVersion?: string[];
isVersionOf?: string[];
landingPage?: string;
language?: string[];
provenance?: string[];
releaseDate?: string;
updateDate?: string;
identifier: string;
otherIdentifier?: string[];
sample?: string[];
source?: string[];
spatialCoverage?: DCTLocation;
temporalCoverage?: DCTPeriodOfTime;
type?: string;
version?: string;
versionNodes?: string[];
rightsHolder?: FOAFAgent;
creator?: FOAFAgent;
subject?: SKOSConcept[];
legacyIdentifier?: string;
constructor(){}
}
\ No newline at end of file
import { DCTLicenseDocument } from "./dctlicense-document";
import { DCTStandard } from "./dctstandard";
import { SKOSConcept } from "./skosconcept";
import { SPDXChecksum } from "./spdxchecksum";
export class DCATDistribution {
id: string;
storedRDF?: boolean;
nodeID: string;
accessURL: string;
description?: string;
format?: string;
license?: DCTLicenseDocument;
byteSize?: string;
checksum?: SPDXChecksum;
documentation?: string[];
downloadURL?: string;
language?: string[];
linkedSchemas?: DCTStandard[];
mediaType?: string;
releaseDate?: string;
updateDate?: string;
rights?: string;
status?: SKOSConcept;
title?: string;
hasDatalets?: boolean;
constructor(){}
}
\ No newline at end of file
export class DCTLicenseDocument {
id?: string;
nodeID?: string;
uri?: string;
name?: string;
type?: string;
versionInfo?: string;
constructor(){}
}
\ No newline at end of file
export class DCTLocation {
id?: string;
nodeID?: string;
uri?: string;
geographicalIdentifier?: string;
geographicalName?: string;
geometry?: string;
constructor(){}
}
\ No newline at end of file
export class DCTPeriodOfTime {
id?: string;
nodeID?: string;
uri?: string;
startDate?: string;
endDate?: string;
constructor(){}
}
\ No newline at end of file
export class DCTStandard {
id?: string;
nodeID?: string;
identifier?: string;
title?: string;
description?: string;
referenceDocumentation?: string[];
constructor(){}
}
\ No newline at end of file
export class ErrorResponse {
statusCode: string;
technicalMessage: string;
errorCode: string;
userMessage?: string;
constructor() { }
}
\ No newline at end of file
export class EuroVocLanguage {
languageName?:
| "BG"
| "ES"
| "CS"
| "DA"
| "DE"
| "ET"
| "EL"
| "EN"
| "FR"
| "GA"
| "HR"
| "IT"
| "LV"
| "LT"
| "HU"
| "MT"
| "NL"
| "PL"
| "PT"
| "RO"
| "SK"
| "SL"
| "FI"
| "SV"
| "MK"
| "SQ"
| "SR";
constructor(){}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment