Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dad
FFDS-register-front
Commits
dfe93a32
Commit
dfe93a32
authored
Oct 14, 2020
by
cazenave
Browse files
test api du smartharvester liste des urls
parent
afbaef4e
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/app/app-routing.module.ts
View file @
dfe93a32
...
...
@@ -26,7 +26,7 @@ const routes: Routes = [
{
path
:
'
ontologie
'
,
component
:
OntologieComponent
},
{
path
:
'
publish
'
,
component
:
PublishComponent
},
{
path
:
'
settingfdp
'
,
component
:
SettingfdpComponent
},
{
path
:
'
settingsmart
api
'
,
component
:
SettingsmartapiComponent
},
{
path
:
'
settingsmart
harvester
'
,
component
:
SettingsmartapiComponent
},
{
path
:
'
swaggerapi
'
,
component
:
SwaggereditorComponent
},
{
path
:
'
elasticsearch
'
,
component
:
ElasticsearchComponent
},
{
path
:
'
publishapi
'
,
component
:
PublishapiComponent
},
...
...
src/app/app.component.html
View file @
dfe93a32
...
...
@@ -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=
"/settingsmart
api
"
routerLinkActive=
"active"
>
Smart
API
setting
</button>
<button
mat-menu-item
routerLink=
"/settingsmart
harvester
"
routerLinkActive=
"active"
>
Smart
Harvester
setting
</button>
<button
mat-menu-item
routerLink=
"/elasticsearch"
routerLinkActive=
"active"
>
Elasticsearch setting
</button>
</mat-menu>
</mat-menu>
...
...
src/app/datasets/datasets.component.html
View file @
dfe93a32
...
...
@@ -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>
src/app/datasets/datasets.component.ts
View file @
dfe93a32
...
...
@@ -32,21 +32,23 @@ export class DatasetsComponent implements OnInit {
var
myInit
=
{
method
:
'
GET
'
,
headers
:
myHeaders
};
//appler smart havester pour récuprer l'api à lancer
//app
e
ler smart havester pour récup
e
rer 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\
...
...
src/app/publishapi/publishapi.component.html
View file @
dfe93a32
<p>
publishapi works!
</p>
<button
(click)=
"goToLink()"
>
OpenAPI editor
</button>
<br><br>
<br><br>
...
...
src/app/services/parse-xml.service.ts
View file @
dfe93a32
...
...
@@ -5,6 +5,9 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
@
Injectable
({
providedIn
:
'
root
'
})
export
class
ParseXmlService
{
constructor
(
private
http
:
HttpClient
)
{
}
...
...
src/app/settingsmartapi/settingsmartapi.component.html
View file @
dfe93a32
...
...
@@ -9,7 +9,7 @@
<div>
<br>
<button
type=
"submit"
class=
"btn btn-primary"
>
Save Smart
Api
setting
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
Save Smart
Harvester
setting
</button>
</div>
</form>
\ No newline at end of file
src/environments/environment.prod.ts
View file @
dfe93a32
...
...
@@ -3,5 +3,5 @@ import { ApiService } from 'src/app/api.service';
export
const
environment
=
{
production
:
true
,
apiurl
:
'
sandbox9.cines.fr
'
,
token
:
'
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOi
JhN2FkZDNkOS1mZTUwLTQ4ZGEtYTNmNC0zY2I1NjljM2Y5YmE
iLCJpYXQiOjE2MD
AwNzUxMzE
sImV4cCI6MTYwM
TI4NDczMX0.gRLsRdoEeIoqPNSZfegKIzdK1bfF16ALJ6xJPOAkVO
A
'
token
:
'
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOi
I5MjU1NjY3Yi04MmY5LTQ1Y2MtOWE4Mi1jOTE0ZThmMjI4OWY
iLCJpYXQiOjE2MD
E4ODcwNTQ
sImV4cCI6MTYwM
zA5NjY1NH0.26TS5m7t3sInRgdJ6kH4ocU2sB3j9I-3uHAHU4Wt4g
A
'
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment