Project

General

Profile

« Previous | Next » 

Revision 57647

StakeholderCreator:
initialize filters where is posible
monitor page:
apply filters when available
add filters section in html for testing (commented)
Indicator-utils:
create IndicatorPath from URL:
add checks if filters & queries exist
apply parameters when there are more than one queries
add Indicator filters if possible
old Tool:
add basic fields in parameters
fix url

View differences:

stakeholderCreator.ts
87 87

  
88 88
    let n_total = new Indicator("Total "+typePlural,null, "number","small",true, true, [new IndicatorPath(null, "search",
89 89
      "/"+dbTypePlural+"/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", null,["total"])]);
90
    n_total.indicatorPaths[0].filters.set("fundingL0","&fq=relfundinglevel0_name exact "+ChartHelper.prefix+'fundingL0'+ChartHelper.suffix);
91

  
90 92
    pubDefSub.numbers.push(n_total);
91 93
    if( dbType != "publication") {
92 94
      let n_linkedPubs = this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Publications","publication");
......
100 102
    res_timeline.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,typePlural+" timeline","column");
101 103
    res_timeline.indicatorPaths[0].parameters.set("start_year","2008");
102 104
    res_timeline.indicatorPaths[0].parameters.set("end_year","2020");
105
    res_timeline.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
103 106
    pubDefSub.charts.push(res_timeline);
104 107

  
105 108

  
......
109 112
        [new IndicatorPath("column", "stats-tool", "chart?json=",
110 113
          '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.classification","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Type"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
111 114
      res_types.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, typeSingl + " types", "bar");
115
      res_types.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
112 116
      pubDefSub.charts.push(res_types);
113 117
    }
114 118
    let res_access_mode = new Indicator("",null, "chart","small",true, true,[new IndicatorPath("pie", "stats-tool", "chart?json=",
115 119
      '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+typePlural+'","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","query":{"select":[{"field":"'+dbType+'","aggregate":"count"},{"field":"'+dbType+'.access mode","aggregate":null}],"filters":[{"groupFilters":[{"field":"'+dbType+'.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'"},"subtitle":{},"yAxis":{"title":{"text":"'+typePlural+'"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
116 120
    res_access_mode.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,typeSingl+" acccess mode","pie");
121
    res_access_mode.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
117 122
    pubDefSub.charts.push(res_access_mode);
118 123

  
119 124
    if( dbType != "publication") {
120 125
      let res_sci_area = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=",
121 126
        '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Scientific area"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
122 127
      res_sci_area.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, typeSingl + " scientific area", "bar");
128
      res_sci_area.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
123 129
      pubDefSub.charts.push(res_sci_area);
124 130

  
125 131
      let res_programmes = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=",
126 132
        '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.project.funding level 2","type":"!=","values":[" "]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Programmes"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
127 133
      res_programmes.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, typeSingl + " programmes", "bar");
134
      res_programmes.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
128 135
      pubDefSub.charts.push(res_programmes);
129 136
    }
130 137
    //{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research Data","type":"bar","query":{"select":[{"field":"dataset","aggregate":"count"},{"field":"dataset.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"dataset.project.funder","type":"=","values":["European Commission"]}],"op":"AND"}],"entity":"dataset","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Scientific Area"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}
......
165 172
      '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+typePlural+'","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","query":{"name":"monitor.'+ChartHelper.prefix+'id'+ChartHelper.suffix+'.'+dbTypePlural+'.pidtypes"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'"},"subtitle":{},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}', null)]);
166 173
    pid.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,typeSingl+" PIDs","pie");
167 174
    pid.indicatorPaths[0].parameters.set("id",stakeholder.index_shortName.toLowerCase());
175
    pid.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType);
168 176
    pubDefSub.charts.push(pid);
169 177
    return pubDefSub;
170 178
  }
......
238 246
  static createLinkToIndicator(stakeholder:Stakeholder,typePlural, typeSingl, dbType, linkedToName,linkedToType ):Indicator {
239 247
      let n_linkedPubs = new Indicator(typePlural+" linked to "+linkedToName, null, "number", "small", true, true, [new IndicatorPath(null, "search",
240 248
        "/resources?query=" + encodeURIComponent(" ( (oaftype exact result) and (resulttypeid exact " + dbType + ") and (relresulttype="+linkedToType+")  )") + "&fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&page=0&size=0&format=json", null, ["meta", "total"])]);
241

  
249
      n_linkedPubs.indicatorPaths[0].filters.set("fundingL0","&fq=relfundinglevel0_name exact "+ChartHelper.prefix+'fundingL0'+ChartHelper.suffix);
250
      /*
251
    filters.set("start_year",'{"groupFilters":[{"field":"'+dbType+'.year","type":">=","values":["'+ChartHelper.prefix+'start_year'+ChartHelper.suffix+'"]}],"op":"AND"}');
252
    filters.set("end_year",'{"groupFilters":[{"field":"'+dbType+'.year","type":"<=","values":["'+ChartHelper.prefix+'end_year'+ChartHelper.suffix+'"]}],"op":"AND"}');
253
       */
242 254
    return n_linkedPubs;
243 255
  }
244 256
  static createFundingImpactTopic():Topic{

Also available in: Unified diff