~adeuring/launchpadlib/wadl_info_hwdrivername

« back to all changes in this revision

Viewing changes to launchpadlib/wadl-to-refhtml.xsl

  • Committer: Launchpad Patch Queue Manager
  • Date: 2008-12-04 20:38:24 UTC
  • mfrom: (26.1.2 add-hwdb-to-wadl-html-xslt)
  • Revision ID: launchpad@pqm.canonical.com-20081204203824-n25zvtattwsq9k6o
[r=mars] fixed the URL generation for hwdb application root in
        wadl-to-refhtml.xsl

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
        </div>
376
376
    </xsl:template>
377
377
 
 
378
    <xsl:template name="find-root-object-uri">
 
379
        <xsl:value-of select="$base"/>
 
380
        <xsl:choose>
 
381
            <xsl:when test="@id = 'hwdb'">
 
382
                <xsl:text>/+hwdb</xsl:text>
 
383
            </xsl:when>
 
384
            <xsl:otherwise>
 
385
                <xsl:text>/</xsl:text><xsl:value-of select="@id" />
 
386
            </xsl:otherwise>
 
387
        </xsl:choose>
 
388
    </xsl:template>
378
389
 
379
390
    <!-- Documentation for one top-level-collection -->
380
391
    <xsl:template match="wadl:resource_type" mode="top-level-collections">
382
393
            <h3><xsl:call-template name="get-title-or-id"/></h3>
383
394
            <xsl:apply-templates select="wadl:doc"/>
384
395
 
385
 
            <xsl:call-template name="resource-uri-doc"/>
 
396
            <xsl:call-template name="resource-uri-doc">
 
397
                <xsl:with-param name="url">
 
398
                    <!-- The default URL schema used for root objects of
 
399
                         Launchpad's webservice is
 
400
 
 
401
                             [urlbase]/[root-object-name]
 
402
 
 
403
                         e.g,
 
404
 
 
405
                             https://api.launchpad.net/beta/bugs
 
406
 
 
407
                         while the HWDB application root's URL is
 
408
 
 
409
                            https://api.launchpad.net/beta/+hwdb
 
410
 
 
411
                         In other words, the URL for the HWDB application
 
412
                         root needs to be mangled in a form similar to
 
413
                         that used for non-root objects in the template
 
414
                         "find-entry-uri".
 
415
                    -->
 
416
 
 
417
                    <xsl:call-template name="find-root-object-uri"/>
 
418
                </xsl:with-param>
 
419
            </xsl:call-template>
 
420
 
386
421
            <!-- All top-level collections supports a GET without arguments
387
422
            iterating over all the resources. 
388
423
            The type of the resource is found by looking at the href attribute