Project

General

Profile

« Previous | Next » 

Revision 49721

Deleting portal with older version of angular

View differences:

modules/uoa-services-portal/trunk/portal/webpack.config.js
1
var webpack = require('webpack');
2
var path = require('path');
3

  
4
var commonConfig = {
5
  resolve: {
6
    extensions: ['', '.ts', '.js']
7
  },
8
  module: {
9
    loaders: [
10
      // TypeScript
11
      { test: /\.ts$/, loader: 'ts-loader' }
12
    ]
13
  },
14
  plugins: [
15
    new webpack.optimize.OccurenceOrderPlugin(true)
16
  ]
17
};
18

  
19

  
20
var clientConfig = {
21
  target: 'web',
22
  entry: './src/client',
23
  output: {
24
    path: path.join(__dirname, 'dist', 'client')
25
  },
26
  node: {
27
    global: true,
28
    __dirname: true,
29
    __filename: true,
30
    process: true,
31
    Buffer: false
32
  }
33
};
34

  
35

  
36
var serverConfig = {
37
  target: 'node',
38
  entry: './src/server',
39
  output: {
40
    path: path.join(__dirname, 'dist', 'server')
41
  },
42
  externals: checkNodeImport,
43
  node: {
44
    global: true,
45
    __dirname: true,
46
    __filename: true,
47
    process: true,
48
    Buffer: true
49
  }
50
};
51

  
52

  
53

  
54
// Default config
55
var defaultConfig = {
56
  module: {
57
    noParse: [
58
      path.join(__dirname, 'zone.js', 'dist'),
59
      path.join(__dirname, 'angular2', 'bundles')
60
    ]
61
  },
62
  context: __dirname,
63
  resolve: {
64
    root: path.join(__dirname, '/src')
65
  },
66
  output: {
67
    publicPath: path.resolve(__dirname),
68
    filename: 'bundle.js'
69
  }
70
}
71

  
72

  
73

  
74
var webpackMerge = require('webpack-merge');
75
module.exports = [
76
  // Client
77
  webpackMerge({}, defaultConfig, commonConfig, clientConfig),
78

  
79
  // Server
80
  webpackMerge({}, defaultConfig, commonConfig, serverConfig)
81
]
82

  
83
// Helpers
84
function checkNodeImport(context, request, cb) {
85
  if (!path.isAbsolute(request) && request.charAt(0) !== '.') {
86
    cb(null, 'commonjs ' + request); return;
87
  }
88
  cb();
89
}
modules/uoa-services-portal/trunk/portal/package.json
1
{
2
  "name": "uoa-services-portal",
3
  "version": "1.0.0",
4
  "description": "Open Access Infrastructure for Research in Europe ",
5
  "scripts": {
6
    "postinstall": "typings install",
7
    "watch": "webpack --watch",
8
    "prebuild": "rimraf dist",
9
    "build": "webpack",
10
    "prestart": "npm run build",
11
    "server": "nodemon dist/server/bundle.js",
12
    "start": "npm run server",
13
    "predebug": "npm run build",
14
    "debug": "node --debug-brk dist/server/bundle.js"
15
  },
16
  "license": "UOA",
17
  "dependencies": {
18
    "@angular/common": "2.0.0-rc.1",
19
    "@angular/compiler": "2.0.0-rc.1",
20
    "@angular/core": "2.0.0-rc.1",
21
    "@angular/http": "2.0.0-rc.1",
22
    "@angular/platform-browser": "2.0.0-rc.1",
23
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
24
    "@angular/platform-server": "2.0.0-rc.1",
25
    "@angular/router-deprecated": "2.0.0-rc.1",
26
    "angular2-universal": "~0.101.8",
27
    "body-parser": "^1.15.1",
28
    "bootstrap": "^3.3.6",
29
    "express": "^4.13.4",
30
    "preboot": "^2.1.2",
31
    "rxjs": "5.0.0-beta.6"
32
  },
33
  "devDependencies": {
34
    "nodemon": "^1.9.2",
35
    "rimraf": "^2.5.2",
36
    "ts-loader": "^0.8.2",
37
    "typescript": "^1.8.9",
38
    "typings": "~0.8.1",
39
    "webpack": "^1.13.1",
40
    "webpack-dev-server": "^1.14.0",
41
    "webpack-merge": "^0.13.0"
42
  }
43
}
modules/uoa-services-portal/trunk/portal/tsconfig.json
1
{
2
  "compilerOptions": {
3
    "emitDecoratorMetadata": true,
4
    "experimentalDecorators": true,
5
    "target": "es5",
6
    "module": "commonjs",
7
    "removeComments": true,
8
    "sourceMap": true
9
  },
10
  "exclude": [
11
    "typings/main.d.ts",
12
    "typings/main",
13
    "node_modules"
14
  ],
15
  "compileOnSave": false,
16
  "buildOnSave": false,
17
  "atom": { "rewriteTsconfig": false }
18
}
modules/uoa-services-portal/trunk/portal/typings.json
1
{
2
  "ambientDependencies": {
3
    "body-parser": "registry:dt/body-parser#0.0.0+20160317120654",
4
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
5
    "express": "registry:dt/express#4.0.0+20160317120654",
6
    "express-serve-static-core": "registry:dt/express-serve-static-core#0.0.0+20160322035842",
7
    "mime": "registry:dt/mime#0.0.0+20160316155526",
8
    "node": "registry:dt/node#4.0.0+20160412142033",
9
    "serve-static": "registry:dt/serve-static#0.0.0+20160317120654"
10
  }
11
}
modules/uoa-services-portal/trunk/portal/nodemon.json
1
{
2
  "watch": [
3
    "dist",
4
    "src/index.html"
5
  ],
6
  "ext" : "js ts json html"
7
}
modules/uoa-services-portal/trunk/portal/src/index.html
1
<!doctype html>
2
<html lang="en">
3
  <head>
4
    <title>OpenAIRE</title>
5
    <meta charset="UTF-8">
6
    <meta name="description" content="Open Access Infrastructure for Europe ">
7
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
8
    <script src="node_modules/bootstrap/dist/js/bootstrap.min.js" ></script>
9
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
10
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
11
    <link rel="icon" href="data:;base64,iVBORw0KGgo=">
12

  
13
    <base href="/">
14

  
15
  </head>
16
  <body>
17

  
18
    <app>
19
      ... Loading ...
20
    </app>
21

  
22
    <script defer src="https://code.getmdl.io/1.1.3/material.min.js"></script>
23
    <script src="/dist/client/bundle.js"></script>
24
  </body>
25
</html>
modules/uoa-services-portal/trunk/portal/src/server.ts
1
import 'angular2-universal/polyfills';
2

  
3
import * as path from 'path';
4
import * as express from 'express';
5
import * as bodyParser from 'body-parser';
6

  
7
// Angular 2 Universal
8
import {
9
  provide,
10
  enableProdMode,
11
  expressEngine,
12
  REQUEST_URL,
13
  ORIGIN_URL,
14
  BASE_URL,
15
  NODE_ROUTER_PROVIDERS,
16
  NODE_HTTP_PROVIDERS,
17
  ExpressEngineConfig
18
} from 'angular2-universal';
19

  
20
// Application
21
import {App} from './app/app.component';
22

  
23
const app = express();
24
const ROOT = path.join(path.resolve(__dirname, '..'));
25

  
26
enableProdMode();
27

  
28
// Express View
29
app.engine('.html', expressEngine);
30
app.set('views', __dirname);
31
app.set('view engine', 'html');
32

  
33
app.use(bodyParser.json());
34

  
35

  
36
function ngApp(req, res) {
37
  let baseUrl = '/';
38
  let url = req.originalUrl || '/';
39

  
40
  let config: ExpressEngineConfig = {
41
    directives: [ App ],
42
    platformProviders: [
43
      provide(ORIGIN_URL, {useValue: 'http://localhost:3000'}),
44
      provide(BASE_URL, {useValue: baseUrl}),
45
    ],
46
    providers: [
47
      provide(REQUEST_URL, {useValue: url}),
48
      NODE_ROUTER_PROVIDERS,
49
      NODE_HTTP_PROVIDERS,
50
    ],
51
    async: true,
52
    preboot: false // { appRoot: 'app' } // your top level app component selector
53
  };
54

  
55
  res.render('index', config);
56
}
57

  
58
function indexFile(req, res) {
59
  res.sendFile('/index.html', {root: __dirname});
60
}
61

  
62
// Serve static files
63
app.use(express.static(ROOT, {index: false}));
64

  
65
// Our API for demos only
66
app.get('/data.json', (req, res) => {
67
  res.json({
68
    data: 'This fake data came from the server.'
69
  });
70
});
71

  
72
// Routes with html5pushstate
73
app.use('/', ngApp);
74
app.use('/home', ngApp);
75
app.use('/search', ngApp);
76
// Server
77
app.listen(3000, () => {
78
  console.log('Listening on: http://localhost:3000');
79
});
modules/uoa-services-portal/trunk/portal/src/app/landingPages/tabTable.component.ts
1
import {Component, Input} from '@angular/core';
2
import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
3

  
4

  
5
@Component({
6
    selector: 'tabTable',
7
    template: `
8
        <table class="table table-striped">
9
            <thead>
10
                <tr>
11
                    <th>Title</th>
12
                    <th>Trust</th>
13
                </tr>
14
            </thead>
15
            <tbody>
16
                <tr *ngFor="let item of info" class="{{item['class']}}">
17
                    <td *ngIf="item != undefined">
18
                        <span *ngIf="item['class'] == 'dataset'" class="glyphicon glyphicon-star" aria-hidden="true">
19

  
20
                        </span>
21
                        <a *ngIf="item['url'] != '' && item['name'] != ''" class="custom-external" href="{{item['url']}}" target="_blank">
22
                            {{item['name']}}
23
                        </a>
24
                        <p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p>
25
                        <span *ngIf="item['date'] != ''">
26
                            ({{item['date']}})
27
                        </span>
28
                    </td>
29
                    <td>
30
                        <div *ngIf="item['trust'] != ''" class="progress">
31
                            <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="29" aria-valuemin="0" aria-valuemax="100" [style.width] = "item['trust']">
32
                                {{item['trust']}}
33
                            </div>
34
                        </div>
35
                        <div *ngIf="item['trust'] == ''">
36
                            <p>no trust found</p>
37
                        </div>
38
                    </td>
39
                </tr>
40
            </tbody>
41
        </table>
42
    `
43
    ,
44
        directives: [
45
          ...ROUTER_DIRECTIVES
46
        ]
47
    })
48

  
49
export class TabTableComponent {
50
    @Input() info: { "name": string, "url": string, "date": string, "trust": string}[];//Map<string, string[]>;
51

  
52
    constructor (private _router: Router) {
53
        console.info('tabTable constructor');
54
    }
55

  
56
    ngOnInit() {
57
    }
58
}
modules/uoa-services-portal/trunk/portal/src/app/landingPages/dataset/dataset.component.ts
1
import {Component, ViewChild} from '@angular/core';
2
import {JSONP_PROVIDERS}  from '@angular/http';
3
import {Observable}       from 'rxjs/Observable';
4
import {DatasetService} from '../../services/dataset.service';
5
import {DatasetInfo} from '../../entities/datasetInfo';
6
import { RouteParams} from '@angular/router-deprecated';
7
import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component';
8
import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component';
9

  
10
import {TabPagingComponent} from '../tabPaging.component.ts';
11
import {TabTableComponent} from '../tabTable.component.ts';
12
import {ShowTitleComponent} from '../showTitle.component.ts';
13
import {ShowAuthorsComponent} from '../showAuthors.component.ts';
14
import {ShowIdentifiersComponent} from '../showIdentifiers.component.ts';
15
import {ShowSubjectsComponent} from '../showSubjects.component.ts';
16

  
17
@Component({
18
    selector: 'dataset',
19
    template: `
20
        <div class="container dataset">
21
            <div class="container-header" >
22
                <div *ngIf="datasetInfo != null" >
23
                    <showTitle [title]="datasetInfo.title"></showTitle>
24
                </div>
25
                <div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
26
                <div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
27
            </div>
28

  
29
            <div class="row row-offcanvas row-offcanvas-right" >
30

  
31
                <div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="datasetInfo != null">
32
                    <div>
33
                        <showAuthors [authors]="datasetInfo.authors"></showAuthors>
34
                        <span *ngIf="datasetInfo.date != ''">({{datasetInfo.date}})</span>
35
                    </div>
36

  
37
                    <dl class="dl-horizontal">
38
                        <dt *ngIf="datasetInfo.publisher != undefined && datasetInfo.publisher != ''">Publisher: </dt>
39
                        <dd *ngIf="datasetInfo.publisher != undefined && datasetInfo.publisher != ''">{{datasetInfo.publisher}}</dd>
40
                        <dt *ngIf="datasetInfo.type != undefined"> Type: </dt>
41
                        <dd *ngIf="datasetInfo.type != undefined">{{datasetInfo.type}}</dd>
42
                        <dt *ngIf="datasetInfo.embargoEndDate != undefined && datasetInfo.embargoEndDate != ''">Embargo end date: </dt>
43
                        <dd *ngIf="datasetInfo.embargoEndDate != undefined && datasetInfo.embargoEndDate != ''">{{datasetInfo.embargoEndDate}}</dd>
44

  
45
                        <showIdentifiers [identifiers]="datasetInfo.identifiers"></showIdentifiers>
46
                        <showSubjects [subjects]="datasetInfo.subjects" [classifiedSubjects]="datasetInfo.classifiedSubjects"></showSubjects>
47
                    </dl>
48

  
49
                    <blockquote *ngIf="datasetInfo.description != ''">
50
                        <div class="text-justify" [innerHTML]="datasetInfo.description"></div>
51
                    </blockquote>
52

  
53
                    <ul class="nav nav-tabs">
54
                        <li class="active">
55
                            <!--a data-toggle="tab" href="#relatedPublicationsTab">
56
                                Related Publications
57
                                <span *ngIf="datasetInfo.isRelatedTo == undefined" class="badge">0</span>
58
                                <span *ngIf="datasetInfo.isRelatedTo != undefined" class="badge">
59
                                    {{datasetInfo.relatedPublications.length}}
60
                                </span>
61
                            </a>
62
                        </li>
63

  
64
                        <li role="presentation">
65
                             <a data-toggle="tab" href="#dataTab">
66
                                 Related Research Results
67
                                 <span *ngIf="datasetInfo.relatedResearchData == undefined" class="badge">0</span>
68
                                 <span *ngIf="datasetInfo.relatedResearchData != undefined" class="badge">
69
                                     {{datasetInfo.relatedResearchData.length}}
70
                                 </span>
71
                             </a>
72
                         </li-->
73

  
74
                             <a data-toggle="tab" href="#relatedTab">
75
                                 Related Research Results
76
                                 <span *ngIf="datasetInfo.relatedResearchResults == undefined" class="badge">0</span>
77
                                 <span *ngIf="datasetInfo.relatedResearchResults != undefined" class="badge">
78
                                     {{datasetInfo.relatedResearchResults.length}}
79
                                 </span>
80
                             </a>
81
                         </li>
82

  
83
                        <li role="presentation">
84
                            <a data-toggle="tab" href="#similarTab">
85
                                Similar Research Results
86
                                <span *ngIf="datasetInfo.similarResearchResults == undefined" class="badge">0</span>
87
                                <span *ngIf="datasetInfo.similarResearchResults != undefined" class="badge">
88
                                    {{datasetInfo.similarResearchResults.length}}
89
                                </span>
90
                            </a>
91
                        </li>
92

  
93
                    </ul>
94

  
95
                    <div class="tab-content">
96
                        <!--div id="relatedPublicationsTab" class="tab-pane fade in active panel-body">
97
                            <div *ngIf="datasetInfo.isRelatedTo == undefined" class = "alert alert-info " >
98
                                 There are no related publications
99
                             </div>
100
                             <div *ngIf="datasetInfo.isRelatedTo != undefined">
101
                                <p>
102
                                    The results below are discovered through our pilot algorithms.
103
                                    <a href="mailto:">Let us know how we are doing!</a>
104
                                </p>
105
                                <tabTable [info]="datasetInfo.isRelatedTo"></tabTable>
106

  
107
                            </div>
108
                        </div-->
109

  
110
                        <div id="relatedTab" class="tab-pane fade in active panel-body">
111
                            <div *ngIf="datasetInfo.relatedResearchResults == undefined" class = "alert alert-info " >
112
                                There are no related research results
113
                            </div>
114
                            <div *ngIf="datasetInfo.relatedResearchResults != undefined">
115
                                <p>
116
                                    The results below are discovered through our pilot algorithms.
117
                                    <a href="mailto:">Let us know how we are doing!</a>
118
                                </p>
119
                                <tabTable [info]="datasetInfo.relatedResearchResults"></tabTable>
120

  
121
                            </div>
122
                        </div>
123

  
124

  
125
                        <div id="similarTab" class="tab-pane fade panel-body">
126
                            <div  *ngIf="datasetInfo.similarResearchResults == undefined"  class = "alert alert-info " >
127
                                There are no similar research results
128
                            </div>
129
                            <div *ngIf="datasetInfo.similarResearchResults != undefined">
130
                                <p>
131
                                    The results below are discovered through our pilot algorithms.
132
                                    <a href="mailto:">Let us know how we are doing!</a>
133
                                </p>
134

  
135
                                <tabTable [info]="datasetInfo.similarResearchResults"></tabTable>
136

  
137
                            </div>
138
                        </div>
139
                    </div>
140
                </div>
141
                <div class="col-xs-12 col-sm-3" *ngIf="datasetInfo != null">
142
                    <ul class="list-group mainFunctionsBlock">
143
                        <li class="list-group-item">
144
                            <dl class="functionsSection">
145
                                <dt  >Share - Bookmark</dt>
146
                                <dd>
147
                                </dd>
148
                            </dl>
149
                        </li>
150
                        <li class="list-group-item" *ngIf="datasetInfo.collectedFrom != undefined">
151
                            <dl class="functionsSection">
152
                                <dt>Collected from</dt>
153
                                <dd  *ngFor="let item of datasetInfo.collectedFrom">
154
                                    <a href="{{item['url']}}">
155
                                        {{item['name']}}
156
                                    </a>
157
                                </dd>
158
                            </dl>
159
                        </li>
160
                        <li class="list-group-item" *ngIf="datasetInfo.downloadFrom != undefined && datasetInfo.downloadFrom.size > 0">
161
                            <dl class="functionsSection">
162
                                <dt class="title">Download from</dt>
163
                                <dd class="line" *ngFor="let key of datasetInfo.downloadFrom.keys()">
164
                                    <div *ngIf="datasetInfo.downloadFrom.get(key)['url'].length > 1">
165
                                        {{key}}
166
                                        <span *ngFor="let url of datasetInfo.downloadFrom.get(key)['url']; let i=index;">
167
                                            <a href="{{url}}">
168
                                                [{{i+1}}]
169
                                            </a>
170
                                        </span>
171
                                    </div>
172
                                    <a *ngIf="datasetInfo.downloadFrom.get(key)['url'].length == 1" href="{{datasetInfo.downloadFrom.get(key)['url']}}">
173
                                        {{key}}
174
                                    </a>
175
                                </dd>
176
                            </dl>
177
                        </li>
178

  
179

  
180
                        <li class="list-group-item">
181
                            <dl class="functionsSection" *ngIf="datasetInfo.fundedByProjects != undefined">
182
                                <dt class="title">Funded By</dt>
183
                                <dd
184
                                    title="{{item['title']}}
185
                                    |   Project Code: {{item['acronym']}}
186
                                    |   Funder: {{item['funderName']}} ({{item['funderShortname']}})
187
                                    |   Funding: {{item['funding']}}"
188
                                    class="line" *ngFor="let item of datasetInfo.fundedByProjects">
189
                                        <a *ngIf="!item['new']" href="{{item['url']}}">
190
                                            {{item['funderShortname']?item['funderShortname']:item['funderName']}}
191
                                            | {{ item['acronym']?item['acronym']:item['title']}}
192
                                        </a>
193

  
194
                                        <a *ngIf="item['new']" href="{{item['url']}}">
195
                                            <mark>
196
                                                {{item['funderShortname']?item['funderShortname']:item['funderName']}}
197
                                                | {{ item['acronym']?item['acronym']:item['title']}}
198
                                            </mark>
199
                                        </a>
200
                                </dd>
201
                            </dl>
202
                            <!--dl class="functionsSection" *ngIf="datasetInfo.fundedByProjects == undefined">
203
                                <dt class="title">Funded By</dt>
204
                            </dl-->
205
                            <button (click)="toggleClaimProject()"  class = "btn btn-default   btn-xs" >Add more Projects</button>
206
                            <inline-claim-project *ngIf="result "  inline="true" inlineType ="dataset" [inlineEntity]="result"  (projectAdded)="projectAdded($event)" ></inline-claim-project>
207
                        </li>
208
                        <!--li class="list-group-item">
209
                            <dl class="functionsSection" *ngIf="datasetInfo.contexts != undefined">
210
                                <dt class="title">Related to </dt>
211
                                <dd class="line" *ngFor="let item of datasetInfo.contexts">
212
                                    <span>{{item['labelContext']}}</span>
213
                                    <span *ngIf="item['labelCategory'] != null">-> {{item['labelCategory']}}</span>
214
                                    <span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
215
                                </dd>
216
                            </dl>
217
                            <dl class="functionsSection" *ngIf="datasetInfo.contexts == undefined">
218
                                <dt class="title">Related to </dt>
219
                            </dl>
220
                            <button (click)=" toggleClaimContext()" class = "btn btn-default   btn-xs" >Add Contexts</button>
221
                            <inline-claim-context   inline="true" inlineType ="dataset" [inlineEntity]="result"  ></inline-claim-context>
222
                        </li-->
223
                    </ul>
224
                </div>
225
            </div>
226
        </div>
227
    `,
228
    providers:[JSONP_PROVIDERS, DatasetService],
229
    directives:[InlineClaimContextComponent, InlineClaimProjectComponent,
230
        TabTableComponent, ShowTitleComponent, ShowAuthorsComponent,
231
        ShowIdentifiersComponent, ShowSubjectsComponent]
232
})
233

  
234
export class DatasetComponent {
235
    constructor (private _datasetService: DatasetService, private _routeParams: RouteParams) {
236
        console.info('dataset constructor');
237
        this.params = _routeParams;
238
    }
239
    ngOnInit() {
240
        this.getDatasetInfo();
241
    }
242

  
243
    private datasetInfo: DatasetInfo;
244
    private params: RouteParams;
245

  
246
    private showStyle: boolean = false;
247
    private showAllReferences: boolean = false;
248
    private showAllRelResData: boolean = false;
249
    private showAllSimilPubl: boolean = false;
250
    private showAllBioentities: boolean = false;
251

  
252
    private result ;
253
    private claimInline:string = "none" ;
254

  
255
    @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ;
256
    @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ;
257

  
258
    public warningMessage = "";
259
    public errorMessage = "";
260

  
261
    getDatasetInfo() {
262
        this.warningMessage = '';
263
        this.errorMessage=""
264
        if(this.params.get("datasetId")==null || this.params.get("datasetId")==''){
265
            this.warningMessage="No valid dataset id";
266
            console.info("novalid");
267
        }else{
268
            console.info("do request");
269
            this._datasetService.getDatasetInfo(this.params.get("datasetId")).subscribe(
270
                data => {
271
                    this.datasetInfo = data;
272

  
273
                    this.result = []
274
                    let result_  ={id: this.params.get("datasetId"), type :"dataset", source : "openaire", title: this.datasetInfo.title,url: '', result: '', accessRights: this.datasetInfo.bestlicense, embargoEndDate: ''};
275
                    this.result.push(result_);
276
                },
277
                err => {
278
                    console.error(err)
279
                    console.info("error");
280

  
281
                    this.errorMessage = 'No dataset found';
282
                }
283
            );
284
        }
285
    }
286

  
287
    /********** Methods for Inline Claim  of project / dataset ******/
288
    toggleClaimProject(){
289
        this.inlineClaimProject.toggle();
290
    }
291
    projectAdded($event){
292
        var projects =$event.value;
293
        if(projects){
294
            for(var i=0; i < projects.length; i++){
295

  
296
                if(this.datasetInfo.fundedByProjects == undefined) {
297
                    this.datasetInfo.fundedByProjects = new Array<
298
                        { "url": string, "acronym": string, "title": string,
299
                          "funderShortname": string, "funderName": string,
300
                          "funding": string, "new": boolean
301
                        }>();
302
                }
303
                var project =projects[i];
304

  
305
                let counter = this.datasetInfo.fundedByProjects.length;
306
                this.datasetInfo.fundedByProjects[counter]['url'] =
307
                    "http://localhost:3000/project?projectId="+project.projectId;
308
                this.datasetInfo.fundedByProjects[counter]['acronym'] = project.projectAcronym;
309
                this.datasetInfo.fundedByProjects[counter]['title'] = project.projectName;
310
                this.datasetInfo.fundedByProjects[counter]['funderShortname'] = project.selectedFunderId;
311
                this.datasetInfo.fundedByProjects[counter]['funderName'] = project.selectedFunderName;
312
                this.datasetInfo.fundedByProjects[counter]['new'] = true;
313
            }
314
        }
315
    }
316
    toggleClaimContext(){
317
        this.inlineClaimContext.toggle();
318
    }
319
    contextAdded($event){
320
        var contexts =$event.value;
321
        if(contexts){
322
            for(var i=0; i < contexts.length; i++){
323
            }
324
        }
325
    }
326
}
modules/uoa-services-portal/trunk/portal/src/app/landingPages/person/person.component.ts
1
import {Component} from '@angular/core';
2
import {JSONP_PROVIDERS}  from '@angular/http';
3
import {Observable}       from 'rxjs/Observable';
4
import { RouteParams } from '@angular/router-deprecated';
5
import {PersonService} from '../../services/person.service';
6
import {PersonInfo} from '../../entities/personInfo';
7

  
8
@Component({
9
    selector: 'person',
10
    template: `
11

  
12
    <div>
13
        <div class="container person">
14
            <div class="container-header" >
15
                <div *ngIf="personInfo != null">
16
                    <h3>{{personInfo.fullname}}</h3>
17
                </div>
18
                <div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
19
                <div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
20
            </div>
21

  
22
            <div class="row row-offcanvas row-offcanvas-right" >
23

  
24
                <div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="personInfo != null">
25
                    <dl class="dl-horizontal">
26
                        <dt *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">Last name: </dt>
27
                        <dd *ngIf="personInfo.secondnames != undefined && personInfo.secondnames != ''">{{personInfo.secondnames}}</dd>
28
                        <dt *ngIf="personInfo.firstname != undefined && personInfo.firstname != ''">First name: </dt>
29
                        <dd *ngIf="personInfo.firstname != undefined && personInfo.firstname != ''">{{personInfo.firstname}}</dd>
30
                        <dt *ngIf="personInfo.country != undefined && personInfo.country != ''">Country: </dt>
31
                        <dd *ngIf="personInfo.country != undefined && personInfo.country != ''">{{personInfo.country}}</dd>
32
                    </dl>
33

  
34
                    <ul class="nav nav-tabs">
35
                        <li class="active">
36
                            <a data-toggle="tab" href="#publicationsTab">
37
                                Publications
38
                            </a>
39
                        </li>
40
                        <li role="presentation">
41
                            <a data-toggle="tab" href="#researchDataTab">
42
                                Research Data
43
                            </a>
44
                        </li>
45
                    </ul>
46

  
47
                    <div class="tab-content">
48
                        <div id="publicationsTab" class="tab-pane fade in active panel-body">
49

  
50
                            <div *ngIf="personInfo.publications == undefined" class = "alert alert-info " >
51
                                There are no publications
52
                            </div>
53

  
54
                            <div *ngIf="personInfo.publications != undefined">
55
                                <p>
56
                                    The results below are discovered through our pilot algorithms.
57
                                    <a href="mailto:">Let us know how we are doing!</a>
58
                                </p>
59
                            </div>
60
                        </div>
61

  
62
                        <div id="researchDataTab" class="tab-pane fade panel-body">
63
                            <div *ngIf="personInfo.researchData == undefined" class = "alert alert-info ">
64
                                There are no research data
65
                            </div>
66
                            <div *ngIf="personInfo.researchData != undefined">
67
                                <p>
68
                                    The results below are discovered through our pilot algorithms.
69
                                    <a href="mailto:">Let us know how we are doing!</a>
70
                                </p>
71
                            </div>
72
                        </div>
73
                    </div>
74
                </div>
75

  
76
                <div class="col-xs-12 col-sm-3" *ngIf="personInfo != null">
77
                    <ul class="list-group mainFunctionsBlock">
78
                        <li class="list-group-item">
79
                            <dl class="functionsSection">
80
                                <dt  >Share - Bookmark</dt>
81
                                <dd>
82
                                </dd>
83
                            </dl>
84
                        </li>
85
                    </ul>
86
                </div>
87
            </div>
88
        </div>
89
    </div>
90

  
91
     `,
92
    providers:[JSONP_PROVIDERS, PersonService]
93
})
94

  
95
export class PersonComponent {
96
    constructor (private _personService: PersonService,
97
        private _routeParams: RouteParams) {
98
            console.info('person constructor');
99
            this.params = _routeParams;
100
        }
101

  
102
    ngOnInit() {
103
        console.info('person init');
104
        this.getPersonInfo();
105
    }
106

  
107
    personInfo: PersonInfo;
108
    params: RouteParams;
109

  
110
    public warningMessage = "";
111
    public errorMessage = "";
112

  
113
    getPersonInfo ()  {
114
        console.info("inside getProjectInfo of component");
115

  
116
        this.warningMessage = '';
117
        this.errorMessage=""
118
        if(this.params.get("personId")==null || this.params.get("personId")==''){
119
            this.warningMessage="No valid person id";
120
            console.info("novalid");
121
        } else {
122
            console.info("do request");
123

  
124
            this._personService.getPersonInfo(this.params.get('personId')).subscribe(
125
                data => {
126
                    this.personInfo = data;
127
                },
128
                err => {
129
                    console.error(err)
130
                    console.info("error");
131

  
132
                    this.errorMessage = 'No person found';
133
                }
134
            );
135
        }
136
    }
137
}
modules/uoa-services-portal/trunk/portal/src/app/landingPages/project/project.component.ts
1
import {Component} from '@angular/core';
2
import {JSONP_PROVIDERS}  from '@angular/http';
3
import {Observable}       from 'rxjs/Observable';
4
import { RouteParams } from '@angular/router-deprecated';
5
import {ProjectService} from '../../services/project.service';
6
import {ProjectInfo} from '../../entities/projectInfo';
7

  
8
@Component({
9
    selector: 'project',
10
    template: `
11
    <div>
12
        <div class="container person">
13
            <div class="container-header" >
14
                <div *ngIf="projectInfo != null">
15
                    <h3 class="sc39" title="Special Clause 39">{{projectInfo.acronym}}</h3>
16
                </div>
17
                <div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
18
                <div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
19
            </div>
20

  
21
            <div class="row row-offcanvas row-offcanvas-right" >
22

  
23
                <div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="projectInfo != null">
24

  
25
                    <dl class="dl-horizontal">
26
                        <dt *ngIf="projectInfo.title != undefined && projectInfo.title != ''">Title: </dt>
27
                        <dd *ngIf="projectInfo.title != undefined && projectInfo.title != ''">{{projectInfo.title}}</dd>
28
                        <dt *ngIf="projectInfo.funding != undefined && projectInfo.funding != ''">Funding: </dt>
29
                        <dd *ngIf="projectInfo.funding != undefined && projectInfo.funding != ''">{{projectInfo.funding}}</dd>
30
                        <dt *ngIf="projectInfo.callIdentifier != undefined && projectInfo.callIdentifier != ''">Call: </dt>
31
                        <dd *ngIf="projectInfo.callIdentifier != undefined && projectInfo.callIdentifier != ''">{{projectInfo.callIdentifier}}</dd>
32
                        <dt *ngIf="projectInfo.contractNum != undefined && projectInfo.contractNum != ''">Contract (GA) number: </dt>
33
                        <dd *ngIf="projectInfo.contractNum != undefined && projectInfo.contractNum != ''">{{projectInfo.contractNum}}</dd>
34
                        <dt *ngIf="projectInfo.startDate != undefined && projectInfo.startDate != ''">Start Date: </dt>
35
                        <dd *ngIf="projectInfo.startDate != undefined && projectInfo.startDate != ''">{{projectInfo.startDate}}</dd>
36
                        <dt *ngIf="projectInfo.endDate != undefined && projectInfo.endDate != ''">End Date: </dt>
37
                        <dd *ngIf="projectInfo.endDate != undefined && projectInfo.endDate != ''">{{projectInfo.endDate}}</dd>
38
                        <dt *ngIf="projectInfo.openAccessMandate != undefined && projectInfo.openAccessMandate != ''">Open Access mandate: </dt>
39
                        <dd *ngIf="projectInfo.openAccessMandate != undefined && projectInfo.openAccessMandate != ''">{{projectInfo.openAccessMandate}}</dd>
40
                        <dt *ngIf="projectInfo.specialClause39 != undefined && projectInfo.specialClause39 != ''">Special Clause 39: </dt>
41
                        <dd *ngIf="projectInfo.specialClause39 != undefined && projectInfo.specialClause39 != ''">{{projectInfo.specialClause39}}</dd>
42
                        <dt *ngIf="projectInfo.organizations != undefined">Organizations: </dt>
43
                        <dd *ngIf="projectInfo.organizations != undefined">
44
                            <ul class="list-inline">
45
                                <li *ngFor="let key of projectInfo.organizations.keys()">
46
                            <a *ngIf="projectInfo.organizations.get(key) != null &&
47
                                projectInfo.organizations.get(key) != ''"
48
                                href="{{projectInfo.organizations.get(key)}}" target="_blank">
49
                                    {{key}}
50
                            </a>
51
                            <span *ngIf="projectInfo.organizations.get(key) == null ||
52
                                projectInfo.organizations.get(key) == ''">
53
                                    {{key}}
54
                            </span>
55
                            <span>;</span>
56
                                </li>
57
                            </ul>
58
                        </dd>
59
                        <dt *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''">More information:</dt>
60
                        <dd *ngIf="projectInfo.urlInfo != undefined && projectInfo.urlInfo != ''">
61
                            <a target="_blank" href="{{projectInfo.url}}">
62
                                {{projectInfo.urlInfo}}
63
                            </a>
64
                        </dd>
65
                    </dl>
66

  
67
                    <ul class="nav nav-tabs">
68
                        <li class="active">
69
                            <a data-toggle="tab" href="#publicationsTab">
70
                                Publications
71
                            </a>
72
                        </li>
73
                        <li>
74
                            <a data-toggle="tab" href="#researchDataTab">
75
                                Research Data
76
                            </a>
77
                        </li>
78
                        <li>
79
                            <a data-toggle="tab" href="#statisticsTab">
80
                                Statistics
81
                            </a>
82
                        </li>
83
                    </ul>
84

  
85
                    <div class="tab-content">
86
                        <div id="publicationsTab" class="tab-pane fade in active panel-body">
87

  
88
                            <div *ngIf="projectInfo.publications == undefined" class = "alert alert-info " >
89
                                There are no publications
90
                            </div>
91

  
92
                            <div *ngIf="projectInfo.publications != undefined">
93
                                <p>
94
                                    The results below are discovered through our pilot algorithms.
95
                                    <a href="mailto:">Let us know how we are doing!</a>
96
                                </p>
97
                            </div>
98
                        </div>
99

  
100
                        <div id="researchDataTab" class="tab-pane fade panel-body">
101
                            <div *ngIf="projectInfo.researchData == undefined" class = "alert alert-info ">
102
                                There are no research data
103
                            </div>
104
                            <div *ngIf="projectInfo.researchData != undefined">
105
                                <p>
106
                                    The results below are discovered through our pilot algorithms.
107
                                    <a href="mailto:">Let us know how we are doing!</a>
108
                                </p>
109
                            </div>
110
                        </div>
111

  
112
                        <div id="statisticsTab" class="tab-pane fade panel-body">
113
                            <div *ngIf="projectInfo.statistics == undefined" class = "alert alert-info ">
114
                                There are no statistics
115
                            </div>
116
                            <div *ngIf="projectInfo.statistics != undefined">
117
                                <p>
118
                                    The results below are discovered through our pilot algorithms.
119
                                    <a href="mailto:">Let us know how we are doing!</a>
120
                                </p>
121
                            </div>
122
                        </div>
123
                    </div>
124
                </div>
125

  
126
                <div class="col-xs-12 col-sm-3" *ngIf="projectInfo != null">
127
                    <ul class="list-group mainFunctionsBlock">
128
                        <li class="list-group-item">
129
                            <dl class="functionsSection">
130
                                <dt  >Share - Bookmark</dt>
131
                                <dd>
132
                                </dd>
133
                            </dl>
134
                        </li>
135

  
136
                        <li class="list-group-item">
137
                            <dl class="functionsSection">
138
                                <dt>
139

  
140
                                    <table class="table table-striped">
141
                                        <tr><td>
142
                                                <a data-toggle="tab" href="">
143
                                                    Publication details
144
                                                </a>
145
                                        </td></tr>
146

  
147
                                        <tr><td>
148
                                                <a data-toggle="tab" href="">
149
                                                    Dynamically incorporate publications in your site (HTML)
150
                                                </a>
151
                                        </td></tr>
152

  
153
                                        <tr><td>
154
                                                <a data-toggle="tab" href="">
155
                                                    View EC progress report (HTML)
156
                                                </a>
157
                                        </td></tr>
158

  
159
                                        <tr><td>
160
                                                <a data-toggle="tab" href="">
161
                                                    Download EC progress report (CSV)
162
                                                </a>
163
                                        </td></tr>
164

  
165
                                        <tr><td>
166
                                            <div class="text-center">
167
                                                <a class="btn btn-danger btn-block" href="">
168
                                                    Link Research Results
169
                                                </a>
170
                                            </div>
171
                                            <div class="text-center">
172
                                                <a class="btn btn-danger btn-block" href="">
173
                                                    Deposit Publications
174
                                                </a>
175
                                            </div>
176
                                        </td></tr>
177
                                    </table>
178
                                </dt>
179
                                <dd>
180
                                </dd>
181
                            </dl>
182
                        </li>
183
                    </ul>
184
                </div>
185
            </div>
186
        </div>
187
    </div>
188

  
189
     `,
190
    providers:[JSONP_PROVIDERS, ProjectService]
191
})
192
export class ProjectComponent {
193
    constructor (private _projectService: ProjectService,
194
        private _routeParams: RouteParams) {
195
            console.info('project constructor');
196
            this.params = _routeParams;
197
    }
198

  
199
    ngOnInit() {
200
        console.info('project init');
201
        this.getProjectInfo();
202
    }
203

  
204
    results : String[];
205
    orcidresults : String[];
206
    resultsNum : number ;
207

  
208
    projectInfo: ProjectInfo;
209
    params: RouteParams;
210

  
211
    public warningMessage = "";
212
    public errorMessage = "";
213

  
214
    getProjectInfo ()  {
215
        console.info("inside getProjectInfo of component");
216

  
217
        this.warningMessage = '';
218
        this.errorMessage=""
219
        if(this.params.get("projectId")==null || this.params.get("projectId")==''){
220
            this.warningMessage="No valid project id";
221
            console.info("novalid");
222
        } else {
223
            console.info("do request");
224

  
225
            this._projectService.getProjectInfo(this.params.get('projectId')).subscribe(
226
                data => {
227
                    this.projectInfo = data;
228
                },
229
                err => {
230
                    console.error(err)
231
                    console.info("error");
232

  
233
                    this.errorMessage = 'No project found';
234
                }
235
            );
236
        }
237
    }
238
}
modules/uoa-services-portal/trunk/portal/src/app/landingPages/showTitle.component.ts
1
import {Component, Input} from '@angular/core';
2
import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
3

  
4

  
5
@Component({
6
    selector: 'showTitle',
7
    template: `
8
        <h2 *ngIf="title != undefined">
9
            <div *ngIf="title['url'] != undefined">
10
                <a class="custom-external" href="{{title['url']}}" target="_blank">
11
                    <div [innerHTML]="title['name']"></div>
12
                </a>
13
            </div>
14
            <div *ngIf="title['url'] == undefined">
15
                <div [innerHTML]="title['name']"></div>
16
            </div>
17
        </h2>
18
    `
19
    ,
20
        directives: [
21
          ...ROUTER_DIRECTIVES
22
        ]
23
    })
24

  
25
export class ShowTitleComponent {
26
    @Input() title: { [key: string]: string };
27

  
28
    constructor (private _router: Router) {
29
        console.info('title constructor');
30
    }
31

  
32
    ngOnInit() {
33
    }
34
}
modules/uoa-services-portal/trunk/portal/src/app/landingPages/publication/publication.component.ts
1
import {Component, ViewChild} from '@angular/core';
2
import {JSONP_PROVIDERS}  from '@angular/http';
3
import {Observable}       from 'rxjs/Observable';
4
import {PublicationService} from '../../services/publication.service';
5
import {PublicationInfo} from '../../entities/publicationInfo';
6
import { RouteParams} from '@angular/router-deprecated';
7
import { InlineClaimContextComponent} from '../../claimPages/inlineClaimContext/inlineClaimContext.component';
8
import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/inlineClaimProject.component';
9

  
10
import {TabPagingComponent} from '../tabPaging.component.ts';
11
import {TabTableComponent} from '../tabTable.component.ts';
12
import {ShowTitleComponent} from '../showTitle.component.ts';
13
import {ShowAuthorsComponent} from '../showAuthors.component.ts';
14
import {ShowIdentifiersComponent} from '../showIdentifiers.component.ts';
15
import {ShowSubjectsComponent} from '../showSubjects.component.ts';
16

  
17
@Component({
18
    selector: 'publication',
19
    template: `
20
        <div>
21
            <div class="container publication">
22
                <div class="container-header" >
23
                    <div *ngIf="publicationInfo != null">
24
                        <showTitle [title]="publicationInfo.title"></showTitle>
25
                    </div>
26
                    <div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
27
                    <div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
28
                </div>
29

  
30
                <div class="row row-offcanvas row-offcanvas-right" >
31

  
32
                    <div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="publicationInfo != null">
33
                        <div>
34
                            <showAuthors [authors]="publicationInfo.authors"></showAuthors>
35
                            <span *ngIf="publicationInfo.date != ''">({{publicationInfo.date}})</span>
36
                        </div>
37

  
38
                        <dl class="dl-horizontal">
39
                            <dt *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">Publisher: </dt>
40
                            <dd *ngIf="publicationInfo.publisher != undefined && publicationInfo.publisher != ''">{{publicationInfo.publisher}}</dd>
41
                            <dt *ngIf="publicationInfo.journal != undefined && publicationInfo.journal['journal'] != ''">Journal: </dt>
42
                            <dd *ngIf="publicationInfo.journal != undefined && publicationInfo.journal != ''">
43
                                {{publicationInfo.journal['journal']}}
44
                                <span *ngIf="publicationInfo.journal['issn'] != ''">
45
                                    <mark>issn:</mark> {{publicationInfo.journal['issn']}}
46
                                </span>
47
                                <span *ngIf="publicationInfo.journal['lissn'] != ''">
48
                                    <mark>lissn:</mark> {{publicationInfo.journal['lissn']}}
49
                                </span>
50
                            </dd>
51
                            <dt *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''"> Languages: </dt>
52
                            <dd *ngIf="publicationInfo.languages != undefined && publicationInfo.languages != 'Undetermined' && publicationInfo.languages != ''">{{publicationInfo.languages}}</dd>
53
                            <dt *ngIf="publicationInfo.types != undefined && publicationInfo.types.length > 0"> Types: </dt>
54
                            <dd *ngIf="publicationInfo.types != undefined && publicationInfo.types.length > 0">{{publicationInfo.types}}</dd>
55
                            <dt *ngIf="publicationInfo.embargoEndDate != undefined && publicationInfo.embargoEndDate != ''">Embargo end date: </dt>
56
                            <dd *ngIf="publicationInfo.embargoEndDate != undefined && publicationInfo.embargoEndDate != ''">{{publicationInfo.embargoEndDate}}</dd>
57

  
58
                            <showIdentifiers [identifiers]="publicationInfo.identifiers"></showIdentifiers>
59
                            <showSubjects [subjects]="publicationInfo.subjects" [classifiedSubjects]="publicationInfo.classifiedSubjects"></showSubjects>
60
                        </dl>
61

  
62
                        <blockquote *ngIf="publicationInfo.description != ''">
63
                            <div class="text-justify" [innerHTML]="publicationInfo.description"></div>
64
                        </blockquote>
65

  
66
                        <ul class="nav nav-tabs">
67
                            <li class="active">
68
                                <a data-toggle="tab" href="#citationsTab">
69
                                    References
70
                                    <span *ngIf="publicationInfo.references == undefined" class="badge">0</span>
71
                                    <span *ngIf="publicationInfo.references != undefined" class="badge">
72
                                        {{publicationInfo.references.length}}
73
                                    </span>
74
                                </a>
75
                            </li>
76
                            <li role="presentation">
77
                                <a data-toggle="tab" href="#relatedTab">
78
                                    Related Research Results
79
                                    <span *ngIf="publicationInfo.relatedResearchResults == undefined" class="badge">0</span>
80
                                    <span *ngIf="publicationInfo.relatedResearchResults != undefined" class="badge">
81
                                        {{publicationInfo.relatedResearchResults.length}}
82
                                    </span>
83
                                </a>
84
                            </li>
85
                            <li role="presentation">
86
                                <a data-toggle="tab" href="#similarTab">
87
                                    Similar Research Results
88
                                    <span *ngIf="publicationInfo.similarResearchResults == undefined" class="badge">0</span>
89
                                    <span *ngIf="publicationInfo.similarResearchResults != undefined" class="badge">
90
                                        {{publicationInfo.similarResearchResults.length}}
91
                                    </span>
92
                                    <!--span *ngIf="publicationInfo.similarPublications == undefined && publicationInfo.similarDatasets == undefined" class="badge">0</span>
93
                                    <span *ngIf="publicationInfo.similarPublications != undefined && publicationInfo.similarDatasets != undefined" class="badge">
94
                                        {{publicationInfo.similarPublications.length + publicationInfo.similarDatasets.length}}
95
                                    </span>
96
                                    <span *ngIf="publicationInfo.similarPublications != undefined && publicationInfo.similarDatasets == undefined" class="badge">
97
                                        {{publicationInfo.similarPublications.length}}
98
                                    </span>
99
                                    <span *ngIf="publicationInfo.similarPublications == undefined && publicationInfo.similarDatasets != undefined" class="badge">
100
                                        {{publicationInfo.similarDatasets.length}}
101
                                    </span-->
102
                                </a>
103
                            </li>
104
                            <li role="presentation" *ngIf="publicationInfo.bioentities != undefined">
105
                                <a data-toggle="tab" href="#bioentitiesTab">
106
                                    Bioentities
107
                                    <span class="badge">{{bioentitiesNum}}</span>
108
                                </a>
109
                            </li>
110
                        </ul>
111

  
112
                        <div class="tab-content">
113
                            <div id="citationsTab" class="tab-pane fade in active panel-body">
114

  
115
                                <div *ngIf="publicationInfo.references == undefined" class = "alert alert-info " >
116
                                    There are no references
117
                                </div>
118

  
119
                                <div *ngIf="publicationInfo.references != undefined">
120
                                    <tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging>
121

  
122
                                    <p>
123
                                        The results below are discovered through our pilot algorithms.
124
                                        <a href="mailto:">Let us know how we are doing!</a>
125
                                    </p>
126

  
127
                                    <div *ngFor="let item of publicationInfo.references.slice(0,10)">
128
                                        <p *ngIf=" item != undefined && item['url'] != undefined">
129
                                            <a href="{{item['url']}}" target="_blank">
130
                                                {{item['name']}}
131
                                            </a>
132
                                        </p>
133
                                        <p *ngIf="item['url'] == undefined">
134
                                            {{item['name']}}
135
                                        </p>
136
                                    </div>
137

  
138
                                    <div *ngIf="showAllReferences">
139
                                        <div *ngFor="let item of publicationInfo.references.slice(10)">
140
                                            <p *ngIf=" item != undefined && item['url'] != undefined">
141
                                                <a href="{{item['url']}}" target="_blank">
142
                                                    {{item['name']}}
143
                                                </a>
144
                                            </p>
145
                                            <p *ngIf="item['url'] == undefined">
146
                                                {{item['name']}}
147
                                            </p>
148
                                       </div>
149
                                    </div>
150

  
151
                                    <tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging>
152

  
153
                                </div>
154
                            </div>
155

  
156
                            <div id="relatedTab" class="tab-pane fade panel-body">
157
                                <div *ngIf="publicationInfo.relatedResearchResults == undefined" class = "alert alert-info ">
158
                                    There are no related research results
159
                                </div>
160
                                <div *ngIf="publicationInfo.relatedResearchResults != undefined">
161
                                    <p>
162
                                        The results below are discovered through our pilot algorithms.
163
                                        <a href="mailto:">Let us know how we are doing!</a>
164
                                    </p>
165

  
166
                                    <tabTable [info]="publicationInfo.relatedResearchResults"></tabTable>
167
                                </div>
168
                            </div>
169

  
170

  
171
                            <div id="similarTab" class="tab-pane fade panel-body">
172
                                <div *ngIf="publicationInfo.similarResearchResults == undefined" class = "alert alert-info ">
173
                                    There are no similar research results
174
                                </div>
175
                                <div *ngIf="publicationInfo.similarResearchResults != undefined">
176
                                    <p>
177
                                        The results below are discovered through our pilot algorithms.
178
                                        <a href="mailto:">Let us know how we are doing!</a>
179
                                    </p>
180

  
181
                                    <tabTable [info]="publicationInfo.similarResearchResults"></tabTable>
182
                                </div>
183

  
184
                                <!--div  *ngIf="publicationInfo.similarPublications == undefined && publicationInfo.similarDatasets == undefined"  class = "alert alert-info " >
185
                                    There are no similar research data
186
                                </div>
187
                                <div *ngIf="publicationInfo.similarPublications != undefined || publicationInfo.similarDatasets != undefined">
188
                                    <p>
189
                                        The results below are discovered through our pilot algorithms.
190
                                        <a href="mailto:">Let us know how we are doing!</a>
191
                                    </p>
192

  
193
                                    <div *ngIf="publicationInfo.similarPublications != undefined">
194
                                        <tabTable [info]="publicationInfo.similarPublications"></tabTable>
195
                                    </div>
196

  
197
                                    <div *ngIf="publicationInfo.similarDatasets != undefined">
198
                                        <tabTable [info]="publicationInfo.similarDatasets"></tabTable>
199
                                    </div>
200
                                </div-->
201
                            </div>
202
                            <div *ngIf="publicationInfo.bioentities != undefined" id="bioentitiesTab" class="tab-pane fade panel-body">
203
                                <p>
204
                                    The results below are discovered through our pilot algorithms.
205
                                    <a href="mailto:">Let us know how we are doing!</a>
206
                                </p>
207
                                <table id="bioentitiesTable" class="table table-striped">
208
                                    <thead>
209
                                        <tr>
210
                                            <th class="text-center">Bio Entity</th>
211
                                            <th class="text-center">Site Name</th>
212
                                        </tr>
213
                                    </thead>
214
                                    <tbody *ngFor="let key of publicationInfo.bioentities.keys()">
215
                                        <tr *ngFor="let keyIn of publicationInfo.bioentities.get(key).keys()">
216
                                            <td class="text-center" *ngIf="keyIn != undefined">
217
                                                <a href="{{publicationInfo.bioentities.get(key).get(keyIn)}}" target="_blank">
218
                                                    {{keyIn}}
219
                                                </a>
220
                                            </td>
221
                                            <td class="text-center">
222
                                                {{key}}
223
                                            </td>
224
                                        </tr>
225
                                    </tbody>
226
                                </table>
227
                            </div>
228
                        </div>
229
                    </div>
230
                    <div class="col-xs-12 col-sm-3" *ngIf="publicationInfo != null">
231

  
232
                        <ul class="list-group mainFunctionsBlock">
233
                            <li class="list-group-item">
234
                                <dl class="functionsSection">
235
                                    <dt  >Share - Bookmark</dt>
236
                                    <dd>
237
                                    </dd>
238
                                </dl>
239
                            </li>
240
                            <li class="list-group-item" *ngIf="publicationInfo.collectedFrom != undefined">
241
                                <dl class="functionsSection">
242
                                    <dt  >Collected from</dt>
243
                                    <dd  *ngFor="let item of publicationInfo.collectedFrom">
244
                                        <a href="{{item['url']}}">
245
                                            {{item['name']}}
246
                                        </a>
247
                                    </dd>
248
                                </dl>
249
                            </li>
250
                            <li class="list-group-item" *ngIf="publicationInfo.downloadFrom != undefined && publicationInfo.downloadFrom.size > 0">
251
                                <dl class="functionsSection">
252
                                    <dt class="title">Download from</dt>
253
                                    <dd class="line" *ngFor="let key of publicationInfo.downloadFrom.keys()">
254
                                        <div *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
255
                                            {{key}}
256
                                            <span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
257
                                                <a href="{{url}}">
258
                                                    [{{i+1}}]
259
                                                </a>
260
                                            </span>
261
                                        </div>
262
                                        <a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1" href="{{publicationInfo.downloadFrom.get(key)['url']}}">
263
                                            {{key}}
264
                                        </a>
265
                                    </dd>
266
                                </dl>
267
                            </li>
268
                            <li class="list-group-item" *ngIf="publicationInfo.publishedIn != undefined && publicationInfo.publishedIn.length > 0">
269
                                <dl class="functionsSection">
270
                                    <dt class="title">Published in</dt>
271
                                    <dd class="line" *ngFor="let key of publicationInfo.publishedIn.keys()">
272
                                        <div *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
273
                                            {{key}}
274
                                            <span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
275
                                                <a href="{{url}}">
276
                                                    [{{i+1}}]
277
                                                </a>
278
                                            </span>
279
                                        </div>
280
                                        <a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1" href="{{publicationInfo.publishedIn.get(key)['url']}}">
281
                                            {{key}}
282
                                        </a>
283
                                    </dd>
284
                                </dl>
285
                            </li>
286

  
287
                            <li class="list-group-item">
288
                                <dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects != undefined">
289
                                    <dt class="title">Funded By</dt>
290
                                    <dd
291
                                        title="{{item['title']}}
292
                                        |   Project Code: {{item['acronym']}}
293
                                        |   Funder: {{item['funderName']}} ({{item['funderShortname']}})
294
                                        |   Funding: {{item['funding']}}"
295
                                        class="line" *ngFor="let item of publicationInfo.fundedByProjects">
296
                                            <a *ngIf="!item['new']" href="{{item['url']}}">
297
                                                {{item['funderShortname']?item['funderShortname']:item['funderName']}}
298
                                                | {{ item['acronym']?item['acronym']:item['title']}}
299
                                            </a>
300

  
301
                                            <a *ngIf="item['new']" href="{{item['url']}}">
302
                                                <mark>
303
                                                    {{item['funderShortname']?item['funderShortname']:item['funderName']}}
304
                                                    | {{ item['acronym']?item['acronym']:item['title']}}
305
                                                </mark>
306
                                            </a>
307
                                    </dd>
308
                                </dl>
309
                                <!--dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects == undefined">
310
                                    <dt class="title">Funded By</dt>
311
                                </dl-->
312
                                <button (click)="toggleClaimProject()"  class = "btn btn-default   btn-xs" >Add more Projects</button>
313
                                <inline-claim-project *ngIf="result "  inline="true" inlineType ="publication" [inlineEntity]="result"  (projectAdded)="projectAdded($event)" ></inline-claim-project>
314
                            </li>
315
                            <li class="list-group-item">
316
                                <dl class="functionsSection" *ngIf="publicationInfo.contexts != undefined">
317
                                    <dt class="title">Related to </dt>
318
                                    <dd class="line" *ngFor="let item of publicationInfo.contexts">
319
                                        <span>{{item['labelContext']}}</span>
320
                                        <span *ngIf="item['labelCategory'] != null">-> {{item['labelCategory']}}</span>
321
                                        <span *ngIf="item['labelConcept'] != null">: {{item['labelConcept']}}</span>
322
                                    </dd>
323
                                </dl>
324
                                <dl class="functionsSection" *ngIf="publicationInfo.contexts == undefined">
325
                                    <dt class="title">Related to </dt>
326

  
327
                                </dl>
328
                                <button (click)=" toggleClaimContext()" class = "btn btn-default   btn-xs" >Add Contexts</button>
329
                                <inline-claim-context   inline="true" inlineType ="publication" [inlineEntity]="result"  ></inline-claim-context>
330
                            </li>
331
                        </ul>
332
                    </div>
333
                </div>
334
            </div>
335
        </div>
336
     `,
337
    providers:[JSONP_PROVIDERS, PublicationService],
338
    directives:[InlineClaimContextComponent, InlineClaimProjectComponent,
339
        TabPagingComponent, TabTableComponent, ShowTitleComponent,
340
        ShowAuthorsComponent, ShowIdentifiersComponent, ShowSubjectsComponent]
341
})
342

  
343
export class PublicationComponent {
344
    constructor (private _publicationService: PublicationService, private _routeParams: RouteParams) {
345
        console.info('publication constructor');
346
        this.params = _routeParams;
347
    }
348

  
349
    ngOnInit() {
350
        this.getPublicationInfo();
351
    }
352

  
353
    private publicationInfo: PublicationInfo;
354
    private params: RouteParams;
355

  
356
    private showAllReferences: boolean = false;
357
    private showAllRelResData: boolean = false;
358
    private showAllSimilPubl: boolean = false;
359
    private showAllBioentities: boolean = false;
360
    private showFundingDetails: boolean = false;
361

  
362
    private bioentitiesNum: number = 0;
363

  
364
    private result;
365
    private claimInline:string = "none" ;
366

  
367
    @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ;
368
    @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ;
369

  
370
    public warningMessage = "";
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff