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

Last change on this file since 28915 was 28915, checked in by ak19, 10 years ago

Changes made to these files at the end of the 2013/2014 Summer project work by Steffan

File size: 6.3 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/von-sparql/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 id="div_PredicateOverview" >
39 <div id="sgvzl_PredicateOverview"
40 data-sgvizler-endpoint="{$endpointPath}"
41 data-sgvizler-chart="google.visualization.Table"
42 data-sgvizler-loglevel="2"
43 data-sgvizler-chart-options="title=Predicate Overview|width=300"
44 >
45 <xsl:attribute name="data-sgvizler-query">
46
47 SELECT (?p as ?Predicate) (COUNT (?s) as ?Total)WHERE
48 {
49 ?s &lt;http://purl.org/dc/elements/1.1/Relation.isPartOf&gt; &lt;http://localhost:8989/greenstone3/library/collection/<xsl:value-of select="$coll_name_short"/>&gt;;
50 ?p ?o
51 }
52 GROUP BY ?p
53 ORDER BY DESC(?Total)
54 </xsl:attribute>
55 <xsl:comment>Filler</xsl:comment>
56 </div>
57 </div>
58
59 <div id="searchContainer">
60 <div id="div_Selects">
61 <label for="sel_Predicate">Select Predicate:</label>
62 <select id="sel_Predicate">
63 <option value="None"></option>
64 </select>
65 <br/>
66 <input type="checkbox" id="cb_RefineSearch"/> <label for="cb_RefineSearch">Refine search to:</label>
67 <br/>
68 <div id="refineControls">
69 <table class="refineControls" id="table_refineControls">
70 <tr>
71 <td><label for="sel_RefineObject">Value:</label></td>
72 <td><select id="sel_RefineObject" enabled='false'>
73 <option value="None">Select predicate above</option>
74 </select>
75 </td>
76 </tr>
77 <tr>
78 <td>
79 <label for="sel_RefinePredicate">Visualize Predicate:</label>
80 </td>
81 <td>
82 <select id="sel_RefinePredicate" enabled='false'>
83 </select>
84 </td>
85 </tr>
86 </table>
87 </div>
88 </div>
89 <div id="searchControls">
90 <select id="sel_Limit">
91 <option value="None">No Limit</option>
92 <option value="10">10</option>
93 <option value="25">25</option>
94 <option value="50">50</option>
95 <option value="75">75</option>
96 <option value="100">100</option>
97 </select>
98 <select id="sel_ChartType">
99 <option value="google.visualization.Table">Table</option>
100 <option value="google.visualization.PieChart">Pie Chart</option>
101 <option value="google.visualization.BarChart">Bar Chart</option>
102 <option value="google.visualization.ImageSparkLine">Sparkline</option>
103 <option value="google.visualization.LineChart">Line Chart</option>
104 </select>
105 <button type="button" id="btn_ShowChart">Execute Query</button>
106 </div>
107<!--
108 <div id="#div_autocomplete" style="width:300px;">
109 <input id="autocomplete" type="text"/>
110 </div> -->
111 </div>
112
113 <div id="sparqlQuery-turnstyle">
114 <div>
115 Show Sparql query
116 </div>
117 <div id="queryContainer" class="documenttext" style="display:none;">
118 <span id="span_sparqlQuery"><xsl:comment>filler</xsl:comment></span>
119 </div>
120 </div>
121
122 <div id="sgvzl_container" style="width:675px; height:400px; margin-top:10px; ">
123 </div>
124 <script type="text/javascript">
125 <xsl:text disable-output-escaping="yes">
126 <![CDATA[
127 var overviewSparqlQuery;
128
129 function createOverviewQuery(){
130 overviewSparqlQuery = $('#sgvzl_PredicateOverview').attr("data-sgvizler-query");
131 }
132
133 transformToTurnstyleBlock("sparqlQuery");
134
135 function sgvizGo(){
136 sgvizler
137 .defaultEndpointOutputFormat('jsonp')
138 // Add prefixes used in examples:
139 .prefix('dc', "http://purl.org/dc/elements/1.1/")
140 .prefix('xsd', "http://www.w3.org/2001/XMLSchema#")
141
142 // Draw all sgvizler containers on page:
143 .containerDrawAll();
144
145 createOverviewQuery();
146
147 //Load possible predicate values into selector
148 updatePredicateSelector();
149
150 //Ensure search refinement elements are greyed
151 toggle_RefineSearch(0);
152 $('#cb_RefineSearch').prop('checked',false);
153 }
154
155 google.load('visualization','1', {packages: ['corechart']});
156 google.setOnLoadCallback(sgvizGo);
157 window.onload=setupPage;
158 ]]>
159 </xsl:text>
160 </script>
161
162 </xsl:template>
163 <!-- the page content -->
164 <xsl:template match="/page">
165
166 <!--Display the description text of the current collection,
167 and if some services are available then create a list
168 of links for each service within a <ul id="servicelist"> element.-->
169 <gslib:collectionDescriptionTextAndServicesLinks/>
170
171 <xsl:call-template name="overview"/>
172
173 </xsl:template>
174
175</xsl:stylesheet>
176
Note: See TracBrowser for help on using the repository browser.