gavo.web.vosi module

VOSI renderers.

These are really three different renderers for each service. IVOA wants it this way (in effect, since they are supposed to be three different capabilities).

class gavo.web.vosi.AVL[source]

Bases: object

The container for elements from the VOSI availability schema.

class AVLElement(id=None)[source]

Bases: Element

class availability(id=None)[source]

Bases: AVLElement

class available(id=None)[source]

Bases: AVLElement

class backAt(id=None)[source]

Bases: AVLElement

class downAt(id=None)[source]

Bases: AVLElement

class note(id=None)[source]

Bases: AVLElement

class upSince(id=None)[source]

Bases: AVLElement

class gavo.web.vosi.CAP[source]

Bases: object

The container for element from the VOSI capabilities schema.

class CAPElement(id=None)[source]

Bases: Element

class capabilities(id=None)[source]

Bases: CAPElement

class gavo.web.vosi.VOSIAvailabilityRenderer(request, service)[source]

Bases: VOSIRenderer

A renderer for a VOSI availability endpoint.

An endpoint with this renderer is automatically registered for every service. The answers can be configured using the admin renderer.

name = 'availability'
class gavo.web.vosi.VOSICapabilityRenderer(request, service)[source]

Bases: VOSIRenderer

A renderer for a VOSI capability endpoint.

An endpoint with this renderer is automatically registered for every service. The responses contain information on what renderers (“interfaces”) are available for a service and what properties they have.

This also doubles as a canary for authentication, which is why there are the somewhat complicated things in render; cf. https://wiki.ivoa.net/twiki/bin/view/IVOA/SSO_next

name = 'capabilities'
render(request)[source]

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

class gavo.web.vosi.VOSIRenderMixin[source]

Bases: object

A mixin furnishing the basic rendering methods for VOSI resources.

You will have to provide a method _getTree(request) returning some xmlstan.

render(request)[source]
class gavo.web.vosi.VOSIRenderer(request, service)[source]

Bases: VOSIRenderMixin, ServiceBasedPage

An abstract base for renderers handling VOSI requests.

All of these return some sort of XML and are legal on all services.

The actual documents returned are defined in _getTree(request)->deferred firing stanxml.

checkedRenderer = False
class gavo.web.vosi.VOSITableResponse(tableDef)[source]

Bases: VOSIRenderMixin, Resource

A resource building a VOSI tableset for a single table.

This is returned as a child resource of VOSITablesetRenderer.

getChild(request, name)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

class gavo.web.vosi.VOSITablesetRenderer(request, service)[source]

Bases: VOSIRenderer

A renderer for a VOSI table metadata endpoint.

An endpoint with this renderer is automatically registered for every service. The responses contain information on the tables exposed by a given service.

aliases = frozenset({'tables'})
getChild(name, request)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

name = 'tableMetadata'
class gavo.web.vosi.VTM[source]

Bases: object

The container for element from the VOSI tableset schema.

class VTMElement(id=None)[source]

Bases: Element

class table(id=None, type=None)[source]

Bases: VTMElement, table

class tableset(id=None)[source]

Bases: VTMElement