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

Last change on this file since 28737 was 28737, checked in by davidb, 8 years ago

Next stage of development

File size: 5.8 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
11 <xsl:template name="von-sparql-canvas">
12
13 <script type="text/javascript" src="ext/jena/sgvizler/jquery-1.6.2.min.js"><xsl:text> </xsl:text></script>
14
15 <script type="text/javascript" src="ext/jena/sgvizler/jsapi"><xsl:text> </xsl:text></script>
16 <script type="text/javascript" id="sgvzlr_script" src="ext/jena/sgvizler/sgvizler.js"><xsl:text> </xsl:text></script>
17 <script type="text/javascript" src="ext/von-sparql/von-sparql-script.js"><xsl:text> </xsl:text></script>
18<div>
19<div id="sgvzl_PredicateOverview"
20 data-sgvizler-endpoint="http://localhost:3030/greenstone/query"
21 data-sgvizler-chart="gTable"
22 data-sgvizler-loglevel="2"
23 data-sgvizler-chart-options="title=Items by Language"
24 width="100"
25 style="width:450px; height:250px;display:inline-block;float:left" >
26 <xsl:attribute name="data-sgvizler-query">
27 SELECT ?Predicate (COUNT (?Predicate) AS ?Count) (COUNT (DISTINCT ?o) AS ?Distinct_Values)
28 WHERE{
29 ?s ?Predicate ?o
30 }
31 GROUP BY ?Predicate
32 ORDER BY DESC (?Predicate)
33 </xsl:attribute>
34 <xsl:comment>Filler</xsl:comment>
35</div>
36<div id="queryContainer"
37 style="
38 border:1px solid #DFD9C3;
39 width:450px;height:250px;
40 float:left;
41 margin-left:15px;
42 padding:10px;
43 overflow-y:scroll;"
44 >
45 <span>SPARQL Query:</span>
46 <br/>
47 <span id="span_sparqlQuery"
48 style="font-size:10pt;">
49 <xsl:comment>Filler</xsl:comment>
50 </span>
51</div>
52</div>
53<br/>
54<div style="margin-top:20px;margin-bottom:10px;display:inline-block;">
55 <label for="sel_Predicate">View Predicate:</label>
56 <select id="sel_Predicate">
57 <option value="None"></option>
58 </select>
59 <br/>
60 <div style="margin-left:20px;margin-bottom:20px;margin-top:5px">
61 <input type="checkbox" id="cb_RefineSearch"/> <label for="cb_RefineSearch">Refine search to:</label>
62 <br/>
63 <label for="sel_RefineObject">?o</label>
64 <select id="sel_RefineObject" enabled='false'>
65 <option value="None">Select predicate above</option>
66 </select>
67 <br/>
68 <label for="sel_RefinePredicate">?p</label>
69 <select id="sel_RefinePredicate" enabled='false'>
70 <option value="None">Select ?o above</option>
71 </select>
72 </div>
73
74 <select id="sel_Limit">
75 <option value="None">No Limit</option>
76 <option value="10">10</option>
77 <option value="25">25</option>
78 <option value="50">50</option>
79 <option value="75">75</option>
80 <option value="100">100</option>
81 </select>
82 <select id="sel_ChartType">
83 <option value="gTable">Table</option>
84 <option value="gPieChart">Pie Chart</option>
85 <option value="gBarChart">Bar Chart</option>
86 </select>
87 <button type="button" id="btn_ShowChart">Execute Query</button>
88</div>
89<script type="text/javascript">
90 <xsl:text disable-output-escaping="yes">
91 var overviewSparqlQuery;
92 function sgvizlerGo (){
93 overviewSparqlQuery = $('#sgvzl_PredicateOverview').attr("data-sgvizler-query");
94 sgvizler.go();
95
96 //Load possible predicate values into selector
97 updatePredicateSelector();
98
99 //Ensure search refinement elements are greyed
100 toggle_RefineSearch(0);
101 $('#cb_RefineSearch').prop('checked',false);
102 }
103 sgvizler.option.namespace.dc = 'http://purl.org/dc/elements/1.1/';
104 sgvizler.option.namespace.gsembedded = 'http://greenstone.org/gsembedded#'
105 sgvizler.option.namespace.greenstonedata = 'http://localhost:3030/greenstone/data/'
106 $(document).ready(sgvizlerGo());
107
108 $("#btn_ShowChart").click(function(){
109 newPredQuery("sgvzl_container", $('#sel_ChartType').val())
110 });
111 $("#cb_RefineSearch").click(function(){
112 if(document.getElementById("cb_RefineSearch").checked==false)
113 toggle_RefineSearch(0);
114 else
115 toggle_RefineSearch(1);
116
117 generateQuery();
118 });
119 $("#sel_Predicate").change(function(){
120 updateRefineObjectSelector($("#sel_Predicate").val());
121 generateQuery();
122 });
123 $("#sel_RefineObject").change(function(){
124 updateRefinePredicateSelector($("#sel_RefineObject").val());
125 generateQuery();
126 });
127 $("#sel_RefinePredicate").change(function(){
128 generateQuery();
129 });
130 $("#sel_Limit").change(function(){
131 generateQuery();
132 });
133 </xsl:text>
134</script>
135
136<div id="sgvzl_container"
137 style="width:auto; height:400px; margin-top:10px; ">
138</div>
139</xsl:template>
140
141
142 <!-- the page content -->
143 <xsl:template match="/page/pageResponse">
144
145 <div id="quickSearch">
146 <gslib:crossCollectionQuickSearchForm/>
147 </div>
148
149 <h2><gslib:selectACollectionTextBar/></h2>
150
151 <div id="collectionLinks">
152 <xsl:if test="count(collectionList/collection) = 0">
153 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
154 <br/>
155 </xsl:if>
156 <xsl:for-each select="collectionList/collection">
157 <gslib:collectionLinkWithImage/>
158 </xsl:for-each>
159 <br class="clear"/>
160 </div>
161
162 <xsl:call-template name="von-sparql-canvas"/>
163
164 <gslib:serviceClusterList/>
165
166 <xsl:for-each select="serviceList/service[@type='query']">
167 <gslib:serviceLink/><br/>
168 </xsl:for-each>
169
170 <xsl:for-each select="serviceList/service[@type='authen']">
171 <gslib:authenticationLink/><br/><br/>
172 <gslib:registerLink/><br/>
173 </xsl:for-each>
174
175 </xsl:template>
176
177</xsl:stylesheet>
178
179
Note: See TracBrowser for help on using the repository browser.