xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:subst="http://www.cs.unibo.it/helm/subst">
+<xsl:import href="utils.xsl"/>
+<xsl:import href="show_dc.xsl"/>
+
<xsl:param name="CICURI" select="''"/>
<xsl:param name="getterURL" select="''"/>
-<xsl:param name="draw_graphURL" select="'http://phd.cs.unibo.it:8083/'"/>
+<xsl:param name="draw_graphURL" select="''"/>
+
+<!--CSC: code cut & pasted from makeGraphLinks -->
+<xsl:param name="uri_set_size" select="'30'"/>
+<!--CSC: end of cut & paste from makeGraphLinks -->
+
+<xsl:variable name="BaseRDFURL" select="concat($getterURL,'getxml?uri=helm:rdf:www.cs.unibo.it/helm/rdf/')"/>
+<xsl:variable name="BaseRDFURLForward" select="concat($BaseRDFURL,'forward//')"/>
+<xsl:variable name="BaseRDFURLBackward" select="concat($BaseRDFURL,'backward//')"/>
+<xsl:variable name="BaseRDFURLDC" select="concat($BaseRDFURL,'dc//')"/>
<xsl:template match="/">
<html>
<subst:script language="JavaScript" src="/javascript/defaults.js"/>
<subst:script language="JavaScript" src="/javascript/utils.js"/>
<subst:script language="JavaScript" src="/javascript/control.js"/>
+ <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
+
<title>Metadata of <xsl:value-of select="$CICURI"/></title>
</head>
<body onLoad="window.focus()" bgColor="white">
- <h1>Metadata of <xsl:value-of select="$CICURI"/></h1>
+ <script>
+ var CICURI = "<xsl:value-of select="$CICURI"/>";
+<![CDATA[
+ document.write('<h1>Metadata of <a target="cic" href="' + mkCICURL(CICURI) + '">' + CICURI + '</a></h1>');
+]]>
+ </script>
<xsl:apply-templates select="*"/>
+ <!--CSC: code almost cut & pasted from makeGraphLinks -->
+ <form name="uri_set_size">
+ Number of nodes to show when following an hyperlink to a graph:
+ <input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
+ </form>
+ <!--CSC: end of cut & paste from makeGraphLinks -->
+ <xsl:call-template name="loop_show_dc">
+ <xsl:with-param name="CICURI" select="$CICURI"/>
+ </xsl:call-template>
</body>
</html>
</xsl:template>
-<xsl:template match="/" mode="makelink">
- <xsl:param name="name" select="''"/>
- <xsl:param name="RDFURI" select="''"/>
- <xsl:apply-templates select="*" mode="makelink">
- <xsl:with-param name="name" select="$name"/>
- <xsl:with-param name="RDFURI" select="$RDFURI"/>
- </xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="unresolved" mode="makelink">
- <xsl:param name="name" select="''"/>
- <p>
- Object <xsl:value-of select="$name"/> is never referenced in other objects
- </p>
- <xsl:apply-templates select="." mode="mk_dep_graph"/>
-</xsl:template>
-
-<xsl:template match="url" mode="makelink">
+<xsl:template name="makelink">
<xsl:param name="name" select="''"/>
+ <xsl:param name="CICURI" select="''"/>
<xsl:param name="RDFURI" select="''"/>
- <p>
- <script>
- var RDFURI = "<xsl:value-of select="$RDFURI"/>";
- var getterURL = "<xsl:value-of select="$getterURL"/>";
+ <xsl:variable name="quotedCICURI">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="$CICURI"/>
+ <xsl:with-param name="times" select="2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="document(concat($BaseRDFURLBackward,$RDFURI))/*/*/*">
+ <p>
+ <script>
+ var CICURI = "<xsl:value-of select="$CICURI"/>";
<![CDATA[
- //url = setParam(url,"keys",getCICMathMLKeys());
- var url = setParam(location.href,"keys","meta_theory%2CT1%2CT2%2CL%2CE");
- url = setParam(url,"xmluri", getterURL + "getxml%3Furi%3D" + RDFURI);
- document.write('<a target="theory" href="' + url + '">View the objects depending on it.</a>');
+ document.write('<a target="theory" href="' + mkMetaTheoryURL(CICURI) + '">View the objects depending on it.</a>');
]]>
- </script>
- </p>
- <p>
- <script>
- var RDFURI = "<xsl:value-of select="$RDFURI"/>";
- var getterURL = "<xsl:value-of select="$getterURL"/>";
- var draw_graphURL = "<xsl:value-of select="$draw_graphURL"/>";
+ </script>
+ </p>
+ <p>
+ <script>
<![CDATA[
- var url = setParam(location.href,"keys","MMG");
- url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + RDFURI);
- url = draw_graphURL + 'draw?url=' + escape(url);
- document.write('<a target="graph" href="' + url + '">View the graph of all the objects depending on this one.</a>');
+ 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>');
]]>
- </script>
- </p>
- <xsl:apply-templates select="." mode="mk_dep_graph"/>
-</xsl:template>
+ </script>
+ </p>
+ </xsl:when>
+ <xsl:otherwise>
+ <p>
+ Object <xsl:value-of select="$name"/> is never referenced in other objects
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
-<xsl:template match="*" mode="mk_dep_graph">
- <p>
- <script>
- var CICURI = "<xsl:value-of select="$CICURI"/>";
- var getterURL = "<xsl:value-of select="$getterURL"/>";
- var draw_graphURL = "<xsl:value-of select="$draw_graphURL"/>";
+ <xsl:choose>
+ <xsl:when test="document(concat($BaseRDFURLForward,$RDFURI))/*/*/*">
+ <p>
+ <!-- CSC: Cut & Paster from above ==> create a single javascript function -->
+ <script>
<![CDATA[
- var url = setParam(location.href,"keys","MDG");
- url = setParam(url,"xmluri", getterURL + 'getxml%3Furi%3D' + CICURI);
- url = draw_graphURL + 'draw?url=' + escape(url);
- document.write('<a target="graph" href="' + url + '">View the graph of all the dependencies of this object.</a>');
+ 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>');
]]>
- </script>
- </p>
+ </script>
+ </p>
+ </xsl:when>
+ <xsl:otherwise>
+ <p>
+ Object <xsl:value-of select="$name"/> does not reference any other object
+ </p>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
</xsl:stylesheet>