]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/metadataLib.xsl
Bug fixed: now links to metadata are created iff at least one pointer is there.
[helm.git] / helm / 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:param name="CICURI" select="''"/>
8 <xsl:param name="getterURL" select="''"/>
9 <xsl:param name="draw_graphURL" select="''"/>
10
11 <xsl:variable name="BaseRDFURL" select="concat($getterURL,'getxml?uri=helm:rdf:www.cs.unibo.it/helm/rdf/')"/>
12 <xsl:variable name="BaseRDFURLForward" select="concat($BaseRDFURL,'forward//')"/>
13 <xsl:variable name="BaseRDFURLBackward" select="concat($BaseRDFURL,'backward//')"/>
14
15 <xsl:template match="/">
16  <html>
17   <head>
18    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
19    <subst:script language="JavaScript" src="/javascript/utils.js"/>
20    <subst:script language="JavaScript" src="/javascript/control.js"/>
21    <title>Metadata of <xsl:value-of select="$CICURI"/></title>
22   </head>
23   <body onLoad="window.focus()" bgColor="white">
24    <h1>Metadata of <xsl:value-of select="$CICURI"/></h1>
25    <xsl:apply-templates select="*"/>
26   </body>
27  </html>
28 </xsl:template>
29
30 <xsl:template name="makelink">
31  <xsl:param name="name" select="''"/>
32  <xsl:param name="CICURI" select="''"/>
33  <xsl:param name="RDFURI" select="''"/>
34  <xsl:choose>
35   <xsl:when test="document(concat($BaseRDFURLBackward,$RDFURI))/*/*/*">
36    <p>
37     <script>
38      var RDFURI = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//<xsl:value-of select="$RDFURI"/>";
39      var getterURL = "<xsl:value-of select="$getterURL"/>";
40 <![CDATA[
41      var url = setParam(location.href,"keys","meta_theory%2CT1%2CT2%2CL%2CE");
42      url = setParam(url,"xmluri", getterURL + "getxml%3Furi%3D" + RDFURI);
43      document.write('<a target="theory" href="' + url + '">View the objects depending on it.</a>');
44 ]]>
45     </script>
46    </p>
47    <p>
48     <script>
49      var CICURI = "<xsl:value-of select="$CICURI"/>";
50      var RDFURI = "helm:rdf:www.cs.unibo.it/helm/rdf/backward//<xsl:value-of select="$RDFURI"/>";
51      var getterURL = "<xsl:value-of select="$getterURL"/>";
52      var draw_graphURL = "<xsl:value-of select="$draw_graphURL"/>";
53 <![CDATA[
54      var url = setParam(location.href,"keys","MMG");
55      url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + RDFURI);
56      url = setParam(url,"param.CICURI",escape(CICURI));
57      url = draw_graphURL + 'draw?url=' + escape(url);
58      var url2 = setParam(location.href,"keys","MGL,RT");
59      url2 = setParam(url2,"xmluri",escape(url));
60      document.write('<a target="graph" href="' + url2 + '">View the graph of all the objects depending on this one.</a>');
61 ]]>
62     </script>
63    </p>
64   </xsl:when>
65   <xsl:otherwise>
66    <p>
67     Object <xsl:value-of select="$name"/> is never referenced in other objects
68    </p>
69   </xsl:otherwise>
70  </xsl:choose>
71
72  <xsl:choose>
73   <xsl:when test="document(concat($BaseRDFURLForward,$RDFURI))/*/*/*">
74    <p>
75     <!-- CSC: Cut & Paster from above ==> create a single javascript function -->
76     <script>
77      var CICURI = "<xsl:value-of select="$CICURI"/>";
78      var RDFURI = "helm:rdf:www.cs.unibo.it/helm/rdf/forward//<xsl:value-of select="$RDFURI"/>";
79      var getterURL = "<xsl:value-of select="$getterURL"/>";
80      var draw_graphURL = "<xsl:value-of select="$draw_graphURL"/>";
81 <![CDATA[
82      var url = setParam(location.href,"keys","MDG");
83      url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + RDFURI);
84      url = setParam(url,"param.CICURI",escape(CICURI));
85      url = draw_graphURL + 'draw?url=' + escape(url);
86      var url2 = setParam(location.href,"keys","MGL,RT");
87      url2 = setParam(url2,"xmluri",escape(url));
88      document.write('<a target="graph" href="' + url2 + '">View the graph of all the dependencies of this object.</a>');
89 ]]>
90     </script>
91    </p>
92   </xsl:when>
93   <xsl:otherwise>
94    <p>
95     Object <xsl:value-of select="$name"/> does not reference any other object
96    </p>
97   </xsl:otherwise>
98  </xsl:choose>
99 </xsl:template>
100
101 </xsl:stylesheet>