Project

General

Profile

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.compatibility"></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.protocol" 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.protocol}} protocol]" 
60
				selection="apiParams[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.protocol}} protocol]" 
68
				selection="apiParams[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.protocol}} protocol]" 
76
				selection="apiParams[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.metadataIdentifierPath"></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
)$
(2-2/5)