]> matita.cs.unibo.it Git - helm.git/blob - on-line/xslt/metadataLib.xsl
made executable again
[helm.git] / on-line / xslt / metadataLib.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5  xmlns:subst="http://www.cs.unibo.it/helm/subst">
6
7 <xsl:import href="utils.xsl"/>
8 <xsl:import href="show_dc.xsl"/>
9
10 <xsl:param name="CICURI" select="''"/>
11 <xsl:param name="getterURL" select="''"/>
12 <xsl:param name="draw_graphURL" select="''"/>
13 <xsl:param name="rdflyURL" select="'http://mowgli.cs.unibo.it:58086/'"/>
14
15 <!--CSC: code cut & pasted from makeGraphLinks -->
16 <xsl:param name="uri_set_size" select="'30'"/>
17 <!--CSC: end of cut & paste from makeGraphLinks -->
18
19 <xsl:variable name="BaseRDFURLForward" select="concat($rdflyURL,'get?kind=forward&amp;object=')"/>
20 <xsl:variable name="BaseRDFURLBackward" select="concat($rdflyURL,'get?kind=backward&amp;object=')"/>
21 <xsl:variable name="BaseRDFURLDC" select="concat($rdflyURL,'get?kind=dc&amp;object=')"/>
22
23 <xsl:template match="/">
24  <html>
25   <head>
26    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
27    <subst:script language="JavaScript" src="/javascript/utils.js"/>
28    <subst:script language="JavaScript" src="/javascript/control.js"/>
29    <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
30
31    <title>Metadata of <xsl:value-of select="$CICURI"/></title>
32   </head>
33   <body onLoad="window.focus()" bgColor="white">
34    <script>
35      var CICURI = "<xsl:value-of select="$CICURI"/>";
36 <![CDATA[
37      document.write('<h1>Metadata of <a target="cic" href="' + mkCICURL(CICURI) + '">' + CICURI + '</a></h1>');
38 ]]>
39    </script>
40    <xsl:apply-templates select="*"/>
41    <!--CSC: code almost cut & pasted from makeGraphLinks -->
42    <form name="uri_set_size">
43     Number of nodes to show when following an hyperlink to a graph:
44     <input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
45    </form>
46    <!--CSC: end of cut & paste from makeGraphLinks -->
47   <xsl:call-template name="loop_show_dc">
48    <xsl:with-param name="CICURI" select="$CICURI"/>
49   </xsl:call-template>
50   </body>
51  </html>
52 </xsl:template>
53
54 <xsl:template name="makelink">
55  <xsl:param name="name" select="''"/>
56  <xsl:param name="CICURI" select="''"/>
57  <xsl:param name="RDFURI" select="''"/>
58  <xsl:variable name="quotedCICURI">
59   <xsl:call-template name="jsquote">
60    <xsl:with-param name="s" select="$CICURI"/>
61    <xsl:with-param name="times" select="2"/>
62   </xsl:call-template>
63  </xsl:variable>
64  <xsl:choose>
65   <xsl:when test="document(concat($BaseRDFURLBackward,$RDFURI))/*/*/*">
66    <p>
67     <script>
68      var CICURI = "<xsl:value-of select="$CICURI"/>";
69 <![CDATA[
70      document.write('<a target="theory" href="' + mkMetaTheoryURL(CICURI) + '">View the objects depending on it.</a>');
71 ]]>
72     </script>
73    </p>
74    <p>
75     <script>
76 <![CDATA[
77      document.write('<a href="" onClick="window.open(mkMetaURL(\']]><xsl:value-of select="$quotedCICURI"/><![CDATA[\'),\'graph\');return false;">View the graph of all the objects depending on this one.</a>');
78 ]]>
79     </script>
80    </p>
81   </xsl:when>
82   <xsl:otherwise>
83    <p>
84     Object <xsl:value-of select="$name"/> is never referenced in other objects
85    </p>
86   </xsl:otherwise>
87  </xsl:choose>
88
89  <xsl:choose>
90   <xsl:when test="document(concat($BaseRDFURLForward,$RDFURI))/*/*/*">
91    <p>
92     <!-- CSC: Cut & Paster from above ==> create a single javascript function -->
93     <script>
94 <![CDATA[
95      document.write('<a href="" onClick="window.open(mkDepURL(\']]><xsl:value-of select="$quotedCICURI"/><![CDATA[\'),\'graph\');return false;">View the graph of all the dependencies of this object.</a>');
96 ]]>
97     </script>
98    </p>
99   </xsl:when>
100   <xsl:otherwise>
101    <p>
102     Object <xsl:value-of select="$name"/> does not reference any other object
103    </p>
104   </xsl:otherwise>
105  </xsl:choose>
106 </xsl:template>
107
108 </xsl:stylesheet>