Project

General

Profile

« Previous | Next » 

Revision 40982

[maven-release-plugin] copy for tag dnet-modular-repositories-ui-4.0.5

View differences:

modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<parent>
4
		<groupId>eu.dnetlib</groupId>
5
		<artifactId>dnet-parent</artifactId>
6
		<version>1.0.0</version>
7
	</parent>
8
	<modelVersion>4.0.0</modelVersion>
9
	<groupId>eu.dnetlib</groupId>
10
	<artifactId>dnet-modular-repositories-ui</artifactId>
11
	<packaging>jar</packaging>
12
	<version>4.0.5</version>
13
	<scm>
14
   		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5</developerConnection>
15
	</scm>
16
	<dependencies>
17
		<dependency>
18
			<groupId>eu.dnetlib</groupId>
19
			<artifactId>dnet-modular-ui</artifactId>
20
			<version>[3.0.0,4.0.0)</version>
21
		</dependency>
22
		<dependency>
23
			<groupId>eu.dnetlib</groupId>
24
			<artifactId>dnet-modular-workflows-ui</artifactId>
25
			<version>[4.0.0,5.0.0)</version>
26
		</dependency>
27
		<dependency>
28
			<groupId>eu.dnetlib</groupId>
29
			<artifactId>dnet-datasource-manager-rmi</artifactId>
30
			<version>[4.0.0, 5.0.0)</version>
31
		</dependency>
32
		<dependency>
33
			<groupId>junit</groupId>
34
			<artifactId>junit</artifactId>
35
			<version>${junit.version}</version>
36
			<scope>test</scope>
37
		</dependency>
38
		<dependency>
39
			<groupId>javax.servlet</groupId>
40
			<artifactId>javax.servlet-api</artifactId>
41
			<version>${javax.servlet.version}</version>
42
			<scope>provided</scope>
43
		</dependency>
44
	</dependencies>
45

  
46
	<properties>
47
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
48
	</properties>
49

  
50
</project>
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/web/resources/html/ngAggrDateCell.html
1
<div class="ngCellText text-center">
2
	<span ng-show="row.getProperty(col.field)">
3
		{{row.getProperty(col.field) | date:'yyyy-MM-dd HH:mm:ss'}}
4
	</span>
5
	<span ng-hide="row.getProperty(col.field)">
6
		<i>not yet available</i>
7
	</span>
8
</div>
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/web/resources/html/ngAggrTotalCell.html
1
<div class="ngCellText text-right">
2
	<span ng-class="{'text-success' : row.getProperty(col.field) > 0, 'text-danger' : row.getProperty(col.field) == 0}">
3
		{{row.getProperty(col.field)}}
4
	</span>
5
</div>
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepoApi.st
1
$common/master(
2

  
3
header={
4
	$ui/repos/header()$
5
	
6
	<link rel="stylesheet" type="text/css" href="../resources/css/chosen.css">
7
	
8
	<link rel="stylesheet" type="text/css" href="../resources/css/chosen-bootstrap.css">
9
    
10
	
11
	
12
	
13
	<script type='text/javascript' src="../resources/js/chosen/chosen.jquery.js"></script>
14
	<script type='text/javascript' src="../resources/js/chosen/angular-chosen.js"></script>
15
	
16
	
17
	<script type="text/javascript" src="../resources/js/dnet_workflows_common.js"></script>
18
	<script type="text/javascript" src="../resources/js/dnet_param_values_functions.js"></script>
19
	<script type="text/javascript" src="../resources/js/addRepoApi.js"></script>
20
	<script type="text/javascript">
21
		function getCompliances()         { return $compliances$ }
22
		function getTypes()               { return $types$ }
23
		function getContentDescriptions() { return $contentDescriptions$ }
24
		function getProtocols()           { return $protocols$ }
25
	</script>
26
	
27
	<style>
28
		.popover { max-width: 450px;  width: auto; }
29
	</style>
30
	
31

  
32
},
33
onLoad={},
34
body={
35
<div ng-app="addRepoApiUI" ng-controller="addRepoApiCtrl">
36
	<div ng-show="done" class="text-center">
37
		<h2>A new api has been registered !</h2> 
38
	</div>
39
	<div ng-hide="done">
40
		<form class="form-horizontal" role="form" ng-hide="repo.id">
41
			<ng-select-vocabulary-field label="Typology" vocabulary="values.types" selection="selectedTypology"></ng-select-vocabulary-field>
42
			<ng-select-repo-field label="Datasource" typology="selectedTypology" selection="repo"></ng-select-repo-field>
43
		</form>
44
	
45
		<form class="form-horizontal" role="form" ng-show="repo.id" name="newApiForm">
46
			<ng-fixed-value-field label="Datasource" value="repo.name"></ng-fixed-value-field>
47
			<ng-fixed-value-field label="Typology" value="api.typology"></ng-fixed-value-field>
48
			<ng-api-id-field label="Api ID" prefix="api_________::{{repo.origId}}::" exclusion="repo.apis" selection="api.id"></ng-api-id-field>
49
			<!-- <ng-select-vocabulary-field label="Typology" vocabulary="values.types" selection="api.typology"></ng-select-vocabulary-field> -->
50
			<ng-select-vocabulary-field label="Compatibility level" vocabulary="values.compliances" selection="api.compliance"></ng-select-vocabulary-field>
51
			<ng-select-vocabulary-field label="Content description" vocabulary="values.contentDescriptions" selection="api.contentDescription"></ng-select-vocabulary-field>
52
			<ng-select-vocabulary-field label="Protocol" vocabulary="values.protocols" selection="api.accessProtocol" contextual-params="currentParams"></ng-select-vocabulary-field>
53
			<ng-simple-edit-field label="BaseURL" selection="api.baseUrl" regex="^(http|https|ftp|file|sftp|jar):\/\/"></ng-simple-edit-field>
54
			
55
			
56
			
57
			<ng-simple-edit-field 
58
				ng-repeat="param in currentParams | filter: { functionPopulated : false }" 
59
				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
60
				selection="api.accessParams[param.name]" 
61
				optional="{{param.optional}}" 
62
				regex="{{param.regex}}" 
63
				type="{{param.type}}"></ng-simple-edit-field>
64
				
65
			<ng-simple-select-field 
66
				ng-repeat="param in currentParams | filter: { functionPopulated : true, type : 'TEXT' }" 
67
				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
68
				selection="api.accessParams[param.name]"
69
				valid-values="validValues[api.baseUrl + '@@@' + param.name]"
70
				refresh-function="listValidValuesForParam(param.name)"
71
				optional="{{param.optional}}"></ng-simple-select-field>
72
			
73
			<ng-multi-select-field 
74
				ng-repeat="param in currentParams | filter: { functionPopulated : true, type : 'LIST' }" 
75
				label="{{param.name}} [{{api.accessProtocol}} protocol]" 
76
				selection="api.accessParams[param.name]"
77
				valid-values="validValues[api.baseUrl + '@@@' + param.name]"
78
				refresh-function="listValidValuesForParam(param.name)"
79
				optional="{{param.optional}}"></ng-multi-select-field>
80
			
81
			<ng-simple-edit-field label="Xpath for Metadata Identifier" selection="api.extraFields['metadata_identifier_path']"></ng-simple-edit-field>
82
				
83
			<div class="form-group">
84
				<div class="col-sm-offset-3 col-sm-9">
85
					<button class="btn btn-default" type="button" ng-click="resetForm()">reset</button>
86
					<button class="btn btn-primary" ng-disabled="newApiForm.\$invalid" ng-click="registerApi()">add</button>
87
				</div>
88
			</div>
89
		</form>
90
		<hr />
91
	</div>
92
	
93
	<!-- ENABLE TO DEBUG -->
94
	<!--
95
	<p><b>Typology:</b> {{selectedTypology}}</p>
96
	<p><b>Repo:</b> {{repo}}</p>
97
	<p><b>Api:</b> {{api}}</p>
98
	-->
99
	
100
</div>
101
}
102

  
103
)$
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/web/resources/css/chosen.css
1
/*!
2
Chosen, a Select Box Enhancer for jQuery and Prototype
3
by Patrick Filler for Harvest, http://getharvest.com
4

  
5
Version 1.4.2
6
Full source at https://github.com/harvesthq/chosen
7
Copyright (c) 2011-2015 Harvest http://getharvest.com
8

  
9
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
This file is generated by `grunt build`, do not edit it by hand.
11
*/
12

  
13
/* @group Base */
14
.chosen-container {
15
  position: relative;
16
  display: inline-block;
17
  vertical-align: middle;
18
  font-size: 13px;
19
  zoom: 1;
20
  *display: inline;
21
  -webkit-user-select: none;
22
  -moz-user-select: none;
23
  user-select: none;
24
}
25
.chosen-container * {
26
  -webkit-box-sizing: border-box;
27
  -moz-box-sizing: border-box;
28
  box-sizing: border-box;
29
}
30
.chosen-container .chosen-drop {
31
  position: absolute;
32
  top: 100%;
33
  left: -9999px;
34
  z-index: 1010;
35
  width: 100%;
36
  border: 1px solid #aaa;
37
  border-top: 0;
38
  background: #fff;
39
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
40
}
41
.chosen-container.chosen-with-drop .chosen-drop {
42
  left: 0;
43
}
44
.chosen-container a {
45
  cursor: pointer;
46
}
47
.chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
48
  margin-right: 4px;
49
  overflow: hidden;
50
  white-space: nowrap;
51
  text-overflow: ellipsis;
52
  font-weight: normal;
53
  color: #999999;
54
}
55
.chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
56
  content: ":";
57
  padding-left: 2px;
58
  vertical-align: top;
59
}
60

  
61
/* @end */
62
/* @group Single Chosen */
63
.chosen-container-single .chosen-single {
64
  position: relative;
65
  display: block;
66
  overflow: hidden;
67
  padding: 0 0 0 8px;
68
  height: 25px;
69
  border: 1px solid #aaa;
70
  border-radius: 5px;
71
  background-color: #fff;
72
  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
73
  background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
74
  background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
75
  background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
76
  background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
77
  background-clip: padding-box;
78
  box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
79
  color: #444;
80
  text-decoration: none;
81
  white-space: nowrap;
82
  line-height: 24px;
83
}
84
.chosen-container-single .chosen-default {
85
  color: #999;
86
}
87
.chosen-container-single .chosen-single span {
88
  display: block;
89
  overflow: hidden;
90
  margin-right: 26px;
91
  text-overflow: ellipsis;
92
  white-space: nowrap;
93
}
94
.chosen-container-single .chosen-single-with-deselect span {
95
  margin-right: 38px;
96
}
97
.chosen-container-single .chosen-single abbr {
98
  position: absolute;
99
  top: 6px;
100
  right: 26px;
101
  display: block;
102
  width: 12px;
103
  height: 12px;
104
  background: url('chosen-sprite.png') -42px 1px no-repeat;
105
  font-size: 1px;
106
}
107
.chosen-container-single .chosen-single abbr:hover {
108
  background-position: -42px -10px;
109
}
110
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
111
  background-position: -42px -10px;
112
}
113
.chosen-container-single .chosen-single div {
114
  position: absolute;
115
  top: 0;
116
  right: 0;
117
  display: block;
118
  width: 18px;
119
  height: 100%;
120
}
121
.chosen-container-single .chosen-single div b {
122
  display: block;
123
  width: 100%;
124
  height: 100%;
125
  background: url('chosen-sprite.png') no-repeat 0px 2px;
126
}
127
.chosen-container-single .chosen-search {
128
  position: relative;
129
  z-index: 1010;
130
  margin: 0;
131
  padding: 3px 4px;
132
  white-space: nowrap;
133
}
134
.chosen-container-single .chosen-search input[type="text"] {
135
  margin: 1px 0;
136
  padding: 4px 20px 4px 5px;
137
  width: 100%;
138
  height: auto;
139
  outline: 0;
140
  border: 1px solid #aaa;
141
  background: white url('chosen-sprite.png') no-repeat 100% -20px;
142
  background: url('chosen-sprite.png') no-repeat 100% -20px;
143
  font-size: 1em;
144
  font-family: sans-serif;
145
  line-height: normal;
146
  border-radius: 0;
147
}
148
.chosen-container-single .chosen-drop {
149
  margin-top: -1px;
150
  border-radius: 0 0 4px 4px;
151
  background-clip: padding-box;
152
}
153
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
154
  position: absolute;
155
  left: -9999px;
156
}
157

  
158
/* @end */
159
/* @group Results */
160
.chosen-container .chosen-results {
161
  color: #444;
162
  position: relative;
163
  overflow-x: hidden;
164
  overflow-y: auto;
165
  margin: 0 4px 4px 0;
166
  padding: 0 0 0 4px;
167
  max-height: 240px;
168
  -webkit-overflow-scrolling: touch;
169
}
170
.chosen-container .chosen-results li {
171
  display: none;
172
  margin: 0;
173
  padding: 5px 6px;
174
  list-style: none;
175
  line-height: 15px;
176
  word-wrap: break-word;
177
  -webkit-touch-callout: none;
178
}
179
.chosen-container .chosen-results li.active-result {
180
  display: list-item;
181
  cursor: pointer;
182
}
183
.chosen-container .chosen-results li.disabled-result {
184
  display: list-item;
185
  color: #ccc;
186
  cursor: default;
187
}
188
.chosen-container .chosen-results li.highlighted {
189
  background-color: #3875d7;
190
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
191
  background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
192
  background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
193
  background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
194
  background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
195
  color: #fff;
196
}
197
.chosen-container .chosen-results li.no-results {
198
  color: #777;
199
  display: list-item;
200
  background: #f4f4f4;
201
}
202
.chosen-container .chosen-results li.group-result {
203
  display: list-item;
204
  font-weight: bold;
205
  cursor: default;
206
}
207
.chosen-container .chosen-results li.group-option {
208
  padding-left: 15px;
209
}
210
.chosen-container .chosen-results li em {
211
  font-style: normal;
212
  text-decoration: underline;
213
}
214

  
215
/* @end */
216
/* @group Multi Chosen */
217
.chosen-container-multi .chosen-choices {
218
  position: relative;
219
  overflow: hidden;
220
  margin: 0;
221
  padding: 0 5px;
222
  width: 100%;
223
  height: auto !important;
224
  height: 1%;
225
  border: 1px solid #aaa;
226
  background-color: #fff;
227
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
228
  background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
229
  background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
230
  background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
231
  background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
232
  cursor: text;
233
}
234
.chosen-container-multi .chosen-choices li {
235
  float: left;
236
  list-style: none;
237
}
238
.chosen-container-multi .chosen-choices li.search-field {
239
  margin: 0;
240
  padding: 0;
241
  white-space: nowrap;
242
}
243
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
244
  margin: 1px 0;
245
  padding: 0;
246
  height: 25px;
247
  outline: 0;
248
  border: 0 !important;
249
  background: transparent !important;
250
  box-shadow: none;
251
  color: #999;
252
  font-size: 100%;
253
  font-family: sans-serif;
254
  line-height: normal;
255
  border-radius: 0;
256
}
257
.chosen-container-multi .chosen-choices li.search-choice {
258
  position: relative;
259
  margin: 3px 5px 3px 0;
260
  padding: 3px 20px 3px 5px;
261
  border: 1px solid #aaa;
262
  max-width: 100%;
263
  border-radius: 3px;
264
  background-color: #eeeeee;
265
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
266
  background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
267
  background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
268
  background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
269
  background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
270
  background-size: 100% 19px;
271
  background-repeat: repeat-x;
272
  background-clip: padding-box;
273
  box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
274
  color: #333;
275
  line-height: 13px;
276
  cursor: default;
277
}
278
.chosen-container-multi .chosen-choices li.search-choice span {
279
  word-wrap: break-word;
280
}
281
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
282
  position: absolute;
283
  top: 4px;
284
  right: 3px;
285
  display: block;
286
  width: 12px;
287
  height: 12px;
288
  background: url('chosen-sprite.png') -42px 1px no-repeat;
289
  font-size: 1px;
290
}
291
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
292
  background-position: -42px -10px;
293
}
294
.chosen-container-multi .chosen-choices li.search-choice-disabled {
295
  padding-right: 5px;
296
  border: 1px solid #ccc;
297
  background-color: #e4e4e4;
298
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
299
  background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
300
  background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
301
  background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
302
  background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
303
  color: #666;
304
}
305
.chosen-container-multi .chosen-choices li.search-choice-focus {
306
  background: #d4d4d4;
307
}
308
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
309
  background-position: -42px -10px;
310
}
311
.chosen-container-multi .chosen-results {
312
  margin: 0;
313
  padding: 0;
314
}
315
.chosen-container-multi .chosen-drop .result-selected {
316
  display: list-item;
317
  color: #ccc;
318
  cursor: default;
319
}
320

  
321
/* @end */
322
/* @group Active  */
323
.chosen-container-active .chosen-single {
324
  border: 1px solid #5897fb;
325
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
326
}
327
.chosen-container-active.chosen-with-drop .chosen-single {
328
  border: 1px solid #aaa;
329
  -moz-border-radius-bottomright: 0;
330
  border-bottom-right-radius: 0;
331
  -moz-border-radius-bottomleft: 0;
332
  border-bottom-left-radius: 0;
333
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
334
  background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
335
  background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
336
  background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
337
  background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
338
  box-shadow: 0 1px 0 #fff inset;
339
}
340
.chosen-container-active.chosen-with-drop .chosen-single div {
341
  border-left: none;
342
  background: transparent;
343
}
344
.chosen-container-active.chosen-with-drop .chosen-single div b {
345
  background-position: -18px 2px;
346
}
347
.chosen-container-active .chosen-choices {
348
  border: 1px solid #5897fb;
349
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
350
}
351
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
352
  color: #222 !important;
353
}
354

  
355
/* @end */
356
/* @group Disabled Support */
357
.chosen-disabled {
358
  opacity: 0.5 !important;
359
  cursor: default;
360
}
361
.chosen-disabled .chosen-single {
362
  cursor: default;
363
}
364
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
365
  cursor: default;
366
}
367

  
368
/* @end */
369
/* @group Right to Left */
370
.chosen-rtl {
371
  text-align: right;
372
}
373
.chosen-rtl .chosen-single {
374
  overflow: visible;
375
  padding: 0 8px 0 0;
376
}
377
.chosen-rtl .chosen-single span {
378
  margin-right: 0;
379
  margin-left: 26px;
380
  direction: rtl;
381
}
382
.chosen-rtl .chosen-single-with-deselect span {
383
  margin-left: 38px;
384
}
385
.chosen-rtl .chosen-single div {
386
  right: auto;
387
  left: 3px;
388
}
389
.chosen-rtl .chosen-single abbr {
390
  right: auto;
391
  left: 26px;
392
}
393
.chosen-rtl .chosen-choices li {
394
  float: right;
395
}
396
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
397
  direction: rtl;
398
}
399
.chosen-rtl .chosen-choices li.search-choice {
400
  margin: 3px 5px 3px 0;
401
  padding: 3px 5px 3px 19px;
402
}
403
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
404
  right: auto;
405
  left: 4px;
406
}
407
.chosen-rtl.chosen-container-single-nosearch .chosen-search,
408
.chosen-rtl .chosen-drop {
409
  left: 9999px;
410
}
411
.chosen-rtl.chosen-container-single .chosen-results {
412
  margin: 0 0 4px 4px;
413
  padding: 0 4px 0 0;
414
}
415
.chosen-rtl .chosen-results li.group-option {
416
  padding-right: 15px;
417
  padding-left: 0;
418
}
419
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
420
  border-right: none;
421
}
422
.chosen-rtl .chosen-search input[type="text"] {
423
  padding: 4px 5px 4px 20px;
424
  background: white url('chosen-sprite.png') no-repeat -30px -20px;
425
  background: url('chosen-sprite.png') no-repeat -30px -20px;
426
  direction: rtl;
427
}
428
.chosen-rtl.chosen-container-single .chosen-single div b {
429
  background-position: 6px 2px;
430
}
431
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
432
  background-position: -12px 2px;
433
}
434

  
435
/* @end */
436
/* @group Retina compatibility */
437
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
438
  .chosen-rtl .chosen-search input[type="text"],
439
  .chosen-container-single .chosen-single abbr,
440
  .chosen-container-single .chosen-single div b,
441
  .chosen-container-single .chosen-search input[type="text"],
442
  .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
443
  .chosen-container .chosen-results-scroll-down span,
444
  .chosen-container .chosen-results-scroll-up span {
445
    background-image: url('chosen-sprite@2x.png') !important;
446
    background-size: 52px 37px !important;
447
    background-repeat: no-repeat !important;
448
  }
449
}
450
/* @end */
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/addRepo.st
1
$common/master(
2

  
3
header={
4
	$ui/repos/header()$
5
	<script type="text/javascript" src="../resources/js/dnet_param_values_functions.js"></script>
6
	<script type="text/javascript" src="../resources/js/addRepo.js"></script>
7
	<script type="text/javascript">
8
		function getTypes()     { return $types$ }
9
		function getCountries() { return $countries$ }
10
	</script>
11
	
12
	<style>
13
		.popover { max-width: 450px;  width: auto; }
14
	</style>
15
	
16
	
17
},
18
onLoad={},
19
body={
20
<div ng-app="addRepoUI" ng-controller="addRepoCtrl">
21
	<div ng-show="done" class="text-center">
22
		<h2>A new datasource has been registered !</h2> 
23
	</div>
24
	<div ng-hide="done">
25
		<form class="form-horizontal" role="form" name="newRepoForm">
26
		
27
			<fieldset>
28
				<legend>General Info</legend>
29
				<ng-simple-edit-field label="Datasource ID" selection="repo.id"></ng-simple-edit-field>
30
				<ng-simple-edit-field label="Official Name" selection="repo.officialName"></ng-simple-edit-field>
31
				<ng-simple-edit-field label="English Name" selection="repo.englishName" optional="true"></ng-simple-edit-field>
32
				<ng-simple-edit-field label="Organization" selection="repo.organization"></ng-simple-edit-field>
33
				<ng-select-vocabulary-field label="Typology Class" vocabulary="validTypes" selection="repo.datasourceClass"></ng-select-vocabulary-field>
34
			</fieldset>
35
			
36
			<fieldset>
37
				<legend>Contacts</legend>
38
				<ng-simple-edit-field label="WebSite Url" selection="repo.websiteUrl" regex="^(http|https):\/\/"></ng-simple-edit-field>
39
				<ng-simple-edit-field label="Contact Email" selection="repo.contactEmail" regex="^.+@.+"></ng-simple-edit-field>
40
			</fieldset>
41
				
42
			<fieldset>
43
				<legend>Geographical Info</legend>
44
				<ng-select-vocabulary-field label="Country" vocabulary="validCountries" selection="repo.countryCode"></ng-select-vocabulary-field>
45
				<ng-simple-edit-field label="Latitude" selection="repo.latitude" type="NUMBER"></ng-simple-edit-field>
46
				<ng-simple-edit-field label="Longitude" selection="repo.longitude" type="NUMBER"></ng-simple-edit-field>
47
			</fieldset>
48
			
49
			<fieldset>
50
				<legend>Technical Info</legend>
51
				<ng-simple-edit-field label="Namespace Prefix (12 chars)" selection="repo.namespacePrefix" regex="^\w{12}\$"></ng-simple-edit-field>
52
				<ng-simple-edit-field label="Software Typology" selection="repo.typology" optional="true"></ng-simple-edit-field>
53
				<ng-simple-edit-field label="Logo Url" selection="repo.logoUrl" regex="^(http|https):\/\/" optional="true"></ng-simple-edit-field>
54
			</fieldset>
55
			
56
			<br /><br />
57
			<div class="form-group">
58
				<div class="col-sm-offset-3 col-sm-9">
59
					<button class="btn btn-default" type="button" ng-click="resetForm()">reset</button>
60
					<button class="btn btn-primary" ng-disabled="newRepoForm.\$invalid" ng-click="registerRepo()">add</button>
61
				</div>
62
			</div>
63
		</form>
64
		<hr />
65
	</div>
66
	
67
	<!-- ENABLE TO DEBUG -->
68
	
69
	<!-- <p><b>Repo:</b> {{repo}}</p> -->
70
	
71
	
72
</div>
73
}
74

  
75
)$
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoApi.st
1
<div class="row">
2
	<div class="col-xs-12">
3
		<div class="pull-right">
4
			<button class="btn btn-sm btn-primary btnRefreshApi" type="button" data-toggle="modal" data-target="#metaWfSelectionModal"><span class="glyphicon glyphicon-plus"></span> add metaworkflow</button>
5
			<button class="btn btn-sm btn-default btnRefreshApi" type="button" ng-click="loadApi()"><span class="glyphicon glyphicon-refresh"></span></button>
6
			<button class="btn btn-sm btn-default" type="button" onclick="history.go(-1);">back</button>
7
		</div>
8
	</div>
9
</div>
10

  
11
<div class="well" style="margin-top: 20px; margin-bottom: 20px">
12
	<div class="row">
13
		<div class="input-group input-group-sm col-xs-12" style="padding: 10px; float: left;">
14
	  		<span class="input-group-addon" style="width: 150px;"><b>Datasource</b></span>
15
			<div class="form-control">{{currentRepoApi.repoName}}
16
				<span class="pull-right" ng-show="currentRepoApi.repoCountry">
17
					<img ng-src="../resources/img/flags/{{currentRepoApi.repoCountry}}.gif" /> 
18
					{{currentRepoApi.repoCountry}}
19
				</span>
20
			</div>
21
			<span class="input-group-btn">
22
				<a href="isManager.do#/profile/{{currentRepoApi.repoId}}" class="btn btn-primary" title="xml profile"><span class="glyphicon glyphicon-link"></span></a>
23
				<button type="button" class="btn btn-primary" ng-click="showDetails(currentRepoApi.repoId, currentRepoApi.repoName)" title="info"><span class="glyphicon glyphicon-info-sign"></span></button>
24
			</span>
25
		</div>
26
		
27
		<div class="input-group input-group-sm col-xs-12 col-md-6" style="padding: 10px; float: left;">
28
			<span class="input-group-addon" style="width: 150px;"><b>API details</b></span>
29
			<span class="form-control" ng-repeat="p in currentRepoApi.commonParams" ng-hide="p.name == 'compliance'" style="white-space: nowrap;"><b>{{p.name}}:</b> {{p.value}}</span>
30
			<span class="form-control"><b>ns prefix:</b> {{currentRepoApi.repoPrefix}}</span>
31
			<span class="form-control" ng-show="currentRepoApi.otherParams.length > 0"><a href="javascript:void(0)" data-toggle="modal" data-target="#showOtherParamsModal">other details...</a></span>
32
		</div>
33
				
34
		<div class="input-group input-group-sm col-xs-12 col-md-6" style="padding: 10px; float: left;">
35
	  		<span class="input-group-addon" style="width: 150px;"><b>Protocol</b></span>
36
			<div class="form-control">
37
				{{currentRepoApi.protocol}}
38
				<span class="pull-right" ng-show="currentRepoApi.protocol == 'oai'">
39
					<a href="javascript:void(0)" ng-click="testOAI(currentRepoApi.accessParams)">verify</a>				
40
				</span>
41
			</div>
42
			<span class="input-group-btn">
43
				<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editAccessParamsModal">access params</button>
44
			</span>
45
		</div>
46
		
47
		<div class="input-group input-group-sm col-xs-12 col-md-6" style="padding: 10px; float: left;" ng-repeat="p in currentRepoApi.commonParams" ng-show="p.name == 'compliance'">
48
			<span class="input-group-addon" style="width: 150px;"><b>Compliance</b></span>
49
			<span class="form-control" ng-show="p.otherValue" style="color: #c06a00">{{p.value}} (override)</span>
50
			<span class="form-control" ng-hide="p.otherValue">{{p.value}} (by validator)</span>
51
		
52
			<div class="input-group-btn">
53
				<button type="button" data-toggle="dropdown" class="btn btn-sm dropdown-toggle" ng-class="{ 'btn-primary' : !p.otherValue, 'btn-warning' : p.otherValue }">
54
					<span class="caret pull-right"></span>
55
				</button>
56
			    <ul class="dropdown-menu dropdown-menu-right" role="menu">
57
			        <li role="presentation" ng-repeat="l in compatibilityLevels">
58
			        	<a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-click="overrideApiCompliance(l.name)">override to <b>{{l.name}}</b> (<i>{{l.desc}}</i>)</a>
59
			        </li>
60
					<li class="divider" role="presentation" ng-show="p.otherValue"></li>
61
			        <li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-show="p.otherValue" ng-click="resetApiCompliance()">reset to the validator value: <b>{{p.otherValue}}</b></a></li>
62
			    </ul>
63
			</div>
64
		</div>
65
			
66
		<div class="input-group input-group-sm col-xs-12 col-md-6" style="padding: 10px; float: left;">
67
	  		<span class="input-group-addon" style="width: 150px;"><b>Last aggregation</b></span>
68
	  		<ng-api-mdstore-info label="Collect" date="currentRepoApi.collDate" total="currentRepoApi.collTotal" id="currentRepoApi.collMdId"></ng-api-mdstore-info>	  		
69
	  		<ng-api-mdstore-info label="Transform" date="currentRepoApi.aggrDate" total="currentRepoApi.aggrTotal" id="currentRepoApi.aggrMdId"></ng-api-mdstore-info>
70
	  		<ng-api-objectstore-info label="Download" date="currentRepoApi.downloadDate" total="currentRepoApi.downloadTotal" id="currentRepoApi.downloadObjId"></ng-api-objectstore-info>
71
		</div>
72
		
73
	</div>
74
</div>
75
	
76
<div ng-hide="metaworkflows.length != 0" class="text-center" style="margin-top: 40px">
77
	<button class="btn btn-lg btn-primary btnRefreshApi" type="button" data-toggle="modal" data-target="#metaWfSelectionModal"><span class="glyphicon glyphicon-plus"></span> add first metaworkflow</button>
78
</div>
79

  
80
<div class="panel-group" id="accordion" ng-show="metaworkflows.length != 0">
81
	<div class="panel panel-default" ng-repeat="m in metaworkflows" style="overflow: visible;">
82
		<div class="panel-heading">
83
			<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" data-target="#collapse_{{m.id | limitTo: 36}}" ng-click="getMetaWorkflow(m.id)">
84
				<b>{{m.name}}</b>
85
			</a>
86
		</div>
87
		
88
		<div id="collapse_{{m.id | limitTo: 36}}" class="panel-collapse collapse out">
89
			<div class="panel-body" ng-show="m.deleting">
90
				<span class="muted" ng-show="m.deleting">deleting...</span>
91
			</div>
92

  
93
			<table class="table" id="metaWfTable" ng-hide="m.deleting">
94
				<thead>
95
					<tr>
96
						<th>Aggregation step</th>
97
						<th class="col-xs-2" style="white-space: nowrap;">Last execution date</th>
98
						<th class="col-xs-1 text-center">Last status</th>
99
						<th class="col-xs-1 text-center">Launch mode</th>
100
						<th class="col-xs-4 col-md-3 text-right">Actions</th>
101
					</tr>
102
				</thead>
103
				<tbody ng-bind-html="to_trusted(currentMetaWorkflow.html)" compile-template></tbody>
104
			</table>
105

  
106
			<div class="panel-footer" ng-hide="m.deleting">
107
				<form class="form-inline">
108
					<a href="isManager.do#/profile/{{currentMetaWorkflow.wfId}}" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-link"></span></a>
109
					<div class="btn-group">
110
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#metaWfEditModal" ng-click="prepareMetaWfEdit()">configure</button>
111
						<button type="button" class="btn btn-default btn-sm" data-toggle="modal" ng-click="updateMetaWorkflowHistory()">history</button>
112
					</div>
113
					<button type="button" class="btn btn-danger btn-sm btnRefreshApi" ng-show="m.destroyWorkflow && !m.deleting" ng-click="destroyDataProviderWorkflow(m)">
114
						<span class="glyphicon glyphicon-remove"></span> delete
115
					</button>
116
				</form>
117
			</div>
118
		</div>
119
	</div>
120
</div>
121

  
122
<div id="metaWfSelectionModal" class="modal fade" tabindex="-1" role="dialog">
123
	<div class="modal-dialog modal-lg">
124
		<div class="modal-content">
125
			<div class="modal-header">
126
				<button type="button" class="close" data-dismiss="modal">&times;</button>
127
				<h4 class="modal-title">Available MetaWorkflows for current API</h4>
128
			</div>
129
			<div class="modal-body">
130
				<div class="panel panel-default" ng-repeat="e in availableRepohiWfs" ng-show="verifyMetaWf(currentRepoApi, e)">
131
					<div class="panel-heading">
132
						<a href="javascript:void(0)" data-dismiss="modal" ng-click="newDataProviderWorkflow(e.id)">{{e.name}}</a>
133
					</div>
134
					<div class="panel-body">
135
						<span ng-repeat="f in e.fields">
136
							<strong >{{f.k}}: </strong>{{f.v}}<br />
137
						</span>
138
						<strong>Typology prefixes: </strong>{{e.ifaceTypes.join()}}
139
						<br />
140
						<strong>Compliance prefixes: </strong>{{e.compliances.join()}}
141
						
142
					</div>
143
				</div>
144
			</div>
145
			<div class="modal-footer">
146
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
147
			</div>
148
		</div>
149
	</div>
150
</div>
151

  
152
<div id="editAccessParamsModal" class="modal fade" tabindex="-1" role="dialog">
153
	<div class="modal-dialog modal-lg">
154
		<div class="modal-content">
155
			<div class="modal-header">
156
				<button type="button" class="close" data-dismiss="modal">&times;</button>
157
				<h4 class="modal-title">Access params (protocol: {{currentRepoApi.protocol}})</h4>
158
			</div>
159
			<div class="modal-body">
160
				<div class="well">
161
					<form class="form-horizontal" role="form">
162
						<div class="form-group" ng-repeat="p in currentRepoApi.accessParams">
163
							<label for="input_ap_{{p.name}}" class="col-sm-3 control-label">{{p.name}}</label>
164
							<div class="col-sm-9" ng-hide="currentRepoApi.protocol == 'oai' && p.name == 'set'">
165
								<input type="text" class="form-control" id="input_ap_{{p.name}}" ng-model="p.value"/>
166
							</div>
167
							<div class="col-sm-9" ng-show="currentRepoApi.protocol == 'oai' && p.name == 'set'"> 
168
								<select class="form-control" style="font-size: 11px" size="10" multiple ng-model="selectedSets" ng-change="updateSets(selectedSets, currentRepoApi.accessParams)">
169
									<option ng-repeat="set in currentSets" value="{{set.id}}" ng-selected="set.selected">{{set.name}}</option>
170
								</select>
171
								<button class="btn btn-xs btn-default" style="margin-top: 4px" ng-click="listSets(currentRepoApi.accessParams)"><span class="glyphicon glyphicon-refresh"></span></button>
172
							</div>
173
  						</div>
174
					</form>
175
				</div>
176
			</div>
177
			<div class="modal-footer">
178
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
179
				<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="updateRepoApi(currentRepoApi.accessParams)">Save</button>
180
			</div>
181
		</div>
182
	</div>
183
</div>
184

  
185
<div id="showOtherParamsModal" class="modal fade" tabindex="-1" role="dialog">
186
	<div class="modal-dialog modal-lg">
187
		<div class="modal-content">
188
			<div class="modal-header">
189
				<button type="button" class="close" data-dismiss="modal">&times;</button>
190
				<h4 class="modal-title">Other parameters</h4>
191
			</div>
192
			<div class="modal-body">
193
				<div class="well">
194
					<table class="table table-bordered table-condensed">
195
						<thead>
196
							<th>
197
								<span>Name</span>
198
								<span class="pull-right">Value</span>
199
							</th>
200
						</thead>
201
						<tbody>
202
							<tr ng-repeat="p in currentRepoApi.otherParams">
203
								<td>
204
									<b>{{p.name}}</b>
205
									<span class="pull-right">{{p.value}}</span>
206
								</td>
207
							</tr>
208
						</tbody>
209
					</table>
210
				</div>
211
			</div>
212
			<div class="modal-footer">
213
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
214
			</div>
215
		</div>
216
	</div>
217
</div>
218

  
219

  
220
$ui/repos/repoDetails()$
221
$ui/workflows/common/atomwf()$
222
$ui/workflows/common/metawf_edit()$		
223
$ui/workflows/common/atomwf_edit()$
224
$ui/workflows/common/wf_monitor()$
225
$ui/workflows/common/wf_monitor_proc( backFunction={updateMetaWorkflowHistory()} )$
226
$ui/workflows/common/wf_monitor_proc_node()$
227
$ui/workflows/common/wf_journal_entry()$
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/repoDetails.st
1
<div id="repoDetailsModal" class="modal fade" tabindex="-1" role="dialog">
2
	<div class="modal-dialog modal-lg">
3
		<div class="modal-content">
4
			<div class="modal-header">
5
				<button type="button" class="close" data-dismiss="modal">&times;</button>
6
				<h4 class="modal-title">{{currentRepoName}}</h4>
7
			</div>
8
			<div class="modal-body">
9
				<div ng-bind-html="currentRepoHTML"></div>
10
			</div>
11
			<div class="modal-footer">
12
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
13
			</div>
14
		</div>
15
	</div>
16
</div>
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos/header.st
1
<script type="text/javascript" src="../resources/js/angular.min.js"></script>
2
<script type="text/javascript" src="../resources/js/ng-grid-2.0.7.min.js"></script>
3
<script type="text/javascript" src="../resources/js/reposCommon.js"></script>
4

  
5
<link rel="stylesheet" type="text/css" href="../resources/css/ng-grid.min.css" />
6

  
7
<style>
8
	.gridStyle {
9
		width: 100%;
10
		height: 150px;
11
		margin-bottom: 20px;
12
		font-size: 11px;
13
	}
14
	
15
	.gridStyle-big {
16
		width: 100%; 
17
		height: 300px;
18
		margin-bottom: 20px;
19
		font-size: 11px;
20
	}
21
</style>
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/web/resources/js/addRepoApi.js
1
var module = angular.module('addRepoApiUI', ['localytics.directives']);
2

  
3
module.directive('bsHasError', function() {
4
	return {
5
		restrict: "A",
6
		link: function(scope, element, attrs, ctrl) {
7
			element.toggleClass('has-feedback', true);
8
			var input = element.find('input[ng-model], select[ng-model]');
9
			if (input) {
10
				scope.$watch(function() {
11
					if (input.hasClass('ng-invalid')) {
12
						return 0;
13
					} else if (input.hasClass('empty')) {
14
						return 1;
15
					} else {
16
						return 2;
17
					}
18
				}, function(code) {
19
					if (code < 0) return;
20
					
21
					element.toggleClass('has-error', (code == 0));
22
					element.toggleClass('has-warning', (code == 1));
23
					element.toggleClass('has-success', (code == 2));
24
					
25
					var feedback = element.find('.form-control-feedback');
26
					if (feedback) {
27
						feedback.toggleClass('glyphicon-remove', (code == 0));
28
						feedback.toggleClass('glyphicon-warning-sign', (code == 1));
29
						feedback.toggleClass('glyphicon-ok', (code == 2));
30
					}
31
				});
32
			}
33
		}
34
	};
35
});
36

  
37
module.directive('ngSelectRepoField', function($http) {
38
	return {
39
		restrict: 'E',
40
		scope: {
41
            'label'     : '@',
42
            'typology'  : '=',
43
            'selection' : '='
44
		},
45
		templateUrl: '../resources/html/addRepoApi/ngSelectRepoField.html',
46
		link: function(scope, element, attrs, ctrl) {
47
			scope.repositories = [];
48
			scope.current = '';
49
			scope.$watch('typology', function() {
50
				scope.repositories = [];
51
				if (scope.typology) {
52
					showSpinner();
53
					$http.get('listRepositories.json?type=' + scope.typology).success(function(data) {
54
						scope.repositories = data;
55
						hideSpinner();
56
					}).error(function() {
57
						show_notification("error", "An error occurred while fetching datasource of type " + scope.typology);
58
						hideSpinner();
59
					});
60
				}
61
			});
62
		}
63
	}
64
});
65

  
66
module.directive('ngFixedValueField', function() {
67
	return {
68
		restrict: 'E',
69
		scope: {
70
            'label'  : '@',
71
            'value'  : '='
72
		},
73
		templateUrl: '../resources/html/addRepoApi/ngFixedValueField.html'
74
	}
75
});
76

  
77
module.directive('ngApiIdValidation', function() {
78
	return {
79
		restrict: 'A',
80
		scope: {
81
			'valid' : '='
82
		},
83
		require: 'ng-model',
84
		link: function(scope, element, attrs, ctrl) {
85
			scope.$watch('valid', function() {
86
				ctrl.$setValidity('wrongId', scope.valid);
87
			});
88
		}
89
	}
90
});
91

  
92
module.directive('ngApiIdField', function() {
93
	return {
94
		restrict: 'E',
95
		scope: {
96
			'label'     : '@',
97
			'prefix'    : '@',
98
			'selection' : '=',
99
			'exclusion' : '='
100
		},
101
		templateUrl: '../resources/html/addRepoApi/ngApiIdField.html',
102
		link: function(scope, element, attrs) {
103
			scope.suffix = '';
104
			scope.alert = '';
105
			scope.valid = false;
106
			scope.required = true;
107
			scope.mypattern = new RegExp(scope.regex);
108

  
109
			scope.validate = function(b, newValue, message) {
110
				scope.valid = b;
111
				scope.selection = newValue;
112
				scope.alert = message;
113
				element.toggleClass('has-error', !b);
114
				element.toggleClass('has-success', b);
115
				var feedback = element.find('.form-control-feedback');
116
				if (feedback) {
117
					feedback.toggleClass('glyphicon-remove', !b);
118
					feedback.toggleClass('glyphicon-ok', b);
119
				}
120
			}
121
			
122
			scope.$watch('suffix', function() {
123
				var tmpId = scope.prefix + scope.suffix;
124
				
125
				if (!scope.suffix) {
126
					scope.validate(false, '', 'ID is empty');
127
				} else if (!scope.suffix.match(/^[A-Za-z0-9_]*$/g)) {
128
					scope.validate(false, '', 'Invalid format, valid chars are: A-Za-z0-9_');
129
				} else if($.inArray(tmpId, scope.exclusion) > -1) {
130
					scope.validate(false, '', 'The ID already exists');
131
				} else {
132
					scope.selection = tmpId;
133
					scope.validate(true, tmpId, '');
134
				}
135
			});
136
		}
137
	}
138
});
139

  
140
module.directive('ngSelectVocabularyField', function() {
141
	return {
142
		restrict: 'E',
143
		scope: {
144
            'label'            : '@',
145
            'vocabulary'       : '=',
146
            'selection'        : '=',
147
            'contextualParams' : '='
148
		},
149
		templateUrl: '../resources/html/addRepoApi/ngSelectVocabularyField.html',
150
		link: function(scope, elem, attrs) {
151
			scope.required = true;
152
			scope.selectId = 'select_' + scope.label.replace( /\s/g, "_").toLowerCase();
153
			
154
			scope.$watch('selection', function() {
155
				scope.contextualParams = [];
156
				angular.forEach(scope.vocabulary, function(term){
157
					if (term.name == scope.selection) {
158
						scope.contextualParams = term.params;
159
					} 					
160
				});				
161
			});
162
		}
163
	}
164
});
165

  
166
module.filter('vocabularyTerm', function() {
167
	return function(term) {
168
		if(term.desc) {
169
			return term.name + ' (' + term.desc + ')';
170
	    } else {
171
	    	return term.name;
172
	    }
173
	};
174
});
175

  
176
module.directive('ngSimpleEditField', function() {
177
	return {
178
		restrict: 'E',
179
		scope: {
180
            'label'         : '@',
181
            'regex'         : '@',
182
            'optional'      : '@',
183
            'type'          : '@',
184
            'selection'     : '=',
185
		},
186
		templateUrl: '../resources/html/addRepoApi/ngSimpleEditField.html',
187
		link: function(scope, element, attrs) {
188
			scope.required = (scope.optional != 'true');
189
			if      (scope.regex)             { scope.mypattern = new RegExp(scope.regex); }
190
			else if (scope.type == 'NUMBER')  { scope.mypattern = new RegExp("^[-+]?[0-9]+(\.[0-9]+)?$"); }
191
			else if (scope.type == 'BOOLEAN') { scope.mypattern = new RegExp("^(true|false)$"); }
192
			else                              { scope.mypattern = new RegExp(".+"); }
193
		}
194
	}
195
});
196

  
197
module.directive('ngSimpleSelectField', function() {
198
	return {
199
		restrict: 'E',
200
		scope: {
201
            'label'           : '@',
202
            'optional'        : '@',
203
            'refreshFunction' : '&',
204
            'validValues'     : '=',
205
            'selection'       : '='
206
		},
207
		templateUrl: '../resources/html/addRepoApi/ngSimpleSelectField.html',
208
		link: function(scope, element, attrs) {
209
			scope.required = (scope.optional != 'true');
210
			scope.populateList = function() {
211
				scope.validValues = scope.functionList();
212
			}
213
		}
214
	}
215
});
216

  
217

  
218
module.directive('ngMultiSelectField', function() {
219
	return {
220
		restrict: 'E',
221
		scope: {
222
			'label'           : '@',
223
            'optional'        : '@',
224
            'refreshFunction' : '&',
225
            'validValues'     : '=',
226
            'selection'       : '='
227
		},
228
		templateUrl: '../resources/html/addRepoApi/ngMultiSelectField.html',
229
		link: function(scope, element, attrs) {
230
			scope.arraySelection = [];
231
			scope.required = (scope.optional != 'true');
232
			scope.$watch('arraySelection', function() {
233
				scope.selection = scope.arraySelection.join();
234
			});
235
		}
236
	}
237
});
238

  
239

  
240
module.controller('addRepoApiCtrl', function ($scope, $http, $sce, $location) {
241
	
242
	common_init($scope, $http, $sce, $location)
243
	
244
	$scope.values = {
245
		'compliances'         : getCompliances(),
246
		'types'               : getTypes(),
247
		'contentDescriptions' : getContentDescriptions(),
248
		'protocols'           : getProtocols()
249
	}
250
		
251
	$scope.$watch('repo', function() {
252
		if ($scope.repo) {
253
			$scope.api = {
254
				'typology'     : $scope.repo.typology,
255
				'accessParams' : {},
256
				'extraFields'  : {}
257
			};
258
		}
259
	});
260
	
261
	$scope.resetForm = function() {
262
		$scope.currentParams = [];
263
		$scope.selectedTypology = '';
264
		$scope.repo = {};
265
		$scope.api = {};
266
		$scope.validValues = [];
267
	}
268
	
269
	$scope.registerApi = function() {
270
		if (confirm('Add new api to repository \n\n' + $scope.repo.name + '?')) {
271
			$scope.showSpinner();
272
			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
273
			$http.post('repoApi.new', $.param({
274
				'repoId' : $scope.repo.origId,
275
				'iface'  : JSON.stringify($scope.api)
276
			})).success(function(res) {
277
	            	if(res) {
278
	            		$scope.showNotification('The API has been registered');
279
	            		$scope.hideSpinner();
280
	            		$scope.done = 1;
281
	            		//TODO once we'll get rid of pending/valid repo state, we'll ba able to redirect to the repo detail page
282
	            		//location.href = 'isManager.do#/profile/' + $scope.repo.id;
283
	            	} else {
284
	                	$scope.hideSpinner();
285
	            		$scope.showError('Registration failed');
286
	            	}
287
			}).error(function(message) {
288
				$scope.hideSpinner();
289
				$scope.showError('Registration failed: ' + message);
290
			});
291
		}
292
	}
293
	
294
	$scope.listValidValuesForParam = function(param) {
295
		if (!param) {
296
			$scope.showError("Invalid param");
297
			return;
298
		}
299
		
300
		if (!$scope.api.accessProtocol) {
301
			$scope.showError("Access Protocol is missing");
302
			return;	
303
		}
304
		if (!$scope.api.baseUrl) {
305
			$scope.showError("BaseUrl is missing");
306
			return;
307
		}
308
		
309
		var key = $scope.api.baseUrl + '@@@' + param;
310
		$scope.validValues[key] = [];
311

  
312
		$scope.showSpinner();
313
		$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
314
		$http.post('listValidValuesForParam.do', $.param({
315
			'protocol' : $scope.api.accessProtocol,
316
			'param'    : param,
317
			'baseUrl'  : $scope.api.baseUrl,
318
		})).success(function(data) {
319
			$scope.hideSpinner();
320
			$scope.validValues[key] = data;
321
		}).error(function(message) {
322
			$scope.hideSpinner();
323
			$scope.showError('Error obtaining values: ' + message);
324
		});
325
	}
326
	
327
	$scope.resetForm();
328
});
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repos.st
1
$common/master(
2

  
3
header={
4
	$ui/repos/header()$
5
	<script type="text/javascript" src="../resources/js/repoEnabler.js"></script>
6
	<script type="text/javascript">
7
		function getTypologies() { return $types$ }
8
	</script>
9
	
10
	<style>
11
		.popover { max-width: 450px;  width: auto; }
12
	</style>
13
},
14
onLoad={},
15
body={
16
	<div id="main" ng-app="repoEnablerUI" ng-controller="repoEnablerCtrl">
17
		$ui/repos/repoDetails()$
18
	
19
		<div class="row">
20
			<div class="col-sm-4 col-lg-3">
21
				<ul class="nav nav-pills nav-stacked">
22
					<li ng-class="{active : t.id == currType}"
23
						ng-repeat="t in types">
24
						<a href="javascript:void(0)" ng-click="selectType(t.name)">{{t.desc}}</a>
25
					</li>
26
				</ul>
27
			</div>
28
			<div class="col-sm-8 col-lg-9">
29
				<div class="well" ng-hide="repos.length > 0">
30
					<h5><i>No datasource</i></h5>
31
				</div>
32
						
33
				<div class="panel panel-default" ng-show="repos.length > 0">
34
					<div class="panel-heading">
35
						<form class="form-inline text-right" role="form">
36
							<div class="form-group">
37
								<label class="sr-only" for="repoFilter">Filter...</label>
38
 								<input type="text" class="form-control input-sm" id="repoFilter" ng-model="repoFilter.name" placeholder="Filter..." />
39
				  			</div>
40
							<button ng-click="selectType(currType)" class="btn btn-sm btn-default" type="button"><span class="glyphicon glyphicon-refresh"></span></button>
41
						</form>
42
					</div>
43
					<table class="table table-bordered table-striped">
44
						<tr ng-repeat="r in repos | filter: repoFilter">
45
							<td>
46
								<a href="isManager.do#/profile/{{r.id}}" class="btn btn-xs btn-primary" title="xml profile"><span class="glyphicon glyphicon-link"></span></a>
47
								<a href="javascript:void(0)" ng-click="showDetails(r.id, r.name)">
48
									{{r.name}}
49
								</a>
50
								<div ng-show="r.valid" class="pull-right">
51
									<a href="javascript:void(0)" ng-click="setValidation(r.id, false)">force invalidate</a> 
52
									/ 
53
									<span class="label label-success">valid</span>
54
								</div>
55
								<div ng-show="!r.valid" class="pull-right">
56
									<span class="label label-danger">pending</span>  
57
									/ 
58
									<a href="javascript:void(0)" ng-click="setValidation(r.id, true)">force validate</a>
59
								</div>
60
							</td>
61
						</tr>
62
					</table>
63
					<div class="panel-footer"></div>
64
				</div>
65
			</div>
66
		</div>
67
	</div>
68
})$ 
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/repoApis.st
1
$common/master(
2

  
3
header={
4
	$ui/repos/header()$
5
	<script type="text/javascript" src="../resources/js/angular-route.min.js"></script>
6
	<script type="text/javascript" src="../resources/js/dnet_workflows_common.js"></script>
7
	<script type="text/javascript" src="../resources/js/dnet_param_values_functions.js"></script>
8
	<script type="text/javascript" src="../resources/js/repoControllers.js"></script>
9
	<script type="text/javascript" src="../resources/js/repos.js"></script>
10
	<script type="text/javascript">
11
		function getAvailableRepohiWfs()  { return $availableRepohiWfs$ }
12
		function getCompatibilityLevels() { return $compatibilityLevels$ }
13
		function getBrowseFields()        { return $browseFields$ }
14
	</script>
15
	
16
	<style>
17
		.popover { max-width: 450px;  width: auto; }
18
	</style>
19
},
20
onLoad={},
21
body={
22
	<div id="main" ng-app="reposUI">
23
		<div ng-view></div>
24
	</div>
25
}
26
)$
modules/dnet-modular-repositories-ui/tags/dnet-modular-repositories-ui-4.0.5/src/main/resources/eu/dnetlib/functionality/modular/ui/views/ui/reposMap.st
1
$common/master(
2
header={
3
	$ui/repos/header()$
4
	<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=en"></script>
5
	<script type="text/javascript" src="../resources/js/reposMap.js"></script>
6
},
7
onLoad={},
8
body={
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff