Package gavo :: Package svcs :: Module service :: Class Service
[frames] | no frames]

Class Service

source code

                   object --+            
                            |            
 base.structure.StructureBase --+        
                                |        
                   object --+   |        
                            |   |        
           base.common.Parser --+        
                                |        
base.structure.ParseableStructure --+    
                                    |    
             base.structure.Structure --+
                                        |
                       object --+       |
                                |       |
              base.meta.MetaMixin --+   |
                                    |   |
          base.meta.ComputedMetaMixin --+
                                        |
                       object --+       |
                                |       |
         base.macros.MacroPackage --+   |
                                    |   |
       base.macros.StandardMacroMixin --+
                                        |
                           object --+   |
                                    |   |
           rscdef.common.IVOMetaMixin --+
                                        |
                                       Service

A service definition.

A service is a combination of a core and one or more renderers.  They
can be published, and they carry the metadata published into the VO.

You can set the defaultSort property on the service to a name of an
output column to preselect a sort order.  Note again that this will
slow down responses for all but the smallest tables unless there is
an index on the corresponding column.

Properties evaluated:

* defaultSort -- a key to sort on by default with the form renderer.  
  This differs from the dbCore's sortKey in that this does not suppress the
  widget itself, it just sets a default for its value.  Don't use this unless
  you have to; the combination of sort and limit can have disastrous effects
  on the run time of queries.
* votableRespectsOutputTable -- usually, VOTable output puts in
  all columns from the underlying database table with low enough
  verbLevel (essentially).  When this property is "True" (case-sensitive),
        that's not done and only the service's output table is evaluated.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
__repr__(self)
repr(x)
source code
 
completeElement(self, ctx) source code
 
onElementComplete(self) source code
 
getTemplate(self, key)
returns the nevow template for the function key on this service.
source code
 
getUWS(self)
returns a user UWS instance for this service.
source code
 
getPublicationsForSet(self, names)
returns publications for a set of set names (the names argument).
source code
 
getURL(self, rendName, absolute=True, canonical=False, **kwargs)
returns the full canonical access URL of this service together with renderer.
source code
 
getBrowserURL(self, fq=True)
returns a published URL that's suitable for a web browser or None if no such URL can be guessed.
source code
 
isBrowseableWith(self, rendName)
returns true if rendering this service through rendName results in something pretty in a web browser.
source code
 
getTableSet(self)
returns a list of table definitions that have something to do with this service.
source code
 
declareServes(self, data)
adds meta to self and data indicating that data is served by service.
source code
 
getHTMLOutputFields(self, queryMeta, ignoreAdditionals=False, raiseOnUnknown=True)
returns a list of OutputFields suitable for an HTML response described by queryMeta.
source code
 
getCurOutputFields(self, queryMeta=None, raiseOnUnknown=True)
returns a list of desired output fields for query meta.
source code
 
getAllOutputFields(self)
Returns a sequence of all available output fields.
source code
 
getCoreFor(self, renderer)
returns a core tailored for renderer.
source code
 
getContextGrammarFor(self, renderer, core=None)
returns an ContextGrammar apropriate for this renderer.
source code
 
getInputKeysFor(self, renderer)
returns a sequence of input keys, adapted for renderer.
source code
 
run(self, renderer, args, queryMeta=None)
runs the service, returning an SvcResult.
source code
 
macro_tablesForTAP(self)
returns a list of table names available for TAP querying.
source code
 
clearProperty(self, name) source code
 
getFullId(self) source code
 
getProperty(self, name, default=<Undefined>) source code
 
hasProperty(self, name) source code
 
setProperty(self, name, value) source code

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement, validate

Inherited from base.structure.ParseableStructure: __init__, end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

Inherited from base.meta.ComputedMetaMixin: getMetaKeys

Inherited from base.meta.MetaMixin: addMeta, buildRepr, copyMetaFrom, delMeta, getAllMetaPairs, getMeta, getMetaParent, isEmpty, iterMeta, keys, makeOriginal, setMeta, setMetaParent, traverse

Inherited from base.macros.StandardMacroMixin: macro_RSTservicelink, macro_RSTtable, macro_decapitalize, macro_getConfig, macro_internallink, macro_magicEmpty, macro_metaSeq, macro_metaString, macro_rdId, macro_rdIdDotted, macro_schema, macro_test, macro_today, macro_upper, macro_urlquote

Inherited from base.macros.MacroPackage: execMacro, expand, getExpander, listMacros, macro_quote, macro_reSub, macro_sql_standardPubDID, macro_sqlquote

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'service'
a sentinel for all kinds of undefined values.
  metaModel = 'title(1), creationDate(1), description(1),subject...
  htmlLikeFormats = ['HTML', 'tar']
  attrSeq = [<gavo.base.attrdef.StringSetAttribute object>, <gav...
  managedAttrs = {'adqlCore': <gavo.svcs.service.CoreAttribute o...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties
  isVOPublished
is true if there is any ivo_managed publication on this service.
  customPage
  rd

Inherited from object: __class__

Method Details

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

completeElement(self, ctx)

source code 
Overrides: base.structure.Structure.completeElement

onElementComplete(self)

source code 
Overrides: base.structure.Structure.onElementComplete

getUWS(self)

source code 

returns a user UWS instance for this service.

This is a service for the UWSAsyncRenderer.

getPublicationsForSet(self, names)

source code 

returns publications for a set of set names (the names argument).

In the special case names=None, all allowed renderers are treated as published.

getURL(self, rendName, absolute=True, canonical=False, **kwargs)

source code 

returns the full canonical access URL of this service together with renderer.

rendName is the name of the intended renderer in the registry of renderers.

With absolute, a fully qualified URL is being returned.

Further keyword arguments are translated into URL parameters in the query part.

getBrowserURL(self, fq=True)

source code 

returns a published URL that's suitable for a web browser or None if no such URL can be guessed.

If you pass fq=False, you will get a path rather than a URL.

getTableSet(self)

source code 

returns a list of table definitions that have something to do with this service.

This is for VOSI-type requests. Usually, that's just the core's queried table or an output table, except when there is a TAP renderer on the service.

All this is a bit heuristic; but then again, there's no rigorous definition for what's to be in a tables endpoint either.

declareServes(self, data)

source code 

adds meta to self and data indicating that data is served by service.

This is used by table/@adql and the publish element on data.

getHTMLOutputFields(self, queryMeta, ignoreAdditionals=False, raiseOnUnknown=True)

source code 

returns a list of OutputFields suitable for an HTML response described by queryMeta.

This is the service's output table if given, else the core's output table at verbLevel 2. Additional fields can be set by the user.

raiseOnUnknown is used by customwidgets to avoid exceptions because of bad additional fields during form construction (when they aren't properly caught).

getCurOutputFields(self, queryMeta=None, raiseOnUnknown=True)

source code 

returns a list of desired output fields for query meta.

This is for both the core and the formatter to figure out the structure of the tables passed.

getAllOutputFields(self)

source code 

Returns a sequence of all available output fields.

This is what the core gives, and this is what will be declared to the registry. Depending on the output format, the verbosity level and perhaps other user settings, the actuall columns produced will be different.

getCoreFor(self, renderer)

source code 

returns a core tailored for renderer.

See svcs.core's module docstring.

The argument can be a renderer or a renderer name.

getContextGrammarFor(self, renderer, core=None)

source code 

returns an ContextGrammar apropriate for this renderer.

Pass in the core if you already have it as an optimisation (in particular for datalink, where cores aren't automatically cached); if you don't the core will be computed from the renderer.

In either case, the context grammar simply is built from the core's inputTable.

getInputKeysFor(self, renderer)

source code 

returns a sequence of input keys, adapted for renderer.

The renderer argument may either be a renderer name, a renderer class or a renderer instance.

This is the main interface for external entities to discover. service metadata.

run(self, renderer, args, queryMeta=None)

source code 

runs the service, returning an SvcResult.

This is the main entry point for protocol renderers; args is a dict of lists as provided by request.args.

Pass in queryMeta if convenient or if args is not simply request.args (but, e.g., nevow formal data). Otherwise, it will be constructed from args.

macro_tablesForTAP(self)

source code 

returns a list of table names available for TAP querying.

This, really, is an implementation detail for the TAP service and might go away anytime.


Class Variable Details

metaModel

Value:
'title(1), creationDate(1), description(1),subject, referenceURL(1), s\
hortName(!)'

attrSeq

Value:
[<gavo.base.attrdef.StringSetAttribute object>,
 <gavo.svcs.service.CoreAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.rscdef.common.ResdirRelativeAttribute object>,
 <gavo.base.complexattrs.StructListAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.parsecontext.IdAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
...

managedAttrs

Value:
{'adqlCore': <gavo.svcs.service.CoreAttribute object>,
 'allowed': <gavo.base.attrdef.StringSetAttribute object>,
 'core': <gavo.svcs.service.CoreAttribute object>,
 'customCore': <gavo.svcs.service.CoreAttribute object>,
 'customDF': <gavo.base.complexattrs.StructListAttribute object>,
 'customDFs': <gavo.base.complexattrs.StructListAttribute object>,
 'customPage': <gavo.rscdef.common.ResdirRelativeAttribute object>,
 'customRF': <gavo.base.complexattrs.StructListAttribute object>,
...

Property Details

isVOPublished

is true if there is any ivo_managed publication on this service.

If renderer is non-None, only publications with this renderer name count.

Get Method:
unreachable.isVOPublished(self, renderer=None) - is true if there is any ivo_managed publication on this service.

customPage

Get Method:
unreachable.computePath(instance)
Set Method:
unreachable.setRelative(instance, value)

rd

Get Method:
unreachable._getRD(self)