JsonLD changes:

Remove server check, get page url using baseurl and pass it as parameter 
	using  location for server wont work


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52703 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-07-06 12:13:37 +00:00
parent 456eb136e5
commit 9089563538
5 changed files with 7 additions and 8 deletions

View File

@ -10,7 +10,7 @@
<div *ngIf="datasetInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record></schema2jsonld>
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record [URL]="properties.baseLink+'/search/dataset?datasetId='+datasetId"></schema2jsonld>
<showTitle [titleName]="datasetInfo.title"></showTitle>
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>

View File

@ -9,6 +9,7 @@ import { JsonldDocumentSerializerService } from './service/jsonld-document-seria
})
export class Schema2jsonldComponent {
@Input() data;
@Input() URL;
json;
constructor( private documentParser: OpenAireJsonldConverterService,
private documentSerializer: JsonldDocumentSerializerService) {
@ -16,10 +17,8 @@ json;
}
ngOnInit() {
if(typeof window !== 'undefined') {
const docOvject = this.documentParser.convertPublication(this.data);
const docOvject = this.documentParser.convertPublication(this.data, this.URL);
this.json = this.documentSerializer.serialize(docOvject);
}
}

View File

@ -6,13 +6,13 @@ import * as _ from "lodash";
export class OpenAireJsonldConverterService {
constructor() { }
convertPublication(result: any): JsonldDocument {
convertPublication(result: any, URL): JsonldDocument {
const doc = new JsonldDocument();
doc.title = this.getTitle(result);
doc.description = this.getDescription(result);
doc.identifier = this.getIdentifier(result);
doc.url = [window.location.toString()];
doc.url = URL;
doc.sameAs = this.getSameAs(result);
doc.creator = this.getCreator(result);
doc.dateCreated = this.getDateCreated(result);

View File

@ -9,7 +9,7 @@
<div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record></schema2jsonld>
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record [URL]="properties.baseLink+'/search/publication?articleId='+articleId"></schema2jsonld>
<showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"class="uk-label custom-label label-blue label-publication" title="Type">{{publicationInfo.types.join(", ")}}</span>
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{publicationInfo.languages.join(", ")}}</span>

View File

@ -10,7 +10,7 @@
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record></schema2jsonld>
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record [URL]="properties.baseLink+'/search/software?softwareId='+softwareId"></schema2jsonld>
<showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>