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
|
<input class="search-text" id="searchText" type="text" placeholder="Search components...">
|
129
|
<button class="btn search" id="search"><img src="images/search.png" title="search" alt="search"></button>
|
130
|
<span class="search-count" id="countOfFound" title="Count of components found">0</span>
|
131
|
</li>
|
132
|
<li>
|
133
|
<hr class="navbar-separator">
|
134
|
</li>
|
135
|
<li>
|
136
|
<form name="actionForm">
|
137
|
<label for="move">
|
138
|
<input type="radio" name="actionMove" value="move" id="move" checked>
|
139
|
move
|
140
|
<img class="navbar-image" src="images/move.png" alt="move">
|
141
|
</label>
|
142
|
<label for="remove">
|
143
|
<input type="radio" name="actionMove" value="exclude" id="remove">
|
144
|
exclude
|
145
|
<img class="navbar-image" src="images/remove2.png" alt="remove">
|
146
|
</label>
|
147
|
</form>
|
148
|
</li>
|
149
|
<li>
|
150
|
<hr class="navbar-separator">
|
151
|
</li>
|
152
|
<li>
|
153
|
<button id="mostEdge" class="btn exclude-separately" title="Exclude components with the most count of edges separately.">
|
154
|
<img src="images/excludeSeparately.png" alt="excludeSeparately">
|
155
|
</button>
|
156
|
</li>
|
157
|
<li>
|
158
|
<hr class="navbar-separator">
|
159
|
</li>
|
160
|
<li>
|
161
|
<button id="vertexToGroup" class="btn exclude-to-group" title="Exclude components with the most count of edges to group.">
|
162
|
<img src="images/package.png" alt="Exclude components to group">
|
163
|
</button>
|
164
|
</li>
|
165
|
<li>
|
166
|
<hr class="navbar-separator">
|
167
|
</li>
|
168
|
<li>
|
169
|
<% if (!is_efp_diagram) { %>
|
170
|
<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>
|
171
|
<% } else { %>
|
172
|
<a href="<%=request.getAttribute("efpPortalRefererUrl")%>" class="btn btn-block back-to-upload" id="view_back_to_upload" title="Back"></a>
|
173
|
<% } %>
|
174
|
</li>
|
175
|
<li>
|
176
|
<hr class="navbar-separator">
|
177
|
</li>
|
178
|
<li>
|
179
|
<button class="btn" id="applyLayout" title="Apply layout to current graph.">
|
180
|
<img src="images/layout_off.png" id="applyLayoutImg" alt="Apply layout to current graph.">
|
181
|
</button>
|
182
|
</li>
|
183
|
<%
|
184
|
if (request.getAttribute("efpPortalEfpNames") != null) {
|
185
|
final Map<String, String> efpMappings = (Map<String, String>)request.getAttribute("efpPortalEfpNames");
|
186
|
if (!efpMappings.isEmpty()) {
|
187
|
%>
|
188
|
<li><hr class="navbar-separator"></li>
|
189
|
<li>
|
190
|
<select name="EFPselector" class="EFP-selector" id="EFPselector">
|
191
|
<option value="" selected="selected" class="option_default">none</option>
|
192
|
<% for (Map.Entry<String, String> entry : efpMappings.entrySet()) { %>
|
193
|
<option value="<%=entry.getValue()%>"><%=entry.getValue()%></option>
|
194
|
<% } %>
|
195
|
</select>
|
196
|
</li>
|
197
|
<%
|
198
|
}
|
199
|
}
|
200
|
%>
|
201
|
|
202
|
<% if (show_icon_save) { %>
|
203
|
<li>
|
204
|
<hr class="navbar-separator">
|
205
|
</li>
|
206
|
<li>
|
207
|
<button class="btn save-diagram" id="btnSaveDiagram" title="Save diagram as PNG.">
|
208
|
<img src="images/png_save.png" id="applyLayoutImg" alt="Save diagram as PNG.">
|
209
|
</button>
|
210
|
</li>
|
211
|
<li>
|
212
|
<hr class="navbar-separator">
|
213
|
</li>
|
214
|
<li>
|
215
|
<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>
|
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-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>
|
222
|
</li>
|
223
|
<% } %>
|
224
|
</ul>
|
225
|
</nav>
|
226
|
</header>
|
227
|
|
228
|
<main class="graph-content" id="content"></main>
|
229
|
</div>
|
230
|
|
231
|
<div class="loader" id="loader">
|
232
|
<div class="loader-content" id="spinLoader">
|
233
|
<p>Loading graph...</p>
|
234
|
</div>
|
235
|
</div>
|
236
|
|
237
|
<script>
|
238
|
var app = new App;
|
239
|
app.HOME_URL = '<%=getPath%>imiger/';
|
240
|
|
241
|
$(document).ready(function() {
|
242
|
var loaderFn;
|
243
|
<% if (request.getAttribute("graph_json") != null) { %>
|
244
|
loaderFn = app.efpLoader('<%=request.getAttribute("graph_json")%>', '<%=efpSettingsJson%>');
|
245
|
<% } else { %>
|
246
|
loaderFn = app.diagramLoader('<%=request.getParameter("diagram_id")%>', '<%=request.getParameter("diagram_hash")%>');
|
247
|
<% } %>
|
248
|
|
249
|
app.run(loaderFn);
|
250
|
});
|
251
|
</script>
|
252
|
</body>
|
253
|
</html>
|