Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-storedprocedure.xsl @ 7987

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
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: leinfelder $'
10
  *     '$Date: 2013-07-15 10:37:09 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7982 $'
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-file.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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
37
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
38
              indent="yes" />  
39
  <!-- This module is for datatable module-->
40

    
41
  <xsl:template name="storedProcedure">
42
      <xsl:param name="storedprocedurefirstColStyle"/>
43
      <xsl:param name="storedproceduresubHeaderStyle"/>
44
      <xsl:param name="docid"/>
45
      <xsl:param name="entityindex"/>
46
      <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
47
        <xsl:choose>
48
         <xsl:when test="references!=''">
49
          <xsl:variable name="ref_id" select="references"/>
50
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
51
          <xsl:for-each select="$references">
52
            <xsl:call-template name="storedProcedureCommon">
53
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
54
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
55
             <xsl:with-param name="docid" select="$docid"/>
56
             <xsl:with-param name="entityindex" select="$entityindex"/>
57
            </xsl:call-template>
58
          </xsl:for-each>
59
        </xsl:when>
60
        <xsl:otherwise>
61
           <xsl:call-template name="storedProcedureCommon">
62
             <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
63
             <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
64
             <xsl:with-param name="docid" select="$docid"/>
65
             <xsl:with-param name="entityindex" select="$entityindex"/>
66
            </xsl:call-template>
67
         </xsl:otherwise>
68
      </xsl:choose>
69
      </table>
70
  </xsl:template>
71

    
72
  <xsl:template name="storedProcedureCommon">
73
    <xsl:param name="storedprocedurefirstColStyle"/>
74
    <xsl:param name="storedproceduresubHeaderStyle"/>
75
    <xsl:param name="docid"/>
76
    <xsl:param name="entityindex"/>
77
    <xsl:for-each select="entityName">
78
       <xsl:call-template name="entityName">
79
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
80
       </xsl:call-template>
81
    </xsl:for-each>
82
    <xsl:for-each select="alternateIdentifier">
83
       <xsl:call-template name="entityalternateIdentifier">
84
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
85
       </xsl:call-template>
86
    </xsl:for-each>
87
    <xsl:for-each select="entityDescription">
88
       <xsl:call-template name="entityDescription">
89
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
90
       </xsl:call-template>
91
    </xsl:for-each>
92
    <xsl:for-each select="additionalInfo">
93
       <xsl:call-template name="entityadditionalInfo">
94
          <xsl:with-param name="entityfirstColStyle" select="$storedprocedurefirstColStyle"/>
95
       </xsl:call-template>
96
    </xsl:for-each>
97
    <!-- call physical moduel without show distribution(we want see it later)-->
98
    <xsl:if test="physical">
99
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
100
        Physical Structure Description:
101
      </td></tr>
102
    </xsl:if>
103
    <xsl:for-each select="physical">
104
       <tr><td colspan="2">
105
        <xsl:call-template name="physical">
106
         <xsl:with-param name="physicalfirstColStyle" select="$storedprocedurefirstColStyle"/>
107
         <xsl:with-param name="notshowdistribution">yes</xsl:with-param>
108
        </xsl:call-template>
109
        </td></tr>
110
    </xsl:for-each>
111
    
112
    <!-- Here to display distribution info-->
113
    <xsl:for-each select="physical">
114
       <xsl:call-template name="storedProcedureShowDistribution">
115
          <xsl:with-param name="docid" select="$docid"/>
116
          <xsl:with-param name="entityindex" select="$entityindex"/>
117
          <xsl:with-param name="physicalindex" select="position()"/>
118
          <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
119
          <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
120
       </xsl:call-template>
121
    </xsl:for-each>
122
    
123
    <xsl:if test="coverage">
124
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
125
        Coverage Description:
126
      </td></tr>
127
    </xsl:if>
128
    <xsl:for-each select="coverage">
129
      <tr><td colspan="2">
130
        <xsl:call-template name="coverage">
131
        </xsl:call-template>
132
      </td></tr>
133
    </xsl:for-each>
134
    <xsl:if test="method">
135
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
136
        Method Description:
137
      </td></tr>
138
    </xsl:if>
139
    <xsl:for-each select="method">
140
      <tr><td colspan="2">
141
        <xsl:call-template name="method">
142
          <xsl:with-param name="methodfirstColStyle" select="$storedprocedurefirstColStyle"/>
143
          <xsl:with-param name="methodsubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
144
        </xsl:call-template>
145
      </td></tr>
146
    </xsl:for-each>
147
    <xsl:if test="constraint">
148
       <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
149
        Constraint:
150
      </td></tr>
151
    </xsl:if>
152
    <xsl:for-each select="constraint">
153
      <tr><td colspan="2">
154
        <xsl:call-template name="constraint">
155
          <xsl:with-param name="constraintfirstColStyle" select="$storedprocedurefirstColStyle"/>
156
        </xsl:call-template>
157
      </td></tr>
158
    </xsl:for-each>
159
    <xsl:for-each select="parameter">
160
       <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
161
            Parameter:
162
            </td>
163
            <td width="{$secondColWidth}">
164
               <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
165
                  <xsl:for-each select="name">
166
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
167
                          Name:
168
                         </td>
169
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
170
                           <xsl:value-of select="."/>
171
                         </td>
172
                     </tr>
173
                  </xsl:for-each>
174
                  <xsl:for-each select="domainDescription">
175
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
176
                          Domain:
177
                         </td>
178
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
179
                           <xsl:value-of select="."/>
180
                         </td>
181
                     </tr>
182
                  </xsl:for-each>
183
                  <xsl:for-each select="required">
184
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
185
                          Required:
186
                         </td>
187
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
188
                           <xsl:value-of select="."/>
189
                         </td>
190
                     </tr>
191
                  </xsl:for-each>
192
                  <xsl:for-each select="repeats">
193
                    <tr><td width="{$firstColWidth}" class="{$storedprocedurefirstColStyle}">
194
                         Repeatable:
195
                         </td>
196
                         <td width="{$secondColWidth}" class="{$secondColStyle}">
197
                           <xsl:value-of select="."/>
198
                         </td>
199
                     </tr>
200
                  </xsl:for-each>
201
               </table>
202
            </td>
203
       </tr>
204
    </xsl:for-each>
205
    <xsl:if test="$withAttributes='1' or $displaymodule='printall'">
206
    <xsl:for-each select="attributeList">
207
      <xsl:call-template name="storedProcedureAttributeList">
208
        <xsl:with-param name="storedprocedurefirstColStyle" select="$storedprocedurefirstColStyle"/>
209
        <xsl:with-param name="storedproceduresubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
210
        <xsl:with-param name="docid" select="$docid"/>
211
        <xsl:with-param name="entityindex" select="$entityindex"/>
212
      </xsl:call-template>
213
    </xsl:for-each>
214
    </xsl:if>
215
     
216
  </xsl:template>
217

    
218
  <xsl:template name="storedProcedureShowDistribution">
219
     <xsl:param name="storedprocedurefirstColStyle"/>
220
     <xsl:param name="storedproceduresubHeaderStyle"/>
221
     <xsl:param name="docid"/>
222
     <xsl:param name="level">entitylevel</xsl:param>
223
     <xsl:param name="entitytype">storedProcedure</xsl:param>
224
     <xsl:param name="entityindex"/>
225
     <xsl:param name="physicalindex"/>
226
     <xsl:for-each select="distribution">
227
      <tr><td colspan="2">
228
        <xsl:call-template name="distribution">
229
          <xsl:with-param name="docid" select="$docid"/>
230
          <xsl:with-param name="level" select="$level"/>
231
          <xsl:with-param name="entitytype" select="$entitytype"/>
232
          <xsl:with-param name="entityindex" select="$entityindex"/>
233
          <xsl:with-param name="physicalindex" select="$physicalindex"/>
234
          <xsl:with-param name="distributionindex" select="position()"/>
235
          <xsl:with-param name="disfirstColStyle" select="$storedprocedurefirstColStyle"/>
236
          <xsl:with-param name="dissubHeaderStyle" select="$storedproceduresubHeaderStyle"/>
237
        </xsl:call-template>
238
      </td></tr>
239
    </xsl:for-each>
240
  </xsl:template>
241

    
242

    
243
  <xsl:template name="storedProcedureAttributeList">
244
    <xsl:param name="storedprocedurefirstColStyle"/>
245
    <xsl:param name="storedproceduresubHeaderStyle"/>
246
    <xsl:param name="docid"/>
247
    <xsl:param name="entitytype">storedProcedure</xsl:param>
248
    <xsl:param name="entityindex"/>
249
    <tr><td class="{$storedproceduresubHeaderStyle}" colspan="2">
250
        <xsl:text>Attribute(s) Info:</xsl:text>
251
    </td></tr>
252
    <tr><td colspan="2">
253
         <xsl:call-template name="attributelist">
254
           <xsl:with-param name="docid" select="$docid"/>
255
           <xsl:with-param name="entitytype" select="$entitytype"/>
256
           <xsl:with-param name="entityindex" select="$entityindex"/>
257
         </xsl:call-template>
258
       </td>
259
    </tr>
260
  </xsl:template>
261

    
262

    
263

    
264
</xsl:stylesheet>