gavo.protocols.ssap module

The SSAP core and supporting code.

class gavo.protocols.ssap.SSADescriptor(pubDID, accref, accessPath, mime, owner=None, embargo=None, sourceTable=None, datalink=None, preview=None, preview_mime=None)[source]

Bases: ProductDescriptor

SSA descriptors have ssaRow and limits attributes.

These both reference SSA results. ssaRow is the first result of the query, which also provides the accref. limits is a table.Limits instance for the total result set.

Warning: limits will be None if this is constructed with fromSSARow.

classmethod fromSSAResult(ssaResult)[source]

returns a descriptor from an SSA query result (an InMemoryTable instance).

classmethod fromSSARow(ssaRow, paramDict)[source]

returns a descriptor from a row in an ssa table and the params of that table.

Don’t use this; the limits attribute will be {} for these.

ssaRow = None
class gavo.protocols.ssap.SSAPCore(parent, **kwargs)[source]

Bases: DBCore

A core doing SSAP queries.

This core knows about metadata queries, version negotiation, and dispatches on REQUEST. Thus, it may return formatted XML data under certain circumstances.

Interpreted Properties:

  • previews: If set to “auto”, the core will automatically add a preview column and fill it with the URL of the products-based preview. Other values are not defined.

attrSeq = [<gavo.base.complexattrs.StructListAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.rscdef.common.NamePathAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.base.parsecontext.ReferenceAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>]
clearProperty(name)
completedCallbacks = []
getFullId()
getProperty(name, default=<Undefined>)
hasProperty(name)
managedAttrs = {'condDesc': <gavo.base.complexattrs.StructListAttribute object>, 'condDescs': <gavo.base.complexattrs.StructListAttribute object>, 'distinct': <gavo.base.attrdef.BooleanAttribute object>, 'groupBy': <gavo.base.attrdef.UnicodeAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'inputTable': <gavo.base.complexattrs.StructAttribute object>, 'limit': <gavo.base.attrdef.IntAttribute object>, 'namePath': <gavo.rscdef.common.NamePathAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'outputTable': <gavo.base.complexattrs.StructAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'queriedTable': <gavo.base.parsecontext.ReferenceAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'sortKey': <gavo.base.attrdef.UnicodeAttribute object>}
name_ = 'ssapCore'
onElementComplete()[source]
outputTableXML = '\n\t\t<outputTable verbLevel="30">\n\t\t\t<property name="virtual">True</property>\n\t\t\t<FEED source="//ssap#coreOutputAdditionals"/>\n\t\t</outputTable>'
previewColumn = <OutputField 'preview'>
property rd
resolveName(context, id)
run(service, inputTable, queryMeta)[source]

does the DB query and returns an InMemoryTable containing the result.

setProperty(name, value)
gavo.protocols.ssap.getDatalinkCore(dlSvc, ssaTable)[source]

returns a datalink core adapted for ssaTable.

dlSvc is the datalink service, ssaTable a non-empty SSA result table.

gavo.protocols.ssap.iterViewColumns(context)[source]

returns a list of column objects for building the SSA view mixin’s columns.

The argument is the DaCHS RD parse context.

This is probably only useful for the //ssap#view mixin. The argument is that mixin’s context. This could go if we drop the hcd and mixc mixins and instead have a normal STREAM with the columns, as it’s really only necessary to make columns from the stupid params and remove their defaults.

This will always return the same column objects – don’t change them.