websrv-php.xsl revision 681bb0bf6e9ab5a590d8afcdf37634e2fc29f595
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:stylesheet version = '1.0'
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync xmlns:vbox="http://www.virtualbox.org/">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<!--
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync websrv-php.xsl:
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync XSLT stylesheet that generates vboxServiceWrappers.php from
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync VirtualBox.xidl. This PHP file represents our
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync web service API. Depends on WSDL file for actual SOAP bindings.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync Contributed by James Lucas (mjlucas at eng.uts.edu.au).
ff48d61b8f3cc4acbe0615d5fcb3dbb28f154347vboxsync
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync Copyright (C) 2008-2014 Oracle Corporation
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync This file is part of VirtualBox Open Source Edition (OSE), as
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync available from http://www.virtualbox.org. This file is free software;
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync you can redistribute it and/or modify it under the terms of the GNU
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync General Public License (GPL) as published by the Free Software
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync Foundation, in version 2 as it comes in the "COPYING" file of the
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a74782eac5771b0de57834e8c8c0247c55e8dd57vboxsync hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync-->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:output
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync method="text"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync version="1.0"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync encoding="utf-8"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync indent="no"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
9019681d4e9b8399b951793a9dd92b63c195e0eevboxsync<xsl:include href="../idl/typemap-shared.inc.xsl" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:variable name="G_setSuppressedInterfaces"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync select="//interface[@wsmap='suppress']" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="emitOutParam">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="type" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="value" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="safearray" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:choose>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:when test="$type='wstring' or $type='uuid'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitPrimitive">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type">string</xsl:with-param>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:when test="$type='boolean'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitPrimitive">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type">bool</xsl:with-param>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync <xsl:when test="$type='short' or $type='unsigned short' or $type='long' or $type='octet'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitPrimitive">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type">int</xsl:with-param>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync <xsl:when test="$type='double' or $type='float' or $type='unsigned long' or $type='long long' or $type='unsigned long long'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitPrimitive">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type">float</xsl:with-param>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:when test="$type='$unknown'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitObject">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type">VBox_ManagedObject</xsl:with-param>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:otherwise>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitObject">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type" select="$type" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="$value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="$safearray"/>
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync </xsl:call-template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:otherwise>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:choose>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync</xsl:template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync<xsl:template name="emitObject">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="type" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="safearray" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:choose>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:when test="$safearray='yes'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" />Collection ($this->connection, (array)<xsl:value-of select="$value"/><xsl:text>)</xsl:text>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:otherwise>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" /> ($this->connection, <xsl:value-of select="$value"/><xsl:text>)</xsl:text>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:otherwise>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:choose>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync</xsl:template>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync<xsl:template name="emitPrimitive">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="type" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="value" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:param name="safearray" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:choose>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:when test="$safearray='yes'">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:text>(array)</xsl:text><xsl:value-of select="$value"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:when>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:otherwise>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:text>(</xsl:text><xsl:value-of select="$type" /><xsl:text>)</xsl:text><xsl:value-of select="$value"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="emitGetAttribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="ifname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrtype" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrsafearray" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="fname"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname"/></xsl:call-template> </xsl:variable>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function <xsl:value-of select="$fname"/>()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request = new stdClass();
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request->_this = $this->handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $response = $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:text>return </xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:call-template name="emitOutParam">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:with-param name="type" select="$attrtype" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:with-param name="value" select="concat('$response->','returnval')" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:with-param name="safearray" select="@safearray"/>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync </xsl:call-template><xsl:text>;</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="emitSetAttribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="ifname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrtype" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="attrsafearray" />
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:variable name="fname"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname"/></xsl:call-template></xsl:variable>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function <xsl:value-of select="$fname"/>($value)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request = new stdClass();
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request->_this = $this->handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:choose>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:when test="$attrsafearray='yes'"> if (is_array($value) || is_null($value) || is_scalar($value))</xsl:when>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:otherwise> if (is_null($value) || is_scalar($value))</xsl:otherwise>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:choose>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request-><xsl:value-of select="$attrname"/> = $value;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync else
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request-><xsl:value-of select="$attrname"/> = $value->handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="interface">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="wsmap"><xsl:value-of select="@wsmap" /></xsl:variable>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:variable name="extends"><xsl:value-of select="@extends" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService Interface Wrapper
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync</xsl:text>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:choose>
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync <xsl:when test="($extends = '$unknown') or ($extends = '$errorinfo')">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:value-of select="concat('class ', $ifname, ' extends VBox_ManagedObject&#10;{&#10;')" />
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync </xsl:when>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:when test="//interface[@name=$extends]">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:value-of select="concat('class ', $ifname, ' extends ', $extends, '&#10;{&#10;')" />
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync </xsl:when>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync </xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="method">
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync <xsl:if test="not((param[@type=($G_setSuppressedInterfaces/@name)])
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync or (param[@mod='ptr']))" >
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync <xsl:call-template name="method">
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync <xsl:with-param name="wsmap" select="$wsmap" />
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync </xsl:call-template>
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="attribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <!-- skip this attribute if it has parameters of a type that has wsmap="suppress" -->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:when test="( $attrtype=($G_setSuppressedInterfaces/@name) )">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:comment><xsl:value-of select="concat('skipping attribute ', $attrtype, ' for it is of a suppressed type')" /></xsl:comment>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:when test="@readonly='yes'">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:comment> readonly attribute <xsl:copy-of select="$ifname" />::<xsl:copy-of select="$attrname" /> </xsl:comment>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:comment> read/write attribute <xsl:copy-of select="$ifname" />::<xsl:copy-of select="$attrname" /> </xsl:comment>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <!-- aa) get method: emit request and result -->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="emitGetAttribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="ifname" select="$ifname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="attrname" select="$attrname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="attrtype" select="$attrtype" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:with-param name="attrsafearray" select="$attrsafearray" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <!-- bb) emit a set method if the attribute is read/write -->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="not($attrreadonly='yes')">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="emitSetAttribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="ifname" select="$ifname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="attrname" select="$attrname" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="attrtype" select="$attrtype" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:with-param name="attrsafearray" select="$attrsafearray" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>}
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="collection">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService Managed Object Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass <xsl:value-of select="$ifname"/>Collection extends VBox_ManagedObjectCollection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync protected $_interfaceName = "<xsl:value-of select="$ifname"/>";
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="interfacestruct">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService Struct
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass <xsl:value-of select="$ifname"/> extends VBox_Struct
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:for-each select="attribute"> protected $<xsl:value-of select="@name"/>;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:for-each>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function __construct($connection, $values)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->connection = $connection;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:for-each select="attribute"> $this-><xsl:value-of select="@name"/> = $values-><xsl:value-of select="@name"/>;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:for-each> }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync<xsl:for-each select="attribute"> public function <xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="@name"/></xsl:call-template>()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:text>return </xsl:text>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:call-template name="emitOutParam">
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="type" select="@type" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="value" select="concat('$this->',@name)" />
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync <xsl:with-param name="safearray" select="@safearray"/>
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync </xsl:call-template>;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:for-each>}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync<xsl:template name="structcollection">
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:text>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService Struct Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass <xsl:value-of select="$ifname"/>Collection extends VBox_StructCollection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync protected $_interfaceName = "<xsl:value-of select="$ifname"/>";
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync}
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync</xsl:template>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="genreq">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:param name="wsmap" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:text> $request = new stdClass();
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:if test="$wsmap='managed'"> $request->_this = $this->handle;</xsl:if>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:for-each select="param[@dir='in']">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request-><xsl:value-of select="@name" /> = $arg_<xsl:value-of select="@name" /><xsl:text>;</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync </xsl:for-each>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $response = $this->connection->__soapCall('<xsl:value-of select="../@name"/>_<xsl:value-of select="@name"/>', array((array)$request));
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync return <xsl:if test="param[@dir='out']">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:text>array(</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="param[@dir='return']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="emitOutParam">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="type" select="@type" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="value" select="concat('$response->','returnval')" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="safearray" select="@safearray"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="../param[@dir='out']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>, </xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="param[@dir='out']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="not(position()=1)">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>, </xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="emitOutParam">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="type" select="@type" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="value" select="concat('$response->',@name)" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="safearray" select="@safearray"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="param[@dir='out']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>)</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:text>;&#10;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="method" >
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:param name="wsmap" />
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function <xsl:value-of select="@name"/><xsl:text>(</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:for-each select="param[@dir='in']">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:if test="not(position()=1)">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:text>, </xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync </xsl:if>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:value-of select="concat('$arg_',@name)"/>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync </xsl:for-each> <xsl:text>)&#10; {&#10;</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:call-template name="genreq"><xsl:with-param name="wsmap" select="$wsmap" /></xsl:call-template>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:text> }&#10;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="enum">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService ENUM
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass <xsl:value-of select="@name"/> extends VBox_Enum
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync 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>);
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync 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>);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync<xsl:template name="enumcollection">
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:text>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * Generated VBoxWebService Enum Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */</xsl:text>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass <xsl:value-of select="$ifname"/>Collection extends VBox_EnumCollection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync protected $_interfaceName = "<xsl:value-of select="$ifname"/>";
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync}
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync</xsl:template>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
514a819c0fab7678e249699636bbfe8ec952c735vboxsync<xsl:template name="comResultCodes">
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync const <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>;
514a819c0fab7678e249699636bbfe8ec952c735vboxsync</xsl:template>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template match="/">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:text>&lt;?php
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/*
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync * Copyright (C) 2008-2014 Oracle Corporation
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync *
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * This file is part of a free software library; you can redistribute
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * it and/or modify it under the terms of the GNU Lesser General
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * Public License version 2.1 as published by the Free Software
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * Foundation and shipped in the "COPYING.LIB" file with this library.
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * The library is distributed in the hope that it will be useful,
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * but WITHOUT ANY WARRANTY of any kind.
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync *
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * any license choice other than GPL or LGPL is available it will
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * apply instead, Oracle elects to use only the Lesser General Public
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * License version 2.1 (LGPLv2) at this time for any software where
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * a choice of LGPL license versions is made available with the
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * language indicating that LGPLv2 or any later version may be used,
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * or where a choice of which version of the LGPL is applied is
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * otherwise unspecified.
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync *
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync * This file is autogenerated from VirtualBox.xidl, DO NOT EDIT!
30cab36719cb316ee7ae8476b9fca7137984adfcvboxsync */
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsyncclass VBox_ManagedObject
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync{
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $connection;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync public function __construct($soap, $handle = null)
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->connection = $soap;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->handle = $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __toString()
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return (string)$this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __set($attr, $value)
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $methodName = "set" . $attr;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if (method_exists($this, $methodName))
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->$methodName($value);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync else
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync throw new Exception("Attribute does not exist");
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __get($attr)
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $methodName = "get" . $attr;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if (method_exists($this, $methodName))
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $this->$methodName();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync else
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync throw new Exception("Attribute does not exist");
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function getHandle()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync return $this->handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function cast($class)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync if (is_subclass_of($class, 'VBox_ManagedObject'))
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync return new $class($this->connection, $this->handle);
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync throw new Exception('Cannot cast VBox_ManagedObject to non-child class VBox_ManagedObject');
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function releaseRemote()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync try
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request = new stdClass();
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $request->_this = $this->handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->connection->__soapCall('IManagedObjectRef_release', array((array)$request));
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync catch (Exception $ex)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncabstract class VBox_Collection implements ArrayAccess, Iterator, Countable
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync protected $_connection;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync protected $_values;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync protected $_objects;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync protected $_interfaceName;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function __construct($soap, array $values = array())
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_connection = $soap;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_values = $values;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_soapToObject();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync protected function _soapToObject()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_objects = array();
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync foreach($this->_values as $value)
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_objects[] = new $this->_interfaceName($this->_connection, $value);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync /** ArrayAccess Functions **/
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function offsetSet($offset, $value)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync if ($value instanceof $this->_interfaceName)
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync if ($offset)
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_objects[$offset] = $value;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync else
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $this->_objects[] = $value;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
a6c0941f24d6df20f1b58a2b466f00ba89e2055cvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync else
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync throw new Exception("Value must be a instance of " . $this->_interfaceName);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function offsetExists($offset)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return isset($this->_objects[$offset]);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function offsetUnset($offset)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync unset($this->_objects[$offset]);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function offsetGet($offset)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return isset($this->_objects[$offset]) ? $this->_objects[$offset] : null;
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync /** Iterator Functions **/
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function rewind()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync reset($this->_objects);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function current()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return current($this->_objects);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function key()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return key($this->_objects);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function next()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return next($this->_objects);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function valid()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return ($this->current() !== false);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync /** Countable Functions **/
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function count()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync return count($this->_objects);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync}
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass VBox_ManagedObjectCollection extends VBox_Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync protected $_interfaceName = 'VBox_ManagedObject';
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync // Result is undefined if this is called AFTER any call to VBox_Collection::offsetSet or VBox_Collection::offsetUnset
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function setInterfaceName($interface)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync if (!is_subclass_of($interface, 'VBox_ManagedObject'))
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync throw new Exception('Cannot set collection interface to non-child class of VBox_ManagedObject');
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->_interfaceName = $interface;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->_soapToObject();
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncabstract class VBox_Struct
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync protected $connection;
e804c5028b8dfc11990922d2fdbf40ad3db6d66cvboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __get($attr)
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $methodName = "get" . $attr;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if (method_exists($this, $methodName))
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $this->$methodName();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync else
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync throw new Exception("Attribute does not exist");
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncabstract class VBox_StructCollection extends VBox_Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync public function __construct($soap, array $values = array())
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync if (!(array_values($values) === $values))
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync {
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync $values = array((object)$values); //Fix for when struct return value only contains one list item (e.g. one medium attachment)
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync parent::__construct($soap, $values);
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync }
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync}
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncabstract class VBox_Enum
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync protected $_handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function __construct($connection, $handle)
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync if (is_string($handle))
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->_handle = $this->ValueMap[$handle];
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync else
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync $this->_handle = $handle;
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync public function __toString()
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync {
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync return (string)$this->NameMap[$this->_handle];
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncabstract class VBox_EnumCollection extends VBox_Collection
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync}
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync
514a819c0fab7678e249699636bbfe8ec952c735vboxsync</xsl:text>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync
514a819c0fab7678e249699636bbfe8ec952c735vboxsync<xsl:text>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync/**
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync * VirtualBox COM result codes
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync */
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsyncclass VirtualBox_COM_result_codes
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync{
514a819c0fab7678e249699636bbfe8ec952c735vboxsync</xsl:text>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync <xsl:for-each select="/idl/library/result">
514a819c0fab7678e249699636bbfe8ec952c735vboxsync <xsl:call-template name="comResultCodes"/>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync </xsl:for-each>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync<xsl:text>
514a819c0fab7678e249699636bbfe8ec952c735vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="//interface[@wsmap='managed' or @wsmap='global']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="interface"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="collection"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
222100f767c7525a6c63188e0fe7b4c708e928a4vboxsync <xsl:for-each select="//interface[@wsmap='struct']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="interfacestruct"/>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:call-template name="structcollection"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="//enum">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="enum"/>
bb97689fe2a180cbf0c76ce0b346055dc10da93dvboxsync <xsl:call-template name="enumcollection"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:stylesheet>