Ignore:
Timestamp:
03/03/09 22:04:41 (3 years ago)
Author:
anp
Message:

ajout sm:widget dans binaryOdTransf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_binaryOdTransf/getContent.xsl.xsl

    r12772 r12951  
    7070        <xsl0:variable name="vIsInline" select="si(codeAgent('.')='contentFile.inline', 'true', 'false')"/> 
    7171         
    72         <xsl0:template match="/*"> 
     72        <xsl0:template match="/* | sm:odContentZone"> 
    7373                <xsl:output method="xml" indent="no" omit-xml-declaration="yes"/> 
    7474                <xsl:param name="vAgent"/> 
     
    7777                <xsl:variable name="idRootAgt" select="getIdNode(.)"/> 
    7878                 
    79                 <xsl:template match="/*"> 
    80                         <xsl0:apply-templates select="sm:content/*"/> 
    81                 </xsl:template> 
     79                 
     80                 
     81                <xsl0:choose> 
     82            <xsl0:when test="name()='sm:odContentZone'"><!-- on est dans une zone d'un sm:Widget --> 
     83                <xsl:template match="*" priority="1"> 
     84                   <xsl0:apply-templates select="*"/> 
     85                </xsl:template> 
     86            </xsl0:when> 
     87            <xsl0:otherwise> 
     88                <xsl:template match="/*"> 
     89                   <xsl0:apply-templates select="sm:content/*"/> 
     90                </xsl:template> 
     91            </xsl0:otherwise> 
     92        </xsl0:choose> 
     93                 
    8294                <xsl:template match="*"/> 
    8395        </xsl0:template> 
     
    119131                </text:span> 
    120132        </xsl0:template> 
     133         
     134        <!-- # Widget 
     135        --> 
     136    <xsl0:template match="sm:Widget"> 
     137        <xsl:value-of select="resultatAgent(concat('widget_{generate-id()}_', generate-id()))" disable-output-escaping="yes"/> 
     138    </xsl0:template> 
    121139                 
    122140<!--** 
     
    139157                 
    140158                <!-- détermination du width et du height --> 
    141                 <xsl:variable name="vInfosRes" select="resultatAgent('../{$vWidgetId}/genResSize')"/> 
     159                <xsl:variable name="vInfosRes" select="resultatAgent('//{$vWidgetId}/genResSize')"/> 
    142160                <xsl:variable name="vWidth" select="substring-before(substring-after($vInfosRes, 'w='), ';')"/> 
    143161                <xsl:variable name="vHeight" select="substring-before(substring-after($vInfosRes, 'h='), ';')"/> 
    144162                <xsl:variable name="vExistRes" select="java:getContentStatus(java:findNodeChild(srcFileAgent(), java:getSrcName(srcFileAgent())))='1'"/> 
    145163                 
    146                 <xsl:variable name="vResourceType" select="si(resultatAgent('../{$vWidgetId}/isVectorImg'), 'file', 'zip')"/> 
    147                 <xsl:variable name="vOdInsertTag" select="si(resultatAgent('../{$vWidgetId}/isVectorImg'), 'draw:image', 'draw:object')"/> 
     164                <xsl:variable name="vResourceType" select="si(resultatAgent('//{$vWidgetId}/isVectorImg'), 'file', 'zip')"/> 
     165                <xsl:variable name="vOdInsertTag" select="si(resultatAgent('//{$vWidgetId}/isVectorImg'), 'draw:image', 'draw:object')"/> 
    148166                                 
    149167                                 
     
    159177                                                <draw:frame draw:style-name="{$vStyle_bxObj}" draw:name="{{local-name()}}" text:anchor-type="{$vAnchorType}" draw:z-index="{$vZIndex}" svg:x="{$vX}" svg:y="{$vY}" svg:width="{{normalize-space($vWidth)}}cm" svg:height="{{normalize-space($vHeight)}}cm"> 
    160178                                                        <xsl:element name="{{$vOdInsertTag}}"> 
    161                                                                 <xsl:attribute name="xlink:href"><xsl:if test="resultatAgent('../{$vWidgetId}/isVectorImg')">./</xsl:if><xsl:value-of select="resultatAgent('../{$vWidgetId}/odResPath')"/></xsl:attribute> 
     179                                                                <xsl:attribute name="xlink:href"><xsl:if test="resultatAgent('//{$vWidgetId}/isVectorImg')">./</xsl:if><xsl:value-of select="resultatAgent('//{$vWidgetId}/odResPath')"/></xsl:attribute> 
    162180                                                                <xsl:attribute name="xlink:type">simple</xsl:attribute> 
    163181                                                                <xsl:attribute name="xlink:show">embed</xsl:attribute> 
    164182                                                                <xsl:attribute name="xlink:actuate">onLoad</xsl:attribute> 
    165183                                                        </xsl:element> 
    166                                                         <!-- <draw:object xlink:href="./{{resultatAgent('../{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> --> 
     184                                                        <!-- <draw:object xlink:href="./{{resultatAgent('//{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> --> 
    167185                                                </draw:frame> 
    168186                                        </xsl0:when> 
     
    173191                                                        <draw:frame draw:style-name="{$vStyle_bxObj}" draw:name="{{local-name()}}" text:anchor-type="{$vAnchorType}" draw:z-index="{$vZIndex}" svg:x="{$vX}" svg:y="{$vY}" svg:width="{{normalize-space($vWidth)}}cm" svg:height="{{normalize-space($vHeight)}}cm" style:rel-height="scale"> 
    174192                                                                <xsl:element name="{{$vOdInsertTag}}"> 
    175                                                                         <xsl:attribute name="xlink:href"><xsl:value-of select="resultatAgent('../{$vWidgetId}/odResPath')"/></xsl:attribute><!-- <xsl:if test="resultatAgent('../{$vWidgetId}/isVectorImg')">./</xsl:if> --> 
     193                                                                        <xsl:attribute name="xlink:href"><xsl:value-of select="resultatAgent('//{$vWidgetId}/odResPath')"/></xsl:attribute><!-- <xsl:if test="resultatAgent('//{$vWidgetId}/isVectorImg')">./</xsl:if> --> 
    176194                                                                        <xsl:attribute name="xlink:type">simple</xsl:attribute> 
    177195                                                                        <xsl:attribute name="xlink:show">embed</xsl:attribute> 
    178196                                                                        <xsl:attribute name="xlink:actuate">onLoad</xsl:attribute> 
    179197                                                                </xsl:element> 
    180                                                                 <!-- <draw:object xlink:href="./{{resultatAgent('../{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> --> 
     198                                                                <!-- <draw:object xlink:href="./{{resultatAgent('//{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> --> 
    181199                                                        </draw:frame> 
    182200                                                </text:p> 
     
    184202                                </xsl0:choose> 
    185203                                <!-- insertion de l'image dans l'OD final --> 
    186                                 <scOd:resources type="{{$vResourceType}}" path="dest:{{resultatAgent('../{$vWidgetId}/genResUri')}}" odPath="{{resultatAgent('../{$vWidgetId}/odResPath')}}" removeSettings="{{si(resultatAgent('../{$vWidgetId}/targetMime')='application/vnd.oasis.opendocument.graphics', 'true', 'false')}}"/><!-- on ne conserve pas le fichier settings.xml pour les ODG : génére des pbs d'affichage (zone active) --> 
    187                                 <!-- <scOd:manifest mime="{$vMime}" path="{{resultatAgent('../{$vWidgetId}/odResPath')}}"/> --> 
     204                                <scOd:resources type="{{$vResourceType}}" path="dest:{{resultatAgent('//{$vWidgetId}/genResUri')}}" odPath="{{resultatAgent('//{$vWidgetId}/odResPath')}}" removeSettings="{{si(resultatAgent('//{$vWidgetId}/targetMime')='application/vnd.oasis.opendocument.graphics', 'true', 'false')}}"/><!-- on ne conserve pas le fichier settings.xml pour les ODG : génére des pbs d'affichage (zone active) --> 
     205                                <!-- <scOd:manifest mime="{$vMime}" path="{{resultatAgent('//{$vWidgetId}/odResPath')}}"/> --> 
    188206                        </xsl:when> 
    189207                        <xsl:otherwise> 
    190                                 <scOd:error type="error" phase="generation" text="Ressource manquante">La ressource '<xsl:value-of select="resultatAgent('../{$vWidgetId}/UriResSource')"/>' est introuvable.</scOd:error> 
     208                                <scOd:error type="error" phase="generation" text="Ressource manquante">La ressource '<xsl:value-of select="resultatAgent('//{$vWidgetId}/UriResSource')"/>' est introuvable.</scOd:error> 
    191209                        </xsl:otherwise> 
    192210                </xsl:choose> 
     
    212230                                 
    213231                <!-- détermination du width et du height --> 
    214                 <xsl:variable name="vInfosRes" select="resultatAgent('../{$vWidgetId}/genResSize')"/> 
     232                <xsl:variable name="vInfosRes" select="resultatAgent('//{$vWidgetId}/genResSize')"/> 
    215233                <xsl:variable name="vWidth" select="substring-before(substring-after($vInfosRes, 'w='), ';')"/> 
    216234                <xsl:variable name="vHeight" select="substring-before(substring-after($vInfosRes, 'h='), ';')"/> 
     
    227245                                        <xsl0:when test="$vIsInline='true'"><!-- niveau inline--> 
    228246                                                <draw:frame draw:style-name="{$vStyle_bxImg}" draw:name="{{local-name()}}" text:anchor-type="{$vAnchorType}" draw:z-index="{$vZIndex}" svg:x="{$vX}" svg:y="{$vY}" svg:width="{{$vWidth}}cm" svg:height="{{$vHeight}}cm"> 
    229                                                         <draw:image xlink:href="{{resultatAgent('../{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> 
     247                                                        <draw:image xlink:href="{{resultatAgent('//{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> 
    230248                                                </draw:frame> 
    231249                                        </xsl0:when> 
     
    235253                                                <text:p text:style-name="{si($vStyle_para!='' and $vStyle_para!='Standard', $vStyle_para, 'odNoDisplayNoKeep')}"> 
    236254                                                        <draw:frame draw:style-name="{$vStyle_bxImg}" draw:name="TODO" text:anchor-type="{$vAnchorType}" draw:z-index="{$vZIndex}" svg:x="{$vX}" svg:y="{$vY}" svg:width="{{$vWidth}}cm" svg:height="{{$vHeight}}cm"> 
    237                                                                 <draw:image xlink:href="{{resultatAgent('../{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> 
     255                                                                <draw:image xlink:href="{{resultatAgent('//{$vWidgetId}/odResPath')}}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> 
    238256                                                        </draw:frame> 
    239257                                                </text:p> 
    240258                                        </xsl0:otherwise> 
    241259                                </xsl0:choose> 
    242                                 <scOd:resources path="dest:{{resultatAgent('../{$vWidgetId}/genResUri')}}" odPath="{{resultatAgent('../{$vWidgetId}/odResPath')}}"/> 
     260                                <scOd:resources path="dest:{{resultatAgent('//{$vWidgetId}/genResUri')}}" odPath="{{resultatAgent('//{$vWidgetId}/odResPath')}}"/> 
    243261                        </xsl:when> 
    244262                        <xsl:otherwise> 
    245                                 <scOd:error type="error" phase="generation" text="Image manquante">La ressource '<xsl:value-of select="resultatAgent('../{$vWidgetId}/UriResSource')"/>' est introuvable.</scOd:error> 
     263                                <scOd:error type="error" phase="generation" text="Image manquante">La ressource '<xsl:value-of select="resultatAgent('//{$vWidgetId}/UriResSource')"/>' est introuvable.</scOd:error> 
    246264                        </xsl:otherwise> 
    247265                </xsl:choose> 
Note: See TracChangeset for help on using the changeset viewer.