root/trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/list-json.xsl

Revision 2843 (checked in by bleibson, 3 years ago)

o add Jasig licensing info to header of source files
o in some cases, remove RPI copyright info.

  • Property svn:mime-type set to text/plain
Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     Licensed to Jasig under one or more contributor license
4     agreements. See the NOTICE file distributed with this work
5     for additional information regarding copyright ownership.
6     Jasig licenses this file to you under the Apache License,
7     Version 2.0 (the "License"); you may not use this file
8     except in compliance with the License. You may obtain a
9     copy of the License at:
10    
11     http://www.apache.org/licenses/LICENSE-2.0
12    
13     Unless required by applicable law or agreed to in writing,
14     software distributed under the License is distributed on
15     an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16     KIND, either express or implied. See the License for the
17     specific language governing permissions and limitations
18     under the License.
19 -->
20 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21   <xsl:output method="html" omit-xml-declaration="yes" indent="no" media-type="text/javascript" standalone="yes"/>
22   <!-- JSON feed of Bedework events,
23        Bedework v3.6, Arlen Johnson
24
25        Purpose: produces an array of javascript objects representing events.
26
27   -->
28  
29   <!-- Bring in settings and included xsl -->
30   <xsl:include href="globals.xsl"/>
31   <xsl:include href="../strings.xsl"/>
32
33   <xsl:include href="./xsl/jsonEvent.xsl"/>
34   <!-- Provides category filter templates -->
35   <xsl:include href="./xsl/categoryFiltering.xsl"/>
36
37   <xsl:template match='/'>
38     <xsl:choose>
39       <xsl:when test="/bedework/appvar/key = 'objName'">
40         var <xsl:value-of select="/bedework/appvar[key='objName']/value"/> = {"bwEventList": {
41       </xsl:when>
42       <xsl:otherwise>
43         {"bwEventList": {
44       </xsl:otherwise>
45     </xsl:choose>
46         "events": [
47            <xsl:apply-templates select="/bedework/events" />
48         ]
49     }}
50   </xsl:template>
51
52   <xsl:template match="events">
53         <xsl:choose>
54           <xsl:when test="/bedework/appvar/key = 'filter'">
55                 <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/>
56                 <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/>
57                 <!-- Define filters here: -->
58                 <xsl:choose>
59               <xsl:when test="$filterName = 'grpAndCats'">
60                         <xsl:call-template name="preprocessCats">
61                           <xsl:with-param name="allCats" select="$filterVal"/>
62                         </xsl:call-template>
63               </xsl:when>
64                   <xsl:otherwise>
65                         <!-- Filter name not defined? Turn off filtering. -->
66                         <xsl:apply-templates select="event"/>
67               </xsl:otherwise>
68             </xsl:choose>
69           </xsl:when>
70           <xsl:otherwise>
71                 <xsl:apply-templates select="event"/>
72           </xsl:otherwise>
73         </xsl:choose>
74   </xsl:template>
75 </xsl:stylesheet>
76
77
Note: See TracBrowser for help on using the browser.