Skip to content
Snippets Groups Projects
Commit dfe93a32 authored by cazenave's avatar cazenave
Browse files

test api du smartharvester liste des urls

parent afbaef4e
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ const routes: Routes = [
{path: 'ontologie', component : OntologieComponent},
{path: 'publish', component : PublishComponent},
{path: 'settingfdp', component : SettingfdpComponent},
{path: 'settingsmartapi', component : SettingsmartapiComponent},
{path: 'settingsmartharvester', component : SettingsmartapiComponent},
{path: 'swaggerapi', component : SwaggereditorComponent},
{path: 'elasticsearch', component : ElasticsearchComponent},
{path: 'publishapi', component : PublishapiComponent},
......
......@@ -151,7 +151,7 @@
<button mat-menu-item [matMenuTriggerFor]="subMenuSetting">Settings</button>
<mat-menu #subMenuSetting="matMenu">
<button mat-menu-item routerLink="/settingfdp" routerLinkActive="active">FDP setting</button>
<button mat-menu-item routerLink="/settingsmartapi" routerLinkActive="active">SmartAPI setting</button>
<button mat-menu-item routerLink="/settingsmartharvester" routerLinkActive="active">SmartHarvester setting</button>
<button mat-menu-item routerLink="/elasticsearch" routerLinkActive="active">Elasticsearch setting</button>
</mat-menu>
</mat-menu>
......
......@@ -4,10 +4,8 @@
<div>
<button type="submit" (click)="listdatasets()" class="btn btn-primary">List datasets</button>
</div>
<p><strong>Total datasets found: {{dataresult}}</strong></p>
<p><strong>Examples of datasets found: </strong></p>
<ul>
<li *ngFor="let item of itemsdatasets; let i = index"><a href={{item.url}} >{{item.entity_id}} {{item.name}} </a> <br> {{item.description}}</li>
<li *ngFor="let item of dataresult"><a href={{item}} target="_blank" >{{item}} </a> </li>
</ul>
</form>
......@@ -17,3 +15,4 @@
<br><br>
<button class="next-step-button" routerLink="/ontologie" routerLinkActive="active" >Next step</button>
......@@ -32,21 +32,23 @@ export class DatasetsComponent implements OnInit {
var myInit = { method: 'GET', headers: myHeaders};
//appler smart havester pour récuprer l'api à lancer
//appeler smart havester pour récuperer l'api à lancer
// http://smart-harvester.eu/openapi/inrae/datasetlist
var myRequest = new Request('https://data.inrae.fr/api/search?q=*&per_page=10&type=dataset&start=0&show_entity_ids=true&show_my_data=true',myInit);
// https://data.inrae.fr/api/search?q=*&per_page=10&type=dataset&start=16000&show_entity_ids=true&show_my_data=true
var myRequest = new Request(this.appConfig.smartapiurl+'harvest/allurls',myInit);
fetch(myRequest, myInit)
.then(response => {
response.json()
.then(data => {
this.dataresult =JSON.stringify(data['data']['total_count']);
this.itemsdatasets = data['data']['items'];
for (var i = 0; i < this.itemsdatasets.length; i++) {
this.createdataset(data['data']['items'][i]);
}
this.dataresult =data;
//this.itemsdatasets = data['data']['items'];
console.log(this.dataresult);
// for (var i = 0; i < this.itemsdatasets.length; i++) {
// this.createdataset(data['data']['items'][i]);
// }
});
});
return null;
......@@ -74,7 +76,7 @@ s:new\n\
a dcat:Dataset, dcat:Resource;\n\
dct:description '+ description +';\n\
dct:hasVersion "1.0";\n\
dct:isPartOf c:d01757b2-178f-44f0-a4b0-c13d15fd307d;\n\
dct:isPartOf c:55500bc8-b379-44ff-b41b-f41c504d56ec;\n\
dct:language language:en;\n\
dct:license <http://rdflicense.appspot.com/rdflicense/cc-by-nc-nd3.0>;\n\
dct:title '+ name +';\n\
......
<p>publishapi works!</p>
<button (click)="goToLink()">OpenAPI editor</button>
<br><br>
<br><br>
......
......@@ -5,6 +5,9 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class ParseXmlService {
constructor(private http:HttpClient) { }
......
......@@ -9,7 +9,7 @@
<div>
<br>
<button type="submit" class="btn btn-primary">Save SmartApi setting</button>
<button type="submit" class="btn btn-primary">Save SmartHarvester setting</button>
</div>
</form>
\ No newline at end of file
......@@ -3,5 +3,5 @@ import { ApiService } from 'src/app/api.service';
export const environment = {
production: true,
apiurl: 'sandbox9.cines.fr',
token: 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhN2FkZDNkOS1mZTUwLTQ4ZGEtYTNmNC0zY2I1NjljM2Y5YmEiLCJpYXQiOjE2MDAwNzUxMzEsImV4cCI6MTYwMTI4NDczMX0.gRLsRdoEeIoqPNSZfegKIzdK1bfF16ALJ6xJPOAkVOA'
token: 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI5MjU1NjY3Yi04MmY5LTQ1Y2MtOWE4Mi1jOTE0ZThmMjI4OWYiLCJpYXQiOjE2MDE4ODcwNTQsImV4cCI6MTYwMzA5NjY1NH0.26TS5m7t3sInRgdJ6kH4ocU2sB3j9I-3uHAHU4Wt4gA'
};
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment