Project

General

Profile

1
<?xml version="1.0" encoding="utf-8"?>
2

    
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
				version="1.0">
5

    
6
	<xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8" standalone="no"/>
7

    
8
	<xsl:template match="/">
9

    
10
		<xsl:variable name="id" select="//RESOURCE_IDENTIFIER/@value"/>
11
		<xsl:variable name="name" select="//WORKFLOW_NAME"/>
12
		<xsl:variable name="startMode" select="//CONFIGURATION/@start"/>
13
		<xsl:variable name="status" select="//CONFIGURATION/@status"/>
14

    
15
		<xsl:variable name="interval" select="//SCHEDULING/MININTERVAL"/>
16

    
17
		<div class="row">
18
  			
19
  			<wf-graph-modal wf-id="currentGraphId" visible="showGraphModal" />
20
  			<wf-process-modal proc-id="currentProcId" visible="showProcModal" />
21
  			
22
  			<xsl:for-each select="//DATASOURCE">
23
				<repo-access-params-modal ds-id="{@id}" iface="{@interface}" protocol="{@protocol}" visible="showAccessParamsModal" />
24
  			</xsl:for-each>
25
  
26
			<div class="col-xs-12 col-md-4 col-lg-2">
27
				<ul class="nav  nav-pills nav-stacked">
28
					<li class="active" style="cursor: pointer">
29
						<a data-target="#tabInfo" data-toggle="tab" ng-click="refresh()">Workflow Info</a>
30
					</li>
31
					<li style="cursor: pointer">
32
						<a data-target="#tabParameters" data-toggle="tab">Parameters</a>
33
					</li>
34
					<li style="cursor: pointer">
35
						<a data-target="#tabHistory" data-toggle="tab" ng-click="updateHistory('{$id}')">History</a>
36
					</li>
37
					<li style="cursor: pointer">
38
						<a data-target="#tabSettings" data-toggle="tab">Other settings</a>
39
					</li>
40
				</ul>
41
			</div>
42
			<div class="col-xs-12 col-md-8 col-lg-10">
43
				<h5>
44
					<b>Workflow:</b>
45
					<xsl:value-of select="concat(' ', $name)"/>
46
				</h5>
47
				<!-- Tab panes -->
48
				<div class="tab-content" style="border: 1px solid #dddddd; border-radius: 4px; padding: 20px">
49
					<div class="tab-pane active" id="tabInfo">
50
						<form class="form-horizontal">
51
							<xsl:for-each select="//DATASOURCE">
52
								<wf-form-row-static name="Datasource" value="{@name}" url="workflows.do#/api/{@id}/{@interface}"/>
53
								<wf-form-row-static name="Interface" value="{@interface}"/>
54
								<wf-form-row-static name="Protocol" value="{@protocol}"/>
55
								
56
								<xsl:if test=".//extraFields/field[@name = 'last_collection_date'] and .//extraFields/field[@name = 'last_collection_mdId'] and .//extraFields/field[@name = 'last_collection_total']">
57
									<wf-form-row-store-link name="Last collection" 
58
										date="{.//extraFields/field[@name = 'last_collection_date']}" 
59
										total="{.//extraFields/field[@name = 'last_collection_total']}" 
60
										url="../inspector/mdstore.do?id={.//extraFields/field[@name = 'last_collection_mdId']}" />
61
								</xsl:if>
62
							
63
								<xsl:if test=".//extraFields/field[@name = 'last_aggregation_date'] and .//extraFields/field[@name = 'last_aggregation_mdId'] and .//extraFields/field[@name = 'last_aggregation_total']">
64
									<wf-form-row-store-link name="Last aggregation" 
65
										date="{.//extraFields/field[@name = 'last_aggregation_date']}" 
66
										total="{.//extraFields/field[@name = 'last_aggregation_total']}" 
67
										url="../inspector/mdstore.do?id={.//extraFields/field[@name = 'last_aggregation_mdId']}" />
68
								</xsl:if>
69
								
70
								<xsl:if test=".//extraFields/field[@name = 'last_download_date'] and .//extraFields/field[@name = 'last_download_objId'] and .//extraFields/field[@name = 'last_download_total']">
71
									<wf-form-row-store-link name="Last download" 
72
										date="{.//extraFields/field[@name = 'last_download_date']}" 
73
										total="{.//extraFields/field[@name = 'last_download_total']}" 
74
										url="objectstoreInspector.do#/inspect.do/{.//extraFields/field[@name = 'last_download_objId']}" />
75
								</xsl:if>
76
								
77
								<div class="form-group">
78
									<div class="col-sm-offset-3 col-sm-9">
79
										<button class="btn btn-sm btn-primary" ng-click="editAccessParams()">access params</button>
80
									</div>
81
								</div>
82
	
83
								<hr/>
84
							</xsl:for-each>
85

    
86
							<wf-form-row-static name="Workflow" value="{$name}" value-description="{//WORKFLOW_DESCRIPTION}" url="isManager.do#/profile/{$id}"/>
87
							<wf-form-row-static name="Family" value="{//WORKFLOW_FAMILY}"/>
88
							
89
							<xsl:choose>
90
								<xsl:when test="//STATUS/LAST_EXECUTION_STATUS = 'SUCCESS'">
91
									<wf-form-row-label name="Last execution" value="SUCCESS" label-class="label-success"  date="{//STATUS/LAST_EXECUTION_DATE}"/>
92
								</xsl:when>
93
								<xsl:when test="//STATUS/LAST_EXECUTION_STATUS = 'FAILURE'">
94
									<wf-form-row-label name="Last execution" value="FAILURE" label-class="label-danger"  date="{//STATUS/LAST_EXECUTION_DATE}"/>
95
								</xsl:when>
96
								<xsl:otherwise>
97
								   <wf-form-row-static name="Last execution" value="not yet executed" value-style="white-space: nowrap; font-style: italic;"/>
98
								</xsl:otherwise>
99
							</xsl:choose>
100
							
101

    
102
							<xsl:if test="count(//NODE[@type='LaunchWorkflow' or @type='LaunchWorkflowTemplate']) &gt; 0">
103
								<hr />
104
								<wf-sub-workflows wf-id="{$id}" graph-id="currentGraphId" show-graph-modal="showGraphModal" />
105
							</xsl:if>
106

    
107
							<div class="form-group" style="margin-top: 50px">
108
								<div class="col-sm-offset-3 col-sm-9">
109
									<button class="btn btn-primary" ng-click="executeWf('{$id}')">
110
										<xsl:if test="$status != 'EXECUTABLE' or $startMode = 'DISABLED'">
111
											<xsl:attribute name="disabled">disabled</xsl:attribute>
112
										</xsl:if>
113
										<span style="margin-right: 8px" class="glyphicon glyphicon-play"></span>
114
										Launch
115
									</button>
116
									<button type="button" class="btn btn-default" ng-click="refresh()" style="margin-left: 5px;">
117
										<span class="glyphicon glyphicon-refresh"></span>
118
									</button>
119
									
120
									<button type="button" class="btn btn-default pull-right" ng-click="showGraph('{$id}')">
121
										<span class="glyphicon glyphicon-picture"></span> Graph
122
									</button>
123
								</div>
124
							</div>
125
						</form>
126

    
127
					</div>
128

    
129
					<div class="tab-pane" id="tabParameters">
130
						<xsl:choose>
131
							<xsl:when test="count(//CONFIGURATION/PARAMETERS/PARAM) &gt; 0">
132
								<form class="form-horizontal" name="wfParamatersForm">
133
									<xsl:for-each select="//CONFIGURATION/PARAMETERS/PARAM">
134
							
135
										<xsl:choose>
136
											<xsl:when test="@managedBy='system'">
137
												<wf-form-row-static name="{@name}" value="{.}" description="{@description}" value-style="font-family: monospace">
138
													<xsl:if test="@category">
139
														<xsl:attribute name="category">
140
															<xsl:value-of select="@category" />
141
														</xsl:attribute>
142
													</xsl:if>
143
												</wf-form-row-static>
144
											</xsl:when>
145

    
146
											<xsl:when test="@type='boolean'">
147
												<wf-form-row-select name="{@name}" description="{@description}"
148
																	mandatory="{@required}"
149
																	init-value="{.}"
150
																	ng-model="params.{@name}"
151
																	ng-original-model="originalParams.{@name}"
152
																	values="[{{'id':'true','name':'TRUE'}},{{'id':'false','name':'FALSE'}}]">
153
													<xsl:if test="@category">
154
														<xsl:attribute name="category">
155
															<xsl:value-of select="@category" />
156
														</xsl:attribute>
157
													</xsl:if>																	
158
												</wf-form-row-select>
159
											</xsl:when>
160
											<xsl:when test="@type='list'">
161
												<wf-form-row-multi-select name="{@name}" description="{@description}"
162
												                    mandatory="{@required}"
163
												                    init-value="{.}"
164
												                    ng-model="params.{@name}"
165
												                    ng-original-model="originalParams.{@name}"
166
												                    values-function="{@function}">
167
													<xsl:if test="@category">
168
														<xsl:attribute name="category">
169
															<xsl:value-of select="@category" />
170
														</xsl:attribute>
171
													</xsl:if>
172
												</wf-form-row-multi-select>
173
											</xsl:when>
174
											<xsl:when test="@function">
175
												<wf-form-row-select name="{@name}" description="{@description}"
176
																	mandatory="{@required}"
177
																	init-value="{.}"
178
																	ng-model="params.{@name}"
179
																	ng-original-model="originalParams.{@name}"
180
																	values-function="{@function}">
181
													<xsl:if test="@category">
182
														<xsl:attribute name="category">
183
															<xsl:value-of select="@category" />
184
														</xsl:attribute>
185
													</xsl:if>
186
												</wf-form-row-select>
187
											</xsl:when>
188
											<xsl:otherwise>
189
												<wf-form-row-text name="{@name}" description="{@description}"
190
																  mandatory="{@required}"
191
																  init-value="{.}"
192
																  ng-model="params.{@name}"
193
																  ng-original-model="originalParams.{@name}">
194
													<xsl:attribute name="type">
195
														<xsl:choose>
196
															<xsl:when test="@type">
197
																<xsl:value-of select="@type"/>
198
															</xsl:when>
199
															<xsl:otherwise>
200
																string
201
															</xsl:otherwise>
202
														</xsl:choose>
203
													</xsl:attribute>
204
													<xsl:if test="@category">
205
														<xsl:attribute name="category">
206
															<xsl:value-of select="@category" />
207
														</xsl:attribute>
208
													</xsl:if>
209
												</wf-form-row-text>
210
											</xsl:otherwise>
211
										</xsl:choose>
212
									</xsl:for-each>
213
									<xsl:if test="count(//CONFIGURATION/PARAMETERS/PARAM[@managedBy = 'user']) &gt; 0">
214
										<div class="form-group">
215
											<div class="col-sm-offset-3 col-sm-9">
216
												<button class="btn btn-primary" ng-click="updateParameters('{$id}', params)"
217
														ng-disabled="wfParamatersForm.$invalid">
218
													<span class="glyphicon glyphicon-ok" style="margin-right: 8px"></span>
219
													Update
220
												</button>
221
												<button class="btn btn-default" style="margin-left:5px;" ng-click="resetParameters()">
222
													<span class="glyphicon glyphicon-remove" style="margin-right:8px"></span>
223
													Reset
224
												</button>
225
											</div>
226
										</div>
227
									</xsl:if>
228
								</form>
229
							</xsl:when>
230
							<xsl:otherwise>
231
								No Parameters
232
							</xsl:otherwise>
233
						</xsl:choose>
234
					</div>
235

    
236
					<div class="tab-pane" id="tabHistory">
237
						<wf-history ng-model="history" on-refresh="updateHistory('{$id}')"/>
238
					</div>
239

    
240
					<div class="tab-pane" id="tabSettings">
241
						<wf-form-update wf-id="{$id}" />
242
					</div>
243
				</div>
244
			</div>
245
		</div>
246
	</xsl:template>
247

    
248
</xsl:stylesheet>
249

    
250

    
251

    
(2-2/2)