Project

General

Profile

« Previous | Next » 

Revision 5694

add stylesheet for rendering simple stats for access log

View differences:

lib/style/skins/default/default.xml
11 11
	<doctype publicid="-//NCEAS//login//EN">
12 12
		<target publicid="-//W3C//HTML//EN">/style/common/login.xsl</target>
13 13
	</doctype>
14
	
15
	<doctype publicid="-//NCEAS//log//EN">
16
		<target publicid="-//W3C//HTML//EN">/style/common/log.xsl</target>
17
	</doctype>
14 18
  
15 19
	<!-- NBII/FGDC styles -->
16 20
  <doctype publicid="metadata">
lib/style/common/log.xsl
1
<?xml version="1.0"?>
2
	<!--
3
		* '$RCSfile$' * Authors: Jivka Bojilova * Copyright: 2000 Regents of
4
		the University of California and the * National Center for Ecological
5
		Analysis and Synthesis * For Details: http://www.nceas.ucsb.edu/ * *
6
		'$Author$' * '$Date: 2008-06-17 13:29:31 -0700 (Tue, 17
7
		Jun 2008) $' * '$Revision$' * * This program is free software;
8
		you can redistribute it and/or modify * it under the terms of the GNU
9
		General Public License as published by * the Free Software Foundation;
10
		either version 2 of the License, or * (at your option) any later
11
		version. * * This program is distributed in the hope that it will be
12
		useful, * but WITHOUT ANY WARRANTY; without even the implied warranty
13
		of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
		GNU General Public License for more details. * * You should have
15
		received a copy of the GNU General Public License * along with this
16
		program; if not, write to the Free Software * Foundation, Inc., 59
17
		Temple Place, Suite 330, Boston, MA 02111-1307 USA * * This is an XSLT
18
		(http://www.w3.org/TR/xslt) stylesheet designed to * convert an XML
19
		file with information about login action * into an HTML format
20
		suitable for rendering with modern web browsers.
21
	-->
22
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23
	version="1.0">
24
	<xsl:output method="html" />
25
	<xsl:param name="qformat">default</xsl:param>
26
	<xsl:param name="contextURL" />
27
	<xsl:param name="cgi-prefix" />
28
	
29
	<xsl:variable name="this" select="/"/>
30
	
31
	<xsl:template match="/">
32
		<html>
33
			<head>
34
				<link rel="stylesheet" type="text/css"
35
					href="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />
36
				<script language="Javascript" type="text/JavaScript"
37
					src="{$contextURL}/style/skins/{$qformat}/{$qformat}.js" />
38
				<script language="Javascript" type="text/JavaScript"
39
					src="{$contextURL}/style/common/branding.js" />
40
			</head>
41

  
42
			<body>
43
				<table class="subGroup subGroup_border">
44
					
45
					<xsl:for-each select="distinct-values(./log/logEntry/docid)" >
46
						<xsl:variable name="uniqueDocid" select="string(.)"/>
47
						<tr>
48
							<th>
49
								Doc Id:
50
							</th>
51
							<th>	 
52
								<xsl:value-of select="$uniqueDocid" />
53
							</th>
54
						</tr>
55
						<tr>
56
							<td>
57
								Read:
58
							</td>
59
							<td>	 
60
								<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='read'])" />
61
							</td>
62
						</tr>
63
						<tr>
64
							<td>									
65
								Insert: 
66
							</td>
67
							<td>	
68
								<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='insert'])" />
69
							</td>
70
						</tr>
71
						<tr>
72
							<td>
73
								Update: 
74
							</td>
75
							<td>	
76
								<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='update'])" />
77
							</td>
78
						</tr>
79
						<tr>
80
							<td>
81
								Delete: 
82
							</td>
83
							<td>	
84
								<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='delete'])" />
85
							</td>
86
						</tr>
87
						<tr>
88
							<td>
89
								Total: 
90
							</td>
91
							<td>	
92
								<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid])" />
93
							</td>
94
						</tr>
95
						
96
					</xsl:for-each>
97
				
98
				</table>
99
			</body>
100
			
101
		</html>
102
	</xsl:template>
103
</xsl:stylesheet>
0 104

  

Also available in: Unified diff