-
Notifications
You must be signed in to change notification settings - Fork 10
/
jspServices.mtl
183 lines (162 loc) · 10.9 KB
/
jspServices.mtl
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
[comment encoding = UTF-8 /]
[comment
/*
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License 1.0
* which is available at http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Simple
*/
/]
[module jspServices('http://org.eclipse.lyo/oslc4j/adaptorInterface')/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::services/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::adaptorInterfaceServices/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::resourceServices/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::serviceProviderServices/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::fileServices/]
[template public generateBootstrapTags(traceabilityContext : OclAny)]
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
[/template]
[query public generateJspFile(anAdaptorInterface : AdaptorInterface, filePath : String) : Boolean =
not (anAdaptorInterface.doNotRegenerateJspFiles()._and(fileExists(filePath)))
/]
[query private resourceCollectionJspSimpleFileName(aQueryCapability: QueryCapability) : String =
(if (aQueryCapability.usages->size() = 0) then
concatenate(aQueryCapability.resourceTypes.javaName(true)->sep('', 'sAnd', 's').oclAsType(String)).toLower()
else
javaSimpleStringFromUri(aQueryCapability.usages->first(), true)
endif)
.concat('collection').concat('.jsp')
/]
[query public resourceCollectionJspRelativeFileName(aQueryCapability: QueryCapability) : String =
webFilesWebappPath(containingAdaptorInterface(aQueryCapability)).concatenatePaths(resourceCollectionJspSimpleFileName(aQueryCapability)).toLower()
/]
[query public resourceCollectionJspFullFileName(aQueryCapability: QueryCapability) : String =
webFilesBasePath(containingAdaptorInterface(aQueryCapability)).concatenatePaths(resourceCollectionJspRelativeFileName(aQueryCapability))
/]
[query public resourceToHtmlJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('ToHtml').concat('.jsp').toLower()
/]
[query public resourceToHtmlJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(resourceToHtmlJspRelativeFileName(aResource, anAdaptorInterface))
/]
[query public getResourceViewForOslcUIJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths('viewResource.jsp').toLower()
/]
[query public getResourceViewForOslcUIJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceViewForOslcUIJspRelativeFileName(anAdaptorInterface))
/]
[query public getResourceJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('.jsp').toLower()
/]
[query public getResourceJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceJspRelativeFileName(aResource, anAdaptorInterface))
/]
[query public getResourceUiPreviewForOslcUIJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths('uipreview.jsp').toLower()
/]
[query public getResourceUiPreviewForOslcUIJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceUiPreviewForOslcUIJspRelativeFileName(anAdaptorInterface))
/]
[query public getResourceSmallPreviewJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('smallpreview.jsp').toLower()
/]
[query public getResourceSmallPreviewJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceSmallPreviewJspRelativeFileName(aResource, anAdaptorInterface))
/]
[query public getResourceLargePreviewJspRelativeFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths(aResource.javaName(true)).concat('largepreview.jsp').toLower()
/]
[query public getResourceLargePreviewJspFullFileName(aResource: Resource, anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(getResourceLargePreviewJspRelativeFileName(aResource, anAdaptorInterface))
/]
[query private resourceCreatorJspSimpleFileName(aCreationDialog: Dialog) : String =
(if (aCreationDialog.usages->size() = 0) then
concatenate(aCreationDialog.resourceTypes.javaName(true)->sep('', 'And', '').oclAsType(String)).toLower()
else
javaSimpleStringFromUri(aCreationDialog.usages->first(), true)
endif)
.concat('creator').concat('.jsp')
/]
[query public resourceCreatorJspRelativeFileName(aCreationDialog: Dialog) : String =
webFilesWebappPath(containingAdaptorInterface(aCreationDialog)).concatenatePaths(resourceCreatorJspSimpleFileName(aCreationDialog)).toLower()
/]
[query public resourceCreatorJspFullFileName(aCreationDialog: Dialog) : String =
webFilesBasePath(containingAdaptorInterface(aCreationDialog)).concatenatePaths(resourceCreatorJspRelativeFileName(aCreationDialog))
/]
[query private resourceSelectorForOslcUIJspSimpleFileName(anAdaptorInterface : AdaptorInterface) : String =
'selectiondialog.jsp'
/]
[query public resourceSelectorForOslcUIJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths(resourceSelectorForOslcUIJspSimpleFileName(anAdaptorInterface)).toLower()
/]
[query public resourceSelectorForOslcUIJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(resourceSelectorForOslcUIJspRelativeFileName(anAdaptorInterface))
/]
[query private resourceSelectorJspSimpleFileName(aSelectionDialog: Dialog) : String =
(if (aSelectionDialog.usages->size() = 0) then
concatenate(aSelectionDialog.resourceTypes.javaName(true)->sep('', 'And', '').oclAsType(String)).toLower()
else
javaSimpleStringFromUri(aSelectionDialog.usages->first(), true)
endif)
.concat('selector').concat('.jsp')
/]
[query public resourceSelectorJspRelativeFileName(aSelectionDialog: Dialog) : String =
webFilesWebappPath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorJspSimpleFileName(aSelectionDialog)).toLower()
/]
[query public resourceSelectorJspFullFileName(aSelectionDialog: Dialog) : String =
webFilesBasePath(containingAdaptorInterface(aSelectionDialog)).concatenatePaths(resourceSelectorJspRelativeFileName(aSelectionDialog))
/]
[query public resourceSelectorClientJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths('selectionDialogSampleClient').concat('.jsp').toLower()
/]
[query public resourceSelectorClientJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(resourceSelectorClientJspRelativeFileName(anAdaptorInterface))
/]
[query public resourceCreatorClientJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths('creationDialogSampleClient').concat('.jsp').toLower()
/]
[query public resourceCreatorClientJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(resourceCreatorClientJspRelativeFileName(anAdaptorInterface))
/]
[query public resourceShapeJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesWebappPath(anAdaptorInterface).concatenatePaths('resourceShape').concat('.jsp').toLower()
/]
[query public resourceShapeJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(resourceShapeJspRelativeFileName(anAdaptorInterface))
/]
[query public serviceProviderCatalogJspRelativeFileName(aServiceProviderCatalog : ServiceProviderCatalog) : String =
webFilesWebappPath(containingAdaptorInterface(aServiceProviderCatalog)).concatenatePaths('serviceProviderCatalog').concat('.jsp').toLower()
/]
[query public serviceProviderCatalogJspFullFileName(aServiceProviderCatalog : ServiceProviderCatalog) : String =
webFilesBasePath(containingAdaptorInterface(aServiceProviderCatalog)).concatenatePaths(serviceProviderCatalogJspRelativeFileName(aServiceProviderCatalog))
/]
[query public serviceProviderJspRelativeFileName(aServiceProvider : ServiceProvider) : String =
webFilesWebappPath(containingAdaptorInterface(aServiceProvider)).concatenatePaths(aServiceProvider.javaName(false)).concat('.jsp').toLower()
/]
[query public serviceProviderJspFullFileName(aServiceProvider : ServiceProvider) : String =
webFilesBasePath(containingAdaptorInterface(aServiceProvider)).concatenatePaths(serviceProviderJspRelativeFileName(aServiceProvider))
/]
[comment TODO: I need to work out how to properly set hte javascript path. This is hard-coded :-)/]
[query public delegatedUIJavaScriptsRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
'delegated-ui'.concat('.js')
/]
[query public delegatedUIJavaScriptsFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths('static/js').concatenatePaths(delegatedUIJavaScriptsRelativeFileName(anAdaptorInterface))
/]
[comment swagger/]
[query public swaggerIndexJspRelativeFileName(anAdaptorInterface : AdaptorInterface) : String =
'/swagger-ui/index'.concat('.jsp').toLower()
/]
[query public swaggerIndexJspFullFileName(anAdaptorInterface : AdaptorInterface) : String =
webFilesBasePath(anAdaptorInterface).concatenatePaths(swaggerIndexJspRelativeFileName(anAdaptorInterface))
/]