Projekt

Obecné

Profil

Stáhnout (10.8 KB) Statistiky
| Větev: | Tag: | Revize:
1
<%@page contentType="text/html" pageEncoding="UTF-8"%>
2
<%@page import="cz.zcu.kiv.offscreen.graph.efp.EfpGraphicSettings"%>
3
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
4
<%@page import="cz.zcu.kiv.comav.loaders.osgi.service.RequiredService"%>
5
<%@page import="sun.reflect.ReflectionFactory.GetReflectionFactoryAction"%>
6
<%@page import="java.util.Map"%>
7
<%@page import="com.google.gson.Gson"%>
8
<%@page import="com.google.gson.GsonBuilder"%>
9

    
10
<!DOCTYPE html>
11
<html>
12
	<head>
13
		<meta charset="utf-8">
14

    
15
		<link rel="stylesheet" href="css/main.css">
16
		<link rel="stylesheet" href="css/jstree/themes/default/style.min.css">
17

    
18
		<script id="htmlTags" type="application/json"><%@ include file="node_modules/html-tags/html-tags.json" %></script>
19
		<script id="svgTags" type="application/json"><%@ include file="node_modules/svg-tags/lib/svg-tags.json" %></script>
20

    
21
		<script src="js/libs/jquery-1.8.3.js"></script>
22
		<script src="js/libs/spin.js"></script>
23
		<script src="js/libs/saveSvgAsPng.js"></script>
24
		<script src="js/libs/jstree.min.js"></script>
25

    
26
		<script src="js/components/edge.js"></script>
27
		<script src="js/components/edgePopover.js"></script>
28
		<script src="js/components/floatingPoint.js"></script>
29
		<script src="js/components/group.js"></script>
30
		<script src="js/components/groupVertexList.js"></script>
31
		<script src="js/components/sidebar.js"></script>
32
		<script src="js/components/sidebarExcludedNodeList.js"></script>
33
		<script src="js/components/sidebarUnconnectedNodeList.js"></script>
34
		<script src="js/components/statusBar.js"></script>
35
		<script src="js/components/vertex.js"></script>
36
		<script src="js/components/vertexContextMenuList.js"></script>
37
		<script src="js/components/vertexLight.js"></script>
38
		<script src="js/components/vertexPopover.js"></script>
39
		<script src="js/components/vertexSymbolList.js"></script>
40
		<script src="js/components/viewport.js"></script>
41

    
42
		<script src="js/exceptions/invalidArgumentException.js"></script>
43

    
44
		<script src="js/constants.js"></script>
45
		<script src="js/coordinates.js"></script>
46
		<script src="js/forceDirected.js"></script>
47
		<script src="js/graphLoader.js"></script>
48
		<script src="js/graphExporter.js"></script>
49
		<script src="js/graphHistory.js"></script>
50
		<script src="js/loader.js"></script>
51
		<script src="js/markSymbol.js"></script>
52
		<script src="js/utils/cookies.js"></script>
53
		<script src="js/utils/dom.js"></script>
54
		<script src="js/utils/utils.js"></script>
55
		<script src="js/zoom.js"></script>
56
		<script src="js/app.js"></script>
57

    
58
		<title>IMiGEr</title>
59
	</head>
60

    
61
	<body>
62
		<%
63
		//String path = request.getContextPath();
64
		String getProtocol = request.getScheme();
65
		String getDomain = request.getServerName();
66
		String getPort = Integer.toString(request.getServerPort());
67
		String getPath = getProtocol+"://"+getDomain+":"+getPort+"/";
68
		String getURI = request.getRequestURI();
69

    
70
		// set graphic settings for EFP graph
71
		ServletContext context = this.getServletContext();
72
		EfpGraphicSettings efpSettings = new EfpGraphicSettings();
73

    
74
		efpSettings.setMinInterfaceDiameter(Integer.valueOf(context.getInitParameter("minInterfaceDiameter")));
75
		efpSettings.setMaxInterfaceDiameter(Integer.valueOf(context.getInitParameter("maxInterfaceDiameter")));
76

    
77
		// JSONize graph settings
78
		GsonBuilder gsonBuilder = new GsonBuilder();
79
		Gson gson = gsonBuilder.create();
80

    
81
		String efpSettingsJson = gson.toJson(efpSettings);
82

    
83
		// logged-in user
84
		boolean logged_user = false;
85
		boolean diagram_id_hash_set = false;
86
		if (request.getSession().getAttribute("logged_user") == "1"){
87
			logged_user = true;
88
		}
89

    
90
		if (request.getParameter("diagram_id")!= null && request.getParameter("diagram_hash") != null) {
91
			diagram_id_hash_set = true;
92
		}
93

    
94
		String diagram_url = "";
95
		boolean show_icon_save = true;
96
		if (logged_user && diagram_id_hash_set) {
97
			diagram_url = "?diagram_id="+ request.getParameter("diagram_id")+"&diagram_hash=" + request.getParameter("diagram_hash");
98
			show_icon_save = true;
99
		}
100

    
101
		boolean is_efp_diagram = false;
102
		if (request.getAttribute("efpPortalRefererUrl") != null) {
103
			is_efp_diagram = true;
104
		}
105
		%>
106

    
107
		<div class="wrapper">
108
			<header class="header" id="header">
109
				<img src="images/logo.png" class="header-logo" alt="logo of University of West Bohemia" title="University of West Bohemia">
110

    
111
				<h2 class="header-title">Interactive Multimodal Graph Explorer</h2>
112

    
113
				<% if (!is_efp_diagram) { %>
114
					<jsp:include page="logged_user.jsp" />
115
				<% } %>
116

    
117
				<nav class="navbar" id="navigation">
118
					<ul>
119
						<li>
120
							<button class="btn zoom" id="zoomOut" title="zoom-"><img src="images/zoom_out.png" alt="zoom-"></button>
121
							<span class="zoom-value" id="zoomValue"></span>
122
							<button class="btn zoom" id="zoomIn" title="zoom+"><img src="images/zoom_in.png" alt="zoom+"></button>
123
						</li>
124
						<li>
125
							<hr class="navbar-separator">
126
						</li>
127
						<li>
128
							<button class="btn toggle-filters" id="toggleFilters">Filters</button>
129
						</li>
130
						<li>
131
							<hr class="navbar-separator">
132
						</li>
133
						<li>
134
							<input class="search-text" id="searchText" type="text" placeholder="Search components...">
135
							<button class="btn search" id="search"><img src="images/search.png" title="search" alt="search"></button>
136
							<span class="search-count" id="countOfFound" title="Count of components found">0</span>
137
						</li>
138
						<li>
139
							<hr class="navbar-separator">
140
						</li>
141
						<li>
142
							<form name="actionForm">
143
								<label for="move">
144
									<input type="radio" name="actionMove" value="move" id="move" checked>
145
									move
146
									<img class="navbar-image" src="images/move.png" alt="move">
147
								</label>
148
								<label for="remove">
149
									<input type="radio" name="actionMove" value="exclude" id="remove">
150
									exclude
151
									<img class="navbar-image" src="images/remove2.png" alt="remove">
152
								</label>
153
							</form>
154
						</li>
155
						<li>
156
							<hr class="navbar-separator">
157
						</li>
158
						<li>
159
							<button id="mostEdge" class="btn exclude-separately" title="Exclude components with the most count of edges separately.">
160
								<img src="images/excludeSeparately.png" alt="excludeSeparately">
161
							</button>
162
						</li>
163
						<li>
164
							<hr class="navbar-separator">
165
						</li>
166
						<li>
167
							<button id="vertexToGroup" class="btn exclude-to-group" title="Exclude components with the most count of edges to group.">
168
								<img src="images/package.png" alt="Exclude components to group">
169
							</button>
170
						</li>
171
						<li>
172
							<hr class="navbar-separator">
173
						</li>
174
						<li>
175
							<% if (!is_efp_diagram) { %>
176
								<a href="<%=getServletContext().getInitParameter("HOME_URL")%>upload-files<%=diagram_url%>" class="btn btn-block back-to-upload" id="view_back_to_upload" title="Back to upload"></a>
177
							<% } else { %>
178
								<a href="<%=request.getAttribute("efpPortalRefererUrl")%>" class="btn btn-block back-to-upload" id="view_back_to_upload" title="Back"></a>
179
							<% } %>
180
						</li>
181
						<li>
182
							<hr class="navbar-separator">
183
						</li>
184
						<li>
185
							<button class="btn" id="applyLayout" title="Apply layout to current graph.">
186
								<img src="images/layout_off.png" id="applyLayoutImg" alt="Apply layout to current graph.">
187
							</button>
188
						</li>
189
						<%
190
						if (request.getAttribute("efpPortalEfpNames") != null) {
191
							final Map<String, String> efpMappings = (Map<String, String>)request.getAttribute("efpPortalEfpNames");
192
							if (!efpMappings.isEmpty()) {
193
						%>
194
						<li><hr class="navbar-separator"></li>
195
						<li>
196
							<select name="EFPselector" class="EFP-selector" id="EFPselector">
197
								<option value="" selected="selected" class="option_default">none</option>
198
								<% for (Map.Entry<String, String> entry : efpMappings.entrySet()) { %>
199
									<option value="<%=entry.getValue()%>"><%=entry.getValue()%></option>
200
								<% } %>
201
							</select>
202
						</li>
203
						<%
204
							}
205
						}
206
						%>
207

    
208
						<% if (show_icon_save) { %>
209
						<li>
210
							<hr class="navbar-separator">
211
						</li>
212
						<li>
213
							<button class="btn save-diagram" id="btnSaveDiagram" title="Save diagram as PNG.">
214
								<img src="images/png_save.png" id="applyLayoutImg" alt="Save diagram as PNG.">
215
							</button>
216
						</li>
217
						<li>
218
							<hr class="navbar-separator">
219
						</li>
220
						<li>
221
							<a href="<%=getServletContext().getInitParameter("HOME_URL")%>graph?diagram_id=<%=request.getParameter("diagram_id")%>&diagram_hash=<%=request.getParameter("diagram_hash")%>" class="btn btn-block view-refresh-diagram" id="view_refresh_diagram" title="Refresh diagram"></a>
222
						</li>
223
						<li>
224
							<hr class="navbar-separator">
225
						</li>
226
						<li>
227
							<a href="<%=getServletContext().getInitParameter("HOME_URL")%>graph?diagram_id=<%=request.getParameter("diagram_id")%>&diagram_hash=<%=request.getParameter("diagram_hash")%>" class="btn btn-block view-refresh-reset-diagram" id="view_refresh_reset_diagram" onclick="reset_diagram(<%=request.getParameter("diagram_id")%>,'<%=request.getParameter("diagram_hash")%>'); return false;" title="Refresh diagram - reset position"></a>
228
						</li>
229
						<% } %>
230
					</ul>
231
				</nav>
232
			</header>
233

    
234
			<div class="filterBar hidden" id="filters">
235
				<div class="filterbar-nav">
236
					<button class="button buttonClassic" id="addFilter">Add filter</button>
237
					<button class="button buttonClassic" id="deleteFilter">Delete filter</button>
238
					<select id="filterTypeSelection">
239
						<option value="Archetype"> Archetype </option>
240
						<option value="Atribute"> Atribute </option>
241
						<option value="Logical"> Logical </option>
242
					</select>
243
					<select id="logicOperationSelection" disabled="disabled">
244
						<option value="And"> And </option>
245
						<option value="Or"> Or </option>
246
						<option value="Xor"> Xor </option>
247
					</select>
248
					<select id="attributeTypeSelection" disabled="disabled">
249
						<option value="Enum"> Enum </option>
250
						<option value="String"> String </option>
251
						<option value="Number"> Number </option>
252
						<option value="Date"> Date </option>
253
					</select>
254
				</div>
255

    
256
				<div class="vertex-tree" id="vertexTree">
257
					<ul class="vertexTreeList">
258
						<li class="vertexTreeItem" id="1">
259
							<span>
260
								Vertex Filters
261
							</span>
262
						</li>
263
					</ul>
264
				</div>
265
			</div>
266

    
267
			<main class="graph-content" id="content"></main>
268
		</div>
269

    
270
		<div class="loader" id="loader">
271
			<div class="loader-content" id="spinLoader">
272
				<p>Loading graph...</p>
273
			</div>
274
		</div>
275

    
276
		<script>
277
		var app = new App;
278
		app.HOME_URL = '<%=getPath%>imiger/';
279

    
280
		$(document).ready(function() {
281
			var loaderFn;
282
			<% if (request.getAttribute("graph_json") != null) { %>
283
				loaderFn = app.efpLoader('<%=request.getAttribute("graph_json")%>', '<%=efpSettingsJson%>');
284
			<% } else { %>
285
				loaderFn = app.diagramLoader('<%=request.getParameter("diagram_id")%>', '<%=request.getParameter("diagram_hash")%>');
286
			<% } %>
287

    
288
			app.run(loaderFn);
289
		});
290
		</script>
291
	</body>
292
</html>
(6-6/7)