Revision 47004
Added by Argiro Kokogiannaki about 7 years ago
modules/uoa-services-portal/trunk/portal-2/src/app/utils/properties/openaireProperties.ts | ||
---|---|---|
34 | 34 |
private static loginAPIURL = "http://mpagasas.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/api/users/authenticates"; |
35 | 35 |
|
36 | 36 |
// public claimsAPIURL = "http://rudie.di.uoa.gr:8080/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/" |
37 |
private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/";
|
|
37 |
private static claimsAPIURL = "https://scoobydoo.di.uoa.gr:8443/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/";
|
|
38 | 38 |
|
39 |
// private static searchAPIURL = " http://beta.services.openaire.eu/search/v2/api/"; |
|
39 |
// private static searchAPIURL = " https://beta.services.openaire.eu/search/v2/api/";
|
|
40 | 40 |
// private searchAPIURL = "http://beta.services.openaire.eu/search/v2.0/api/"; |
41 |
private static searchAPIURL = "http://beta.services.openaire.eu/search/v2/api/"; |
|
41 |
private static searchAPIURL = "https://beta.services.openaire.eu/search/v2/api/";
|
|
42 | 42 |
//"http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
43 | 43 |
|
44 |
// private static searchAPIURLLAst = " http://beta.services.openaire.eu/search/v2/api/"; |
|
45 |
private static searchAPIURLLAst = "http://beta.services.openaire.eu/search/v2/api/"; |
|
44 |
// private static searchAPIURLLAst = " https://beta.services.openaire.eu/search/v2/api/";
|
|
45 |
private static searchAPIURLLAst = "https://beta.services.openaire.eu/search/v2/api/";
|
|
46 | 46 |
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
47 | 47 |
//private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; |
48 | 48 |
|
49 |
// private static searchResourcesAPIURL = " http://beta.services.openaire.eu/search/v2/api/resources"; |
|
50 |
private static searchResourcesAPIURL = "http://beta.services.openaire.eu/search/v2/api/resources"; |
|
49 |
// private static searchResourcesAPIURL = " https://beta.services.openaire.eu/search/v2/api/resources";
|
|
50 |
private static searchResourcesAPIURL = "https://beta.services.openaire.eu/search/v2/api/resources";
|
|
51 | 51 |
|
52 | 52 |
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; |
53 | 53 |
private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/rest/"; |
54 | 54 |
// private static searchServiveURL = "http://services.openaire.eu:8380/search/"; |
55 | 55 |
// private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/"; |
56 | 56 |
|
57 |
private static csvAPIURL = "http://beta.services.openaire.eu/search/v2/api/";//publications?format=csv |
|
57 |
private static csvAPIURL = "https://beta.services.openaire.eu/search/v2/api/";//publications?format=csv
|
|
58 | 58 |
|
59 | 59 |
private static searchCrossrefAPIURL = "http://api.crossref.org/works"; |
60 | 60 |
private static searchDataciteAPIURL = "https://search.datacite.org/api"; |
... | ... | |
62 | 62 |
|
63 | 63 |
// Identifiers |
64 | 64 |
private static pmidURL = "http://www.ncbi.nlm.nih.gov/pubmed/"; |
65 |
private static doiURL = "http://dx.doi.org/"; |
|
65 |
private static doiURL = "https://dx.doi.org/";
|
|
66 | 66 |
private static cordisURL = "http://cordis.europa.eu/projects/"; |
67 | 67 |
private static pmcURL = "http://europepmc.org/articles/"; |
68 | 68 |
|
modules/uoa-services-portal/trunk/portal-2/src/app/claims/claim-utils/service/claims.service.ts | ||
---|---|---|
112 | 112 |
.catch(this.handleError); |
113 | 113 |
|
114 | 114 |
} |
115 |
insertDirectRecords(records,token:string):any{ |
|
116 |
console.warn('Trying to feedrecords : '+records); |
|
117 |
let url = this.baseUrl +"feed/bulk"+"?token="+token; |
|
118 |
let body = JSON.stringify( records ); |
|
119 |
console.warn('Json body: : '+body); |
|
120 |
let headers = new Headers({ 'Content-Type': 'application/json' }); |
|
121 |
let options = new RequestOptions({ headers: headers }); |
|
122 |
return this.http.post(url, body, options) |
|
123 |
.map(res => res.json()) |
|
124 |
.do(request => console.info("Insert Response:"+request.status) ) |
|
125 |
.catch(this.handleError); |
|
115 | 126 |
|
127 |
} |
|
116 | 128 |
private handleError (error: Response) { |
117 | 129 |
// in a real world app, we may send the error to some remote logging infrastructure |
118 | 130 |
// instead of just logging it to the console |
modules/uoa-services-portal/trunk/portal-2/src/app/claims/linking/insertClaim/insertClaim.component.ts | ||
---|---|---|
54 | 54 |
public claims:number = 0; |
55 | 55 |
public errorclaims:number = 0; |
56 | 56 |
|
57 |
private servicesRespond:number = 0; |
|
58 |
private insertedClaims=[]; |
|
59 |
private errorInClaims=[]; |
|
60 |
private insertedRecords=[]; |
|
61 |
private errorInRecords=[]; |
|
57 | 62 |
public validateInsertions(){ |
58 | 63 |
// console.info("Inlineentity:" +(this.inlineEntity)?this.inlineEntity+(this.inlineEntity.id)?this.inlineEntity.id:"no id":"null"+ + " show "+ (!this.claiming && this.showButton) ); |
59 | 64 |
if(this.validate()){ |
... | ... | |
65 | 70 |
return |
66 | 71 |
} |
67 | 72 |
private insert(){ |
73 |
this.servicesRespond = 0; |
|
74 |
this.insertedClaims=[]; |
|
75 |
this.errorInClaims=[]; |
|
76 |
this.insertedRecords=[]; |
|
77 |
this.errorInRecords=[]; |
|
68 | 78 |
if(!Session.isValidAndRemove()){ |
69 | 79 |
this.showButton = false; |
70 | 80 |
localStorage.setItem("projects", JSON.stringify(this.projects)); |
... | ... | |
89 | 99 |
for (var i = 0; i < this.results.length; i++) { |
90 | 100 |
var result=this.results[i]; |
91 | 101 |
if(["crossref","datacite","orcid"].indexOf(result.source) != -1){ |
92 |
directclaims.push(this.createDirectClaim(result,this.projects,this.contexts));
|
|
102 |
directclaims.push({"id":result.id, "record":this.createDirectClaim(result,this.projects,this.contexts)});
|
|
93 | 103 |
} |
94 | 104 |
if(this.contexts){ |
95 | 105 |
for (var j = 0; j < this.contexts.length; j++) { |
... | ... | |
112 | 122 |
|
113 | 123 |
} |
114 | 124 |
} |
115 |
var created =[]; |
|
116 |
var failed =[]; |
|
125 |
// var created =[];
|
|
126 |
// var failed =[];
|
|
117 | 127 |
console.info("\n\ndirectclaims: "+directclaims.length+"\n\n"); |
118 |
for(var i = 0; i<directclaims.length; i++){ |
|
119 |
// console.info("\n\ntry to direct insert: "+JSON.stringify(directclaims[i])+"\n\n"); |
|
128 |
// for(var i = 0; i<directclaims.length; i++){ |
|
129 |
// // console.info("\n\ntry to direct insert: "+JSON.stringify(directclaims[i])+"\n\n"); |
|
130 |
// |
|
131 |
// this.directIndexClaimService.directClaim(directclaims[i]).subscribe( |
|
132 |
// data => { |
|
133 |
// console.log("AAA" + data); |
|
134 |
// created.push(directclaims[i].originalId) |
|
135 |
// }, |
|
136 |
// err => { |
|
137 |
// console.log(err); |
|
138 |
// failed.push(directclaims[i].originalId) |
|
139 |
// if(failed.length + created.length == directclaims.length){ |
|
140 |
// console.log("failed:"+failed); |
|
141 |
// console.log("created:"+created); |
|
142 |
// |
|
143 |
// } |
|
144 |
// } |
|
145 |
// ); |
|
146 |
// } |
|
120 | 147 |
|
121 |
this.directIndexClaimService.directClaim(directclaims[i]).subscribe( |
|
122 |
data => { |
|
123 |
console.log("AAA" + data); |
|
124 |
created.push(directclaims[i].originalId) |
|
125 |
}, |
|
126 |
err => { |
|
127 |
console.log(err); |
|
128 |
failed.push(directclaims[i].originalId) |
|
129 |
if(failed.length + created.length == directclaims.length){ |
|
130 |
console.log("failed:"+failed); |
|
131 |
console.log("created:"+created); |
|
148 |
this.claimService.insertDirectRecords(directclaims,token).subscribe( |
|
149 |
data => { |
|
150 |
this.insertedRecords = data.insertedIds; |
|
132 | 151 |
|
133 |
} |
|
134 |
} |
|
135 |
); |
|
136 |
} |
|
152 |
this.errorInRecords = data.insertedIds; |
|
153 |
this.afterclaimsInsertion(); |
|
154 |
}, |
|
155 |
err => { |
|
156 |
console.log(err); |
|
157 |
this.insertedRecords = err.insertedIds; |
|
158 |
|
|
159 |
this.errorInRecords = err.insertedIds; |
|
160 |
this.errorsInClaimsInsertion(); |
|
161 |
} |
|
162 |
); |
|
137 | 163 |
console.info("try to insert "+claims.length+" claims"); |
138 | 164 |
this.claimService.insertBulkClaims(claims,token).subscribe( |
139 | 165 |
data => { |
140 |
var inserted = data.insertedIds.length;
|
|
166 |
this.insertedClaims = data.insertedIds;
|
|
141 | 167 |
|
142 |
var inserted = data.insertedIds.length;
|
|
143 |
this.afterclaimsInsertion(data.insertedIds,data.errorInClaims);
|
|
168 |
this.errorclaims = data.insertedIds;
|
|
169 |
this.afterclaimsInsertion(); |
|
144 | 170 |
}, |
145 | 171 |
err => { |
146 | 172 |
console.log(err); |
147 |
this.errorsInClaimsInsertion(err.insertedIds,err.errorInClaims); |
|
173 |
this.insertedClaims = err.insertedIds; |
|
174 |
|
|
175 |
this.errorclaims = err.insertedIds; |
|
176 |
this.errorsInClaimsInsertion(); |
|
148 | 177 |
} |
149 | 178 |
); |
150 | 179 |
} |
... | ... | |
201 | 230 |
|
202 | 231 |
return true; |
203 | 232 |
} |
204 |
private afterclaimsInsertion(insertedIds, errorInClaims){ |
|
205 |
this.loading.close(); |
|
206 |
this.claiming = false; |
|
207 |
if(errorInClaims.length == 0 && insertedIds.length > 0 ){ |
|
208 |
// if(this.inline){ |
|
209 |
// this.show = "end"; |
|
210 |
// }else{ |
|
211 |
this._router.navigate( ['/myclaims'] ); |
|
212 |
// } |
|
213 |
this.showChange.emit({ |
|
214 |
value: this.show |
|
215 |
}); |
|
216 |
}else{ |
|
217 |
this.errorsInClaimsInsertion(insertedIds, errorInClaims); |
|
233 |
private afterclaimsInsertion(){ |
|
234 |
this.servicesRespond++; |
|
235 |
if(this.servicesRespond == 2){ |
|
236 |
this.loading.close(); |
|
237 |
this.claiming = false; |
|
238 |
if(this.errorInClaims.length == 0 && this.insertedClaims.length > 0 && this.errorInRecords.length == 0){ |
|
239 |
// if(this.inline){ |
|
240 |
// this.show = "end"; |
|
241 |
// }else{ |
|
242 |
this._router.navigate( ['/myclaims'] ); |
|
243 |
// } |
|
244 |
this.showChange.emit({ |
|
245 |
value: this.show |
|
246 |
}); |
|
247 |
}else{ |
|
248 |
this.errorsInClaimsInsertion(); |
|
249 |
} |
|
218 | 250 |
} |
219 | 251 |
} |
220 |
private errorsInClaimsInsertion(insertedIds, errorInClaims){
|
|
252 |
private errorsInClaimsInsertion(){ |
|
221 | 253 |
this.errorMessage = "An Error Occured."; |
222 | 254 |
this.loading.close(); |
223 | 255 |
this.error = true; |
224 | 256 |
this.claiming = false; |
225 | 257 |
this.showButton = true; |
258 |
var text ="" |
|
259 |
if(this.errorInRecords.length>0){ |
|
260 |
text+="The following records couldn't automatically inserted to the Openaire Info space: <br>"; |
|
261 |
for(var i=0; i< this.errorInRecords.length ; i++){ |
|
262 |
for(var k=0; k< this.results.length ; k++){ |
|
263 |
if(this.results[k].id == this.errorInRecords[i]){ |
|
264 |
text+=""+this.results[i].title+" url:"+this.results[i].url+" from "+this.results[i].source; |
|
265 |
} |
|
266 |
} |
|
267 |
} |
|
268 |
|
|
269 |
} |
|
270 |
if(this.errorsInClaimsInsertion.length > 0){ |
|
271 |
text+="The following couldn't be saved: <br>"; |
|
272 |
for(var i=0; i< this.errorsInClaimsInsertion.length ; i++){ |
|
273 |
text+="The following couldn't be saved: <br>"; |
|
274 |
|
|
275 |
} |
|
276 |
} |
|
226 | 277 |
// if(this.inline){ |
227 | 278 |
// this.show = "error"; |
228 | 279 |
// this.showChange.emit({ |
... | ... | |
306 | 357 |
} |
307 | 358 |
var json = JSON.stringify(entity); |
308 | 359 |
console.log("\nJSON:\n"+json); |
309 |
return json;
|
|
360 |
return entity;
|
|
310 | 361 |
|
311 | 362 |
/* |
312 | 363 |
{ |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/dataset/dataset.component.html | ||
---|---|---|
39 | 39 |
|
40 | 40 |
<div class="uk-clearfix uk-margin-top uk-margin-bottom"> |
41 | 41 |
|
42 |
<!--a class="uk-float-right uk-button" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Links to research Results</a-->
|
|
42 |
<a class="uk-float-right uk-button" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Links to research Results</a>
|
|
43 | 43 |
</div> |
44 | 44 |
<ul class="uk-tab" data-uk-switcher="{connect:'#tab-content'}"> |
45 | 45 |
<li class="uk-active"> |
... | ... | |
198 | 198 |
</span> |
199 | 199 |
</div> |
200 | 200 |
</dd> |
201 |
<!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to projects</a></dd-->
|
|
201 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to projects</a></dd>
|
|
202 | 202 |
<dd *ngIf="showAllFundedBy" class="uk-text-right"> |
203 | 203 |
<a class="uk-text-muted" (click)="showAllFundedBy = !showAllFundedBy;"> |
204 | 204 |
View less |
... | ... | |
228 | 228 |
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> |
229 | 229 |
</mark> |
230 | 230 |
</dd> |
231 |
<!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to contexts</a></dd-->
|
|
231 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[datasetId,'dataset','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to contexts</a></dd>
|
|
232 | 232 |
</dl> |
233 | 233 |
|
234 | 234 |
</li> |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.component.html | ||
---|---|---|
221 | 221 |
<span>{{projectInfo.funder}} progress report (CSV)</span> |
222 | 222 |
</span> |
223 | 223 |
</li> |
224 |
<!--li>
|
|
224 |
<li> |
|
225 | 225 |
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId,'project','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> |
226 | 226 |
Link to research results |
227 | 227 |
</a> |
228 |
</li-->
|
|
228 |
</li> |
|
229 | 229 |
<li> |
230 | 230 |
<a routerLinkActive="router-link-active" routerLink="/participate/deposit-publications"> |
231 | 231 |
Deposit Publications |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/publication/publication.component.html | ||
---|---|---|
55 | 55 |
<div class="uk-text-justify">{{publicationInfo.description}}</div> |
56 | 56 |
</blockquote> |
57 | 57 |
|
58 |
<!--div class="uk-clearfix uk-margin-top uk-margin-bottom">
|
|
58 |
<div class="uk-clearfix uk-margin-top uk-margin-bottom"> |
|
59 | 59 |
|
60 | 60 |
<a class="uk-float-right uk-button" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','result'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Links to research Results</a> |
61 |
</div-->
|
|
61 |
</div> |
|
62 | 62 |
|
63 | 63 |
<ul class="uk-tab" data-uk-switcher="{connect: '#tab-content'}"> |
64 | 64 |
<li class="uk-active"> |
... | ... | |
470 | 470 |
View more |
471 | 471 |
</a> |
472 | 472 |
</dd> |
473 |
<!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to projects</a></dd-->
|
|
473 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','project'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to projects</a></dd>
|
|
474 | 474 |
</dl> |
475 | 475 |
</li> |
476 | 476 |
|
... | ... | |
489 | 489 |
<span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span> |
490 | 490 |
</mark> |
491 | 491 |
</dd> |
492 |
<!--dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to contexts</a></dd-->
|
|
492 |
<dd><a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','context'])" routerLinkActive="router-link-active" routerLink="/participate/direct-claim" > <i class="uk-icon-link"></i> Add links to contexts</a></dd>
|
|
493 | 493 |
</dl> |
494 | 494 |
|
495 | 495 |
</li> |
Also available in: Unified diff
add claims API methods for direct claims | uncomment links to direct linking page from landing pages | add https in some APIs