websrv-php.xsl revision d616d445d74ff474716e9c5105c9d8d52abaac20
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
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync Copyright (C) 2009 Sun Microsystems, Inc.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync This file is part of VirtualBox Open Source Edition (OSE), as
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync available from http://www.virtualbox.org. This file is free software;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync you can redistribute it and/or modify it under the terms of the GNU
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync General Public License (GPL) as published by the Free Software
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync Foundation, in version 2 as it comes in the "COPYING" file of the
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync VirtualBox OSE distribution. VirtualBox OSE is distributed in the
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync Clara, CA 95054 USA or visit http://www.sun.com if you need
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync additional information or have any questions.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync-->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:output
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync method="text"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync version="1.0"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync encoding="utf-8"
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync indent="no"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:include href="websrv-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>
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync <xsl:when test="$type='wstring' or $type='uuid'">(string)<xsl:value-of select="$value" /></xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:when test="$type='boolean'">(bool)<xsl:value-of select="$value" /></xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <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>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:when test="$type='double' or $type='float'">(float)<xsl:value-of select="$value" /></xsl:when>
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync <xsl:when test="$type='octet'"><xsl:value-of select="$value" /></xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:when test="$safearray='yes'">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" />Collection ($this->connection, <xsl:value-of select="$value"/><xsl:text>)</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:when>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>new </xsl:text><xsl:value-of select="$type" /> ($this->connection, <xsl:value-of select="$value"/><xsl:text>)</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:choose>
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>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function <xsl:value-of select="$fname"/>() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request = new stdClass();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request->_this = $this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $response = $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>return </xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="emitOutParam">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="type" select="$attrtype" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="value" select="concat('$response->','returnval')" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:with-param name="safearray" select="@safearray"/>
e0b91e4f93fb43371374df4aeb636dffea336056vboxsync </xsl:call-template><xsl:text>;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
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>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function <xsl:value-of select="$fname"/>($value) {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request = stdClass();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request->_this = $this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if (is_int($value) || is_string($value) || is_bool($value)) {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request-><xsl:value-of select="$attrname"/> = $value;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync else
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request-><xsl:value-of select="$attrname"/> = $value->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->connection->__soapCall('<xsl:value-of select="$ifname"/>_<xsl:value-of select="$fname"/>', array((array)$request));
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
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/**
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Generated VBoxWebService Interface Wrapper
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync*/
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync</xsl:text>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:choose>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:when test="($extends = '$unknown') or ($extends = '$dispatched') or ($extends = '$errorinfo')">
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:value-of select="concat('class ', $ifname, ' extends VBox_ManagedObject {&#10;')" />
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync </xsl:when>
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:when test="//interface[@name=$extends]">
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync <xsl:value-of select="concat('class ', $ifname, ' extends ', $extends, ' {&#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>
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" />
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" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:otherwise>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:choose>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </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/**
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Generated VBoxWebService Managed Object Collection
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*/</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncclass <xsl:value-of select="$ifname"/>Collection extends VBox_ManagedObjectCollection {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync 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/**
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Generated VBoxWebService Struct
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*/</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncclass <xsl:value-of select="$ifname"/> extends VBox_Struct {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="attribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $<xsl:value-of select="@name"/>;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __construct($connection, $handle) {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="attribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this-><xsl:value-of select="@name"/> = $handle-><xsl:value-of select="@name"/><xsl:text>;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="attribute">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function <xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="@name"/></xsl:call-template>() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $this-><xsl:value-of select="@name"/>;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="genreq">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="wsmap" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>$request = new stdClass()</xsl:text>;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="$wsmap='managed'">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request->_this = $this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="param[@dir='in']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request-><xsl:value-of select="@name" /> = $arg_<xsl:value-of select="@name" /><xsl:text>;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $response = $this->connection->__soapCall('<xsl:value-of select="../@name"/>_<xsl:value-of select="@name"/>', array((array)$request));
e0b91e4f93fb43371374df4aeb636dffea336056vboxsync <!-- return needs to be the first one -->
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return <xsl:if test="param[@dir='out']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>array(</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </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" >
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:param name="wsmap" />
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function <xsl:value-of select="@name"/><xsl:text>(</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="param[@dir='in']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:if test="not(position()=1)">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>, </xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:if>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:value-of select="concat('$arg_',@name)"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each><xsl:text>) { &#10; </xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="genreq"><xsl:with-param name="wsmap" select="$wsmap" /></xsl:call-template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text> }&#10;</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template name="enum">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/**
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Generated VBoxWebService ENUM
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*/</xsl:text>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncclass <xsl:value-of select="@name"/> extends VBox_Enum {
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync 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>);
d616d445d74ff474716e9c5105c9d8d52abaac20vboxsync 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
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:template match="/">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync<xsl:text>&lt;?php
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync/*
5a830ff4499e2a4221c717c199bbf29ee388a128vboxsync* Copyright (C) 2009 Sun Microsystems, Inc.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* This file is part of VirtualBox Open Source Edition (OSE), as
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* available from http://www.virtualbox.org. This file is free software;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* you can redistribute it and/or modify it under the terms of the GNU
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* General Public License (GPL) as published by the Free Software
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Foundation, in version 2 as it comes in the "COPYING" file of the
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* Clara, CA 95054 USA or visit http://www.sun.com if you need
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* additional information or have any questions.
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync* This file is autogenerated from VirtualBox.xidl, DO NOT EDIT!
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync*/
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncabstract class VBox_ManagedObject
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync{
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $connection;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync 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
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function getHandle()
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function releaseRemote()
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync try
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
e0b91e4f93fb43371374df4aeb636dffea336056vboxsync $request = new stdClass();
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $request->_this = $this->handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->connection->__soapCall('IManagedObjectRef_release', array((array)$request));
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync } catch (Exception $ex) {}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncabstract class VBox_ManagedObjectCollection implements Iterator {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $connection;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $handles;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $_interfaceName = null;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __construct($soap, array $handles = array())
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->connection = $soap;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->handles = $handles;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function rewind() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync reset($this->handles);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function current() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $handle = current($this->handles);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if ($handle !== false &amp;&amp; !$handle instanceof $this->_interfaceName) {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $handle = new $this->_interfaceName($this->connection, $handle);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function key() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $handle = key($this->handles);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function next() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $handle = next($this->handles);
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function valid() {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $handle = $this->current() !== false;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncabstract class VBox_Struct {
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
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsyncabstract class VBox_Enum {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync protected $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __construct($connection, $handle)
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync if (is_string($handle))
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->handle = $this->ValueMap[$handle];
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync else
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync $this->handle = $handle;
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync public function __toString()
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync {
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync return (string)$this->NameMap[$this->handle];
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync }
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync}
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
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>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="//interface[@wsmap='struct']">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="interfacestruct"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="collection"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:for-each select="//enum">
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync <xsl:call-template name="enum"/>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync </xsl:for-each>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:template>
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync
92eb6e9fc8a36d83ad72344227a488a99945db52vboxsync</xsl:stylesheet>