Project

General

Profile

« Previous | Next » 

Revision 44406

Deposit Pages for 'Publications' and 'R3data' Repositories seperated | publications and datasets tabs in dataprovider landing page ready | subjects categorized by taxonomy added in publication landing page

View differences:

publication.service.ts
17 17

  
18 18
        return this.http.get(url)
19 19
                    .map(res => <any> res.json())
20
                    .do(res => console.info(res['result']['metadata']['oaf:entity']))
21 20
                    .map(res => res['result']['metadata']['oaf:entity'])
22 21
                    .map(res => [res['oaf:result'],
23 22
                                 res['oaf:result']['title'],
......
190 189
                }
191 190
            }
192 191

  
193
            this.publicationInfo.authors = this.publicationInfo.authors.filter(function (item) {
194
                return (item != undefined);
195
            });
192
            if(this.publicationInfo.authors != undefined) {
193
                this.publicationInfo.authors = this.publicationInfo.authors.filter(function (item) {
194
                    return (item != undefined);
195
                });
196
            }
196 197
        }
197 198

  
198 199
        if(data[3] != null) {
......
400 401
        }
401 402

  
402 403
        if(data[7] != null) {
403
            this.publicationInfo.classifiedSubjects = new Map<string, string[]>();
404
            this.publicationInfo.subjects = new Array<string>();
405

  
406 404
            let mydata;
407 405
            let length = data[7].length!=undefined ? data[7].length : 1;
408 406

  
......
411 409

  
412 410
                if(mydata.classid != "") {
413 411
                    if(mydata.inferred == true) {
414
                        if(!this.publicationInfo.classifiedSubjects.has(mydata.classid)) {
415
                            this.publicationInfo.classifiedSubjects.set(mydata.classid, new Array<string>());
412
                        if(this.publicationInfo.classifiedSubjects == undefined) {
413
                            this.publicationInfo.classifiedSubjects = new Map<string, string[]>();
416 414
                        }
417 415

  
418
                        let counter = this.publicationInfo.classifiedSubjects.get(mydata.classid).length;
419
                        this.publicationInfo.classifiedSubjects.get(mydata.classid)[counter] = mydata.content;
416
                        if(!this.publicationInfo.classifiedSubjects.has(mydata.classname)) {
417
                            this.publicationInfo.classifiedSubjects.set(mydata.classname, new Array<string>());
418
                        }
419

  
420
                        this.publicationInfo.classifiedSubjects.get(mydata.classname).push(mydata.content);
420 421
                    } else {
421
                        let counter = this.publicationInfo.subjects.length;
422
                        this.publicationInfo.subjects[counter] = mydata.content;
422
                        if(mydata.classid == "keyword") {
423
                            if(this.publicationInfo.subjects == undefined) {
424
                                this.publicationInfo.subjects = new Array<string>();
425
                            }
426

  
427
                            let counter = this.publicationInfo.subjects.length;
428
                            this.publicationInfo.subjects[counter] = mydata.content;
429
                        } else {
430
                            if(this.publicationInfo.otherSubjects == undefined) {
431
                                this.publicationInfo.otherSubjects = new Map<string, string[]>();
432
                            }
433

  
434
                            if(!this.publicationInfo.otherSubjects.has(mydata.classname)) {
435
                                this.publicationInfo.otherSubjects.set(mydata.classname, new Array<string>());
436
                            }
437
                            this.publicationInfo.otherSubjects.get(mydata.classname).push(mydata.content);
438
                        }
423 439
                    }
424 440
                }
425 441
            }

Also available in: Unified diff