Project

General

Profile

root / trunk / model / sources / math / latex / mathTexInline_web.uiwidget @ 1445

1
<?xml version="1.0" encoding="UTF-8"?>
2
<sm:freeUiWidget xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sm="http://www.utc.fr/ics/scenari/v3/modeling" code="mathTexInlineSwf">
3
	<sm:widgetBsFragment contentFormat="xhtml">       &lt;source type="xslOnSrc-dynamique"&gt;
4
                &lt;xsl:stylesheet exclude-result-prefixes="sc sp sfm java "
5
                    version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
                    xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
7
                    xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
8
                    xmlns:sfm="http://www.utc.fr/ics/scenari/v3/filemeta"
9
                    xmlns:java="http://xml.apache.org/xslt/java"&gt;
10
                    &lt;xsl:output omit-xml-declaration="yes" indent="no" method="xml" /&gt;
11
                    &lt;xsl:param name="vDialog" /&gt;
12
                    &lt;xsl:param name="vAgent" /&gt;
13
                    &lt;xsl:param name="vArguments" /&gt;
14

    
15
                    &lt;xsl:variable name="vMaxWidth"&gt;550&lt;/xsl:variable&gt;
16
                    &lt;xsl:variable name="vMaxHeight"&gt;550&lt;/xsl:variable&gt;
17
                    &lt;xsl:variable name="vFontSize"&gt;14&lt;/xsl:variable&gt;
18

    
19
                    &lt;xsl:variable name="vIdNodePrefixMeta" select="getIdNode(.)"/&gt;
20
		    &lt;xsl:variable name="vUri" select="resultatAgent('//', concat('res:src=src:', java:hGetUri(srcFileAgent()), '?transform=latex2mathml&amp;amp;omitXmlDeclaration=yes&amp;amp;content=', java:java.net.URLEncoder.encode(java:replaceAll(string($vArguments), '&amp;amp;', '%26'), 'UTF-8'), '&amp;amp;fileExt=.swf&amp;amp;transform=mathml2mathmlOO&amp;amp;transform=mml2swf'))"/&gt;
21
		     &lt;xsl:variable name="vResUri" select="resultatAgent('//', concat('resUri:src=src:', java:hGetUri(srcFileAgent()), '?transform=latex2mathml&amp;amp;omitXmlDeclaration=yes&amp;amp;content=', java:java.net.URLEncoder.encode(java:replaceAll(string($vArguments), '&amp;amp;', '%26'), 'UTF-8'), '&amp;amp;fileExt=.swf&amp;amp;transform=mathml2mathmlOO&amp;amp;transform=mml2swf'))"/&gt;
22
                     
23
               		        &lt;xsl:variable name="vResInfoObj" select="parseXml(resultatAgent('//', concat('get:src:', java:hGetUri(srcFileAgent()), '?transform=latex2mathml&amp;amp;omitXmlDeclaration=yes&amp;amp;content=', java:java.net.URLEncoder.encode(java:replaceAll(string($vArguments), '&amp;amp;', '%26'), 'UTF-8'), '&amp;amp;transform=mathml2mathmlOO&amp;amp;transform=mml2png&amp;amp;fontSize=', $vFontSize,'&amp;amp;transform=img2props')))"/&gt;&lt;!-- NOTE : on part du PNG car OO ne rensigne pas correctement les infos de taille dans le SWF --&gt;
24
				&lt;xsl:variable name="vResWebSize" select="java:com.scenari.s.co.transform.img.ImgUtil.getSize($vResInfoObj/props/p[@cd='width'], $vResInfoObj/props/p[@cd='height'], '', '', '', $vMaxWidth, $vMaxHeight)"/&gt;
25

    
26

    
27
                    &lt;xsl:template match="*"&gt;
28
                    	&lt;object
29
                            classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
30
                            class="embedObj"
31
                            codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"&gt;
32
                            &lt;xsl:attribute name="width"&gt;
33
                                &lt;xsl:value-of select="java:getWidth($vResWebSize)" /&gt;
34
                            &lt;/xsl:attribute&gt;
35
                            &lt;xsl:attribute name="height"&gt;
36
                                &lt;xsl:value-of select="java:getHeight($vResWebSize)" /&gt;
37
                            &lt;/xsl:attribute&gt;
38
                            &lt;param name="src" value="{$vUri}"/&gt;
39
                            &lt;param name="wmode" value="transparent" /&gt;
40
                            &lt;embed src="{$vUri}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflash/" wmode="transparent" class="embedObj"&gt;
41
                                &lt;xsl:attribute name="width"&gt;
42
                                    &lt;xsl:value-of select="java:getWidth($vResWebSize)" /&gt;
43
                                &lt;/xsl:attribute&gt;
44
                                &lt;xsl:attribute name="height"&gt;
45
                                    &lt;xsl:value-of select="java:getHeight($vResWebSize)" /&gt;
46
                                &lt;/xsl:attribute&gt;
47
                            &lt;/embed&gt;
48
                        &lt;/object&gt;
49
                    &lt;/xsl:template&gt;
50
                &lt;/xsl:stylesheet&gt;
51
            &lt;/source&gt;</sm:widgetBsFragment>
52
</sm:freeUiWidget>
(5-5/11)