VirtualBox

Changeset 45483 in vbox for trunk/src


Ignore:
Timestamp:
Apr 11, 2013 1:07:09 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84944
Message:

Main/glue+idl+webservice: move the type mapping XSLT include file to a central place, it is not webservice specific, and extend it slightly

Location:
trunk/src/VBox/Main
Files:
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/glue-java.xsl

    r45195 r45483  
    4141              select="//interface[@wsmap='suppress']" />
    4242
    43 <xsl:include href="../webservice/websrv-shared.inc.xsl" />
     43<xsl:include href="../idl/typemap-shared.inc.xsl" />
    4444
    4545<xsl:strip-space elements="*"/>
     
    4848  <xsl:param name="name" />
    4949  <xsl:text>/*
    50  *  Copyright (C) 2010-2012 Oracle Corporation
     50 *  Copyright (C) 2010-2013 Oracle Corporation
    5151 *
    5252 *  This file is part of the VirtualBox SDK, as available from
     
    644644
    645645  <xsl:if test="not($needlist) or not($skiplisttype='yes')">
    646     <!-- look up Java type from IDL type from table array in websrv-shared.inc.xsl -->
     646    <!-- look up Java type from IDL type from table array in typemap-shared.inc.xsl -->
    647647    <xsl:variable name="javatypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@javaname" />
    648648
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r43103 r45483  
    1414        Further extension to other interfaces is possible and anticipated.
    1515
    16     Copyright (C) 2010-2012 Oracle Corporation
     16    Copyright (C) 2010-2013 Oracle Corporation
    1717
    1818    This file is part of VirtualBox Open Source Edition (OSE), as
     
    3131  indent="no"/>
    3232
    33 <xsl:include href="../webservice/websrv-shared.inc.xsl" />
     33<xsl:include href="typemap-shared.inc.xsl" />
    3434
    3535<!-- $G_kind contains what kind of COM class implementation we generate -->
     
    4747
    4848/*
    49  * Copyright (C) 2010-2012 Oracle Corporation
     49 * Copyright (C) 2010-2013 Oracle Corporation
    5050 *
    5151 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Main/idl/typemap-shared.inc.xsl

    r45482 r45483  
    11<!--
    2     websrv-shared.inc.xsl:
    3         this gets included from the other websrv-*.xsl XSLT stylesheets
    4         so we can share some definitions that must be the same for
    5         all of them (like method prefixes/suffices).
    6         See webservice/Makefile.kmk for an overview of all the things
    7         generated for the webservice.
    8 
    9     Copyright (C) 2006-2012 Oracle Corporation
     2    typemap-shared.inc.xsl:
     3    this gets included from other XSLT stylesheets including those
     4    for the webservice, so we can share some definitions that must
     5    be the same for all of them (like method prefixes/suffices).
     6
     7    Copyright (C) 2006-2013 Oracle Corporation
    108
    119    This file is part of VirtualBox Open Source Edition (OSE), as
     
    2725  xmlns:vbox="http://www.virtualbox.org/">
    2826
    29 <xsl:variable name="G_xsltIncludeFilename" select="'websrv-shared.inc.xsl'" />
     27<xsl:variable name="G_xsltIncludeFilename" select="'typemap-shared.inc.xsl'" />
     28
     29<xsl:variable name="G_lowerCase" select="'abcdefghijklmnopqrstuvwxyz'" />
     30<xsl:variable name="G_upperCase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
    3031
    3132<!-- target namespace; this must match the xmlns:vbox in stylesheet opening tags! -->
     
    162163
    163164<xsl:variable name="G_aSharedTypes">
    164   <type idlname="octet"              xmlname="unsignedByte"  cname="unsigned char"    gluename="BYTE"    javaname="byte" />
    165   <type idlname="boolean"            xmlname="boolean"       cname="bool"             gluename="BOOL"    javaname="Boolean" />
    166   <type idlname="short"              xmlname="short"         cname="short"            gluename="SHORT"   javaname="Short" />
    167   <type idlname="unsigned short"     xmlname="unsignedShort" cname="unsigned short"   gluename="USHORT"  javaname="Integer" />
    168   <type idlname="long"               xmlname="int"           cname="int"              gluename="LONG"    javaname="Integer" />
    169   <type idlname="unsigned long"      xmlname="unsignedInt"   cname="unsigned int"     gluename="ULONG"   javaname="Long" />
    170   <type idlname="long long"          xmlname="long"          cname="LONG64"           gluename="LONG64"  javaname="Long" />
    171   <type idlname="unsigned long long" xmlname="unsignedLong"  cname="ULONG64"          gluename="ULONG64" javaname="BigInteger" />
    172   <type idlname="double"             xmlname="double"        cname="double"           gluename=""        javaname="Double" />
    173   <type idlname="float"              xmlname="float"         cname="float"            gluename=""        javaname="Float" />
    174   <type idlname="wstring"            xmlname="string"        cname="std::string"      gluename=""        javaname="String" />
    175   <type idlname="uuid"               xmlname="string"        cname="std::string"      gluename=""        javaname="String" />
    176   <type idlname="result"             xmlname="unsignedInt"   cname="unsigned int"     gluename="HRESULT" javaname="Long" />
     165  <type idlname="octet"              xmlname="unsignedByte"  cname="unsigned char"    gluename="BYTE"    gluefmt="%RU8"      javaname="byte" />
     166  <type idlname="boolean"            xmlname="boolean"       cname="bool"             gluename="BOOL"    gluefmt="%RTbool"   javaname="Boolean" />
     167  <type idlname="short"              xmlname="short"         cname="short"            gluename="SHORT"   gluefmt="%RI16"     javaname="Short" />
     168  <type idlname="unsigned short"     xmlname="unsignedShort" cname="unsigned short"   gluename="USHORT"  gluefmt="%RU16"     javaname="Integer" />
     169  <type idlname="long"               xmlname="int"           cname="int"              gluename="LONG"    gluefmt="%RI32"     javaname="Integer" />
     170  <type idlname="unsigned long"      xmlname="unsignedInt"   cname="unsigned int"     gluename="ULONG"   gluefmt="%RU32"     javaname="Long" />
     171  <type idlname="long long"          xmlname="long"          cname="LONG64"           gluename="LONG64"  gluefmt="%RI64"     javaname="Long" />
     172  <type idlname="unsigned long long" xmlname="unsignedLong"  cname="ULONG64"          gluename="ULONG64" gluefmt="%RU64"     javaname="BigInteger" />
     173  <type idlname="double"             xmlname="double"        cname="double"           gluename="DOUBLE"  gluefmt="%#RX64"    javaname="Double" />
     174  <type idlname="float"              xmlname="float"         cname="float"            gluename="FLOAT"   gluefmt="%#RX32"    javaname="Float" />
     175  <type idlname="wstring"            xmlname="string"        cname="std::string"      gluename="BSTR"    gluefmt="%ls"       javaname="String" />
     176  <type idlname="uuid"               xmlname="string"        cname="std::string"      gluename="BSTR"    gluefmt="%ls"       javaname="String" />
     177  <type idlname="result"             xmlname="unsignedInt"   cname="unsigned int"     gluename="HRESULT" gluefmt="%Rhrc"     javaname="Long" />
    177178</xsl:variable>
    178179
     
    223224  <xsl:value-of select="
    224225        concat(
    225             translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),
     226            translate(substring($str,1,1),$G_upperCase,$G_lowerCase),
    226227            substring($str,2)
    227228        )
     
    240241    <xsl:when test="$strlen>1">
    241242     <xsl:choose>
    242        <xsl:when test="contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ',substring($str,1,1))
     243       <xsl:when test="contains($G_upperCase,substring($str,1,1))
    243244                       and
    244                        contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ',substring($str,2,1))">
     245                       contains($G_upperCase,substring($str,2,1))">
    245246         <xsl:variable name="cdr">
    246247           <xsl:call-template name="uncapitalize2">
     
    251252           concat(
    252253            translate(substring($str,1,1),
    253                       'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    254                       'abcdefghijklmnopqrstuvwxyz'),
     254                      $G_upperCase,
     255                      $G_lowerCase),
    255256            $cdr
    256257           )
     
    266267      <xsl:value-of select="
    267268                            translate($str,
    268                             'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    269                             'abcdefghijklmnopqrstuvwxyz')
     269                            $G_upperCase,
     270                            $G_lowerCase)
    270271                            "/>
    271272    </xsl:when>
     
    282283  <xsl:value-of select="
    283284        concat(
    284             translate(substring($str,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
     285            translate(substring($str,1,1),$G_lowerCase,$G_upperCase),
    285286            substring($str,2)
    286287        )
  • trunk/src/VBox/Main/webservice/Makefile.kmk

    r45075 r45483  
    77
    88#
    9 # Copyright (C) 2007-2012 Oracle Corporation
     9# Copyright (C) 2007-2013 Oracle Corporation
    1010#
    1111# This file is part of VirtualBox Open Source Edition (OSE), as
     
    151151# The webservice location
    152152VBOX_PATH_WEBSERVICE          := $(PATH_SUB_CURRENT)
     153
     154# The IDL subdirectory (contains some XSLT files)
     155VBOX_PATH_IDL                 := $(abspath $(PATH_SUB_CURRENT)/../idl)
    153156
    154157# If this is set, all webservice files are considered out-of-date every time
     
    560563
    561564# generate WSDL from main XIDL file
    562 $(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
     565$(VBOXWEB_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
    563566        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl.xsl)
    564567        $(QUIET)$(RM) -f -- $@
     
    566569        $(QUIET)$(VBOX_XSLTPROC) $(VBOXWEB_XSLTPROC_VERBOSE) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-wsdl.xsl $<
    567570
    568 $(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
     571$(VBOXWEBSERVICE_WSDL): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl-service.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) ## @todo | $$(dir $$@)
    569572        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-wsdl-service.xsl)
    570573        $(QUIET)$(RM) -f -- $@
     
    606609
    607610# generate typemap.dat (used by wsdl2h) from main XIDL file
    608 $(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
     611$(VBOXWEB_TYPEMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-typemap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
    609612        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-typemap.xsl)
    610613        $(QUIET)$(RM) -f -- $@
     
    612615
    613616# generate gsoap pseudo-C header file from that WSDL; once via XSLT...
    614 $(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
     617$(VBOXWEB_GSOAPH_FROM_XSLT): $(VBOXWEB_WSDL) $(VBOX_PATH_WEBSERVICE)/websrv-wsdl2gsoapH.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
    615618        $(call MSG_GENERATE,,$@,$(VBOXWEB_WSDL) using websrv-wsdl2gsoapH.xsl)
    616619        $(QUIET)$(RM) -f -- $@
     
    618621
    619622VBOX_NSMAP = $(VBOXWEB_OUT_DIR)/vboxwebsrv.nsmap
    620 $(VBOX_NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
     623$(VBOX_NSMAP): $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-nsmap.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
    621624        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-nsmap.xsl)
    622625        $(QUIET)$(RM) -f -- $@
     
    711714
    712715# generate method maps in server: map wsdl operations to com/xpcom method calls
    713 $(VBOXWEB_OUT_DIR)/methodmaps.cpp: $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $(VBOX_PATH_WEBSERVICE)/websrv-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
     716$(VBOXWEB_OUT_DIR)/methodmaps.cpp: $(VBOXWEB_IDL_SRC) $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $(VBOX_PATH_IDL)/typemap-shared.inc.xsl $(RECOMPILE_ON_MAKEFILE_CURRENT) | $$(dir $$@)
    714717        $(call MSG_GENERATE,,$@,$(VBOXWEB_IDL_SRC) using websrv-cpp.xsl)
    715718        $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_WEBSERVICE)/websrv-cpp.xsl $<
  • trunk/src/VBox/Main/webservice/websrv-cpp.xsl

    r44414 r45483  
    4040<xsl:variable name="G_xsltFilename" select="'websrv-cpp.xsl'" />
    4141
    42 <xsl:include href="websrv-shared.inc.xsl" />
     42<xsl:include href="../idl/typemap-shared.inc.xsl" />
    4343
    4444<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
     
    361361  <xsl:param name="inptr" />          <!-- whether to add INPTR to BSTR (Dmitry template magic) -->
    362362
    363   <!-- look up C++ glue type from IDL type from table array in websrv-shared.inc.xsl -->
     363  <!-- look up C++ glue type from IDL type from table array in typemap-shared.inc.xsl -->
    364364  <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename" />
    365365
     
    985985      <xsl:value-of select="'{'" />
    986986      <xsl:call-template name="emitNewlineIndent8" />
    987       <!-- look up C++ glue type from IDL type from table array in websrv-shared.inc.xsl -->
     987      <!-- look up C++ glue type from IDL type from table array in typemap-shared.inc.xsl -->
    988988      <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename" />
    989989      <xsl:choose>
  • trunk/src/VBox/Main/webservice/websrv-nsmap.xsl

    r44528 r45483  
    1010        generated for the webservice.
    1111
    12     Copyright (C) 2006-2012 Oracle Corporation
     12    Copyright (C) 2006-2013 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636<xsl:variable name="G_xsltFilename" select="'websrv-typemap.xsl'" />
    3737
    38 <xsl:include href="websrv-shared.inc.xsl" />
     38<xsl:include href="../idl/typemap-shared.inc.xsl" />
    3939
    4040<!-- - - - - - - - - - - - - - - - - - - - - - -
  • trunk/src/VBox/Main/webservice/websrv-php.xsl

    r43546 r45483  
    1212     Contributed by James Lucas (mjlucas at eng.uts.edu.au).
    1313
    14     Copyright (C) 2008-2012 Oracle Corporation
     14    Copyright (C) 2008-2013 Oracle Corporation
    1515
    1616    This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030  indent="no"/>
    3131
    32 <xsl:include href="websrv-shared.inc.xsl" />
     32<xsl:include href="../idl/typemap-shared.inc.xsl" />
    3333
    3434<xsl:variable name="G_setSuppressedInterfaces"
     
    361361
    362362/*
    363  * Copyright (C) 2008-2012 Oracle Corporation
     363 * Copyright (C) 2008-2013 Oracle Corporation
    364364 *
    365365 * This file is part of a free software library; you can redistribute
  • trunk/src/VBox/Main/webservice/websrv-python.xsl

    r44528 r45483  
    1010        web service API. Depends on WSDL file for actual SOAP bindings.
    1111
    12     Copyright (C) 2008-2012 Oracle Corporation
     12    Copyright (C) 2008-2013 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828  indent="no"/>
    2929
    30 <xsl:include href="websrv-shared.inc.xsl" />
     30<xsl:include href="../idl/typemap-shared.inc.xsl" />
    3131
    3232<xsl:variable name="G_setSuppressedInterfaces"
  • trunk/src/VBox/Main/webservice/websrv-typemap.xsl

    r44528 r45483  
    99        generated for the webservice.
    1010
    11     Copyright (C) 2006-2012 Oracle Corporation
     11    Copyright (C) 2006-2013 Oracle Corporation
    1212
    1313    This file is part of VirtualBox Open Source Edition (OSE), as
     
    3535<xsl:variable name="G_xsltFilename" select="'websrv-typemap.xsl'" />
    3636
    37 <xsl:include href="websrv-shared.inc.xsl" />
     37<xsl:include href="../idl/typemap-shared.inc.xsl" />
    3838
    3939<!-- - - - - - - - - - - - - - - - - - - - - - -
  • trunk/src/VBox/Main/webservice/websrv-wsdl-service.xsl

    r44528 r45483  
    1010        generated for the webservice.
    1111
    12     Copyright (C) 2006-2012 Oracle Corporation
     12    Copyright (C) 2006-2013 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646<xsl:variable name="G_xsltFilename" select="'websrv-wsdl-service.xsl'" />
    4747
    48 <xsl:include href="websrv-shared.inc.xsl" />
     48<xsl:include href="../idl/typemap-shared.inc.xsl" />
    4949
    5050<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
  • trunk/src/VBox/Main/webservice/websrv-wsdl.xsl

    r44528 r45483  
    1010        generated for the webservice.
    1111
    12     Copyright (C) 2006-2012 Oracle Corporation
     12    Copyright (C) 2006-2013 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    119119<xsl:variable name="G_xsltFilename" select="'websrv-wsdl.xsl'" />
    120120
    121 <xsl:include href="websrv-shared.inc.xsl" />
     121<xsl:include href="../idl/typemap-shared.inc.xsl" />
    122122
    123123<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
     
    148148  <xsl:param name="type" />
    149149  <xsl:call-template name="debugMsg"><xsl:with-param name="msg" select="concat('......emitConvertedType: type=&quot;', $type, '&quot;')" /></xsl:call-template>
    150   <!-- look up XML Schema type from IDL type from table array in websrv-shared.inc.xsl -->
     150  <!-- look up XML Schema type from IDL type from table array in typemap-shared.inc.xsl -->
    151151  <xsl:variable name="xmltypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@xmlname" />
    152152  <xsl:choose>
  • trunk/src/VBox/Main/webservice/websrv-wsdl2gsoapH.xsl

    r44414 r45483  
    4444<xsl:variable name="G_xsltFilename" select="'websrv-wsdl2gsoapH.xsl'" />
    4545
    46 <xsl:include href="websrv-shared.inc.xsl" />
     46<xsl:include href="../idl/typemap-shared.inc.xsl" />
    4747
    4848<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
Note: See TracChangeset for help on using the changeset viewer.

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