redesign develop page, update submodules
This commit is contained in:
parent
a36c695d2b
commit
623c5fbc6e
|
@ -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: `
|
||||
<div page-content>
|
||||
<div inner>
|
||||
<div *ngIf="aggregator" class="uk-container uk-container-large uk-section-small">
|
||||
<h2 class="uk-text-center">
|
||||
Develop
|
||||
</h2>
|
||||
<div class="uk-margin-medium-top uk-card uk-card-body uk-card-default">
|
||||
<h3 class="uk-text-center">Help developers with <span
|
||||
class="portal-color uk-text-bold">OpenAIRE APIs</span>
|
||||
</h3>
|
||||
<div class="uk-margin-large-top uk-margin-medium-bottom">
|
||||
Not sure where to start? Let us give you some guides and request examples.
|
||||
</div>
|
||||
<p>
|
||||
<span class="uk-text-bold">For research outcomes </span>
|
||||
(publications, datasets, software and other research data) you can use the
|
||||
<a href="https://graph.openaire.eu/develop/api.html" target="_blank">Selective Access APIs</a>
|
||||
by adding the <span class="uk-text-lowercase">country</span> parameter.
|
||||
</p>
|
||||
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-1@s" uk-grid>
|
||||
<div>
|
||||
|
||||
<p>
|
||||
Request examples:
|
||||
</p>
|
||||
<ul class="portal-circle">
|
||||
<li>
|
||||
<span class="uk-text-bold">Access “Publications”</span><br>
|
||||
<span class="uk-text-bold">GET</span>
|
||||
<span
|
||||
class="uk-text-break space">https://api.openaire.eu/search/publications?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="uk-text-bold">Access “Open Access Publications”</span><br>
|
||||
<span class="uk-text-bold">GET</span>
|
||||
<span
|
||||
class="uk-text-break space">http://api.openaire.eu/search/publications?country={{aggregator.valueId}}&OA=true</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="uk-text-bold">Access “Datasets”</span><br>
|
||||
<span class="uk-text-bold">GET</span>
|
||||
<span
|
||||
class="uk-text-break space">https://api.openaire.eu/search/datasets?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="uk-text-bold">Access “Software”</span><br>
|
||||
<span class="uk-text-bold">GET</span>
|
||||
<span
|
||||
class="uk-text-break space">https://api.openaire.eu/search/software?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="uk-text-bold">Access “Other Research”</span><br>
|
||||
<span class="uk-text-bold">GET</span>
|
||||
<span
|
||||
class="uk-text-break space">https://api.openaire.eu/search/other?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<div class="uk-flex uk-flex-center uk-width-1-1 uk-margin-medium-top">
|
||||
<img width="350" src="assets/develop.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-large-top uk-flex uk-flex-center uk-padding">
|
||||
<div class="documentation">
|
||||
For <span
|
||||
class="uk-text-bold">more information</span> on the full potential of the OpenAIRE APIs please check
|
||||
the <a href="https://graph.openaire.eu/develop" target="_blank">OpenAIRE API Documentation</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-section">
|
||||
<div class="uk-container uk-container-large">
|
||||
<h1>OpenAIRE APIs<br> for developers<span class="uk-text-primary">.</span></h1>
|
||||
</div>
|
||||
<div class="uk-section uk-container uk-container-large">
|
||||
<div class="uk-grid uk-grid-large uk-child-width-1-2@m" uk-grid>
|
||||
<div class="uk-text-center uk-margin-large-top">
|
||||
<div class="uk-width-2-3@m uk-margin-auto@m">
|
||||
<div class="uk-icon-bg-shadow uk-icon-bg-shadow-large uk-margin-auto">
|
||||
<icon name="description" customClass="uk-text-background" [flex]="true" ratio="2.5" type="outlined" visuallyHidden="For {{openaireEntities.RESULTS}}"></icon>
|
||||
</div>
|
||||
<h3>For {{openaireEntities.RESULTS | lowercase}}</h3>
|
||||
<div class="uk-margin-bottom">
|
||||
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.
|
||||
</div>
|
||||
<a class="uk-display-inline-block uk-button uk-button-text"
|
||||
href="https://graph.openaire.eu/develop/api.html" target="_blank">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<span>Selective Access APIs</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-large-top">
|
||||
<div class="uk-margin-top">
|
||||
<div>Request examples:</div>
|
||||
<ul class="uk-list uk-list-large uk-list-bullet uk-list-primary">
|
||||
<li>
|
||||
<span>Access all </span><span class="uk-text-bolder">{{openaireEntities.RESULTS}}</span> ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}})<br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="">https://api.openaire.eu/search/researchProducts?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Access </span><span class="uk-text-bolder">{{openaireEntities.PUBLICATIONS}}</span><br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="">https://api.openaire.eu/search/publications?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Access </span> <span class="uk-text-bolder">Open Access {{openaireEntities.PUBLICATIONS}}</span><br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="uk-text-break">http://api.openaire.eu/search/publications?country={{aggregator.valueId}}&OA=true</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Access </span><span class="uk-text-bolder">{{openaireEntities.DATASETS}}</span><br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="uk-text-break">https://api.openaire.eu/search/datasets?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Access </span><span class="uk-text-bolder">{{openaireEntities.SOFTWARE}}</span><br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="uk-text-break">https://api.openaire.eu/search/software?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>Access </span><span class="uk-text-bolder">{{openaireEntities.OTHER}}</span><br>
|
||||
<span class="uk-text-bold uk-margin-small-right">GET</span>
|
||||
<span class="uk-text-break">https://api.openaire.eu/search/other?country={{aggregator.valueId}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
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}});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 35ab282e53ad5b7790bc431820a4400cfc36c977
|
||||
Subproject commit c2bf664ce363f49f64ca5b05f3456dd902dcad5b
|
Loading…
Reference in New Issue