forked from essentialproject/essential_viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathessential_utilities.xsl
More file actions
487 lines (445 loc) · 20.7 KB
/
essential_utilities.xsl
File metadata and controls
487 lines (445 loc) · 20.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xpath-default-namespace="http://protege.stanford.edu/xml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt" xmlns:pro="http://protege.stanford.edu/xml" xmlns:eas="http://www.enterprise-architecture.org/essential" xmlns:functx="http://www.functx.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ess="http://www.enterprise-architecture.org/essential/errorview">
<xsl:include href="common/core_doctype.xsl"/>
<xsl:include href="common/core_common_head_content.xsl"/>
<xsl:include href="common/core_header.xsl"/>
<xsl:include href="common/core_footer.xsl"/>
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="param1"/>
<!-- param4 = the taxonomy term that will be used to scope the organisation model -->
<xsl:param name="param4"/>
<!--
* Copyright © 2008-2017 Enterprise Architecture Solutions Limited.
* This file is part of Essential Architecture Manager,
* the Essential Architecture Meta Model and The Essential Project.
*
* Essential Architecture Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Essential Architecture Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Essential Architecture Manager. If not, see <http://www.gnu.org/licenses/>.
*
-->
<!-- 19.04.2008 JP Migrated to new servlet reporting engine -->
<!-- 06.11.2008 JWC Migrated to XSL v2 -->
<!-- 29.06.2010 JWC Fixed details links to support " ' " characters in names -->
<!-- 01.05.2011 NJW Updated to support Essential Viewer version 3-->
<!-- 05.01.2016 NJW Updated to support Essential Viewer version 5-->
<!-- 05.06.2013 JWC Added the eas namespace for the i18n framework -->
<!-- 05.06.2013 JWC Added the Spreadsheet downloads -->
<xsl:variable name="allReports" select="/node()/simple_instance[(type = 'Report') and (own_slot_value[slot_reference = 'report_is_enabled']/value = 'true')]"/>
<xsl:variable name="allTaxonomyTerms" select="/node()/simple_instance[type = 'Taxonomy_Term']"/>
<xsl:variable name="intArchViewsTaxonomyTerm" select="$allTaxonomyTerms[own_slot_value[slot_reference = 'name']/value = 'Integration Extract Views']"/>
<xsl:variable name="aSpreadsheetList" select="/node()/simple_instance[type = 'Spreadsheet_Specification']"/>
<xsl:variable name="allSpreadsheetSpec" select="$aSpreadsheetList[own_slot_value[slot_reference = 'ss_enabled']/value = 'true']"/>
<xsl:variable name="eaArchViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Enterprise Architecture Views')]"/>
<xsl:variable name="busArchViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Business Architecture Views')]"/>
<xsl:variable name="infArchViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Information Architecture Views')]"/>
<xsl:variable name="appArchViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Application Architecture Views')]"/>
<xsl:variable name="techArchViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Technology Architecture Views')]"/>
<xsl:variable name="supportViewsTaxonomyTerm" select="/node()/simple_instance[(type = 'Taxonomy_Term') and (own_slot_value[slot_reference = 'name']/value = 'Support Views')]"/>
<xsl:variable name="countEASpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $eaArchViewsTaxonomyTerm/name)]"/>
<xsl:variable name="countBusSpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $busArchViewsTaxonomyTerm/name)]"/>
<xsl:variable name="countInfSpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $infArchViewsTaxonomyTerm/name)]"/>
<xsl:variable name="countAppSpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $appArchViewsTaxonomyTerm/name)]"/>
<xsl:variable name="countTechSpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $techArchViewsTaxonomyTerm/name)]"/>
<xsl:variable name="countSupportSpreadsheet" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $supportViewsTaxonomyTerm/name)]"/>
<xsl:variable name="unClassifedSpreadsheets" select="$allSpreadsheetSpec except ($countEASpreadsheet union $countBusSpreadsheet union $countAppSpreadsheet union $countInfSpreadsheet union $countTechSpreadsheet union $countSupportSpreadsheet)"/>
<xsl:template match="knowledge_base">
<xsl:call-template name="docType"/>
<html>
<head>
<xsl:call-template name="commonHeadContent"/>
<title>Essential Utilities</title>
</head>
<body>
<!-- ADD THE PAGE HEADING -->
<xsl:call-template name="Heading"/>
<!--ADD THE CONTENT-->
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="page-header">
<h1>
<span class="text-primary"><xsl:value-of select="eas:i18n('View')"/>: </span>
<span class="text-darkgrey">Essential Utilities</span>
</h1>
</div>
</div>
<!--Setup Integration Section-->
<div class="col-xs-12">
<div class="sectionIcon">
<i class="fa fa-exchange icon-section icon-color"/>
</div>
<h2 class="text-primary">Integration Extracts</h2>
<div class="content-section">
<p>Computer-readable extracts providing lists of specific objects stored in the architecture repository.</p>
<div class="row">
<xsl:apply-templates mode="Integrations" select="$allReports[(own_slot_value[slot_reference = 'element_classified_by']/value = $intArchViewsTaxonomyTerm/name)]"/>
</div>
</div>
<hr/>
</div>
<!--Setup Description Section-->
<xsl:if test="count($aSpreadsheetList) > 0">
<div class="col-xs-12">
<div class="sectionIcon">
<i class="fa fa-list-ul icon-section icon-color"/>
</div>
<h2 class="text-primary">Spreadsheet Data Capture Template Catalogue</h2>
<div class="content-section">
<xsl:choose>
<xsl:when test="count($allSpreadsheetSpec) > 0">
<p>The following table lists template spreadsheets that are available for download (in Excel 2004 XML format), which can be used for capturing and importing content into Essential Architecture Manager.</p>
<div class="verticalSpacer_10px"/>
<h3>Enterprise</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Enterprise"/>
<div class="verticalSpacer_20px"/>
<h3>Business</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Business"/>
<div class="verticalSpacer_20px"/>
<h3>Information</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Information"/>
<div class="verticalSpacer_20px"/>
<h3>Application</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Application"/>
<div class="verticalSpacer_20px"/>
<h3>Technology</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Technology"/>
<div class="verticalSpacer_20px"/>
<h3>Support</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Support"/>
<div class="verticalSpacer_20px"/>
<h3>Unclassified</h3>
<div class="verticalSpacer_10px"/>
<xsl:call-template name="Unclassified"/>
</xsl:when>
<xsl:otherwise>
<em>No spreadsheet templates defined</em>
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</xsl:if>
</div>
<!-- ADD THE PAGE FOOTER -->
<xsl:call-template name="Footer"/>
<script>
$(document).ready(function() {
// initialize tooltip
$(".viewElement").tooltip({
// tweak the position
offset: [-10, -140],
predelay: '500',
relative: 'true',
position: 'bottom',
opacity: '0.9',
// use the "fade" effect
effect: 'fade'
// add dynamic plugin with optional configuration for bottom edge
}).dynamic({ bottom: { direction: 'down', bounce: true } });
});
</script>
</div>
</body>
</html>
</xsl:template>
<xsl:template mode="Integrations" match="node()">
<xsl:variable name="reportLabelName" select="own_slot_value[slot_reference = 'report_label']/value"/>
<xsl:variable name="reportFilename" select="own_slot_value[slot_reference = 'report_xsl_filename']/value"/>
<a class="noUL text-black" download="extract.txt">
<xsl:call-template name="RenderLinkHref">
<xsl:with-param name="theXSL" select="$reportFilename"/>
<xsl:with-param name="theInstanceID" select="$param1"/>
<xsl:with-param name="theHistoryLabel" select="concat($reportLabelName, ' - ', $param1)"/>
<xsl:with-param name="theParam4" select="$param4"/>
<!-- pass the id of the taxonomy term used for scoping as parameter 4-->
</xsl:call-template>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<p class="fontSemi larger">
<xsl:value-of select="own_slot_value[slot_reference = 'report_label']/value"/>
</p>
<p>
<xsl:call-template name="RenderMultiLangInstanceDescription">
<xsl:with-param name="theSubjectInstance" select="current()"/>
</xsl:call-template>
</p>
</div>
</a>
</xsl:template>
<xsl:template name="Enterprise">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countEASpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $eaArchViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Business">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countBusSpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $busArchViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Information">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countInfSpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $infArchViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Application">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countAppSpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $appArchViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Technology">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countTechSpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $techArchViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Support">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($countSupportSpreadsheet) = 0">
<p>
<em>No spreadsheets classified for this layer</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$allSpreadsheetSpec[(own_slot_value[slot_reference = 'element_classified_by']/value = $supportViewsTaxonomyTerm/name)]">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="Unclassified">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:choose>
<xsl:when test="count($unClassifedSpreadsheets) = 0">
<p>
<em>No unclassified spreadsheets available</em>
</p>
</xsl:when>
<xsl:otherwise>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="cellWidth-35pc text-primary impact">Template Name</th>
<th class="cellWidth-45pc text-primary impact">
<xsl:value-of select="eas:i18n('Description')"/>
</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Populated</th>
<th class="cellWidth-10pc text-primary impact alignCentre">Empty</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates mode="SpreadsheetTemplate" select="$unClassifedSpreadsheets">
<xsl:sort order="ascending" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:with-param name="doPopulate" select="$doPopulate"/>
</xsl:apply-templates>
</tbody>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="node()" mode="SpreadsheetTemplate">
<xsl:param name="doPopulate">false</xsl:param>
<xsl:variable name="ssName" select="own_slot_value[slot_reference = 'name']/value"/>
<xsl:variable name="ssDescription" select="own_slot_value[slot_reference = 'description']/value"/>
<xsl:variable name="ssFilename" select="own_slot_value[slot_reference = 'ss_filename']/value"/>
<tr>
<td>
<strong>
<xsl:value-of select="$ssName"/>
</strong>
</td>
<td>
<xsl:choose>
<xsl:when test="string-length($ssDescription) = 0">-</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$ssDescription"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<a class="noUL">
<xsl:call-template name="RenderLinkHref">
<xsl:with-param name="theXSL" select="'integration/int_excel_import_generation.xsl'"/>
<xsl:with-param name="theInstanceID" select="current()/name"/>
<xsl:with-param name="theUserParams" select="'populateSS=true'"/>
<xsl:with-param name="theXML">reportXML.xml</xsl:with-param>
<xsl:with-param name="theHistoryLabel">Spreadsheet Template Download - <xsl:value-of select="$ssName"/></xsl:with-param>
<xsl:with-param name="theContentType" select="'application/ms-excel'"/>
<xsl:with-param name="theFilename" select="$ssFilename"/>
</xsl:call-template>
<!--<img src="images/GreenArrow.png" alt="Populated"/>-->
<div class="basicButton backColour9 text-white small">Download</div>
</a>
</td>
<td>
<a class="noUL">
<xsl:call-template name="RenderLinkHref">
<xsl:with-param name="theXSL" select="'integration/int_excel_import_generation.xsl'"/>
<xsl:with-param name="theInstanceID" select="current()/name"/>
<xsl:with-param name="theUserParams" select="'populateSS=false'"/>
<xsl:with-param name="theXML">reportXML.xml</xsl:with-param>
<xsl:with-param name="theHistoryLabel">Spreadsheet Template Download - <xsl:value-of select="$ssName"/></xsl:with-param>
<xsl:with-param name="theContentType" select="'application/ms-excel'"/>
<xsl:with-param name="theFilename" select="$ssFilename"/>
</xsl:call-template>
<!--<img src="images/RedArrow.png" alt="Empty"/>-->
<div class="basicButton backColour10 text-white small">Download</div>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>