source: main/trunk/model-sites-dev/von-sparql/transform/pages/about.xsl@ 29446

Last change on this file since 29446 was 29446, checked in by sjs49, 6 years ago

Removed old commented code, and added some css for a previously unstyled page element

File size: 6.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <!-- use the 'main' layout -->
11 <!--<xsl:include href="layouts/main.xsl"/>-->
12
13 <!-- set page title -->
14 <!--<xsl:template name="pageTitle"><gslib:collectionName/></xsl:template>-->
15
16 <!-- set page breadcrumbs -->
17 <!--<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>-->
18
19 <xsl:variable name="coll_name"><gslib:collectionName/></xsl:variable>
20 <xsl:variable name="coll_name_short"><gslib:collectionNameShort/></xsl:variable>
21 <xsl:template name="overview">
22
23 <link rel="stylesheet" type="text/css" href="sites/{$site_name}/transform/pages/style.css"/>
24 <link rel="stylesheet" type="text/css" href="sites/{$site_name}/js/jquery-ui-extra/turnstyle-block.css"/>
25
26 <script type="text/javascript" src="https://www.google.com/jsapi"><xsl:text> </xsl:text></script>
27 <script type="text/javascript" src="http://beta.data2000.no/sgvizler/release/0.6/sgvizler.js"><xsl:text> </xsl:text></script>
28 <script type="text/javascript" src="sites/{$site_name}/js/von-sparql-script.js"><xsl:text> </xsl:text></script>
29 <script type="text/javascript" src="sites/{$site_name}/js/von-sparql-setup.js"><xsl:text> </xsl:text></script>
30 <script type="text/javascript" src="sites/{$site_name}/js/combobox.js"><xsl:text> </xsl:text></script>
31 <script type="text/javascript" src="sites/{$site_name}/js/jquery-ui-extra/turnstyle-block.js"><xsl:text> </xsl:text></script>
32
33 <xsl:variable name="protocol" select="substring-before(/page/pageRequest/@baseURL,':')"/>
34 <xsl:variable name="baseURL" select="substring-after(/page/pageRequest/@baseURL,':')"/>
35 <xsl:variable name="domain" select="substring-before($baseURL,':')"/>
36 <xsl:variable name="endpointPath" select="concat($protocol,':',$domain,':3030/greenstone/query')"/>
37
38 <div class="collectionName" >
39 <span>Collection Exploration (<xsl:value-of select="$coll_name_short"/>)</span>
40 </div>
41
42 <div id="div_PredicateOverview" >
43 <div id="sgvzl_PredicateOverview"
44 data-sgvizler-endpoint="{$endpointPath}"
45 data-sgvizler-chart="google.visualization.Table"
46 data-sgvizler-loglevel="2"
47 data-sgvizler-chart-options="title=Predicate Overview|width=300"
48 >
49 <xsl:attribute name="data-sgvizler-query">
50
51 PREFIX gsdl: &lt;http://localhost:3030/greenstone/data/&gt;
52 SELECT (?p as ?Predicate) (COUNT (?s) as ?Total)WHERE
53 {
54 GRAPH gsdl:<xsl:value-of select="$coll_name_short"/>{
55 ?s ?p ?o
56 }
57 }
58 GROUP BY ?p
59 ORDER BY DESC(?Total)
60 </xsl:attribute>
61 <xsl:comment>Filler</xsl:comment>
62 </div>
63 </div>
64
65 <div id="searchContainer">
66 <div id="div_Selects">
67 <label for="sel_Predicate">Select Predicate:</label>
68 <select id="sel_Predicate">
69 <option value="None"></option>
70 </select>
71 <br/>
72 <input type="checkbox" id="cb_RefineSearch"/> <label for="cb_RefineSearch">Refine search to:</label>
73 <br/>
74 <div id="refineControls">
75 <table class="refineControls" id="table_refineControls">
76 <tr>
77 <td><label for="sel_RefineObject">Value:</label></td>
78 <td><select id="sel_RefineObject" enabled='false'>
79 <option value="None">Select predicate above</option>
80 </select>
81 </td>
82 </tr>
83 <tr>
84 <td>
85 <label for="sel_RefinePredicate">Visualize Predicate:</label>
86 </td>
87 <td>
88 <select id="sel_RefinePredicate" enabled='false'>
89 </select>
90 </td>
91 </tr>
92 </table>
93 </div>
94 </div>
95 <div id="searchControls">
96 <select id="sel_Limit">
97 <option value="None">No Limit</option>
98 <option value="10">10</option>
99 <option value="25">25</option>
100 <option value="50">50</option>
101 <option value="75">75</option>
102 <option value="100">100</option>
103 </select>
104 <select id="sel_ChartType">
105 <option value="google.visualization.Table">Table</option>
106 <option value="google.visualization.PieChart">Pie Chart</option>
107 <option value="google.visualization.BarChart">Bar Chart</option>
108 <option value="google.visualization.ImageSparkLine">Sparkline</option>
109 <option value="google.visualization.LineChart">Line Chart</option>
110 </select>
111 <button type="button" id="btn_ShowChart">Execute Query</button>
112 </div>
113 </div>
114
115 <div id="sparqlQuery-turnstyle">
116 <div>
117 Show Sparql query
118 </div>
119 <div id="queryContainer" class="documenttext" style="display:none;">
120 <span id="span_sparqlQuery"><xsl:comment>filler</xsl:comment></span>
121 </div>
122 </div>
123
124 <div id="sgvzl_container" style="width:675px; height:400px; margin-top:10px; ">
125 </div>
126 <script type="text/javascript">
127 <xsl:text disable-output-escaping="yes">
128 <![CDATA[
129 var overviewSparqlQuery;
130
131 function createOverviewQuery(){
132 overviewSparqlQuery = $('#sgvzl_PredicateOverview').attr("data-sgvizler-query");
133 }
134
135 transformToTurnstyleBlock("sparqlQuery");
136
137 function sgvizGo(){
138 sgvizler
139 .defaultEndpointOutputFormat('jsonp')
140 // Add prefixes used in examples:
141 .prefix('dc', "http://purl.org/dc/elements/1.1/")
142 .prefix('xsd', "http://www.w3.org/2001/XMLSchema#")
143
144 // Draw all sgvizler containers on page:
145 .containerDrawAll();
146
147 createOverviewQuery();
148
149 //Load possible predicate values into selector
150 updatePredicateSelector();
151
152 //Ensure search refinement elements are greyed
153 toggle_RefineSearch(0);
154 $('#cb_RefineSearch').prop('checked',false);
155 }
156
157 google.load('visualization','1', {packages: ['corechart']});
158 google.setOnLoadCallback(sgvizGo);
159 window.onload=setupPage;
160 ]]>
161 </xsl:text>
162 </script>
163
164 </xsl:template>
165 <!-- the page content -->
166 <xsl:template match="/page">
167
168 <!--Display the description text of the current collection,
169 and if some services are available then create a list
170 of links for each service within a <ul id="servicelist"> element.-->
171 <gslib:collectionDescriptionTextAndServicesLinks/>
172
173 <xsl:call-template name="overview"/>
174
175 </xsl:template>
176
177</xsl:stylesheet>
178
Note: See TracBrowser for help on using the repository browser.