diff --git a/src/app/shared/services/vocabulary.service.ts b/src/app/shared/services/vocabulary.service.ts index 4804850..ee2b2a2 100644 --- a/src/app/shared/services/vocabulary.service.ts +++ b/src/app/shared/services/vocabulary.service.ts @@ -17,23 +17,31 @@ import { Observable } from 'rxjs'; import { Vocabulary } from "../models/vocabulary"; import { environment } from "src/environments/environment"; +import { JSON_LD_DEFAULT_CONTEXT } from '@think-it-labs/edc-connector-client'; @Injectable({ providedIn: 'root' }) export class VocabularyService { - private readonly BASE_URL = `${environment.runtime.managementApiUrl}${environment.runtime.service.vocabulary.baseUrl}`; + private readonly BASE_URL = `${environment.runtime.sharedUrl}${environment.runtime.service.vocabulary.baseUrl}`; + private readonly PARTICIPANT_ID = `${environment.runtime.sharedUrl}`; constructor(private http: HttpClient) { } /** - * Gets all vocabularies according to a particular query + * Gets all vocabularies according to the connector Id */ public requestVocabularies(): Observable> { + + const body = { + "@context": JSON_LD_DEFAULT_CONTEXT, + "connectorId": this.PARTICIPANT_ID + } + return this.http.post>( - `${this.BASE_URL}${environment.runtime.service.vocabulary.getAll}`, null + `${this.BASE_URL}${environment.runtime.service.vocabulary.getAll}`, body ); } } diff --git a/src/assets/config/app.config.json b/src/assets/config/app.config.json index 3b651d1..6496364 100644 --- a/src/assets/config/app.config.json +++ b/src/assets/config/app.config.json @@ -1,6 +1,8 @@ { "managementApiUrl": "http://localhost:19193/management", "catalogUrl": "http://localhost:19193/management/federatedcatalog", + "sharedUrl": "http://localhost:19196/shared", + "participantId": "connector-c1", "storageAccount": "company2assets", "storageExplorerLinkTemplate": "storageexplorer://v=1", "theme": "theme-2", @@ -49,8 +51,8 @@ "count": "/pagination/count?type=transferProcess" }, "vocabulary": { - "baseUrl": "/vocabularies", - "getAll": "/request" + "baseUrl": "/connector-vocabularies", + "getAll": "/request-by-connector" }, "federatedCatalog": { "count": "/pagination/count?type=federatedCatalog", diff --git a/src/assets/config/app.config.template.json b/src/assets/config/app.config.template.json index 68f282b..0400d4a 100644 --- a/src/assets/config/app.config.template.json +++ b/src/assets/config/app.config.template.json @@ -1,6 +1,8 @@ { "managementApiUrl": "$MANAGEMENT_API_URL", "catalogUrl": "$CATALOG_URL", + "sharedUrl": "$SHARED_URL", + "participantId": "$PARTICIPANT_ID", "storageAccount": "$STORAGE_ACCOUNT", "storageExplorerLinkTemplate": "$STORAGE_LINK_TEMPLATE", "theme": "$APP_THEME", @@ -49,8 +51,8 @@ "count": "/pagination/count?type=transferProcess" }, "vocabulary": { - "baseUrl": "/vocabularies", - "getAll": "/request" + "baseUrl": "/connector-vocabularies", + "getAll": "/request-by-connector" }, "federatedCatalog": { "count": "/pagination/count?type=federatedCatalog", diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index b8cf15f..5badf34 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -9,6 +9,8 @@ export const environment = { runtime: { managementApiUrl: '', catalogUrl: '', + sharedUrl: "", + participantId: "", storageAccount: '', storageExplorerLinkTemplate: '', theme: '', @@ -57,8 +59,8 @@ export const environment = { count: '/pagination/count?type=transferProcess' }, vocabulary: { - baseUrl: '/vocabularies', - getAll: '/request' + baseUrl: '/connector-vocabularies', + getAll: '/request-by-connector' }, federatedCatalog: { count: '/pagination/count?type=federatedCatalog', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index be7e39b..d1ed077 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -13,6 +13,8 @@ export const environment = { runtime: { managementApiUrl: "http://localhost:19193/management", catalogUrl: "http://localhost:19193/management/federatedcatalog", + sharedUrl: "http://localhost:19196/shared", + participantId: "connector-c1", storageAccount: "company2assets", storageExplorerLinkTemplate: "storageexplorer://v=1", theme: "theme-2", @@ -61,8 +63,8 @@ export const environment = { count: '/pagination/count?type=transferProcess' }, vocabulary: { - baseUrl: '/vocabularies', - getAll: '/request' + baseUrl: '/connector-vocabularies', + getAll: '/request-by-connector' }, federatedCatalog: { count: '/pagination/count?type=federatedCatalog',