websrv-php.xsl revision b335f748d7a64e1ea9d54b28c3770141a634341f
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync<xsl:stylesheet version = '1.0'
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync XSLT stylesheet that generates vboxServiceWrappers.php from
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync VirtualBox.xidl. This PHP file represents our
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync web service API. Depends on WSDL file for actual SOAP bindings.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync Copyright (C) 2009 Sun Microsystems, Inc.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync Contributed by James Lucas (mjlucas at eng.uts.edu.au).
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync Clara, CA 95054 USA or visit http://www.sun.com if you need
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync additional information or have any questions.
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync method="text"
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsync version="1.0"
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsync encoding="utf-8"
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync indent="no"/>
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync<xsl:include href="websrv-shared.inc.xsl" />
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync<xsl:variable name="G_setSuppressedInterfaces"
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync select="//interface[@wsmap='suppress']" />
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync<xsl:template name="emitOutParam">
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync <xsl:param name="type" />
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync <xsl:param name="value" />
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync <xsl:param name="safearray" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:choose>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:when test="$type='wstring' or $type='uuid'">(string)<xsl:value-of select="$value" /></xsl:when>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:when test="$type='boolean'">(bool)<xsl:value-of select="$value" /></xsl:when>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:when test="$type='long' or $type='unsigned long' or $type='long long' or $type='short' or $type='unsigned short' or $type='unsigned long long' or $type='result'">(int)<xsl:value-of select="$value" /></xsl:when>
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:when test="$type='double' or $type='float'">(float)<xsl:value-of select="$value" /></xsl:when>
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:when test="$type='octet'"><xsl:value-of select="$value" /></xsl:when>
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:otherwise>
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:choose>
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:when test="$safearray='yes'">
c320aee99660824809e157bbad368db3542a9e90vboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" />Collection ($this->connection, <xsl:value-of select="$value"/><xsl:text>)</xsl:text>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync </xsl:when>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync <xsl:otherwise>
ea7d33962ceb90ea90e67e427d60b5788f34268avboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" /> ($this->connection, <xsl:value-of select="$value"/><xsl:text>)</xsl:text>
ea7d33962ceb90ea90e67e427d60b5788f34268avboxsync </xsl:otherwise>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync </xsl:choose>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync </xsl:otherwise>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync </xsl:choose>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync</xsl:template>
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync<xsl:template name="emitGetAttribute">
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync <xsl:param name="ifname" />
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync <xsl:param name="attrname" />
b6dc9545438e63d05fff621e85ddb7dc39cf14e7vboxsync <xsl:param name="attrtype" />
b6dc9545438e63d05fff621e85ddb7dc39cf14e7vboxsync <xsl:param name="attrsafearray" />
b6dc9545438e63d05fff621e85ddb7dc39cf14e7vboxsync <xsl:variable name="fname"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname"/></xsl:call-template> </xsl:variable>
b6dc9545438e63d05fff621e85ddb7dc39cf14e7vboxsync public function <xsl:value-of select="$fname"/>() {
20593760b116c90f3e439552763eef632a3bbb17vboxsync $request = new stdClass();
20593760b116c90f3e439552763eef632a3bbb17vboxsync $request->_this = $this->handle;
20593760b116c90f3e439552763eef632a3bbb17vboxsync $response = $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
20593760b116c90f3e439552763eef632a3bbb17vboxsync <xsl:text>return </xsl:text>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:call-template name="emitOutParam">
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:with-param name="type" select="$attrtype" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:with-param name="value" select="concat('$response->','returnval')" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:with-param name="safearray" select="@safearray"/>
6fea4abcc6ee0f2797ac01ef79c374d506aedc02vboxsync </xsl:call-template><xsl:text>;</xsl:text>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync</xsl:template>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync<xsl:template name="emitSetAttribute">
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:param name="ifname" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:param name="attrname" />
5a4155f3cdda48bce86222313348e5fb35561f84vboxsync <xsl:param name="attrtype" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:param name="attrsafearray" />
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:variable name="fname"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname"/></xsl:call-template></xsl:variable>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync public function <xsl:value-of select="$fname"/>($value) {
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync $request = stdClass();
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync $request->_this = $this->handle;
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync if (is_int($value) || is_string($value) || is_bool($value)) {
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync $request-><xsl:value-of select="$attrname"/> = $value;
20593760b116c90f3e439552763eef632a3bbb17vboxsync $request-><xsl:value-of select="$attrname"/> = $value->handle;
20593760b116c90f3e439552763eef632a3bbb17vboxsync $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync</xsl:template>
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync<xsl:template name="interface">
9cabb72c6d6feb65e839ce50765643b98bb9a301vboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:variable name="wsmap"><xsl:value-of select="@wsmap" /></xsl:variable>
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync <xsl:variable name="extends"><xsl:value-of select="@extends" /></xsl:variable>
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync* Generated VBoxWebService Interface Wrapper
d1ae44110ca869b6cb4a708dc6d676e10f4167bavboxsync <xsl:choose>
2cf084f1df635fcf1e1e40547a96c33f723471cbvboxsync <xsl:when test="($extends = '$unknown') or ($extends = '$dispatched') or ($extends = '$errorinfo')">
2cf084f1df635fcf1e1e40547a96c33f723471cbvboxsync <xsl:value-of select="concat('class ', $ifname, ' extends VBox_ManagedObject { ')" />
2cf084f1df635fcf1e1e40547a96c33f723471cbvboxsync </xsl:when>
2cf084f1df635fcf1e1e40547a96c33f723471cbvboxsync <xsl:when test="//interface[@name=$extends]">
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync <xsl:value-of select="concat('class ', $ifname, ' extends ', $extends, ' { ')" />
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync </xsl:when>
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync </xsl:choose>
65b0f0cd3c38007138720b7eaa43c963a9ee1244vboxsync <xsl:for-each select="method">
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync <xsl:if test="not((param[@type=($G_setSuppressedInterfaces/@name)])
<xsl:comment><xsl:value-of select="concat('skipping attribute ', $attrtype, ' for it is of a suppressed type')" /></xsl:comment>
<xsl:comment> readonly attribute <xsl:copy-of select="$ifname" />::<xsl:copy-of select="$attrname" /> </xsl:comment>
<xsl:comment> read/write attribute <xsl:copy-of select="$ifname" />::<xsl:copy-of select="$attrname" /> </xsl:comment>
<!-- bb) emit a set method if the attribute is read/write -->
$this-><xsl:value-of select="@name"/> = $handle-><xsl:value-of select="@name"/><xsl:text>;</xsl:text>
public function <xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="@name"/></xsl:call-template>() {
$request-><xsl:value-of select="@name" /> = $arg_<xsl:value-of select="@name" /><xsl:text>;</xsl:text>
$response = $this->connection->__soapCall('<xsl:value-of select="../@name"/>_<xsl:value-of select="@name"/>', array((array)$request));
<xsl:call-template name="genreq"><xsl:with-param name="wsmap" select="$wsmap" /></xsl:call-template>
public $NameMap = array(<xsl:for-each select="const"><xsl:if test="not(@wsmap='suppress')"><xsl:value-of select="@value"/> => '<xsl:value-of select="@name"/>'<xsl:if test="not(position()=last())">, </xsl:if></xsl:if></xsl:for-each>);
public $ValueMap = array(<xsl:for-each select="const"><xsl:if test="not(@wsmap='suppress')">'<xsl:value-of select="@name"/>' => <xsl:value-of select="@value"/><xsl:if test="not(position()=last())">, </xsl:if></xsl:if></xsl:for-each>);
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* This file is autogenerated from VirtualBox.xidl, DO NOT EDIT!