Project landing page: Functionalities for 'Software' in APP BOX added -- no changes or additions in display | HtmlProjectReport: case for type=='Software' added in component and service

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@49957 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-11-20 11:50:23 +00:00
parent 90c459ad7f
commit 66c89f8584
3 changed files with 54 additions and 10 deletions

View File

@ -76,14 +76,21 @@ export class HtmlProjectReportComponent{
this.showLoading = false;
this.warningMessage="Requested size is not an integer";
}
console.info(params['type']);
if(params['type'] && (params['type'] == "dataset" || params['type'] == "publication")){
this.resultsType = (params['type'] == "dataset") ? 'research data' : params['type'];
if(params['type'] && (params['type'] == "publication" || params['type'] == "dataset" || params['type'] == "software")){
if(params['type'] == "publication") {
this.resultsType = 'publication';
} else if(params['type'] == "dataset") {
this.resultsType = 'research data';
} else if(params['type'] == "software") {
this.resultsType = 'software';
}
this.updateTitle("Project's "+this.resultsType+" report");
this.updateDescription("project, project "+ this.resultsType +" report, funding, open access, publications, research data");
this.updateDescription("project, project "+ this.resultsType +" report, funding, open access, publications, research data, software");
} else {
this.showLoading = false;
this.warningMessage="Requested type should be publication or research data";
this.warningMessage="Requested type should be publication or research data or software";
}
//showLoading is true if no warnings
@ -130,7 +137,13 @@ console.info(params['type']);
}
);
this.header2 = this.totalResults+((this.resultsType == "publication")?" publications":" research data");
if(this.resultsType == "publication") {
this.header2 += this.totalResults + " publications";
} else if(this.resultsType == "research data") {
this.header2 += this.totalResults + " research data";
} else if(this.resultsType == "software") {
this.header2 += this.totalResults + " software";
}
}
private createClipboard() {
@ -170,7 +183,13 @@ console.info(params['type']);
}
createHeader1(data: {"title": string, "acronym": string, "callIdentifier": string}) {
this.header1 = ((this.resultsType == "publication")?"Publications":"Research Data") + " of Project ";
if(this.resultsType == "publication") {
this.header1 += "Publications";
} else if(this.resultsType == "research data") {
this.header1 += "Research Data";
} else if(this.resultsType == "software") {
this.header1 += "Software";
}
if(data != undefined) {
if(data.title != undefined && data.title != "") {

View File

@ -12,8 +12,19 @@ export class HtmlProjectReportService {
getHTML(id: string, size: number, type:string):any {
console.info("getHTML in service");
let resultTypeId: string = (type == "research data") ? 'dataset' : type;
let requestType: string = (resultTypeId == "dataset") ? 'datasets' : 'publications';
let resultTypeId: string;
let requestType: string;
if(type == "publication") {
resultTypeId = 'publication';
requestType = 'publications';
} else if(type == "research data") {
resultTypeId = 'dataset';
requestType = 'datasets';
} else if(type == "software") {
resultTypeId = 'software';
requestType = 'software'
}
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
let url = OpenaireProperties.getCsvAPIURL();
url += 'resources?format=html&page=0&size='+size+'&type='+requestType+'&query=(((oaftype exact result) and (resulttypeid exact '+resultTypeId+')) and (relprojectid exact "'+id+'"))';

View File

@ -46,6 +46,7 @@ export class ProjectComponent{
// HTML variables in APP BOX
public publications_dynamic: string;
public datasets_dynamic: string;
public software_dynamic: string;
public project ;
@ -53,6 +54,7 @@ export class ProjectComponent{
public downloadURLAPI: string;
public csvParams: string;
public csvParamsDatasets: string;
public csvParamsSoftware: string;
// Message variables
public warningMessage = "";
@ -128,6 +130,16 @@ export class ProjectComponent{
+ "\n-->"
+ "\n</script>";
this.software_dynamic =
"<script type=\"text/javascript\">"
+ "\n<!--"
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
+ "\ndocument.write('<script type=\"text/javascript\""
+ "\nsrc=\"https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId="
+ this.projectId + "&type=software\"></script>');"
+ "\n-->"
+ "\n</script>";
this.getProjectInfo(this.projectId);
this.searchPublications();
this.fetchDatasets.getNumForEntity("project", this.projectId);
@ -142,6 +154,7 @@ export class ProjectComponent{
this.createClipboard();
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
this.csvParamsDatasets = "format=csv-special&page=0&type=datasets&query=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact "+this.projectId+"))&size=";
this.csvParamsSoftware = "format=csv-special&page=0&type=software&query=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact "+this.projectId+"))&size=";
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
@ -166,11 +179,12 @@ export class ProjectComponent{
private createClipboard() {
if(typeof window !== 'undefined') {
let publ_clipboard, datasets_clipboard;
let publ_clipboard, datasets_clipboard, software_clipboard;
let Clipboard;
Clipboard = require('clipboard');
publ_clipboard = new Clipboard('.publ_clipboard_btn');
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
software_clipboard = new Clipboard('.software_clipboard_btn');
}
}