VirtualBox

Changeset 59486 in vbox


Ignore:
Timestamp:
Jan 26, 2016 7:38:44 PM (9 years ago)
Author:
vboxsync
Message:

websrv-python.xsl: fixed safearray handling of attribute setters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/websrv-python.xsl

    r53932 r59486  
    1010        web service API. Depends on WSDL file for actual SOAP bindings.
    1111
    12     Copyright (C) 2008-2015 Oracle Corporation
     12    Copyright (C) 2008-2016 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    9595       req._this=self.handle
    9696       val=self.mgr.getPort().<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>(req)
    97        <xsl:text>return  </xsl:text>
     97       <xsl:text>return </xsl:text>
    9898       <xsl:call-template name="emitOutParam">
    9999           <xsl:with-param name="ifname" select="$ifname" />
     
    101101           <xsl:with-param name="type" select="$attrtype" />
    102102           <xsl:with-param name="value" select="concat('val.','_returnval')" />
    103            <xsl:with-param name="safearray" select="@safearray"/>
     103           <xsl:with-param name="safearray" select="$attrsafearray"/>
    104104         </xsl:call-template>
    105105</xsl:template>
     
    114114       req=<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>RequestMsg()
    115115       req._this=self.handle
    116        if type(value) in [int, bool, basestring, str]:
    117             req._<xsl:value-of select="$attrname"/> = value
     116       <xsl:choose>
     117         <xsl:when test="$attrsafearray='yes'">
     118          <xsl:text>req._</xsl:text><xsl:value-of select="$attrname"/><xsl:text> = value</xsl:text>
     119         </xsl:when>
     120         <xsl:otherwise>
     121           <xsl:text>if type(value) in [int, bool, basestring, str]:
     122            req._</xsl:text><xsl:value-of select="$attrname"/><xsl:text> = value
    118123       else:
    119             req._<xsl:value-of select="$attrname"/> = value.handle
     124            req._</xsl:text><xsl:value-of select="$attrname"/><xsl:text> = value.handle</xsl:text>
     125         </xsl:otherwise>
     126       </xsl:choose>
    120127       self.mgr.getPort().<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>(req)
    121128</xsl:template>
     
    241248      <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
    242249      <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable>
     250      <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
    243251      <!-- skip this attribute if it has parameters of a type that has wsmap="suppress" -->
    244252      <xsl:choose>
     
    260268            <xsl:with-param name="attrname" select="$attrname" />
    261269            <xsl:with-param name="attrtype" select="$attrtype" />
     270            <xsl:with-param name="attrsafearray" select="$attrsafearray" />
    262271          </xsl:call-template>
    263272          <!-- bb) emit a set method if the attribute is read/write -->
     
    267276              <xsl:with-param name="attrname" select="$attrname" />
    268277              <xsl:with-param name="attrtype" select="$attrtype" />
     278              <xsl:with-param name="attrsafearray" select="$attrsafearray" />
    269279            </xsl:call-template>
    270280          </xsl:if>
     
    468478
    469479<xsl:template match="/">
    470 <xsl:text># Copyright (C) 2008-2015 Oracle Corporation
     480<xsl:text># Copyright (C) 2008-2016 Oracle Corporation
    471481#
    472482# This file is part of a free software library; you can redistribute
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette