Service

From Friend2Friend Wiki

Revision as of 19:26, 7 October 2009 by Admin (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Services are the main resources for serverside programming. They are invoked as usual, with a request element:

<f2f:servicereq function="the URI of the service required"/>

Contents

Core Services

The F2F core provides about 100 services, which are implemented with hard code. These all have the URI "http://friend2friend.net/services/...". As well as created through the servicereq processing model, they made invoked directly in from XSL by using the f2f:core template. i.e.:

<xsl:call-template name="f2f:core">

  <xsl:with-param name="servicereq">
     <f2f:servicereq function="http://friend2friend.net/services/...">
        ...
     </f2f:servicereq>
  </xsl:with-param>

</xsl:call-template>

Custom Services

F2F modules may extend the set of services by using <service> elements in theif definition file. This has an XSD-like syntax for defining its <f2f:argument>(s) and its <f2f:output>, so that compilation can create an XSD for validating input and output. All custom services are implemented by extended XSL stylesheets. Basic XSL functionality is augmented in 3 ways:

  • The system parameters are available as xsl:params
  • F2F templates are available, such as f2f:core, which allows direct invocation of [[ F2F core services] or public custom services
  • Their output is processed using the servicereq processing model, so they can call other services.

Privilege

Appropriate declaration in the module definition file allows services to run not with the uid of their invoker, but that of the module creator. This may be either for N>0 iterations, or * (unlimited).

References