Changeset 30542
- Timestamp:
- 2016-05-18T11:41:49+12:00 (7 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r30477 r30542 554 554 return new Locale(display_lang).getDisplayLanguage(new Locale(lang)); 555 555 } 556 557 public static boolean checkFileExistence(String site_name, String filePath){ 558 559 String gsdl3_home = GlobalProperties.getGSDL3Home(); 560 //Remove leading file separator 561 filePath = filePath.replaceAll("^/+", ""); 562 //Remove duplicates and replace by separator for current platform 563 filePath = filePath.replaceAll("/+", File.separator); 564 //Create full path to check 565 String fullPath = GSFile.siteHome(gsdl3_home, site_name) + File.separator + filePath; 566 File file = new File(fullPath); 567 if (file.exists() && file.isFile()) { 568 return true; 569 } 570 return false; 571 } 572 556 573 public static String uriEncode(String input) 557 574 { -
main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
r30540 r30542 204 204 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable> 205 205 <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>?a=p&sa=home&group=<xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/<xsl:value-of select="@name"/></xsl:variable> 206 206 207 <xsl:choose> 207 <xsl:when test=" backgroundImage">208 <xsl:when test="util:checkFileExistence($site_name, backgroundImage)"> 208 209 <a href="{$group_href}" title="{$desc}"> 209 210 <img class="groupLinkImage"> 210 211 <xsl:attribute name="alt"><xsl:value-of select="displayItem[@name='name']"/></xsl:attribute> 211 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/ images/<xsl:value-of select="backgroundImage"/></xsl:attribute>212 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/<xsl:value-of select="backgroundImage"/></xsl:attribute> 212 213 </img> 213 214 </a> … … 217 218 <div class="groupLink ui-corner-all"> 218 219 <div class="groupLinkText ui-widget-content ui-corner-top"> 219 <xsl:value-of select="title"/> 220 <xsl:choose> 221 <xsl:when test="boolean(title)"> 222 <xsl:value-of select="title"/> 223 </xsl:when> 224 <xsl:otherwise> 225 <xsl:value-of select="@name"/> 226 </xsl:otherwise> 227 </xsl:choose> 220 228 </div> 221 229 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div> -
main/trunk/greenstone3/web/sites/localsite/groupConfig.xml
r30540 r30542 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <!-- Collection groups configuration file 3 Uncomment hierarchy and groupDescription elements to make collection groups work. 4 Describe your structure inside hiearchy tag as shown in example below. 5 Describe your groups in groupDescriptions element as shown below. 6 Without group tag with @name in groupDescriptions group will be invisible(but available). 7 If your collection not described in hierarchy element it will be visible after described 8 groups and collections at home page. 9 First level - home page 10 Second level - inside first group 11 Third level - inside second group 12 13 --> 3 14 <groupConfig> 4 15 <!-- 5 16 <hierarchy> 6 <!--7 17 <group name="group2"> 8 18 <collection name="solr-jdbm-demo" /> 9 10 19 </group> 11 20 <group name="group1"> 12 13 21 <group name="group3"> 14 22 <collection name="solr-jdbm-demo" /> … … 16 24 <collection name="solr-jdbm-demo" /> 17 25 <group name="group1"> 18 19 26 </group> 20 27 </group> 21 28 </group> 22 29 </group> 23 <collection name="test-webeditor" /> 24 --> 30 <collection name="lucene-jdbm-demo" /> 25 31 </hierarchy> 26 32 <groupDescriptions> 27 <!--28 33 <group name="group1"> 29 <title>Group of collections</title>30 <description>some description</description>31 <shortDescription>Short description</shortDescription>32 33 34 </group> 34 35 <group name="group2"> 35 <title>Group 2 of collections</title>36 <description> second full description</description>37 <shortDescription> second short description</shortDescription>36 <title>Group 2 title</title> 37 <description>Second group full description example</description> 38 <shortDescription>Second group short description example</shortDescription> 38 39 39 40 </group> 40 41 <group name="group3"> 41 <title>Group 3 of collections</title>42 <description> 3 full description</description>43 <shortDescription> 3 short description</shortDescription>44 <backgroundImage> Group3.jpg</backgroundImage>42 <title>Group 3 title</title> 43 <description>Group 3 full description example </description> 44 <shortDescription>Group 3 short description example</shortDescription> 45 <backgroundImage>/images/Group3.jpg</backgroundImage> 45 46 </group> 46 -->47 47 </groupDescriptions> 48 --> 48 49 </groupConfig>
Note:
See TracChangeset
for help on using the changeset viewer.