diff --git a/src/app/develop/develop.component.ts b/src/app/develop/develop.component.ts index ceb6ad6..7419bb2 100644 --- a/src/app/develop/develop.component.ts +++ b/src/app/develop/develop.component.ts @@ -7,91 +7,82 @@ import {AggregatorInfo, PortalAggregators} from "../utils/aggregators"; import {ConnectHelper} from "../openaireLibrary/connect/connectHelper"; import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; import {Subscription} from "rxjs"; +import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields"; @Component({ selector: 'develop', template: ` -
-
-
-

- Develop -

-
-

Help developers with OpenAIRE APIs -

-
- Not sure where to start? Let us give you some guides and request examples. -
-

- For research outcomes - (publications, datasets, software and other research data) you can use the - Selective Access APIs - by adding the country parameter. -

-
-
- -

- Request examples: -

-
    -
  • - Access “Publications”
    - GET - https://api.openaire.eu/search/publications?country={{aggregator.valueId}} -
  • -
  • - Access “Open Access Publications”
    - GET - http://api.openaire.eu/search/publications?country={{aggregator.valueId}}&OA=true -
  • -
  • - Access “Datasets”
    - GET - https://api.openaire.eu/search/datasets?country={{aggregator.valueId}} -
  • -
  • - Access “Software”
    - GET - https://api.openaire.eu/search/software?country={{aggregator.valueId}} -
  • -
  • - Access “Other Research”
    - GET - https://api.openaire.eu/search/other?country={{aggregator.valueId}} -
  • -
-
-
-
- -
-
-
-
-
- For more information on the full potential of the OpenAIRE APIs please check - the OpenAIRE API Documentation. -
-
-
-
-
-
+
+
+

OpenAIRE APIs
for developers.

+
+
+
+
+
+
+ +
+

For {{openaireEntities.RESULTS | lowercase}}

+
+ For {{openaireEntities.RESULTS | lowercase}} ({{openaireEntities.PUBLICATIONS | lowercase}}, {{openaireEntities.DATASETS | lowercase}}, {{openaireEntities.SOFTWARE | lowercase}} and {{openaireEntities.OTHER | lowercase}}) you can use the Selective Access APIs by adding the community parameter. +
+ + + Selective Access APIs + + +
+
+
+
+
Request examples:
+
    +
  • + Access all {{openaireEntities.RESULTS}} ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}})
    + GET + https://api.openaire.eu/search/researchProducts?country={{aggregator.valueId}} +
  • +
  • + Access {{openaireEntities.PUBLICATIONS}}
    + GET + https://api.openaire.eu/search/publications?country={{aggregator.valueId}} +
  • +
  • + Access Open Access {{openaireEntities.PUBLICATIONS}}
    + GET + http://api.openaire.eu/search/publications?country={{aggregator.valueId}}&OA=true +
  • +
  • + Access {{openaireEntities.DATASETS}}
    + GET + https://api.openaire.eu/search/datasets?country={{aggregator.valueId}} +
  • +
  • + Access {{openaireEntities.SOFTWARE}}
    + GET + https://api.openaire.eu/search/software?country={{aggregator.valueId}} +
  • +
  • + Access {{openaireEntities.OTHER}}
    + GET + https://api.openaire.eu/search/other?country={{aggregator.valueId}} +
  • +
+
+
+
+
+
`, styleUrls: ['develop.component.css'] }) export class DevelopComponent implements OnInit { public aggregator: AggregatorInfo = null; + public openaireEntities = OpenaireEntities; + subs: Subscription[] = []; constructor(private seoService: SEOService, @@ -105,34 +96,29 @@ export class DevelopComponent implements OnInit { } } ngOnInit() { - - let id = ConnectHelper.getCommunityFromDomain(properties.domain); - this.aggregator = PortalAggregators.getFilterInfoByMenuId(id); - if (this.aggregator) { - - /* Metadata */ - const url = properties.domain + properties.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(url, false); - this._meta.updateTag({content: url}, "property='og:url'"); - const description = "Develop | " + this.aggregator.valueName; - const title = "Develop | " + this.aggregator.valueName; - this._meta.updateTag({content: description}, "name='description'"); - this._meta.updateTag({content: description}, "property='og:description'"); - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - if(properties.enablePiwikTrack && (typeof document !== 'undefined')){ - this.subs.push(this._piwikService.trackView(properties, "OpenAIRE").subscribe()); - } - - }else { - this.navigateToError(); - } - + let id = ConnectHelper.getCommunityFromDomain(properties.domain); + this.aggregator = PortalAggregators.getFilterInfoByMenuId(id); + if (this.aggregator) { + /* Metadata */ + const url = properties.domain + properties.baseLink + this._router.url; + this.seoService.createLinkForCanonicalURL(url, false); + this._meta.updateTag({content: url}, "property='og:url'"); + const description = "Develop | " + this.aggregator.valueName; + const title = "Develop | " + this.aggregator.valueName; + this._meta.updateTag({content: description}, "name='description'"); + this._meta.updateTag({content: description}, "property='og:description'"); + this._meta.updateTag({content: title}, "property='og:title'"); + this._title.setTitle(title); + if(properties.enablePiwikTrack && (typeof document !== 'undefined')){ + this.subs.push(this._piwikService.trackView(properties, "OpenAIRE").subscribe()); + } + }else { + this.navigateToError(); + } } private navigateToError() { this._router.navigate([properties.errorLink], {queryParams: {'page': this._router.url}}); } - } diff --git a/src/app/develop/develop.module.ts b/src/app/develop/develop.module.ts index 73d6fcc..0114f33 100644 --- a/src/app/develop/develop.module.ts +++ b/src/app/develop/develop.module.ts @@ -4,16 +4,17 @@ import {DevelopComponent} from "./develop.component"; import {RouterModule} from "@angular/router"; import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; import {PiwikServiceModule} from "../openaireLibrary/utils/piwik/piwikService.module"; +import {IconsModule} from "../openaireLibrary/utils/icons/icons.module"; @NgModule({ declarations: [DevelopComponent], - imports: [CommonModule,PiwikServiceModule, RouterModule.forChild([ + imports: [CommonModule, PiwikServiceModule, RouterModule.forChild([ { path: '', component: DevelopComponent, canDeactivate: [PreviousRouteRecorder] }, - ])], + ]), IconsModule], exports: [DevelopComponent] }) export class DevelopModule { diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 35ab282..c2bf664 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 35ab282e53ad5b7790bc431820a4400cfc36c977 +Subproject commit c2bf664ce363f49f64ca5b05f3456dd902dcad5b