Skip to main content

An extension to ``zope.publisher`` that provides a ZCML directive for XML-RPC views that supports a ``layer`` parameter.

Project description

https://img.shields.io/pypi/v/gocept.xmlrpcskin https://img.shields.io/pypi/pyversions/gocept.xmlrpcskin https://img.shields.io/travis/com/zopefoundation/gocept.xmlrpcskin/master https://coveralls.io/repos/github/zopefoundation/gocept.xmlrpcskin/badge?branch=master

This package is an extension to the Zope Publisher that provides a ZCML directive for XML-RPC views that supports a layer parameter.

It collects the changes that briefly were contained in 3.5.0alpha releases (but subsequently have been removed) of the following packages

  • zope.app.publisher (removed in r82484)

  • zope.traversing (removed in r82482)

  • zope.publisher (removed in r82493)

Usage

The gocept:xmlrpcview directive is like the xmlrpc:view directive of zope.app.publisher, but with an additional parameter layer.

Here’s an abbriged example (also available as gocept.xmlrpcskin.tests.fixture):

<include package="zope.component" file="meta.zcml" />

<include package="gocept.xmlrpcskin" file="meta.zcml" />
<include package="gocept.xmlrpcskin" />

<interface
  interface=".interfaces.IFooLayer"
  type="gocept.xmlrpcskin.interfaces.IXMLRPCSkinType"
  name="foo"
  />

<gocept:xmlrpcview
  for="*"
  class=".view.Example"
  permission="zope.Public"
  methods="
  all_layers
  "
  />

<gocept:xmlrpcview
  for="*"
  class=".view.Example"
  layer=".interfaces.IFooLayer"
  permission="zope.Public"
  methods="
  foo_layer
  "
  />


class IFooLayer(zope.publisher.interfaces.xmlrpc.IXMLRPCRequest):
    pass

class Example(zope.app.publisher.xmlrpc.XMLRPCView):

    def all_layers(self):
        return dict(returncode=1)

    def foo_layer(self):
        return dict(returncode=2)

The method all_layers will then be available on all layers, while foo_layer only is available on /++skin++foo.

CHANGES

1.1 (2019-12-03)

  • Explicitly support and test for Python 2.7, 3.7 and 3.8.

1.0 (2011-09-22)

  • first release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gocept.xmlrpcskin-1.1.tar.gz (7.4 kB view hashes)

Uploaded source

Built Distribution

gocept.xmlrpcskin-1.1-py2.py3-none-any.whl (11.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page