Changeset 9844 for trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_binaryXhtmlTransf/widgets.xsl.xsl
- Timestamp:
- 10/18/07 14:56:29 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_binaryXhtmlTransf/widgets.xsl.xsl
r9762 r9844 47 47 xmlns:java="http://xml.apache.org/xslt/java" 48 48 xmlns:xalan="http://xml.apache.org/xalan" 49 exclude-result-prefixes="sm sc sp xsl java xalan"> 49 xmlns:xhtml="http://www.w3.org/1999/xhtml" 50 exclude-result-prefixes="sm sc sp xsl java xalan xhtml"> 50 51 51 52 <xsl0:import href="bsco:sm/web/sm_WLink.xml.xsl"/> … … 71 72 <xsl0:template name="sizeAtts"> 72 73 <xsl0:choose> 73 <xsl0:when test="boolean( */sm:fromPublishedImage)">74 <xsl: variable name="vInfosRes" select="parseXml(resultatAgent('//', concat('get:dest:', resultatAgent('//genResUri_{generate-id(sm:binaryUrl)}'), '?transform=img2props&unit=px')))"/>75 </xsl0:when>76 < xsl0:when test="boolean(*/sm:fromPublishedObject/@type='flash')">77 <xsl:variable name="vInfosRes" select="parseXml(resultatAgent('//', concat('get:dest:', resultatAgent('//genResUri_{generate-id(sm:binaryUrl)}'), '?transform=swf2props')))"/>78 </xsl0:when>79 </xsl0:choose>80 <xsl0:call-template name="sizeAttWidth"/>81 < xsl0:call-template name="sizeAttHeight"/>74 <xsl0:when test="boolean(sm:size)"> 75 <xsl:attribute name="width"><xsl:value-of select="java:getWidth($vResWebSize_{generate-id(.)})"/></xsl:attribute> 76 <xsl:attribute name="height"><xsl:value-of select="java:getHeight($vResWebSize_{generate-id(.)})"/></xsl:attribute> 77 </xsl0:when> 78 <xsl0:otherwise> 79 <xsl0:call-template name="sizeAttWidth"/> 80 <xsl0:call-template name="sizeAttHeight"/> 81 </xsl0:otherwise> 82 </xsl0:choose> 82 83 </xsl0:template> 83 84 <xsl0:template name="sizeAttWidth"> … … 94 95 <xsl0:choose> 95 96 <xsl0:when test="boolean(sm:width/sm:fixedValue)"><xsl0:value-of select="sm:width/sm:fixedValue/@value"/></xsl0:when> 96 <xsl0:when test="boolean(sm:width/sm:fromPublishedImage)"><xsl:value-of select="$vInfosRes/props/p[@cd='width']"/></xsl0:when>97 <xsl0:when test="boolean(sm:width/sm:fromPublishedObject/@type='flash')"><xsl:value-of select="($vInfosRes/swfHeader/@x2 - $vInfosRes/swfHeader/@x1) div 20"/></xsl0:when>98 97 </xsl0:choose> 99 98 </xsl0:template> … … 101 100 <xsl0:choose> 102 101 <xsl0:when test="boolean(sm:height/sm:fixedValue)"><xsl0:value-of select="sm:height/sm:fixedValue/@value"/></xsl0:when> 103 <xsl0:when test="boolean(sm:height/sm:fromPublishedImage)"><xsl:value-of select="$vInfosRes/props/p[@cd='height']"/></xsl0:when>104 <xsl0:when test="boolean(sm:height/sm:fromPublishedObject/@type='flash')"><xsl:value-of select="($vInfosRes/swfHeader/@y2 - $vInfosRes/swfHeader/@y1) div 20"/></xsl0:when>105 102 </xsl0:choose> 106 103 </xsl0:template> … … 131 128 </xsl0:template> 132 129 --> 130 131 <!-- chooseOnBinary --> 132 <xsl0:template match="sm:chooseOnBinary" mode="content"> 133 <xsl:variable name="vResType_{generate-id(sm:binary)}" select="'{si(sm:binary/@outputType, sm:binary/@outputType, 'unknown')}'"/> 134 <xsl:variable name="vResInfo_{generate-id(sm:binary)}" select="si($vResType_{generate-id(sm:binary)} = 'image' or $vResType_{generate-id(sm:binary)} = 'flash', parseXml(resultatAgent('//', concat(resultatAgent('//getResUri_{generate-id(sm:binary)}'), resultatAgent('//resUriHasTransf_{generate-id(sm:binary)}'), si($vResType_{generate-id(sm:binary)} = 'image', 'transform=img2props&unit=px', 'transform=swf2props')))))"/> 135 <xsl0:if test="sm:when[@widthOver]"> 136 <xsl:variable name="vResInfoWidth_{generate-id(sm:binary)}" select="si($vResType_{generate-id(sm:binary)} = 'image', $vResInfo_{generate-id(sm:binary)}/props/p[@cd='width'], si($vResType_{generate-id(sm:binary)} = 'flash', ($vResInfo_{generate-id(sm:binary)}/swfHeader/@x2 - $vResInfo_{generate-id(sm:binary)}/swfHeader/@x1) div 20, '0'))"/> 137 </xsl0:if> 138 <xsl0:if test="sm:when[@heightOver]"> 139 <xsl:variable name="vResInfoHeight_{generate-id(sm:binary)}" select="si($vResType_{generate-id(sm:binary)} = 'image', $vResInfo_{generate-id(sm:binary)}/props/p[@cd='height'], si($vResType_{generate-id(sm:binary)} = 'flash', ($vResInfo_{generate-id(sm:binary)}/swfHeader/@y2 - $vResInfo_{generate-id(sm:binary)}/swfHeader/@y1) div 20, '0'))"/> 140 </xsl0:if> 141 <xsl:choose> 142 <xsl0:apply-templates mode="content"/> 143 </xsl:choose> 144 </xsl0:template> 145 <xsl0:template match="sm:when" mode="content"> 146 <xsl:when test="{concat(si(@widthOver, concat('$vResInfoWidth_', generate-id(../sm:binary), '>', @widthOver, ' or ')), si(@heightOver, concat('$vResInfoHeight_', generate-id(../sm:binary), '>', @heightOver, ' or ')), 'false()')}"> 147 <xsl0:apply-templates mode="content"/> 148 </xsl:when> 149 </xsl0:template> 150 <xsl0:template match="sm:otherwise" mode="content"> 151 <xsl:otherwise> 152 <xsl0:apply-templates mode="content"/> 153 </xsl:otherwise> 154 </xsl0:template> 133 155 134 156 <!-- WObject --> … … 141 163 <xsl0:apply-templates select="sm:param[count(@type)=0 or @type!='url']" mode="content"/> 142 164 <embed pluginspage="{sm:pluginspage/@value}" src="{{resultatAgent('//url_{generate-id(sm:binaryUrl)}')}}{$vUrlParams}"> 165 <xsl0:call-template name="classAtt"/> 166 <xsl0:apply-templates select="sm:param[count(@type)=0 or @type!='url']" mode="contentEmbedAtts"/> 167 <xsl0:call-template name="sizeAtts"/> 168 </embed> 169 </object> 170 </xsl0:template> 171 172 <!-- WFlash --> 173 <xsl0:template match="sm:WFlash" mode="content"> 174 <xsl0:variable name="vUrlParams"><xsl0:apply-templates select="sm:param[@type='url']" mode="urlInlineParams"/></xsl0:variable> 175 <object codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> 176 <xsl0:call-template name="classAtt"/> 177 <xsl0:call-template name="sizeAtts"/> 178 <param name="src" value="{{resultatAgent('//url_{generate-id(sm:binaryUrl)}')}}{$vUrlParams}"/> 179 <xsl0:apply-templates select="sm:param[count(@type)=0 or @type!='url']" mode="content"/> 180 <embed pluginspage="http://www.macromedia.com/go/getflash/" type="application/x-shockwave-flash" src="{{resultatAgent('//url_{generate-id(sm:binaryUrl)}')}}{$vUrlParams}"> 143 181 <xsl0:call-template name="classAtt"/> 144 182 <xsl0:apply-templates select="sm:param[count(@type)=0 or @type!='url']" mode="contentEmbedAtts"/> … … 516 554 </xsl0:template> 517 555 518 <!-- Common W Object,WVideo,WAudio templates -->556 <!-- Common WFlash,WObject,WVideo,WAudio templates --> 519 557 <xsl0:template match="sm:param" mode="content"> 520 558 <param name="{@name}"> … … 572 610 <xsl0:template match="sm:WLink" mode="content"> 573 611 <xsl0:variable name="vOptions"> 574 <xsl0:call-template name="linkOptions"/><!-- Dans bsco:sm/web/sm_WLink.xml.xsl --> 612 <xsl0:call-template name="linkOptionsXsl"><!-- Dans bsco:sm/web/sm_WLink.xml.xsl --> 613 <xsl0:with-param name="pWidthDefault"> 614 <xsl0:choose> 615 <xsl0:when test="sm:link/sm:WImage[sm:size]"> 616 <xsl:value-of select="round(java:getWidth($vResWebSize_{generate-id(sm:link/sm:WImage)}))"/> 617 </xsl0:when> 618 <xsl0:when test="sm:link/sm:WFlash[sm:size]"> 619 <xsl:value-of select="round(java:getWidth($vResWebSize_{generate-id(sm:link/sm:WFlash)}))"/> 620 </xsl0:when> 621 </xsl0:choose> 622 </xsl0:with-param> 623 <xsl0:with-param name="pHeightDefault"> 624 <xsl0:choose> 625 <xsl0:when test="sm:link/sm:WImage[sm:size]"> 626 <xsl:value-of select="round(java:getHeight($vResWebSize_{generate-id(sm:link/sm:WImage)}))"/> 627 </xsl0:when> 628 <xsl0:when test="sm:link/sm:WFlash[sm:size]"> 629 <xsl:value-of select="round(java:getHeight($vResWebSize_{generate-id(sm:link/sm:WFlash)}))"/> 630 </xsl0:when> 631 </xsl0:choose> 632 </xsl0:with-param> 633 </xsl0:call-template> 575 634 </xsl0:variable> 576 635 <a> … … 578 637 <xsl0:call-template name="linkHrefXsl"><!-- Dans bsco:sm/web/sm_WLink.xml.xsl --> 579 638 <xsl0:with-param name="pUrl"><xsl0:apply-templates select="sm:link/*" mode="pathNavXsl"/></xsl0:with-param> 580 <xsl0:with-param name="pOptions" ><xsl0:value-of select="$vOptions"/></xsl0:with-param>639 <xsl0:with-param name="pOptions" select="$vOptions"/> 581 640 <xsl0:with-param name="pExtraOptions"><xsl0:if test="sm:link/@target='subWindow'">SUBWINTI:'<xsl:value-of select="chaineProtegeJs(si(resultatAgent('//fullTitleText')!='', resultatAgent('//fullTitleText'), java:hGetName(srcFileAgent()) ))"/>',</xsl0:if></xsl0:with-param> 582 641 </xsl0:call-template> … … 675 734 </xsl0:template> 676 735 736 <!-- sm:WFreeBlock --> 737 <xsl0:template match="sm:WFreeBlock" mode="content"> 738 <xsl0:apply-templates mode="content"/> 739 </xsl0:template> 740 <xsl0:template match="sm:WFreeBlock/sm:title" mode="content"> 741 <xsl0:apply-templates select="." mode="contentTitleIn"/> 742 </xsl0:template> 743 <xsl0:template match="xhtml:*/sm:title" mode="content"> 744 <xsl0:apply-templates select="." mode="contentTitleIn"/> 745 </xsl0:template> 746 <xsl0:template match="xhtml:*" mode="content"> 747 <xsl0:element name="{local-name()}"> 748 <xsl0:apply-templates select="@*" mode="freeAtts"/> 749 <xsl0:apply-templates select="node()" mode="content"/> 750 </xsl0:element > 751 </xsl0:template> 752 <xsl0:template match="xhtml:img" mode="content"> 753 <img src="[![agent=//;arguments=pubres:{resultatAgent('//', concat('res:src=wsp:', @sc:refUri, ';mutabledst=', resultatAgent('//agentGenerator', 'destPathLibInSiteFolder'), '/', extractFileNameFromPath(@sc:refUri) ))}]!]" alt="{@alt}"> 754 <xsl0:apply-templates select="@*" mode="freeAtts"/> 755 </img> 756 </xsl0:template> 757 <xsl0:template match="sm:WFreeBlock//text()" mode="content"> 758 <xsl0:if test="string-length(normalize-space(.)) > 0"><xsl0:value-of select="."/></xsl0:if> 759 </xsl0:template> 760 <xsl0:template match="@*" mode="freeAtts"> 761 <xsl0:copy/> 762 </xsl0:template> 763 <xsl0:template match="@sc:*" mode="freeAtts"/> 764 677 765 <!-- sm:Widget --> 678 766 <xsl0:template match="sm:Widget" mode="content"><xsl:value-of select="resultatAgent(concat('widget_{generate-id(.)}_',generate-id()))" disable-output-escaping="yes"/></xsl0:template>
Note: See TracChangeset
for help on using the changeset viewer.