Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author: tao $'
10
  *     '$Date: 2000-11-20 05:14:04 -0800 (Mon, 20 Nov 2000) $'
11
  * '$Revision: 553 $'
12
  *
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
  * convert an XML file that is valid with respect to the eml-dataset.dtd
29
  * module of the Ecological Metadata Language (EML) into an HTML format
30
  * suitable for rendering with modern web browsers.
31
-->
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33

    
34

    
35
  <xsl:output method="html" encoding="iso-8859-1"/>
36

    
37
  
38

    
39
          <!--xsl:apply-templates select="acl/identifier"
40
mode="resource"/-->
41
          <xsl:apply-templates select="acl"/>
42
          <tr>
43
            <td class="{$subHeaderStyle}" colspan="2"><xsl:text>Rules:</xsl:text>
44
            </td>
45
          </tr>
46
          <xsl:if test="normalize-space(acl/@order)='allowFirst' and (//allow)">
47
            <tr>
48
              <td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
49
              <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td>
50
            </tr>
51
            <xsl:call-template name="allow_deny">
52
              <xsl:with-param name="permission" select="'allow'"/>
53
            </xsl:call-template>
54
          </xsl:if>
55
          <xsl:if test="(//deny)">
56
          <tr>
57
            <td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
58
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td>
59
          </tr>
60
          <xsl:call-template name="allow_deny">
61
            <xsl:with-param name="permission" select="'deny'"/>
62
          </xsl:call-template>
63
          </xsl:if>
64
          <tr>
65
            <td width="{$firstColWidth}" class="{$firstColStyle}">&#160;</td>
66
            <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;</td>
67
          </tr>
68
          <xsl:if test="normalize-space(acl/@order)='denyFirst' and (//allow)">
69
            <xsl:call-template name="allow_deny">
70
                <xsl:with-param name="permission" select="'allow'"/>
71
            </xsl:call-template>
72
          </xsl:if>
73
     </table>
74
            </div>
75
          <!-- BEGIN SBCLTER PAGE BOTTOM HTML -->
76
            </td>
77
          </tr>
78
          <tr>
79
            <td colspan="2">
80
              <!--div class="nsf" >This material is based on the upon work
81
              supported by the National Science Foundation under Cooperative
82
              Agreement #OCE-9982105. Any opinions, findings, or recommendations
83
              expressed in the material are those of author(s) and do not
84
              necessarily reflect the view of the National Science Foundation.
85
              </div-->
86
            </td>
87
          </tr>
88
          <tr>
89
            <td class="footer-menu" colspan="2">
90
              <div class="footer-menu">
91
                @footer-menu@
92
              </div>
93
            </td>
94
          </tr>
95
          <tr>
96
            <td class="footer-left">
97
              <div class="footer-left">
98
                @copyright@
99
              </div>
100
            </td>
101
            <td class="footer-right">
102
              <div class="footer-right">
103
               Contact: <a class="footer-link"
104
                        href="@mailto-address@">
105
                        @header-subtitle@data@nceas.ucsb.edu
106
                        </a> |
107
                <a class="footer-link"
108
                   href="@intranet-address@"
109
                   target="offline">Internal Login
110
                </a>
111
              </div>
112
            </td>
113
          </tr>
114
        </table>
115
      </div>
116
    </body>
117
    </html>
118
    <!-- END SBCLTER PAGE BOTTOM HTML -->
119
</xsl:template>
120

    
121
<xsl:template name="allow_deny">
122
   <xsl:param name="permission"/>
123
   <xsl:choose>
124
       <xsl:when test="$permission='allow'">
125
           <xsl:for-each select="//allow">
126
           <tr><td width="{$firstColWidth}" class="{$firstColStyle}" valign="top">
127
            ALLOW:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
128
                    <table width="100%">
129
                        <tr><td width="{$secondColIndent}" valign="top" class="{$firstColStyle}">
130
                        <xsl:for-each select="./permission">
131
                            <xsl:text>[</xsl:text><xsl:value-of select="."/><xsl:text>] </xsl:text>
132
                        </xsl:for-each></td>
133
                        <td class="{$firstColStyle}">
134
                        <xsl:for-each select="./principal">
135
                            <xsl:value-of select="."/><br/>
136
                        </xsl:for-each>
137
                        </td></tr>
138
                        <xsl:if test="(./ticketCount) and normalize-space(./ticketCount)!=''">
139
                            <tr><td width="{$secondColIndent}" valign="top">ticket<br />count:</td>
140
                                <td><xsl:value-of select="./ticketCount"/></td></tr>
141
                        </xsl:if>
142
                        <xsl:if test="(./duration)">
143
                            <xsl:apply-templates select="./duration"/>
144
                        </xsl:if>
145
                         <tr><td width="{$secondColIndent}">&#160;</td><td>&#160;</td></tr>
146
                    </table></td></tr>
147
          </xsl:for-each>
148
       </xsl:when>
149
       <xsl:otherwise>
150
           <xsl:for-each select="//deny">
151
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}" valign="top">
152
            DENY:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
153
           <table width="100%">
154
              <tr><td width="{$secondColIndent}" valign="top" class="{$firstColStyle}">
155
                <xsl:for-each select="./permission">
156
                    <xsl:text>[</xsl:text><xsl:value-of select="."/><xsl:text>] </xsl:text>
157
                </xsl:for-each></td>
158
                <td class="{$firstColStyle}">
159
                <xsl:for-each select="./principal">
160
                    <xsl:value-of select="."/><br/>
161
                </xsl:for-each>
162
                </td></tr>
163
                <xsl:if test="(./ticketCount) and normalize-space(./ticketCount)!=''">
164
                    <tr><td width="{$secondColIndent}" valign="top">ticket<br />count:</td>
165
                        <td><xsl:value-of select="./ticketCount"/></td></tr>
166
                </xsl:if>
167
                <xsl:if test="(./duration)">
168
                    <xsl:apply-templates select="./duration"/>
169
                </xsl:if>
170
                 <tr><td width="{$secondColIndent}">&#160;</td><td>&#160;</td></tr>
171
            </table></td></tr>
172
        </xsl:for-each>
173
       </xsl:otherwise>
174
   </xsl:choose>
175
</xsl:template>
176

    
177
<xsl:template match="acl">
178
     <tr>
179
       <td class="{$subHeaderStyle}" colspan="2">
180
         <xsl:text>Access Control:</xsl:text>
181
       </td>
182
     </tr>
183
     <tr>
184
      <td width="{$firstColWidth}" class="{$firstColStyle}">Auth System:
185
      </td>
186
      <td width="{$secondColWidth}" class="{$secondColStyle}">
187
          <xsl:value-of select="./@authSystem"/>
188
      </td>
189
     </tr>
190
     <tr>
191
      <td width="{$firstColWidth}" class="{$firstColStyle}">Order:
192
      </td>
193
      <td width="{$secondColWidth}" class="{$secondColStyle}">
194
          <xsl:value-of select="./@order"/>
195
      </td>
196
     </tr>
197
  </xsl:template>
198
</xsl:stylesheet>
(4-4/33)