PageRenderTime 32ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/facete-client/src/main/webapp/WEB-INF/jsp/facete-index.jsp

https://github.com/GeoKnow/Facete
JavaServer Pages | 571 lines | 346 code | 146 blank | 79 comment | 14 complexity | 812d24afea431d8742344ad5341de04b MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html class="js" lang="en" dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head xmlns:update="http://ns.aksw.org/update/">
  4. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>${title}</title>
  7. <link rel="stylesheet" href="resources/lib/twitter-bootstrap/2.3.2/css/bootstrap.min.css" />
  8. <!--[if lt IE 8]>
  9. <link rel="stylesheet" type="text/css" href="resources/lib/Font-Awesome/current/css/font-awesome-ie7.css" />
  10. <![endif]-->
  11. ${cssIncludes}
  12. <link rel="stylesheet" type="text/css" href="resources/lib/select2/3.4.1/select2.css" />
  13. <link rel="stylesheet" type="text/css" href="resources/lib/jquery-ui/1.10.2/themes/base/jquery-ui.css" />
  14. <!-- <script type="text/javascript" src="js/prototypes.js"></script> -->
  15. <!--[if lt IE 9]>
  16. <script type="text/javascript" src="resources/lib/html5shiv/67bff28/dist/html5shiv.js"></script>
  17. <![endif]-->
  18. <script type="text/javascript" src="resources/lib/JSON-js/json2.js"></script>
  19. <script type="text/javascript" src="resources/lib/namespacedotjs/a28da387ce/Namespace.js"></script>
  20. <script type="text/javascript" src="resources/lib/jquery/1.10.1/jquery-1.10.1.js"></script>
  21. <script type="text/javascript" src="resources/lib/jQuery-ajaxTransport-XDomainRequest/current/jQuery.XDomainRequest.js"></script>
  22. <script type="text/javascript" src="resources/lib/jquery-ui/1.10.2/ui/jquery-ui.js"></script>
  23. <script type="text/javascript" src="resources/lib/underscore/1.4.4/underscore.js"></script>
  24. <script type="text/javascript" src="resources/lib/underscore.string/current/dist/underscore.string.min.js"></script>
  25. <script type="text/javascript" src="resources/lib/backbone/1.0.0/backbone.js"></script>
  26. <script type="text/javascript" src="resources/lib/twitter-bootstrap/2.3.2/js/bootstrap.js"></script>
  27. <script type="text/javascript" src="resources/lib/agility/current/agility.js" charset="utf-8"></script>
  28. <script type="text/javascript" src="resources/lib/CryptoJS/3.0.2/components/core-min.js"></script>
  29. <script type="text/javascript" src="resources/lib/CryptoJS/3.0.2/components/enc-utf16-min.js"></script>
  30. <script type="text/javascript" src="resources/lib/CryptoJS/3.0.2/components/enc-base64-min.js"></script>
  31. <script type="text/javascript" src="resources/lib/open-layers/2.12/OpenLayers.js"></script>
  32. <script type="text/javascript" src="resources/lib/json-template/0.85/json-template.js"></script>
  33. <script type="text/javascript" src="resources/lib/RDFauthor/current/libraries/jquery.rdfquery.rdfa-1.0.js"></script>
  34. <!-- <script type="text/javascript" src="lib/open-layers/2.10/extensions/OpenStreetMap/OpenStreetMap.js"></script> -->
  35. <script type="text/javascript" src="resources/lib/doT/current/doT.js"></script>
  36. <script type="text/javascript" src="resources/lib/select2/3.4.1/select2.js"></script>
  37. <script type="text/javascript" src="resources/lib/persist-js/0.1.0/persist.js"></script>
  38. <script type="text/javascript" src="resources/lib/simpleresizabletables/simpleresizabletables.js"></script>
  39. <!-- The actual spatial semantic browsing widgets -->
  40. ${jsIncludes}
  41. <script type="text/javascript" src="resources/facete-config.js"></script>
  42. <script type="text/javascript" src="resources/js/main-facets.js"></script>
  43. <script type="text/javascript">
  44. $(document).ready(function() {
  45. var store = new Persist.Store('FaceteStore');
  46. /*
  47. * Intro screen
  48. */
  49. var suppressIntroScreenKey = 'suppressIntroScreen';
  50. var $showIntroScreen = $('#show-intro-screen');
  51. var $introScreen = $('#myModal');
  52. $introScreen.on('shown', function() {
  53. $(window).resize();
  54. });
  55. $showIntroScreen.click(function(ev) {
  56. ev.preventDefault();
  57. $introScreen.modal('show');
  58. });
  59. var $introScreenCheckbox = $('#introScreenCheckbox');
  60. $introScreen.on('hidden.bs.modal', function () {
  61. var isSuppressed = !($introScreenCheckbox.is(':checked'));
  62. //console.log('[DEBUG] Store data updated to ', isSuppressed);
  63. if(isSuppressed) {
  64. store.set(suppressIntroScreenKey, '' + isSuppressed);
  65. } else {
  66. store.get(suppressIntroScreenKey, function(ok, val) {
  67. var isSuppressed = (val === 'true');
  68. if(isSuppressed) {
  69. // There seems to be a bug in persistjs, that remove does not work :/
  70. //store.remove(suppressIntroScreenKey);
  71. //alert('cookie removed');
  72. document.cookie = suppressIntroScreenKey + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
  73. store.set(suppressIntroScreenKey, '');
  74. }
  75. });
  76. }
  77. // if(isSuppressed) {
  78. // store.set(suppressIntroScreenKey, 'true');
  79. // }
  80. // else {
  81. // store.remove(suppressIntroScreenKey);
  82. // }
  83. $introScreen.css('display', 'none');
  84. });
  85. store.get(suppressIntroScreenKey, function(ok, val) {
  86. //console.log('[DEBUG] Store data: ', ok, val);
  87. var isVisible = (val != 'true');
  88. $introScreenCheckbox.prop('checked', isVisible);
  89. if(isVisible) {
  90. $introScreen.modal();
  91. }
  92. });
  93. var layoutUtils = Namespace('org.aksw.utils.layout');
  94. $('.portlet-header').disableSelection();
  95. $('.portlet')
  96. //.addClass('ui-widget') //ui-corner-all ui-widget-content
  97. .find('.portlet-header')
  98. //.addClass('ui-widget-header ui-corner-all')
  99. .addClass('navbar portlet-navbar') // navbar-fixed-top
  100. .wrapInner(function() {
  101. //console.log('this', this);
  102. var str
  103. = '<div class="navbar-inner" style="min-height:20px; height:20px; position:relative;">'
  104. + '<a href="#" class="brand" style="font-size:14px; padding-top: 0px; padding-bottom: 0px;" />'
  105. // + '<a href="#" class="toggle-minimized" style="position: absolute; top: 4px; right: 20px;">'
  106. // + '<i class="icon-minus-sign" />'
  107. // + '</a>'
  108. + '<a href="#" class="toggle-context-help" style="position: absolute; top: 4px; right: 5px;" data-title="Popover" data-content="Content" data-trigger="click" data-placement="bottom" rel="popover">'
  109. + '<i class="icon-info-sign" />'
  110. + '</a>'
  111. //+ this.nodeValue.text()
  112. + '</div>';
  113. return str;
  114. })
  115. //.prepend('<span class="ui-icon ui-icon-minusthick"></span>')
  116. .end()
  117. .find('.portlet-content');
  118. //$('.portlet-header').children();
  119. $('.portlet').resizable({
  120. //handles: {'s': 'ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se'},
  121. handles: 's',
  122. //grid: [25, 25],
  123. //alsoResize: $(this).find('.portlet-content'),
  124. resize: function(event, ui) {
  125. //$(ui.element).find()
  126. var $elContent = $(this).find('.portlet-content');
  127. var height = layoutUtils.getDefaultAutoHeight($elContent, false);
  128. $elContent.css('height', (height - 5) + 'px');
  129. }
  130. /*
  131. stop: function(ev, ui) {
  132. //$(ui.element).removeClass('width');
  133. }*/
  134. });
  135. //.draggable({
  136. // grid: [25, 25]
  137. // }).);
  138. $('.toggle-minimized').click(function(ev) {
  139. ev.preventDefault();
  140. $elI = $(this).find('i:first');
  141. $elI.toggleClass('icon-minus-sign').toggleClass('icon-plus-sign');
  142. $(this).parents('.portlet:first').toggleClass('portlet-minimized');
  143. });
  144. $('.portlet-group').sortable({
  145. //connectWith: 'portlet-group',
  146. handle: '.portlet-header'
  147. /*
  148. update: function(event, ui) {
  149. var orders = new Array();
  150. $('.portlet-group .portlet').each(function(i) {
  151. var order = $(this).index();
  152. var id = $(this).attr('data-post-id');
  153. orders.push(order);
  154. });
  155. console.log(orders);
  156. }
  157. */
  158. });
  159. // Source: http://stackoverflow.com/questions/11703093/how-to-dismiss-a-twitter-bootstrap-popover-by-clicking-outside
  160. //var $poped = $('.toggle-context-help');
  161. // $poped.popover();
  162. // $poped.click(function() {
  163. // console.log('[TRACE] click event received');
  164. // });
  165. // Trigger for the popover
  166. // $poped.each(function() {
  167. // var $this = $(this);
  168. // $this.on('hover',function() {
  169. // var popover = $this.data('popover');
  170. // var shown = popover && popover.tip().is(':visible');
  171. // if(shown) return; // Avoids flashing
  172. // $this.popover('show');
  173. // });
  174. // });
  175. // Trigger for the hiding
  176. // $('html').on('click.popover.data-api',function() {
  177. // $poped.popover('hide');
  178. // });
  179. var popoverTexts = {
  180. 'facetView': 'This view shows the properties of all items matching your current filter selection. Click the down arrow to view the sub-properties. Click the name of a property to show its values. Click the right arrow icon that appears on hover to add the values of the property as a column to the table view.',
  181. 'facetValuesView': 'This view shows the values of any property previously selected in the facet view. Click the check box to filter the items accordingly.',
  182. 'filterView': 'This view shows a summary of the filters that are in place. Click a filter to remove it. Click "Clear all" to remove all filters.',
  183. 'tableView': 'This view shows the table in regard to properties that were attached to the table and set filters.',
  184. 'mapView': 'This view shows a map. If there is data to be displayed on the map, then appropriate selections will be available in the geo-link drop down.',
  185. 'detailView': 'If there are markers on the map, upon clicking one, details about it will be shown here.'
  186. };
  187. // http://stackoverflow.com/questions/17842121/hiding-bootstrap-popover-on-click-outside-popover
  188. //var $popover = $('[data-toggle=popover]').popover();
  189. var popoverSelector = '[rel=popover]';
  190. var $popover = $('.portlet-header a[rel=popover]').popover({
  191. html: true,
  192. title: function() {
  193. var $this = $(this);
  194. var $parent = $this.closest('.portlet-header').find('.brand');
  195. var result = 'Quick help for ' + $parent.html();
  196. return result;
  197. },
  198. content: function() {
  199. var $this = $(this);
  200. var $parent = $this.closest('.portlet');
  201. // TODO Catch the case if there is no portlet ... if(!)
  202. var classNames = $parent.attr('class').split(/\s+/);
  203. //console.log('Class names: ', classNames);
  204. var result = "We are sorry, but there is no help text available :/";
  205. for(var i = 0; i < classNames.length; ++i) {
  206. var className = classNames[i];
  207. var text = popoverTexts[className];
  208. if(text) {
  209. result = text;
  210. break;
  211. }
  212. }
  213. return result;
  214. }
  215. });
  216. $popover.on('click', function(ev) {
  217. ev.preventDefault();
  218. //return true;
  219. });
  220. $(document).on('click', function (e) {
  221. var $target = $(e.target);
  222. var $popovers = $(popoverSelector);
  223. //var isPopover = $target.is(popoverSelector);
  224. var isPopover = $target.closest(popoverSelector).length > 0;
  225. //var isPopover = $target.closest('.popover').length > 0;
  226. var inPopover = $target.closest('.popover').length > 0;
  227. //console.log('state', isPopover, inPopover, $target);
  228. //hide only if clicked on button or inside popover
  229. if (!isPopover && !inPopover) {
  230. //alert('hide');
  231. $popovers.popover('hide');
  232. }
  233. });
  234. $('.modal-body').autoHeight();
  235. //$('.portlet-content').autoHeight();
  236. //$('.portlet-container').disableSelection();
  237. //$('#main-layout-table').simpleResizableTable();
  238. });
  239. var facets = Namespace("org.aksw.ssb.facets");
  240. $(document).ready(facets.facetTest);
  241. </script>
  242. </head>
  243. <body>
  244. <div class="container fill">
  245. <!-- <div class="row-fluid"> -->
  246. <!-- <?php include($headerFile); ?> -->
  247. ${headerHtml}
  248. <div id="div-settings" class="row-fluid" style="display: none">
  249. <form>
  250. <!-- <label><input type="radio" name="group1" checked="checked"/>Global</label> -->
  251. <div class="service-config">
  252. <div class="inline">Service:</div> <div id="sparql-service-selector" class="select2-container inline" style="width: 300px;"></div>
  253. <div class="inline">Datasets:</div> <div id="default-graph-selector" class="select2-container multiple inline" style="width: 300px;"></div>
  254. </div>
  255. <br class="clearBoth" />
  256. <hr />
  257. <!-- <label><input type="radio" name="group1" />Level of Detail</label> -->
  258. <!-- <div class="lod-slider inline" style="width: 300px;"></div> -->
  259. <!-- <div class="lod-service-condfig"></div> -->
  260. <!-- <br class="clearBoth" /> -->
  261. </form>
  262. </div>
  263. <!-- </div> -->
  264. <!-- <br class="clearBoth" style="width:0px; height: 0px;" /> -->
  265. <div class="clearfix"></div>
  266. <div class="row-fluid fill" id="css-index-mainContainer" style="overflow: visible;">
  267. <!-- <div class="span3 filler portlet-group ui-sortable" style="background-color:#E9EFF3;"> -->
  268. <table id="main-layout-table" class="layout-table">
  269. <!-- <tr><th></th><th></th><th></th></tr> -->
  270. <!-- <tr><td id="notification-area" colspan="3">The endpoint is not reachable!</td></tr> -->
  271. <tr>
  272. <td style="border-left:none; width: 20%; background-color:#E9EFF3;">
  273. <div class="section-heading">1. Selection</div>
  274. <!-- <div class="portlet-group ui-sortable"> row-fluid -->
  275. <div class="portlet facetView">
  276. <div class="portlet-header">Facets</div>
  277. <div class="portlet-content"> <!-- min-height: 300px; -->
  278. <!-- <div style="overflow:auto;"> -->
  279. <ul id="facets" class="facet-tree" style="list-style: none; list-style-type:none;"></ul>
  280. <!-- </div> -->
  281. </div>
  282. </div>
  283. <div class="portlet facetValuesView">
  284. <div class="portlet-header">Facet Values</div>
  285. <div id="facetValues" class="portlet-content"></div>
  286. </div>
  287. <!-- </div> -->
  288. <div class="portlet filterView">
  289. <div class="portlet-header">Filters</div>
  290. <button id="facete-clear-filters" type="submit" class="btn btn-default">Clear filters</button>
  291. <div id="constraints" class="portlet-content"></div>
  292. </div>
  293. <!-- A dummy div to use more space, so that the popover of the last portlet is correctly shown -->
  294. <div style="width: 100%; height: 150px"></div>
  295. <!-- </div> -->
  296. </td>
  297. <td style="width: 38%;">
  298. <!-- <div class="span4" style="margin-left: 5px; margin-top: 3px;"> -->
  299. <!-- <div class="portlet-group ui-sortable"> -->
  300. <!-- <table id="css-index-mainTable" style="width: 100%"> -->
  301. <!-- <tr> -->
  302. <!-- Left side (Table View) -->
  303. <!-- <td id="css-index-mainTable-leftSide" style="vertical-align: top"> -->
  304. <div class="section-heading">2. Data</div>
  305. <div class="portlet tableView">
  306. <div class="portlet-header">Table View</div>
  307. <div id="instances" class="portlet-content"></div>
  308. <!-- <div class="portlet-content" style="overflow: auto;")> -->
  309. <!-- <div id="instances"></div> -->
  310. <!-- </div> -->
  311. <!-- <a style="display:none" id="exportCsv" href="#">Export CSV</a> -->
  312. <!-- <a style="display:none" id="exportRdf" href="#">Export RDF</a> -->
  313. </div>
  314. <!-- </td> -->
  315. <!-- </div> -->
  316. </td>
  317. <td style="border-right: none; background-color:#E9EFF3; width: 42%;">
  318. <!-- <div class="span5 filler-right" style="margin-left: 5px; margin-top: 3px; background-color:#E9EFF3;"> -->
  319. <!-- Right side (Map and Detail View) -->
  320. <!-- <td id="css-index-mainTable-rightSide" class="filler-right"> -->
  321. <div class="section-heading">3. Geographical</div>
  322. <div class="portlet mapView">
  323. <div class="portlet-header">Map</div>
  324. <div id="mapNoticeArea"></div>
  325. <table style="width: 100%">
  326. <tr><td style="width: 1px">Geo-Link:</td><td style="width:100%"><select id="geolink" style="width: 100%"></select></td></tr>
  327. </table>
  328. <div id="mapContainer" class="portlet-content">
  329. <div id="map" style="height: 350px;"></div>
  330. <a id="centerMapOnPosition" href="#" style="display:none; position:absolute; bottom: 20px; z-index: 1000;">Center on user location</a>
  331. </div>
  332. </div>
  333. <div class="portlet detailView">
  334. <div class="portlet-header">Detail view</div>
  335. <div id="detailViewState"></div>
  336. <div id="detailView" class="portlet-content"></div>
  337. </div>
  338. <!-- </td> -->
  339. <!-- </tr> -->
  340. <!-- </table> -->
  341. <!-- </div> -->
  342. <!-- </div> -->
  343. <!-- <div class="portlet-group ui-sortable row-fluid"> -->
  344. <!-- </div> -->
  345. </td>
  346. </tr>
  347. </table>
  348. </div>
  349. </div>
  350. <!-- </div> -->
  351. <!-- </div> -->
  352. <!-- Modal -->
  353. <div class="modal fade" style="position: fixed; display: none; top: 5%; left: 5%; width: 90%; height: 90%; margin: 0px" id="myModal">
  354. <div class="modal-dialog" style="height: 100%">
  355. <div class="modal-content" style="height: 100%">
  356. <div class="modal-header">
  357. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  358. <h4 class="modal-title">Welcome to SemMap - A tool for exploring (geographical) Linked Data datasets on the Web.</h4>
  359. </div>
  360. <div class="modal-body" style="max-height: 100%; font-size:13px;">
  361. <h3>About SemMap</h3>
  362. The <i>Semmap</i> application allows the user to explore the content of a Linked Data endpoint in a graphical way.
  363. It allows the user to select a specific slice of data that he or she is interested in, creating a '<i>facet</i>' of the dataset.
  364. The facet is created by defining a set of constraints on properties in the database. Once the facet is define, the information in the facet can be clicked-through in a tabular interface and visualized on a map.
  365. The user can choose a SPARQL endpoint and graph through the selection boxes on the top of the screen.
  366. This screen is meant as a quick guide on how to use SemMap. The application's structure is shown below, with an explanation on how to use each part.
  367. A more in-depth tutorial is provided under <a href="http://odp.tenforce.com/semmap/tutorial">http://odp.tenforce.com/semmap/tutorial</a>.
  368. <table class="layout-table">
  369. <tr>
  370. <td style="border-left:none; width: 20%; background-color:#E9EFF3;">
  371. <div class="section-heading">1. Selection</div>
  372. </td>
  373. <td style="width: 35%;">
  374. <div class="section-heading">2. Data</div>
  375. </td>
  376. <td style="border-right: none; background-color:#E9EFF3; width: 40%;">
  377. <div class="section-heading">3. Geographical</div>
  378. </td>
  379. </tr>
  380. <tr>
  381. <td style="border-left:none; width: 20%; background-color:#E9EFF3;">
  382. The facet tree shows the structure of the dataset to the user. It shows all items' properties and sub-properties as a tree.
  383. <img style="width: 100%;" src="resources/images/org/aksw/facete/intro/facete-intro-facets.png" />
  384. The user can add a property as a column to the table view by hovering over the property and clicking the arrow symbol.
  385. <!-- TODO Add image of arrow symbol -->
  386. The user can also place restrictions on items in the facet by clicking a property and selecting a number of values that are allowed for the property and selecting a number of values that are exist for the property.
  387. <img style="width: 100%;" src="resources/images/org/aksw/facete/intro/facete-intro-facetValues.png" />
  388. All filters can be removed by clicking 'Clear Filters'.
  389. </td>
  390. <td style="width: 35%;">
  391. The Table view shows a tabular representation of the data in the facet.
  392. All properties that have been marked with an arrow symbol in the facet tree are shown as columns.
  393. The columns contain the property values for every item according to the selected filter criteria.
  394. <img style="width: 100%;" src="resources/images/org/aksw/facete/intro/facete-intro-dataTable.png" />
  395. Every table view in SemMap has a 'filter' input field.
  396. The user can enter a word in this field.
  397. All elements in the table that do not contain this word are then hidden.
  398. The number of rows shown per page in the table is controlled by the the 'Max Rows' selection.
  399. The user can flip pages using the controls at the bottom of the table.
  400. </td>
  401. <td style="border-right: none; background-color:#E9EFF3; width: 40%;">
  402. The map view shows a geographic representation of the elements in the facet if there are elements with geo-coordinates available.
  403. <img style="width: 100%;" src="resources/images/org/aksw/facete/intro/facete-intro-map.png" />
  404. It can happen that there are a lot of elements present in a region. That region is then shown as a blue rectangle to keep the application responsive. The user can zoom in on this region to view hidden items.
  405. The user can click an item on the map to show all its property values below the map.
  406. <img style="width: 100%;" src="resources/images/org/aksw/facete/intro/facete-intro-detailView.png" />
  407. </td>
  408. </tr>
  409. </table>
  410. <!--
  411. <img src="resources/images/facete-intro.png"></img>
  412. -->
  413. </div>
  414. <div class="modal-footer">
  415. <div style="display:inline; font-size:13px; margin-bottom: 3px;" class="alert alert-info"><strong>When closing this dialog after having unchecked the checkbox, you give consent to accepting a cookie with the purpose of remembering your decision.</strong></div><br />
  416. <label style="display: inline"><input id="introScreenCheckbox" type="checkbox" /> Show this introduction on next visit</label>
  417. <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>
  418. <!-- <a href="#" class="btn btn-primary">Save changes</a> -->
  419. </div>
  420. </div><!-- /.modal-content -->
  421. </div><!-- /.modal-dialog -->
  422. </div><!-- /.modal -->
  423. </body>
  424. </html>