Skip to content
Snippets Groups Projects
Commit 1121a465 authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

Merge branch 'fix/search_feature' into 'master'

update with fdp 1.12

See merge request !40
parents 8d75e132 2e2fb49a
No related branches found
No related tags found
1 merge request!40update with fdp 1.12
...@@ -137,6 +137,7 @@ repository:\n\ ...@@ -137,6 +137,7 @@ repository:\n\
dct:description "'+ this.Form.value.repodescription + '";\n\ dct:description "'+ this.Form.value.repodescription + '";\n\
dct:hasVersion "'+ this.Form.value.repoversion + '";\n\ dct:hasVersion "'+ this.Form.value.repoversion + '";\n\
dct:isPartOf <' + this.persistentUrl + '>;\n\ dct:isPartOf <' + this.persistentUrl + '>;\n\
dct:publisher [ a foaf:Agent; foaf:name " +this.Form.value.reponame + " ]; \n\
dcat:keyword "'+ this.Form.value.repotype + '";\n\ dcat:keyword "'+ this.Form.value.repotype + '";\n\
dct:title "'+ this.Form.value.reponame + '";\n\ dct:title "'+ this.Form.value.reponame + '";\n\
foaf:homepage <' + this.Form.value.repourl + '>;\n\ foaf:homepage <' + this.Form.value.repourl + '>;\n\
......
import { HttpClient } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { AppConfiguration } from 'src/app/AppConfiguration'; import { AppConfiguration } from 'src/app/AppConfiguration';
...@@ -43,15 +43,30 @@ export class PublishRepositoryService { ...@@ -43,15 +43,30 @@ export class PublishRepositoryService {
const response = await fetch(myRequest, myInit); const response = await fetch(myRequest, myInit);
const id = await response.headers.get("location"); const id = await response.headers.get("location");
const url = id
const catId = id.substring(id.search("catalog/") + 8, id.length); const catId = id.substring(id.search("catalog/") + 8, id.length);
console.log('catalog creaetd with fdp / id = ' + catId); console.log('catalog creaetd with fdp / id = ' + catId);
this.publishMetadata(url);
return this.addUserCatalog(catId); return this.addUserCatalog(catId);
} }
return null; return null;
} }
async publishMetadata(url: string) {
if (this.fds2Token) {
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ' + this.fds2Token
})
};
return this.http.put(`${url}/meta/state`, { current: 'PUBLISHED' }, httpOptions).toPromise();
}
}
getPersistentUrl(): Observable<PersistentUrlResponse> { getPersistentUrl(): Observable<PersistentUrlResponse> {
return this.http.get<PersistentUrlResponse>(environment.fdpUrl + '/configs/bootstrap'); return this.http.get<PersistentUrlResponse>(environment.fdpUrl + '/configs/bootstrap');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment