Revision 58298
Added by Serafeim Chatzopoulos about 4 years ago
searchResearchResults.service.ts | ||
---|---|---|
29 | 29 |
url += "&sortBy=" + sortBy; |
30 | 30 |
} |
31 | 31 |
url += "&page="+(page-1)+"&size="+size+"&format=json"; |
32 |
|
|
32 |
|
|
33 | 33 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
34 | 34 |
.pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")])); |
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
searchById (resultType:string, id: string, properties:EnvProperties ):any { |
38 | 38 |
let url = properties.searchAPIURLLAst+this.getEntityName(resultType,true) +"/"+id+"?format=json"; |
39 |
|
|
39 |
|
|
40 | 40 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
41 | 41 |
.pipe(map(res => this.parseResults(resultType, res, properties))); |
42 | 42 |
} |
... | ... | |
105 | 105 |
let link = properties.searchAPIURLLAst; |
106 | 106 |
let url = link+params+"/"+this.getEntityName(resultType,true)+ "?format=json"; |
107 | 107 |
url += "&page="+(page-1)+"&size="+size; |
108 |
|
|
108 |
|
|
109 | 109 |
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
110 | 110 |
.pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)])); |
111 | 111 |
} |
... | ... | |
124 | 124 |
|
125 | 125 |
for(let i=0; i<length; i++) { |
126 | 126 |
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result']; |
127 |
|
|
127 |
// console.log("line: ",i," resData: ",resData); //ATHENA CODE |
|
128 | 128 |
var result: SearchResult = new SearchResult(); |
129 | 129 |
result.entityType = resultType; |
130 | 130 |
|
... | ... | |
137 | 137 |
for(let i=0; i<length; i++) { |
138 | 138 |
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance']; |
139 | 139 |
this.parsingFunctions.parseTypes(result.types, types, instance); |
140 |
// console.log("line: ",i," instance: ",instance); //ATHENA CODE |
|
140 | 141 |
} |
141 |
|
|
142 |
/////////////////////////// Athena Code /////////////////////////// |
|
143 |
// var dois_concat = ''; |
|
144 |
// console.log("line: ",i," pid: ",resData['pid']); |
|
145 |
for(let i=0; i<resData['pid'].length; i++){ |
|
146 |
|
|
147 |
if(resData['pid'][i].classid == 'doi'){ |
|
148 |
// result.DOI = new Array<string>(); |
|
149 |
// console.log(resData['pid'][i].classid," => ",resData['pid'][i].content.replace("https://doi.org/","")); |
|
150 |
// result.DOI.push(resData['pid'][i].content.replace("https://doi.org/","")) // |
|
151 |
// result.DOI[i] = (resData['pid'][i].content.replace("https://doi.org/","")); |
|
152 |
if(resData['pid'][i].content != '' && resData['pid'][i].content != null){ |
|
153 |
result.DOI = resData['pid'][i].content.replace("https://doi.org/",""); |
|
154 |
} |
|
155 |
|
|
156 |
// console.log(result); |
|
157 |
// console.log("length of resData: ", resData['pid'].length); |
|
158 |
// console.log("doi: ", resData['pid'][i].content); |
|
159 |
// if(i == resData['pid'].length - 1){ |
|
160 |
// dois_concat += resData['pid'][i].content.replace("https://doi.org/","")+","; |
|
161 |
// }else{ |
|
162 |
// dois_concat += resData['pid'][i].content.replace("https://doi.org/",""); |
|
163 |
// } |
|
164 |
} |
|
165 |
|
|
166 |
} |
|
167 |
// console.log("dois unencoded: ",dois_concat); |
|
168 |
// console.log("dois ",encodeURIComponent(dois_concat)); |
|
169 |
/////////////////////////// Athena Code /////////////////////////// |
|
142 | 170 |
if(resData['programmingLanguage'] && resData['programmingLanguage'] != null) { |
143 | 171 |
result.programmingLanguages = new Array<string>(); |
144 | 172 |
|
Also available in: Unified diff
Add impact indicators on research dashboard