index.xhtml 12.2 KB
Newer Older
Piotr Gawron's avatar
Piotr Gawron committed
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	>

<f:view contentType="text/html">

 
<h:head>
	<title>#{mapMB.currentProject.name}</title>
	
	<!-- Google Maps API version 3.20	-->
	<script src="https://maps.google.com/maps/api/js?libraries=drawing&amp;v=3.22" type="text/javascript"/>
	
	<link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" />

<!-- log4javascript library -->
	<h:outputScript library="js" name="log4javascript.js"  />
<!-- configuration for log4javascript -->
	<h:outputScript library="js" name="LogConfig.js"  />

	<h:outputScript library="js" name="ObjectWithListeners.js"/>
	
	<h:outputScript library="js" name="AbstractCustomMap.js" />
	<h:outputScript library="js" name="AbstractInfoWindow.js"/>
	<h:outputScript library="js" name="AbstractMarker.js"/>  
	<h:outputScript library="js" name="Alias.js" />
	<h:outputScript library="js" name="AliasInfoWindow.js" />
	<h:outputScript library="js" name="AliasMarker.js" />
	<h:outputScript library="js" name="AliasOverlay.js" />
	<h:outputScript library="js" name="Configuration.js" />
	<h:outputScript library="js" name="CustomMap.js" />
	<h:outputScript library="js" name="CustomMapOptions.js" />
	<h:outputScript library="js" name="Functions.js" />
	<h:outputScript library="js" name="GeneVariant.js" />
	<h:outputScript library="js" name="GuiConnector.js" />
	<h:outputScript library="js" name="IdentifiedElement.js" />
	<h:outputScript library="js" name="LayoutAlias.js" />
	<h:outputScript library="js" name="LayoutData.js" />
	<h:outputScript library="js" name="LayoutReaction.js" />
	<h:outputScript library="js" name="MapModel.js"/>
	<h:outputScript library="js" name="OverlayCollection.js" />
	<h:outputScript library="js" name="pileup.js"/>
	<h:outputScript library="js" name="PointData.js"/>
	<h:outputScript library="js" name="PointInfoWindow.js"/>
	<h:outputScript library="js" name="PointMarker.js"/>
	<h:outputScript library="js" name="Reaction.js" />
	<h:outputScript library="js" name="ReactionMarker.js" />
	<h:outputScript library="js" name="ReactionInfoWindow.js" />
	<h:outputScript library="js" name="ReactionOverlay.js" />
	<h:outputScript library="js" name="ReferenceGenome.js" />
	<h:outputScript library="js" name="ReferenceGenomeGeneMapping.js" />
	<h:outputScript library="js" name="SearchPanel.js" />
	<h:outputScript library="js" name="ServerConnector.js" />
	<h:outputScript library="js" name="Submap.js" />
	<h:outputScript library="js" name="TabNavi.js" />
 	<h:outputScript library="js" name="TouchMap.js" />
	
	<ui:include src="/WEB-INF/components/map/statistics.xhtml" />

	<script type="text/javascript">
//<![CDATA[
		var DEBUG_ON =false;

		if (browser.name=="IE") {
			if (browser.version<=8 || browser.compatibilityMode) {
				alert("This webpage works only with Internet Explorer version 9 or greater.\n" +
							"If you have Internet Explorer version 9 or greater and still see this message, please, turn the 'Compatibility modeoff:\n" +
							"Open Internet Explorer and press the Alt key on your keyboard.\n" +
							"Select 'Tools' menu item. \n" +
							"Select the 'Compatibility View' settings option. \n" +
							"Make sure the 'Display all websites in Compatibility View' check box is unchecked and that the 'Compatibility View; list of websites is cleared.\n" +
							"\n"+
							"Alternatively, please, use other browsers: Chrome, Firefox or Safari.");
			}
		}
 	var configuration = new Configuration();

function processUrlGetParams() {
	if (GuiConnector.getParams["x"]!=undefined && GuiConnector.getParams["y"]!=undefined){
		ServerConnector.setCenterCoordinateX(GuiConnector.getParams["x"]);
		ServerConnector.setCenterCoordinateY(GuiConnector.getParams["y"]);
	}
	if (GuiConnector.getParams["zoom"]!=undefined ){
		ServerConnector.setZoomLevel(GuiConnector.getParams["zoom"]);
	}
}

function updateConfig() {
	var json = document.getElementById('configurationForm:configurationGson').value;
//there are some strange problems here...
	json = json.replace(/\n/g," ");
	configuration.loadFromModelView(JSON.parse(json));
}					
					 
function initMap(){
	processUrlGetParams();

	updateConfig();

	searchPanel = new SearchPanel(document.getElementById('tabView:mainForm:searchText_input'), 
																document.getElementById('tabView:mainForm:searchButton'),
																function(){
																	tabViewVar.select(0);
																}
															 );
	
	var mapElement = gmtls.getMap();
	if (configuration.MAPS!=null) {

		var windowsTouchInterface = ((navigator.appVersion.indexOf("Win")!=-1) && ('ontouchstart' in document.documentElement)); 
		var overviewDiv = document.getElementById("overviewDiv");
	  customMap = new CustomMap({
		    map : mapElement, 
		    configuration : configuration, 
		    hideDiv : document.getElementById('leftPanel'), 
		    markerOptimization : !windowsTouchInterface, 
		    bigLogo : windowsTouchInterface, 
		    overviewDiv : overviewDiv,
		    customTouchInterface: windowsTouchInterface
		});
	
    ServerConnector.setCustomMap(customMap);  
		GuiConnector.showGoogleMap();
		
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "search"));
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "missingConnection"));
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "drug",true, true));
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "chemical",#{chemicalMB.linkedToDisease()}, #{chemicalMB.linkedToDisease() == true}));
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "mirna",true, true));
		ServerConnector.addOverlayCollection(new OverlayCollection(customMap, "comment",false, true));
		
		customMap.refreshOverlays();

		
		if (GuiConnector.getParams["search"]!=undefined) {
			searchPanel.search(GuiConnector.getParams["search"]);
		}
		
		if (GuiConnector.getParams["comments"]=="on") {
			document.getElementById('comment_checkbox').click();
		}
		if (GuiConnector.getParams["layout"]!=undefined) {
			document.getElementById('tabView:layoutForm3:hidden2').value=GuiConnector.getParams["layout"];
			getVisualizedLayoutDetails();
		}

  }
	//when I try to hide legend from the beginning or in the same thread it's hidden forever... ;/
	setTimeout(function() {
		GuiConnector.hideLegend();
	}, 0);
}


function removeMissingConnection(id) {
	document.getElementById('missingConnectionForm:connectionId').value=""+id;
	dlg4.show();
}

function removeComment(id) {
	document.getElementById('missingConnectionForm:commentId').value=""+id;
	dlg5.show();
}


//]]>
		</script>
</h:head>
<h:body onload="initMap();" >
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="pileup.css"/>

	<h:outputScript library="primefaces" name="jquery/jquery.js" target="head"	/>
	<div class = "containerClass">
		<div id="leftPanel" class ="leftPanelClass">
		
		<ui:include src="/WEB-INF/components/admin/header.xhtml" />
		
<!--		<div class="tabNavigation">
		<a href="javascript:;" onclick="GuiConnector.tabNaviShow('prev');" class="naviLeft"><i class="fa fa-chevron-left"></i></a>
		<a href="javascript:;" onclick="GuiConnector.tabNaviShow('next');" class="naviRight"><i class="fa fa-chevron-right"></i></a>
		</div>
-->

			<p:tabView id="tabView" widgetVar="tabViewVar" styleClass="leftTabView" activeIndex="0" >	
				<p:tab id="searchTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-search maintab'&gt;&lt;/i&gt;&lt;br&gt;SEARCH&lt;/div&gt;" styleClass="leftTab">
					<ui:include src="/WEB-INF/components/map/searchPanel.xhtml" />
				</p:tab >	
				<p:tab id="drugTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-map-marker maintab'&gt;&lt;/i&gt;&lt;br&gt;DRUG&lt;/div&gt;" styleClass="leftTab">	
					<ui:include src="/WEB-INF/components/map/drugPanel.xhtml" />
				</p:tab >	
				<p:tab id="chemicalTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-map-marker maintab'&gt;&lt;/i&gt;&lt;br&gt;CHEMICAL&lt;/div&gt;" styleClass="leftTab">	
					<ui:include src="/WEB-INF/components/map/chemicalPanel.xhtml" />
				</p:tab >
				<p:tab id="miRNATab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-map-marker maintab'&gt;&lt;/i&gt;&lt;br&gt;MiRNA&lt;/div&gt;" styleClass="leftTab">	
					<ui:include src="/WEB-INF/components/map/miRNAPanel.xhtml" />
				</p:tab >
				<p:tab id="layoutTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-th-list maintab'&gt;&lt;/i&gt;&lt;br&gt;OVERLAYS&lt;/div&gt;" styleClass="leftTab">
					<ui:include src="/WEB-INF/components/map/layoutPanel.xhtml" />
				</p:tab >	
				<p:tab id="loginTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-sign-in maintab'&gt;&lt;/i&gt;&lt;br&gt;LOGIN&lt;/div&gt;" styleClass="leftTab" rendered ="#{userMB.loggedUser.login=='anonymous'}">	
					<ui:include src="/WEB-INF/components/map/loginPanel.xhtml" />
				</p:tab >	
				<p:tab id="profileTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-user maintab'&gt;&lt;/i&gt;&lt;br&gt;PROFILE&lt;/div&gt;" styleClass="leftTab" rendered ="#{not (userMB.loggedUser.login=='anonymous')}">	
					<ui:include src="/WEB-INF/components/map/profilePanel.xhtml" />
				</p:tab >	
				<p:tab id="submapTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-sitemap maintab'&gt;&lt;/i&gt;&lt;br&gt;SUBMAPS&lt;/div&gt;" styleClass="leftTab">	
					<ui:include src="/WEB-INF/components/map/submapPanel.xhtml" />
				</p:tab >	
				<p:tab id="infoTab" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-info maintab'&gt;&lt;/i&gt;&lt;br&gt;PROJECT&lt;/div&gt;" styleClass="leftTab">	
					<ui:include src="/WEB-INF/components/map/infoPanel.xhtml" />
				</p:tab >	
<!--				
<p:tab id="sample1" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-envelope maintab'&gt;&lt;/i&gt;&lt;br&gt;SAMPLE 1&lt;/div&gt;" styleClass="leftTab hide">
</p:tab >

<p:tab id="sample2" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-envelope maintab'&gt;&lt;/i&gt;&lt;br&gt;SAMPLE 2&lt;/div&gt;" styleClass="leftTab hide">
</p:tab >

<p:tab id="sample3" title="&lt;div class='tngContainer'&gt;&lt;div class='tng'&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class='maintabdiv'&gt;&lt;i class='fa fa-envelope maintab'&gt;&lt;/i&gt;&lt;br&gt;SAMPLE 3&lt;/div&gt;" styleClass="leftTab hide">
</p:tab >			 
-->		
			</p:tabView >
			
			
			<div id="footerLinks">
			 <a href="admin.xhtml?id=#{mapMB.currentMapId}" style="float:left; padding-left:25px;"><i class="fa fa-lock" style="font-size:17px"></i> &nbsp;ADMIN</a>
			 <a href="#{configurationMB.userManual}" target="_user_manual_" style="float:left; padding-left:50px;"><i class="fa" style="font-size:17px"></i> &nbsp;MANUAL</a>
			 <a href="export.xhtml?id=#{mapMB.currentMapId}" style="float:right; padding-right:25px;">EXPORT&nbsp; <i class="fa fa-mail-forward" style="font-size:17px"></i></a>
			</div>
				
		</div>
		<div>
			<ui:include src="/WEB-INF/components/map/map.xhtml" />
		</div>
	</div>

	<!--<ui:include src="/WEB-INF/components/map/footer.xhtml" />-->
			
	<ui:include src="/WEB-INF/components/map/feedbackDialog.xhtml" />
	<ui:include src="/WEB-INF/components/map/missingConnectionDialog.xhtml" />

</h:body>
</f:view>
</html>