Skip to content

Commit

Permalink
#436475 - Changed the vocabularies request
Browse files Browse the repository at this point in the history
  • Loading branch information
ppel-gmv committed Jul 25, 2024
1 parent 0f86692 commit a311028
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
14 changes: 11 additions & 3 deletions src/app/shared/services/vocabulary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Array<Vocabulary>> {

const body = {
"@context": JSON_LD_DEFAULT_CONTEXT,
"connectorId": this.PARTICIPANT_ID
}

return this.http.post<Array<Vocabulary>>(
`${this.BASE_URL}${environment.runtime.service.vocabulary.getAll}`, null
`${this.BASE_URL}${environment.runtime.service.vocabulary.getAll}`, body
);
}
}
6 changes: 4 additions & 2 deletions src/assets/config/app.config.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/assets/config/app.config.template.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export const environment = {
runtime: {
managementApiUrl: '',
catalogUrl: '',
sharedUrl: "",
participantId: "",
storageAccount: '',
storageExplorerLinkTemplate: '',
theme: '',
Expand Down Expand Up @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit a311028

Please sign in to comment.