source: documentation/trunk/tutorial_sample_files/interfaces/aybara/interface.txt@ 37565

Last change on this file since 37565 was 37565, checked in by anupama, 13 months ago

Getting the image slider to work again in the Designing a New Interface: Part 2 tutorial step 6 required one more change.

File size: 14.0 KB
Line 
1
2Designing a new interface: Part 1
3
4
5Step 4:
6
7<servlet>
8<servlet-name>golden</servlet-name>
9<description>A new library with my new interface!</description>
10<servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
11<init-param>
12<param-name>library_name</param-name>
13<param-value>golden</param-value>
14</init-param>
15<init-param>
16<param-name>site_name</param-name>
17<param-value>localsite</param-value>
18</init-param>
19<init-param>
20<param-name>interface_name</param-name>
21<param-value>perrin</param-value>
22</init-param>
23<init-param>
24<param-name>receptionist_class</param-name>
25<param-value>DefaultReceptionist</param-value>
26</init-param>
27<init-param>
28<param-name>default_lang</param-name>
29<param-value>en</param-value>
30</init-param>
31</servlet>
32
33
34<servlet-mapping>
35<servlet-name>golden</servlet-name>
36<url-pattern>/golden/*</url-pattern>
37</servlet-mapping>
38
39
40***********************************
41
42Designing a new interface: Part 2
43
44
45Step 3:
46
47<div class="content">
48<div id="featured_slide">
49<ul id="featurednews">
50<xsl:call-template name="collSlider"/>
51</ul>
52</div>
53</div>
54
55
56Step 4:
57
58<xsl:template name="collSlider">
59<xsl:for-each select="./collectionList/collection">
60<xsl:variable name="collectionFolder" select="@name"/>
61<xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
62<xsl:variable name="homeImage">
63<xsl:choose>
64<xsl:when test="displayItem[@name='smallicon']">
65sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="$collectionFolder"/>/images/<xsl:value-of select="displayItem[@name='smallicon']"/>
66</xsl:when>
67<xsl:otherwise>
68interfaces/<xsl:value-of select="$interface_name"/>/images/default.jpg
69</xsl:otherwise>
70</xsl:choose>
71</xsl:variable>
72
73<li><img src="{$homeImage}" alt="" />
74<div class="panel-overlay">
75<a href="{$library_name}/collection/{$collectionFolder}/page/about">
76<h2><xsl:value-of select="$collectionName"/></h2>
77</a>
78</div>
79</li>
80</xsl:for-each>
81</xsl:template>
82
83
84Step 6:
85
86<xsl:template name="additionalHeaderContent">
87<script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.min.js"><xsl:text> </xsl:text></script>
88<script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"><xsl:text> </xsl:text></script>
89<script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"><xsl:text> </xsl:text></script>
90<script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"><xsl:text> </xsl:text></script>
91<script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"><xsl:text> </xsl:text></script>
92</xsl:template>
93
94
95Step 7:
96
97<div class="column">
98<ul class="latestnews">
99<li>
100<p><strong><a href="#">Highlighted Item 1</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.</p>
101</li>
102<li><img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" />
103<p><strong><a href="#">Highlighted Item 2</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection,with or without an accompanying image.</p>
104</li>
105<li class="last"><img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" />
106<p><strong><a href="#">Highlighted Item 3</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.</p>
107</li>
108</ul>
109</div>
110<br class="clear" />
111
112
113Step 8:
114
115<div id="hpage_cats">
116<xsl:call-template name="collectionsList"/>
117</div>
118
119
120<xsl:template name="collectionsList">
121<xsl:for-each select="./collectionList/collection">
122<xsl:choose>
123<xsl:when test="position() mod 2 = 1">
124<div class="fl_left">
125<xsl:call-template name="collDescription"/>
126</div>
127</xsl:when>
128<xsl:otherwise>
129<div class="fl_right">
130<xsl:call-template name="collDescription"/>
131</div>
132<br class="clear" />
133</xsl:otherwise>
134</xsl:choose>
135</xsl:for-each>
136</xsl:template>
137
138<xsl:template name="collDescription">
139<xsl:variable name="collectionFolder" select="@name"/>
140<xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
141<xsl:variable name="homeImage" select="displayItemList/displayItem[@name='icon']"/>
142<xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='smallicon']"/>
143<xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/>
144<xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/>
145
146<h2><a href="{$library_name}/collection/{$collectionFolder}/page/about"><xsl:value-of select="$collectionName"/></a></h2>
147<xsl:if test="$aboutImage">
148<img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$aboutImage}" alt="{$collectionName}" />
149</xsl:if>
150
151<xsl:choose>
152<xsl:when test="$collDesc">
153<p class="justify"><xsl:apply-templates select="displayItemList/displayItem[@name='description']"/></p>
154</xsl:when>
155<xsl:otherwise>
156<p class="justify">Welcome to the <xsl:value-of select="$collectionName"/> collection. This collection contains <xsl:value-of select="$numDocs"/> documents.</p>
157</xsl:otherwise>
158</xsl:choose>
159</xsl:template>
160
161
162Step 11 (header.xsl):
163
164<link rel="stylesheet" href="interfaces/{$interface_name}/styles/layout.css" type="text/css" />
165<link rel="stylesheet" href="interfaces/{$interface_name}/styles/gs3-core-min.css" type="text/css" />
166
167***********************************
168
169Designing a new interface: Part 3
170
171
172Step 2:
173
174<!-- ******DO NOT REMOVE THE LINK TO OS TEMPLATES: Template is free to use/modify, but this link MUST remain on all pages. Do not remove Copyright information. Replace "Your Webpage Here" (and it's link) with your own information.-->
175<div class="wrapper col8">
176<div id="copyright">
177<p class="fl_left">Copyright © 2013 - All Rights Reserved - <a href="#">Your Webpage Here</a></p>
178<p class="fl_right">Template by <a href="http://www.os-templates.com/" title="Free Website Templates">OS Templates</a></p>
179<br class="clear" />
180</div>
181</div>
182
183
184Step 4:
185
186<div class="wrapper">
187<div class="container" id="gs_content">
188<xsl:apply-templates select="/page"/>
189<br class="clear" />
190</div>
191</div>
192
193
194Step 6:
195
196<div class="wrapper col2">
197<div id="topbar">
198<div id="topnav">
199<ul>
200<li class="active"><a href="index.html">Home</a></li>
201<li><a href="style-demo.html">Browse</a>
202<ul>
203<li><a href="#">Link 1</a></li>
204<li><a href="#">Link 2</a></li>
205<li><a href="#">Link 3</a></li>
206</ul>
207</li>
208<li><a href="#">Search</a>
209<ul>
210<li><a href="#">Link 1</a></li>
211<li><a href="#">Link 2</a></li>
212<li><a href="#">Link 3</a></li>
213</ul>
214</li>
215</ul>
216</div>
217<!--**********************************************************************-->
218<div id="search">
219<form action="#" method="post">
220<fieldset>
221<legend>Site Search</legend>
222<input type="text" value="Search Our Website
" onfocus="this.value=(this.value=='Search Our Website
')? '' : this.value ;" />
223<input type="submit" name="go" id="go" value="Search" />
224</fieldset>
225</form>
226</div>
227<br class="clear" />
228<div id="advanced"><a href="#">advanced search</a></div>
229<!--**********************************************************************-->
230</div>
231</div>
232
233
234Step 8:
235
236<xsl:call-template name="navBar"/>
237
238
239" select="@name"/>
240<xsl:variable name="search_name" select="displayItem[@name='name']"/>
241<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
242</xsl:for-each>
243</ul>
244</li>
245</xsl:if>
246
247</xsl:when>
248<xsl:otherwise> </xsl:otherwise>
249</xsl:choose>
250</xsl:template>
251
252<xsl:template name="Browsing">
253<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
254<li>
255<xsl:choose>
256<!-- If this tab is selected then colour it differently -->
257<xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
258<xsl:attribute name='class'>active</xsl:attribute>
259</xsl:when>
260<xsl:otherwise> </xsl:otherwise>
261</xsl:choose>
262
263<a>
264<!-- Add a title element to the <a> tag if a description exists for this classifier -->
265<xsl:if test="displayItem[@name='description']">
266<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
267</xsl:if>
268
269<!-- Add the href element to the <a> tag -->
270<xsl:choose>
271<xsl:when test="@name">
272<xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/></xsl:attribute>
273</xsl:when>
274<xsl:otherwise>
275<xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1</xsl:attribute>
276</xsl:otherwise>
277</xsl:choose>
278
279<!-- Add the actual text of the <a> tag -->
280<xsl:value-of select="displayItem[@name='name']"/>
281</a>
282</li>
283</xsl:for-each>
284</xsl:template>
285
286
287Step 10:
288
289<xsl:choose>
290<xsl:when test="page/pageRequest/@subaction='home'">
291<xsl:call-template name="crossCollSearch"/>
292</xsl:when>
293<xsl:when test="page/pageRequest/paramList/param/@name='c' and /page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
294<xsl:call-template name="CollectionSearch"/>
295</xsl:when>
296<xsl:otherwise/>
297</xsl:choose>
298
299
300Step 11:
301
302<xsl:template name="crossCollSearch">
303<div id="search">
304<xsl:for-each select="/page/pageResponse/serviceList/service[@name='TextQuery']">
305<form name="QuickSearch" method="get" action="{$library_name}">
306<input type="hidden" name="a" value="q"/>
307<input type="hidden" name="rt" value="rd"/>
308<input type="hidden" name="s" value="{@name}"/>
309<input type="hidden" name="s1.collection" value="all"/>
310<input type="text" name="s1.query" id="search-text" value="Search all collections
" onfocus="this.value=(this.value=='Search all collections
')? '' : this.value ;" />
311<input type="submit" name="go" id="go" value="Search" />
312</form>
313</xsl:for-each>
314</div>
315<br class="clear" />
316</xsl:template>
317
318<xsl:template name="CollectionSearch">
319<div id="search">
320<xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
321<form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
322<!-- This parameter says that we have come from the quick search area -->
323<input type="hidden" name="qs" value="1"/>
324<input type="hidden" name="rt" value="rd"/>
325<input type="hidden" name="s1.level">
326<xsl:attribute name="value">
327<xsl:choose>
328<xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']">
329<xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/>
330</xsl:when>
331<xsl:otherwise>
332<xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
333</xsl:otherwise>
334</xsl:choose>
335</xsl:attribute>
336</input>
337<xsl:choose>
338<xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
339<input type="hidden" name="s1.startPage" value="1"/>
340</xsl:when>
341<xsl:otherwise>
342<input type="hidden" name="startPage" value="1"/>
343</xsl:otherwise>
344</xsl:choose>
345<xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
346<input type="hidden" name="s1.hitsPerPage" value="20"/>
347</xsl:if>
348<xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
349<input type="hidden" name="s1.maxDocs" value="100"/>
350</xsl:if>
351<!-- The query text box -->
352<span class="querybox">
353<xsl:variable name="qs">
354<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
355</xsl:variable>
356<nobr>
357<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
358<xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
359</xsl:apply-templates>
360</nobr>
361</span>
362<!-- The submit button (for TextQuery) -->
363<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
364<input type="submit" name="go" id="go" value="Search" > </input>
365<br/>
366</xsl:if>
367</form>
368</div>
369<br class="clear" />
370<div id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/TextQuery">advanced search</a></div>
371</xsl:template>
372
373
374Step 13:
375
376<div class="wrapper">
377<div id="header">
378<div class="fl_left">
379<h1><a href="{$library_name}"><xsl:call-template name="siteName"/></a></h1>
380<p>&#160;
381<xsl:if test="page/pageResponse/collection">
382<a href="{$library_name}/collection/{$collNameChecked}/page/about">
383<xsl:value-of select="page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
384</a>
385</xsl:if>
386</p>
387</div>
388<br class="clear"/></div>
389</div>
390
391
392Step 14:
393
394<body id="top">
395<div class="wrapper col0">
396<div id="topline">
397<ul>
398<xsl:call-template name="loginLinks"/>
399<li><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li>
400<li><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li>
401</ul>
402<br class="clear" />
403</div>
404</div>
405
406
407<xsl:template name="loginLinks">
408<xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
409<xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
410
411<xsl:choose>
412<xsl:when test="$username">
413<xsl:if test="contains($groups,'admin')">
414<li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li>
415<li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
416</xsl:if>
417<li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
418<li class="login"><a href="{$library_name}?logout=">Logout</a></li>
419</xsl:when>
420<xsl:otherwise>
421<li class="login">
422<a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
423<xsl:attribute name="title">
424<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
425</xsl:attribute>
426</a>
427</li>
428</xsl:otherwise>
429</xsl:choose>
430</xsl:template>
431
432
433***********************************
434
435
Note: See TracBrowser for help on using the repository browser.