Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
	*  '$RCSfile$'
4
	*      Authors: Matt Jones, CHad Berkley
5
	*    Copyright: 2009 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: 2009-04-02 14:20:05 -0800 (Thu, 02 Apr 2009) $'
11
	* '$Revision: 4893 $'
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 showing the resultset of a query
29
	* into an HTML format suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32
	
33
	<xsl:import href="util.xsl"/>
34
	<xsl:output method="html" />
35
	<xsl:param name="sessid" />
36
	<xsl:param name="qformat">default</xsl:param>
37
	<xsl:param name="enableediting">false</xsl:param>
38
	<xsl:param name="contextURL"/>
39
	<xsl:variable name ="emptyString"/>
40

    
41
	<xsl:template match="/">  
42
	
43
		<div class="result-header-section">      
44
        	<div class="result-header">TPC Workflows</div>
45
		</div>
46
		<div class="row row-header" >
47
			<div class="col col1">TPC Name</div>
48
			<div class="col col2">Creator</div>
49
			<div class="col col3">Date Created</div>
50
			<div class="col col4">Action</div>
51
		</div>			
52
		<!-- This tests to see if there are returned documents,
53
			if there are not then don't show the query results -->
54
		<xsl:if test="count(resultset/document) &gt; 0">
55
			<xsl:for-each select="resultset/document">
56
				<xsl:sort select='./updatedate' order='descending' />
57
				<!--<xsl:sort select='./param[@name="/entity/@name"]' />
58
				<xsl:if test="./docname = 'entity'">-->
59
				<xsl:sort select='./param[@name="karEntry/karEntryXML/entity/@name"]' />
60
				<xsl:variable name="workflowRunClassName">
61
                    <xsl:value-of select='./param[@name="karEntry/karEntryXML/property[@name=&apos;WorkflowRun&apos;]/@class"]'/>
62
                </xsl:variable>
63
                <xsl:if test="$workflowRunClassName = $emptyString">
64
					<div>
65
						<xsl:attribute name="class">
66
							<xsl:choose>
67
								<xsl:when test="position() mod 2 = 1">row row-odd</xsl:when>
68
								<xsl:when test="position() mod 2 = 0">row row-even</xsl:when>
69
							</xsl:choose>
70
						</xsl:attribute>
71
						<xsl:variable name="karLSID">
72
							<xsl:value-of select='./param[@name="mainAttributes/lsid"]' />
73
						</xsl:variable>
74
						<xsl:variable name="karDocid">
75
							<xsl:call-template name="extractDocidFromLsid">
76
								<xsl:with-param name="lsidString" select="$karLSID" />
77
							</xsl:call-template>
78
						</xsl:variable>
79
						<xsl:variable name="workflowLSID">
80
							<xsl:value-of select='./param[@name="karEntry/karEntryXML/entity/property[@name=&apos;entityId&apos;]/@value"]'/>
81
						</xsl:variable>
82
						<xsl:variable name="karXmlDocid">
83
                            <xsl:value-of select='./docid'/>
84
                        </xsl:variable>
85
                        <xsl:variable name="karXmlLSID">
86
                            <xsl:call-template name="lsid">
87
                                <xsl:with-param name="docid" select="$karXmlDocid" />
88
                            </xsl:call-template>
89
                        </xsl:variable>
90

    
91
						<div class="col col1">	
92
							<!--<xsl:value-of select='./param[@name="/entity/@name"]' />-->
93
							<xsl:value-of select='./param[@name="karEntry/karEntryXML/entity/@name"]' />		
94
						</div>
95
						<div class="col col2">	
96
							<!--<xsl:value-of select='./param[@name="property[@name=&apos;KeplerDocumentation&apos;]/property[@name=&apos;author&apos;]/configure"]' />-->
97
							<xsl:value-of select='./param[@name="karEntry/karEntryXML/entity/property[@name=&apos;KeplerDocumentation&apos;]/property[@name=&apos;author&apos;]/configure"]' />		
98
						</div>
99
						<div class="col col3">	
100
							<xsl:value-of select='./updatedate' />			
101
						</div>
102
						<div class="col col4">	
103
							<a>
104
								<xsl:attribute name="class">underlined</xsl:attribute>
105
								<!--<xsl:attribute name="href">./searchWorkflowRun.jsp?workflowid=<xsl:value-of select='./param[@name="/entity/property[@name=&apos;entityId&apos;]/@value"]' /></xsl:attribute>-->
106
								<xsl:attribute name="href">./searchWorkflowRun.jsp?workflowlsid=<xsl:value-of select="$workflowLSID" /></xsl:attribute>
107
									 View Runs
108
							</a>
109
							<span> | </span>
110
							<a>
111
								<xsl:attribute name="class">underlined</xsl:attribute>
112
								<!--<xsl:attribute name="href">./scheduleWorkflowRun.jsp?workflowid=<xsl:value-of select='./param[@name="/entity/property[@name=&apos;entityId&apos;]/@value"]' />&amp;karid=<xsl:value-of select='./param[@name="/entity/property[@name=&apos;karLSID&apos;]/@value"]' />&amp;workflowname=<xsl:value-of select='./param[@name="/entity/@name"]' /></xsl:attribute>-->
113
								<xsl:attribute name="href">./scheduleWorkflowRun.jsp?workflowid=<xsl:value-of select="$karXmlLSID" />&amp;karid=<xsl:value-of select="normalize-space($karLSID)" />&amp;workflowname=<xsl:value-of select='./param[@name="karEntry/karEntryXML/entity/@name"]' /></xsl:attribute>	 
114
									 Schedule
115
							</a> 
116
							<span> | </span>
117
							<a>
118
								<xsl:attribute name="class">underlined</xsl:attribute>
119
								<xsl:attribute name="href">
120
									<!--<xsl:value-of select='$contextURL' />/metacat?action=read&amp;docid=<xsl:value-of select='./param[@name="/entity/property[@name=&apos;karLSID&apos;]/@value"]' />-->
121
									<xsl:value-of select='$contextURL' />/metacat?action=read&amp;docid=<xsl:value-of select="$karDocid" />
122
								</xsl:attribute>	 
123
									 Download
124
							</a> 
125
						</div>		
126
					</div>
127
				</xsl:if>
128
			</xsl:for-each>
129
		</xsl:if>
130
	</xsl:template>
131
	
132
	<!--************** creates a fake lsid for kar xml file document**************-->
133
   <xsl:template name="lsid">
134
       <xsl:param name="docid"/>
135
       <xsl:variable name="colonString">
136
           <xsl:value-of select="translate($docid, '.', ':')" />
137
        </xsl:variable>
138
       <xsl:variable name="lsidString" select="concat('urn:lsid:','gamma.msi.ucsb.edu/OpenAuth',':',string($colonString))"/>      
139
        <xsl:value-of select="$lsidString"/>
140
   </xsl:template>
141
</xsl:stylesheet>
(26-26/30)